function playDancerVideo(dancer, videoDataItemLabel) {
	new LDialog({
		title: 'Dancer: ' + dancer,
		content: new Element("div"),
		ajax: {
			url: "/h/sfballet/playDancerVideo",
			options: {
				evalScripts: true,
				parameters: {
					videoDataItemLabel: videoDataItemLabel
				}
			}
		}
	}); 
}

function submitProtectedPageForm() {	
	$('loginForm').request( {
		onComplete: function(response) {
			//console.log(response);
			if (response.responseJSON.status == 'SUCCESS') {
				new LDialog({
					title: 'Agreement',
					width: 550,
					height: 370,
					content: "<div id='agreementWindow'></div>"
				});
				lDialogs.lastDialog.updateContent(response.responseJSON.newContent);
			} else if (response.responseJSON.status == 'FAIL') {
				$('loginFormContainer').innerHTML = response.responseJSON.newContent;
			} else {
				return;
			}
		}
	});
}

function showCastingDialog(date, performance) {
	if (lDialogs.lastDialog !== null) {
		lDialogs.lastDialog.close();
	}
	
	var dialog = new LDialog({
		title: "Casting Info",
		content: "Loading...",
		width:600,
		height: 500
	});	
	
	lDialogs.lastDialog.updateContentViaAjax({
		url: '/h/sfballet/ShowCastingInfo?date=' + date + '&performance=' + performance, 
	});	
}

function checkSubmit(e)
{
   if(e && e.keyCode == 13)
   {
		return true;
   }
}

