// Tour Navigation Animation Functions

function SubOn(sub_num) {
	HideIt();
	document.getElementById(default_sub).style.visibility = "hidden";
	document.getElementById("sub_" + sub_num).style.visibility = "visible";
	curr_sub = "sub_" + sub_num;
}

function SubOff() {
	pause = setTimeout('HideIt()',800);
}

// add a delay for mouseover movement
function HideIt() {
	window.clearTimeout(pause);
	document.getElementById(curr_sub).style.visibility = "hidden";
	document.getElementById(default_sub).style.visibility = "visible";
}

var curr_sub;
var pause;

// Destinations Menu Functions

function GoToDestination(sel_dest) {
	sel_url = document.getElementById('destinations_menu').options[sel_dest].value;
	if(sel_url != "") {
		//document.getElementById('destinations_menu').options[0].text = "Destinations";
		document.getElementById('destinations_menu').selectedIndex = 0;
		document.location.href = sel_url;
	}
	else {
		//document.getElementById('destinations_menu').options[0].text = "Destinations";
		document.getElementById('destinations_menu').selectedIndex = 0;
	}
}

function MenuFocus(sel_box) {
	//sel_box.options[0].text = "";
}

function MenuBlur(sel_box) {
	//sel_box.options[0].text = "Destinations";
}


// close a popup or go back one page in Javascript history

function ClosePopup() {
	if (window.opener) {
		window.close();
	}
	else {
		window.history.back();
	}
}

// close a popup or go to home page

function GoHome () {
	if (window.opener) {
		window.opener.document.location = "http://www.artisansofleisure.com";
		window.opener.focus();
		window.close();
	}
	else {
		document.location = "http://www.artisansofleisure.com";
	}
}

// other functions

function popupimg(pxml,phigh)
{
	window.open("popup.php?loadxml="+pxml+"&high="+phigh,"pop","menubar=0,location=0,toolbar=0,scrollbars=0,status=1,resizable=0,width=530,height=500,screenX=0,screenY=0,left=10,top=10");
}

function popupbook()
{
	var booking_window = window.open("/tour/booking.html","booking","menubar=0,location=0,toolbar=0,scrollbars=1,status=1,resizable=0,width=630,height=500,screenX=0,screenY=0,left=10,top=10");
	booking_window.focus();
}

function popuppress(url)
{
	var press_window = window.open(url,"press","menubar=0,location=0,toolbar=0,scrollbars=1,status=1,resizable=0,width=630,height=500,screenX=0,screenY=0,left=10,top=10");
	press_window.focus();
}

function popuploader()
{
	window.open("upload.php","upload","menubar=0,location=0,toolbar=0,scrollbars=1,status=1,resizable=0,width=300,height=400,screenX=0,screenY=0,left=10,top=10");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function checkform()
{
	if ((document.forms['mainform'].elements['fname'].value.length==0)||(document.forms['mainform'].elements['lname'].value.length==0)){
  		alert ("Please enter your first and last name.");
  	} else {
  		if (document.forms['mainform'].elements['email'].value.length==0) {
  			alert ("Please enter your email.");
  		} else {
  			if (document.forms['mainform'].elements['address1'].value.length==0) {
  				alert ("Please enter your address.");
  			} else {
  				if ((document.forms['mainform'].elements['city'].value.length==0)||(document.forms['mainform'].elements['zip'].value.length==0)) { 
					alert ("Please enter your city and zip code.");
				} else {
					if ((document.forms['mainform'].elements['dphone1'].value.length==0)||(document.forms['mainform'].elements['dphone2'].value.length==0)
	                ||(document.forms['mainform'].elements['dphone3'].value.length==0)) { 
	                	alert ("Please enter your daytime phone number.");
	                } else {
	                	if (document.forms['mainform'].elements['refer'].value.length==0) { 
	                		alert ("Please enter how did you hear about us.");
	                	} else {
	                		document.forms['mainform'].submit();
	                	}
	                }
	            }
	        }
	   	}
	}
}


function checkNewsletterForm()
{if (document.forms['mainform'].elements['fname'].value.length==0)
  {alert ("Please enter your first name.");}
  else  {if (document.forms['mainform'].elements['lname'].value.length==0)
     {alert ("Please enter your last name.");}
    else {if (document.forms['mainform'].elements['email'].value.length==0)
	  {alert ("Please enter your email.");}
 else {document.forms['mainform'].submit();}}}}



// OLD DEAD SCRIPTS FROM THE 1990s...

function MM_swapImgRestore() {
	return true;	
}

function MM_preloadImages() {
	return true;
}

function MM_swapImage() {
	return true;
}