// JavaScript Document

function show(idLayer) {document.getElementById(idLayer).style.display='block';}
function showInline(idLayer) { document.getElementById(idLayer).style.display='inline'; }
function hide(idLayer) {document.getElementById(idLayer).style.display='none';}

function visible(idLayer) {document.getElementById(idLayer).style.visibility='visible';}
function invisible(idLayer) {document.getElementById(idLayer).style.visibility='hidden';}

function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

//Children selector.
function displayages(childobj)
{
if (childobj.options[0].selected){hide('children_box'); hide('minorsAge1'); hide('minorsAge2'); hide('minorsAge3'); hide('minorsAge4');}
if (childobj.options[1].selected){show('children_box'); showInline('minorsAge1'); hide('minorsAge2'); hide('minorsAge3'); hide('minorsAge4');}
if (childobj.options[2].selected){show('children_box'); showInline('minorsAge1'); showInline('minorsAge2'); hide('minorsAge3'); hide('minorsAge4');}
if (childobj.options[3].selected){show('children_box'); showInline('minorsAge1'); showInline('minorsAge2'); showInline('minorsAge3'); hide('minorsAge4');}
if (childobj.options[4].selected){ show('children_box'); showInline('minorsAge1'); showInline('minorsAge2'); showInline('minorsAge3'); showInline('minorsAge4');}
}


function verifyForm(strID)
{
	var blnPass = false;
	var objF = document.getElementById(strID);
	if(objF.chk_in.value=="mm/dd/yyyy"||objF.chk_in.value=="")
	{
		alert("Please select a check in date.");
		objF.chk_in.focus();
	}
	else if(objF.chk_out.value=="mm/dd/yyyy"||objF.chk_out.value=="")
	{
		alert("Please select a check out date.");
		objF.chk_out.focus();
	}
	else
	{
		if(strID=="airHotelSearch")
		{
			
			if(objF.leavingFrom.value=="")
			{
				alert("Please enter the city you are leaving from.");
				objF.leavingFrom.focus();
			}
			else if(objF.goingTo.value=="")
			{
				alert("Please enter the city you are going to.");
				objF.goingTo.focus();
			}
			else
			{
				objF.dateLeavingMonth.value = objF.doa_mm.value;
				objF.dateLeavingDay.value = objF.doa_dd.value;
				objF.dateReturningMonth.value = objF.dod_mm.value;
				objF.dateReturningDay.value = objF.dod_dd.value;
				blnPass = true;
			}
		}
		else if(strID=="CarSearch")
		{
			if(objF.pucity.value=="")
			{
				alert("Please enter the pick-up city.");
				objF.pucity.focus();
			}
			else if(objF.docity.value=="")
			{
				alert("Please enter the drop-off city.");
				objF.docity.focus();
			}
			else
			{
				objF.pudate_mo.value = objF.doa_mm.value;
				objF.pudate_dy.value = objF.doa_dd.value;
				objF.dodate_mo.value = objF.dod_mm.value;
				objF.dodate_dy.value = objF.dod_dd.value;
				blnPass = true;
			}
		}
		else
			blnPass = true;
	}
	return blnPass;
	
}

var strSlideIDs = new Array();
var strSlideURL = new Array();
strSlideIDs[1] = "hotel";
strSlideIDs[2] = "h02";
strSlideIDs[3] = "h03";
strSlideIDs[4] = "h04";
strSlideIDs[5] = "h05";
strSlideIDs[6] = "h06";
strSlideIDs[7] = "h07";
strSlideIDs[8] = "h08";
strSlideIDs[9] = "h09";
strSlideIDs[10] = "h10";
strSlideIDs[11] = "h11";
strSlideIDs[12] = "h12";
strSlideURL[1] = "#";
strSlideURL[2] = "#";
strSlideURL[3] = "#";
strSlideURL[4] = "#";
strSlideURL[5] = "#";
strSlideURL[6] = "#";
strSlideURL[7] = "#";
strSlideURL[8] = "#";
strSlideURL[9] = "#";
strSlideURL[10] = "#";
strSlideURL[11] = "#";
strSlideURL[12] = "#";

