YAHOO.example.Timing = function() {	//create shortcut for YAHOO.util.Event:	var e = YAHOO.util.Event;	//the returned object here will be assigned	//to YAHOO.example.Timing and its members will	//then be publicly available:	return {		init: function() {						//assign page load handler:			e.on(window, "load", this.fnLoadHandler);		},		//we'll use this handler for the page load event:		fnLoadHandler: function(oEvent, message) {			document.getElementById('burrito').style.visibility="visible";			YAHOO.example.container.panelLoading.hide();		}	}}();//initialize the example:YAHOO.example.Timing.init();function delayLoading() {	if (document.getElementById('burrito').style.visibility !="visible") {		YAHOO.example.container.panelLoading.show();	} else {		return;	}}function resetShare(varName,varId) {	document.formShare.shareFrom.value="";	document.formShare.shareTo.value="";	document.formShare.shareSubject.value = "{the picturebooth} " + varName;	document.formShare.shareMessage1.value = "Check it out! I want to share the " + varName + " picturebooth photo gallery with you:";	document.formShare.shareMessage2.value = "http:/" + "/www.thepicturebooth.net/events/?id=" + varId;	document.getElementById("shareMessage").innerHTML = "Check it out! I want to share the " + varName + " picturebooth photo gallery with you:<br><br>http:/" + "/www.thepicturebooth.net/events/?id=" + varId;	document.formShare.shareMessage3.value="";	document.formShare.shareId.value = varId;	}	function resetSubmit(varName) {	document.formSubmit.submitFrom.value="";	document.formSubmit.submitSubject.value = "{tpb mailing list} " + varName;}function resetContactUs(varName) {	document.formSubmit.contactUsFrom.value="";}YAHOO.namespace("example.container");function init() {		// Define various event handlers for Dialog	var handleSubmit = function() {		this.submit();	};	var handleCancel = function() {		this.cancel();	};	var handleSuccess = function(o) {		document.getElementById("formAlert").innerHTML = "Thank you for taking the time to share {the picturebooth}!";		YAHOO.example.container.dialogAlert.show();	};	var handleFailure = function(o) {		document.getElementById("formAlert").innerHTML = "Sorry, but we are unable to send your email. Please makes sure you have entered a valid email address and try again.";		YAHOO.example.container.dialogAlert.show();	};	var contactUsSuccess = function(o) {		document.getElementById("formAlert").innerHTML = "Your email has been sent!";		YAHOO.example.container.dialogAlert.show();	};	var contactUsFailure = function(o) {		document.getElementById("formAlert").innerHTML = "Sorry, but we are unable to send your email. Please makes sure you have entered a valid email address and try again.";		YAHOO.example.container.dialogAlert.show();	};	var formSubmitSuccess = function(o) {		document.getElementById("formAlert").innerHTML = "Thank you! You will be notified when this gallery becomes available!";		YAHOO.example.container.dialogAlert.show();	};	var formSubmitFailure = function(o) {		document.getElementById("formAlert").innerHTML = "Sorry, but something went wrong. Please makes sure you have entered a valid email address and try again.";		YAHOO.example.container.dialogAlert.show();	};	// Instantiate the Share This Gallery Dialog	YAHOO.example.container.dialogFormShare = new YAHOO.widget.Dialog("dialogFormShare", 							{ width : "468px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"Submit", handler:handleSubmit, isDefault:true },								      { text:"Cancel", handler:handleCancel } ]							});								// Instantiate the general Alert Dialog	YAHOO.example.container.dialogAlert = new YAHOO.widget.Dialog("dialogAlert", 							{ width : "350px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1001,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"OK", handler:handleCancel, isDefault:true } ]							});								// Instantiate the Submit Dialog for gallery availablity	YAHOO.example.container.dialogFormSubmit = new YAHOO.widget.Dialog("dialogFormSubmit", 							{ width : "468px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"Submit", handler:handleSubmit, isDefault:true },								      { text:"Cancel", handler:handleCancel } ]							});		// Instantiate the Contact Us Dialog	YAHOO.example.container.dialogContactUs = new YAHOO.widget.Dialog("dialogContactUs", 							{ width : "468px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"Submit", handler:handleSubmit, isDefault:true },								      { text:"Cancel", handler:handleCancel } ]							});								YAHOO.example.container.panelLoading = new YAHOO.widget.Panel("panelLoading", 							{ width : "154px",							  height : "52px",							  fixedcenter : true,							  visible : false,							  close:false,							  modal:false,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10}							});								YAHOO.example.container.dialogCustomPrints = new YAHOO.widget.Dialog("dialogCustomPrints", 							{ width : "468px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"OK", handler:handleCancel, isDefault:true } ]							});								YAHOO.example.container.dialogDownloadImage = new YAHOO.widget.Dialog("dialogDownloadImage", 							{ width : "750px",							  fixedcenter : true,							  visible : false,							  modal:true,							  draggable:false,							  zindex:1000,							  constraintoviewport : true,							  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.10},							  buttons : [ { text:"OK", handler:handleCancel, isDefault:true } ]							});	// Validate the entries in the form to require that both first and last name are entered	YAHOO.example.container.dialogFormShare.validate = function() {		var data = this.getData();		if (data.shareFrom == "" || data.shareFrom == "please enter a valid email address") {			document.formShare.shareFrom.style.color="red";			document.formShare.shareFrom.value="please enter a valid email address";			return false;		} else if (data.shareTo == "" || data.shareTo == "please enter an email address") {			document.formShare.shareTo.style.color="red";			document.formShare.shareTo.value="please enter an email address";			return false;		} else {			return true;		}	};		// Validate the entries in the form to require that both first and last name are entered	YAHOO.example.container.dialogFormSubmit.validate = function() {		var data = this.getData();		if (data.submitFrom == "" || data.submitFrom == "please enter a valid email address") {			document.formSubmit.submitFrom.style.color="red";			document.formSubmit.submitFrom.value="please enter a valid email address";			return false;		} else {			return true;		}	};		// Validate the entries in the form to require that the email field is entered	YAHOO.example.container.dialogContactUs.validate = function() {		var data = this.getData();		if (data.contactUsFrom == "" || data.contactUsFrom == "please enter a valid email address") {			document.formContactUs.contactUsFrom.style.color="red";			document.formContactUs.contactUsFrom.value="please enter a valid email address";			return false;		} else {			return true;		}	};	// Wire up the formShare success and failure handlers	YAHOO.example.container.dialogFormShare.callback = { success: handleSuccess,						     failure: handleFailure };	// Wire up the ContactUs success and failure handlers	YAHOO.example.container.dialogContactUs.callback = { success: contactUsSuccess,						     failure: contactUsFailure };	// Wire up the ContactUs success and failure handlers	YAHOO.example.container.dialogFormSubmit.callback = { success: formSubmitSuccess,						     failure: formSubmitFailure };		// Render the Dialog	YAHOO.example.container.dialogFormShare.render();	YAHOO.example.container.dialogAlert.render();	YAHOO.example.container.dialogFormSubmit.render();	YAHOO.example.container.dialogContactUs.render();	YAHOO.example.container.panelLoading.render();	YAHOO.example.container.dialogCustomPrints.render();	YAHOO.example.container.dialogDownloadImage.render();		setTimeout('delayLoading()',2000);}YAHOO.util.Event.onDOMReady(init);