// JavaScript Document

<!--	
	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=yes,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 "contact" : pageURL = "/home/contact.php"; winHeight = "352"; break;
			case "sitemap" : pageURL = "/home/sitemap.php"; winHeight = "400"; break;
		}
		
		window.open(pageURL, "PPWindow", "scrollbars=yes,resizable=no,location=no,toolbar=no,height="+ winHeight + ",width=520").focus();
	}
	
	/* ********************************************************************************************************* */
	
	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 showInstructions(nodeName) {
		var divs = document.getElementsByTagName("div");
		
		for (var i=0;i<divs.length;i++) {
			if (divs[i].title == "Filling Instructions") {
				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/nav/nav_about_on.gif");
			var nav2 = newImage("/images/nav/nav_collections_on.gif");
			var nav3 = newImage("/images/nav/nav_limited_on.gif");
			var nav4 = newImage("/images/nav/nav_parts_on.gif");
			var nav5 = newImage("/images/nav/nav_pilotHome_on.gif");
			
			preloadFlag = true;
		}
	}
	
	/* ********************************************************** */
	
	function submitFeedback() {
		if (document.feedbackForm.email.value == '' ) {
			alert('Please provide an e-mail address.');
			document.feedbackForm.email.focus();
			return;
		} else {
			document.feedbackForm.submit();
		}
	}
	
	/* ********************************************************** */
	
	function showThis() {		
		document.getElementById("locateDealerForm").submit();
	}
	
	/* ********************************************************** */
	
	function submitCategory(value, cat, a) {
		if(value!="") document.categoryForm.submit();		
	}
		
	function init() 
	{		
		try {
			var submitted = document.getElementById("success").value;
			if (submitted == "true") alert("Your feedback has been submitted to Namiki Customer Service.  Thank You!");
		} catch (e) {
			// do nothing
		}
	}
	
	/* ********************************************************** */
-->