var blnSlidePause = false;
var intCurrSlide = 1;
var intMaxSlide = 12;

function goSlide()
{
	if(!blnSlidePause)
	{
		unsetAllSlides();
		setSlide(intCurrSlide);
		if(intCurrSlide<intMaxSlide)intCurrSlide++;
		else intCurrSlide = 1;
	}
	setTimeout("goSlide()",3000);
}
function setSlide(intSlide)
{
	document.getElementById("header-image").className = "header-" + strSlideIDs[intSlide];
	document.getElementById(strSlideIDs[intSlide]).className = "image outline";
	document.getElementById("click-here").href = strSlideURL[intSlide];
	
	
}
function unsetSlide(intSlide)
{
	document.getElementById(strSlideIDs[intSlide]).className = "image";
}
function unsetAllSlides()
{
	for(x=1;x<=intMaxSlide;x++)
	{
		unsetSlide(x);
	}
}








var strTabOn = 'waterTab';
function tabOver(strID)
{
	var obj1 = document.getElementById(strID);
	obj1.style.backgroundPosition='0% 0%';
}
function tabOut(strID)
{
	if(strTabOn!=strID)
	{
		var obj1 = document.getElementById(strID);
		obj1.style.backgroundPosition='0% 100%';
	}
}
function tabClick(strID)
{
	var obj1 = document.getElementById(strID);
	obj1.style.backgroundPosition='0% 0%';

	if(strID!='diversityTab')
		document.getElementById('diversityTab').style.backgroundPosition='0% 100%';
	if(strID!='activitiesTab')
		document.getElementById('activitiesTab').style.backgroundPosition='0% 100%';
	if(strID!='waterTab')
		document.getElementById('waterTab').style.backgroundPosition='0% 100%';

	strTabOn = strID;
}
function iconClick(strID)
{
	var obj1 = document.getElementById(strID);
	obj1.style.backgroundPosition='0% 0%';

	if(strID!='flip-basics')
	{
		document.getElementById('flip-basics').style.backgroundPosition='100% 100%';
		document.getElementById('flip-basics-page').style.display = "none";
	}
	if(strID!='flip-booking')
	{
		document.getElementById('flip-booking').style.backgroundPosition='100% 100%';
		document.getElementById('flip-booking-page').style.display = "none";
	}
	if(strID!='flip-news')
	{
		document.getElementById('flip-news').style.backgroundPosition='100% 100%';
		document.getElementById('flip-news-page').style.display = "none";
	}
	if(strID!='flip-specialty')
	{
		document.getElementById('flip-specialty').style.backgroundPosition='100% 100%';
		document.getElementById('flip-specialty-page').style.display = "none";
	}
	if(strID!='flip-food')
	{
		document.getElementById('flip-food').style.backgroundPosition='100% 100%';
		document.getElementById('flip-food-page').style.display = "none";
	}
	if(strID!='flip-phone')
	{
		document.getElementById('flip-phone').style.backgroundPosition='100% 100%';
		document.getElementById('flip-phone-page').style.display = "none";
	}
	if(strID!='flip-shopping')
	{
		document.getElementById('flip-shopping').style.backgroundPosition='100% 100%';
		document.getElementById('flip-shopping-page').style.display = "none";
	}
	if(strID!='flip-attire')
	{
		document.getElementById('flip-attire').style.backgroundPosition='100% 100%';
		document.getElementById('flip-attire-page').style.display = "none";
	}
	if(strID!='flip-activities')
	{
		document.getElementById('flip-activities').style.backgroundPosition='100% 100%';
		document.getElementById('flip-activities-page').style.display = "none";
	}
		
	document.getElementById(strID + '-page').style.display = "block";
}
