	function showslide(){
		//alert("showslide entered");
		var anchors = document.getElementsByTagName('a');
		for (var i = 0; i < anchors.length; i++) {
		    var anchor = anchors[i];
			//alert("showslide loop thru images i=" + i + "-anchor=" + anchor);
		    var relAttribute = String(anchor.getAttribute('rel'));
			//alert("showslide loop thru images i=" + i + "-relAttribute=" + relAttribute + "anchor - href=" + anchor.getAttribute('href'));
		    if (anchor.getAttribute('href')) {
		        if (relAttribute.toLowerCase().match('lyteshow')) {
					//alert("showslide start...");
		            myLytebox.start(anchor, true, false);
		            return false;
		        }
		    }
		}
	}	
	

function displayTripNotesPopup() {
	// prefill the form with cookies
	document.getElementById("email").value = YAHOO.util.Cookie.get("email");
	document.getElementById("first_name").value = YAHOO.util.Cookie.get("first_name");
	document.getElementById("last_name").value = YAHOO.util.Cookie.get("last_name");	
	//alert("displayTripNotesPopup show");

	YAHOO.example.container.tripnotes_dialog.render(document.body);
	YAHOO.example.container.tripnotes_dialog.show();
	urchinTracker("/DownloadTripNotes/Form");
}

YAHOO.namespace("example.container");
// Instantiate the Dialog
YAHOO.example.container.tripnotes_dialog = 
	new YAHOO.widget.Dialog("tripnotes_dialog", 
		 	{ width: "350px",
		   	fixedcenter: true,
		   	visible: false,
		   	draggable: false,
		   	close: true,
		   	constraintoviewport: true,
		   	hideaftersubmit: false,
			zIndex: 1000,
			effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5},
			buttons: [{text:"Request Trip Notes", handler:function(){this.submit();}, isDefault:true},
				{text:"Cancel", handler:function(){this.cancel();}}]
		 	} );
		
// Validate the entries in the form to require that both first and last name are entered
YAHOO.example.container.tripnotes_dialog.validate = function() {
	var data = this.getData();
	if (data.email != data.email2) {
		alert("Please check that your email address is re-entered correctly.");
		return false;
	} else if (!data.first_name) {
		alert("First name is a required field.");
		return false;
	} else if (!data.last_name) {
		alert("Last name is a required field.");
		return false;
	} else if (!data.email) {
		alert("Email address is a required field.");
		return false;
	} else {
	//save the cookies of email, first name, last name when the user submits the form
		var expDate = new Date();
		expDate.setFullYear(expDate.getFullYear() + 1);
		YAHOO.util.Cookie.set("email", data.email, {expires: expDate});
		YAHOO.util.Cookie.set("first_name", data.first_name, {expires: expDate});
		YAHOO.util.Cookie.set("last_name", data.last_name, {expires: expDate});	
		//alert("cookies set and validate done");
		return true;
	}
};
YAHOO.example.container.tripnotes_dialog.callback.success = function(o) {
	//alert("Your data was successfully submitted. The response was: " + o.responseText);
	if (o.status == 200) {
		YAHOO.example.container.tripnotes_dialog.hide();
		YAHOO.example.container.tripnotes_followup.render(document.body);
		YAHOO.example.container.tripnotes_followup.show();
		urchinTracker("/DownloadTripNotes/Thank_You");
	} else {
		alert("There was an error submitting your request.  Please try again.");
	}
}
YAHOO.example.container.tripnotes_dialog.callback.failure = function(o) {
	alert("There was an error submitting your request.  Please try again.");
}

YAHOO.example.container.tripnotes_followup = 
	new YAHOO.widget.Dialog("tripnotes_followup", 
		 	{ width: "350px",
		   	fixedcenter: true,
		   	visible: false,
		   	draggable: false,
		   	close: true,
		   	constraintoviewport: true,
			effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5},
			buttons: [{text:"OK", handler:function(){this.hide();}, isDefault:true}]
		 	} );
		

