function objToggle(obj1,strDo)
{
	if(strDo=='show')
		obj1.style.display = 'block';
	else if(strDo=='hide')
		obj1.style.display = 'none';
}
function goKids(intKid)
{
	var intKidMax = 4;
	var x = 1;
	var objF = document.getElementById("frmLodge");
	var objS;
	
	while(x<=intKidMax)
	{
		if(x==1)
			objS = objF.selKidAge1;
		else if(x==2)
			objS = objF.selKidAge2;
		else if(x==3)
			objS = objF.selKidAge3;
		else if(x==4)
			objS = objF.selKidAge4;
		objToggle(objS,'hide');
		x++;
	}	
	x = 1;
	while(x<=intKid)
	{
		if(x==1)
			objS = objF.selKidAge1;
		else if(x==2)
			objS = objF.selKidAge2;
		else if(x==3)
			objS = objF.selKidAge3;
		else if(x==4)
			objS = objF.selKidAge4;
		objToggle(objS,'show');
		x++;
	}
	objToggle(document.getElementById('dvKids'),'show');
}
function mapArea(intX)
{
	objF = document.getElementById('frmLodge');
	objF.selArea.value = intX;
	hide('map_box');
}
function mapSort(intX)
{
	if(intX==8)
		hide('map_box_results');
	else
	{
		hide('map_box_results');
		goArea(intX);
	}
}
function verifyForm()
{
	var blnPass = false;
	objF = document.getElementById('frmLodge');
	if(objF.txtCheckin.value=="mm/dd/yyyy")
	{
		alert("Please select a check-in date.");
		toggleCalendar(1);
		objF.txtCheckin.value = "";
	}
	else if(objF.txtCheckin.value=="")
		alert("Please select a check-in date.");
	else if(objF.txtCheckout.value=="mm/dd/yyyy")
	{
		alert("Please select a check-out date.");
		toggleCalendar(2);
		objF.txtCheckout.value = "";
	}
	else if(objF.txtCheckout.value=="")
		alert("Please select a check-out date.");
	else
	{
		//var inDate = new Date();
		//var outDate = new Date();
		//inDate = objF.txtCheckin.value;
		//outDate = objF.txtCheckout.value;
		//if(outDate<inDate)
		//{
		//	alert('The check-in date must be before the check-out date.');
		//	objF.txtCheckin.value = "";
		//	objF.txtCheckout.value = "";
		//	toggleCalendar(1);
		//}
		//else
			blnPass = true;
	}
	return blnPass;
}


function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function doLoad()
{
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();	
	//var objOverlay = document.getElementById('dvOverlay');
	var objLoadImg = document.getElementById('imgLoad');
	//objOverlay.style.height = (arrayPageSize[1] + 'px');
	//objOverlay.style.display = 'block';
	
	objLoadImg.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - 150) / 2) + 'px');
	objLoadImg.style.left = (((arrayPageSize[0] - 800) / 2) + 'px');
	objLoadImg.style.display = 'block';
}
function verifyCCform()
{
	var objF = document.getElementById("frmCC");
	var blnPass = false;
	
	if(objF.txtFName.value=="")
	{
		alert("Please enter your first name.");
		objF.txtFName.focus();
	}
	else if(objF.txtLName.value=="")
	{
		alert("Please enter your last name.");
		objF.txtLName.focus();
	}
	else if(objF.txtPhone.value=="")
	{
		alert("Please enter your phone number.");
		objF.txtPhone.focus();
	}
	else if(objF.txtEmail1.value=="")
	{
		alert("Please enter your email address.");
		objF.txtEmail1.focus();
	}
	else if(objF.txtEmail2.value=="")
	{
		alert("Please verify your email address.");
		objF.txtEmail2.focus();
	}
	else if(objF.txtEmail1.value!=objF.txtEmail2.value)
	{
		alert("Email address verification did not match.");
		objF.txtEmail2.focus();
	}
	else if(objF.txtAddr1.value=="")
	{
		alert("Please enter your mailing address.");
		objF.txtAddr1.focus();
	}
	else if(objF.txtCity.value=="")
	{
		alert("Please enter your city.");
		objF.txtCity.focus();
	}
	else if(objF.txtState.value=="")
	{
		alert("Please enter your state.");
		objF.txtState.focus();
	}
	else if(objF.txtZip.value=="")
	{
		alert("Please enter your zip code.");
		objF.txtZip.focus();
	}
	else if(objF.txtZip.value=="")
	{
		alert("Please enter your zip code.");
		objF.txtZip.focus();
	}
	else if(objF.selCntry.value=="ws")
	{
		alert("Please select your country.");
		objF.txtZip.focus();
	}
	else if(objF.txtCCnum.value=="")
	{
		alert("Please enter your credit card number.");
		objF.txtCCnum.focus();
	}
	else if(!ccNumCheck(objF.txtCCnum.value,objF.selCCtype.value))
	{
		if(objF.selCCtype.value=="VI")
			alert("Invalid Visa number.");
		if(objF.selCCtype.value=="CA")
			alert("Invalid Mastercard number.");
		if(objF.selCCtype.value=="AX")
			alert("Invalid American Express number.");
		if(objF.selCCtype.value=="DC")
			alert("Invalid Diner's Club number.");
		objF.txtCCnum.focus();
	}
	else if(objF.txtCCid.value=="")
	{
		alert("Please enter your credit card code.");
		objF.txtCCid.focus();
	}
	else
	{
		blnPass = true;
	}
	
	
	return blnPass;
}
function ccNumCheck(strCC,strCCtype)
{
	var blnPass = false;
	if(strCCtype=="VI")
	{
		blnPass = true;
	
	}
	else if(strCCtype=="CA")
	{
		blnPass = true;
	}
	else if(strCCtype=="AX")
	{
		blnPass = true;
	}
	else if(strCCtype=="DC")
	{
		blnPass = true;
	}

	
	return blnPass;
}
function send2friend()
{
	var objF = document.getElementById("frmSendG");
	var strQ = "";
	if(objF.txtEmail.value=="")
	{
		alert("Enter your friend's email.");
		objF.txtEmail.focus();
	}
	else if(objF.txtName.value=="")
	{
		alert("Enter your name.");
		objF.txtName.focus();
	}
	else
	{
		strQ = "email=" + objF.txtEmail.value + "&name=" + objF.txtName.value;
		if(objF.txtNameSrch.value!="")
			strQ += "&namesrch=" + objF.txtNameSrch.value;
		if(objF.txtTypes.value!="")
			strQ += "&types=" + objF.txtTypes.value;
		if(objF.txtLocs.value!="")
			strQ += "&locs=" + objF.txtLocs.value;
		if(objF.txtAmenz.value!="")
			strQ += "&amenz=" + objF.txtAmenz.value;
		if(objF.txtHealth.value!="")
			strQ += "&healthInspectionRating=" + objF.txtHealth.value;
		document.getElementById("ifWarp").src = "sendgrid.php?" +strQ;
		document.getElementById("dvPage1").style.display = "none";
		document.getElementById("dvPage2").style.display = "block";
	}
}

