// JavaScript Document

<!--	
	if (document.images) {
		window.name = "PeterPanWindow";
		window.focus();
	}
	
	// pick a stylesheet for the mmenus
	if ((is_win && is_nav6up) || (is_win && is_nav) || (is_win && is_opera) 
		|| (is_mac && is_safari) || (is_mac && is_nav6up) || (is_mac && is_nav) || (is_mac && is_ie5up)) {
		document.write('<style type="text/css" media="screen">@import "../css/menu_style_nav.css";</style>');
	} else {
		document.write('<style type="text/css" media="screen">@import "../css/menu_style_ie.css";</style>');
	}
	
	var preloadFlag = false;
	
	/* ********************************************************** */
	
	function printMe() {
		window.print();	
	}
	
	/* ********************************************************** */
	
	function changeImages() 
	{
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
	
	/* ********************************************************** */
	
	function showDetails(trip) {
		switch (trip) {
			case 1 : document.getElementById("frmSchedules").submit(); break;
			case 2 : temp = document.getElementById("destCity").value;
					 document.getElementById("destCity").value = document.getElementById("origCity").value;
					 document.getElementById("origCity").value = temp;
					 document.getElementById("frmSchedules").submit();
					 break;
			case 3 : document.getElementById("frmPrintableSchedules").submit(); break;
		}
	}
	
	/* ********************************************************************************************************* */
	
	function popAddInfo(pageFamily, state, city, terminalID) {
		window.open('/home/addInfo.php?pageFamily=' + pageFamily + '&state=' + state + '&city=' + city + '&terminalID=' + terminalID, 'AdditionalInformation', "scrollbars=no,resizable=no,location=no,toolbar=no,height=353,width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	function popTransferInfo() {
		window.open("/tickets/transferInfo.php", "newwindow", "scrollbars=yes,resizable=no,location=no,toolbar=no,height=353,width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	function popDriverPic(driverName, drvrImg, numMiles) {
		window.open("/whoweare/driverHOF.php?driverName=" + driverName + "&drvrImg=" + drvrImg + "&numMiles=" + numMiles, "DriverHallofFame", "scrollbars=yes,resizable=no,location=no,toolbar=no,height=380,width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	function popPrivacy() {
		window.open("/customerservice/privacyPolicy.php", "PrivacyPolicy", "scrollbars=yes,resizable=no,location=no,toolbar=no,height=360,width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	function popWindow(page) {
		var pageURL = "";
		var winHeight = 0;
		
		switch (page) {
			case "charter" : pageURL = "/tours/charterRequest.php"; winHeight = "860"; winWidth = "535"; break;
			case "contact" : pageURL = "/home/contact.php"; winHeight = "450"; winWidth = "520"; break;
			case "sitemap" : pageURL = "/home/sitemap.php"; winHeight = "400"; winWidth = "520"; break;
		}
		
		window.open(pageURL, "PPWindow", "scrollbars=yes,resizable=no,location=no,toolbar=no,height="+ winHeight + ",width="+ winWidth).focus();
	}
	
	/* ********************************************************************************************************* */
	
	function swapForms(formName) {
		switch (formName) {
			case "complaint" 	: document.getElementById("complaintFormDiv").style.display = "inline";
								  document.getElementById("suggestionFormDiv").style.display = "none";
								  document.getElementById("filler").style.display = "none";
								  break;
			case "suggestion" 	: document.getElementById("complaintFormDiv").style.display = "none";
								  document.getElementById("suggestionFormDiv").style.display = "inline";
								  document.getElementById("filler").style.display = "none";
								  break;
			case "webYes" 		: document.getElementById("webRelated").style.display = "inline";
								  document.getElementById("serviceRelated").style.display = "none";
								  break;
			case "webNo" 		: document.getElementById("webRelated").style.display = "none";
								  document.getElementById("serviceRelated").style.display = "inline";
								  break;	
		}
	}
	
	/* ********************************************************************************************************* */
	
	function enlargeItem(itemSrc,itemName) {
		window.open('/customerservice/merchandise.php?itemSrc=' + itemSrc + '&itemName=' + itemName, 'PeterPanMerchandise', "scrollbars=yes,resizable=no,location=no,toolbar=no,height=470,width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	function loadPR(nodeName) {
		var divs = document.getElementsByTagName("div");
		
		for (var i=0;i<divs.length;i++) {
			if (divs[i].title == "prText") {
				if (divs[i].id == nodeName) {
					var nodeIsVisible = divs[i].style.display == "block";
					divs[i].style.display = nodeIsVisible ? "none" : "block";
				} else {
					divs[i].style.display = "none";
				}			
			}
		}
	}
	
	/* ********************************************************** */
	
	function newImage(arg) 
	{
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	/* ********************************************************** */
	
	function preloadImages() 
	{
		if (document.images) {
			var nav1 = newImage("images/navHome_on.jpg");
			var nav1 = newImage("images/navTickets_on.jpg");
			var nav1 = newImage("images/navTours_on.jpg");
			var nav1 = newImage("images/navServices_on.jpg");
			var nav1 = newImage("images/navCustServ_on.jpg");
			var nav1 = newImage("images/navWhoWeAre_on.jpg");
			
			preloadFlag = true;
		}
	}
	
	/* ********************************************************** */
	
	function submitFeedback() {
		if (document.feedbackForm.email.value == '' ) {
			alert('Please provide an e-mail address.');
			document.feedbackForm.email.focus();
			return;
		} else if ((document.feedbackForm.situation.value).indexOf("http") != -1) {				
			document.feedbackForm.situation.value = "";
			return;
		} else {
			alert("Thank you for providing us with your feedback.  We truly value your input!");
			document.feedbackForm.action = "/include/p1.php";
			document.feedbackForm.submit();
		}
	}
	
	/* ********************************************************** */
	
	function submitSuggestion() {
		if (document.suggestionForm.email2.value == '' ) {
			alert('Please provide an e-mail address.');
			document.suggestionForm.email2.focus();
			return;
		} else if ((document.suggestionForm.suggestion.value).indexOf("http") != -1) {				
			document.suggestionForm.suggestion.value = "";
			return;
		} else {
			alert("Thank you for providing us with your feedback.  We truly value your input!");
			document.suggestionForm.action = "/include/p2.php";
			document.suggestionForm.submit();
		}
	}
	
	/* ********************************************************** */
		
	function init() 
	{
		preloadImages();
		
		document.menuList =
		{
			ticketsMenu: new Array("navTickets", "/images/navTickets_on.jpg", "/images/navTickets_off.jpg"),
			faqMenu: new Array("navFAQs", "/images/spacer.gif", "/images/spacer.gif"),
			toursMenu: new Array("navTours", "/images/navTours_on.jpg", "/images/navTours_off.jpg"),
			servicesMenu: new Array("navServices", "/images/navServices_on.jpg", "/images/navServices_off.jpg"),
			custServMenu: new Array("navCustServ", "/images/navCustServ_on.jpg", "/images/navCustServ_off.jpg"),
			whoWeAreMenu: new Array("navWhoWeAre", "/images/navWhoWeAre_on.jpg", "/images/navWhoWeAre_off.jpg")
		};
		
		try {
			document.getElementById("destCity").value = document.getElementById("destination").value;
		} catch (e) {
			// do nothing
		}
		
		try {
			var submitted = document.getElementById("success").value;
			if (submitted != "") alert("Your feedback has been submitted to Peter Pan Customer Service.  Thank You!");
		} catch (e) {
			// do nothing
		}
	}
	
	/* ********************************************************** */
	
	AnimatedMenu.prototype.onactivate = function() 
	{
		changeImages(document.menuList[this.id][0], document.menuList[this.id][1]);
	};
	
	AnimatedMenu.prototype.ondeactivate = function()
	{
		changeImages(document.menuList[this.id][0], document.menuList[this.id][2]);
	};

	var menuX 		= 155;
	ticketsMenu  	= new AnimatedMenu("ticketsMenu", "right", menuX, 92, 120, 150);
	faqMenu  		= new AnimatedMenu("faqMenu", "right", 275, 92, 180, 130);
	toursMenu  		= new AnimatedMenu("toursMenu", "right", menuX, 113, 70, 130);
	servicesMenu  	= new AnimatedMenu("servicesMenu", "right", menuX, 134, 155, 130);
	custServMenu  	= new AnimatedMenu("custServMenu", "right", menuX, 155, 155, 130);
	whoWeAreMenu  	= new AnimatedMenu("whoWeAreMenu", "right", menuX, 176, 155, 130);
	
	// BB 6-2007  For lightbox like functions
	// BB 10-2007 Removed 
/*	dojo.require("dojo.widget.Dialog");
	var dojoDialogBox;
	function initDojoDialogBox(e) {
		dojoDialogBox = dojo.widget.byId("DialogContent");
	}

	dojo.addOnLoad(initDojoDialogBox);	// Include this line on templates you need 
	
*/
	
	
	
-->