
resortsOff=new Image(11,31);resortsOff.src="/images/template/resortsoff.gif";resortsOn=new Image(11,31);resortsOn.src="/images/template/resortson.gif";villasOff=new Image(11,31);villasOff.src="/images/template/villasoff.gif";villasOn=new Image(11,31);villasOn.src="/images/template/villason.gif";activeMenu="";function Cabo()
{var randomNumber=Math.floor(Math.random()*7);if(randomNumber==0)document.write('<img src="/images/template/CaboSanLucas_family_03.jpg" style="margin-top:16px;" width="251" height="155">');else if(randomNumber==1)document.write('<img src="/images/template/CaboSanLucas_boat_06.jpg" style="margin-top:16px;" width="251" height="155">');else if(randomNumber==2)document.write('<img src="/images/template/CaboSanLucas_BV_06.jpg" style="margin-top:16px;" width="251" height="155">');else if(randomNumber==3)document.write('<img src="/images/template/CaboSanLucas_hottub_06.jpg" style="margin-top:16px;" width="251" height="155">');else if(randomNumber==4)document.write('<img src="/images/template/CaboSanLucas_jetski_06.jpg" style="margin-top:16px;" width="251" height="155">');else if(randomNumber==5)document.write('<img src="/images/template/CaboSanLucas_poolside_06.jpg" style="margin-top:16px;" width="251" height="155">');else document.write('<img src="/images/template/CaboSanLucas_villa_03.jpg" style="margin-top:16px;" width="251" height="155">');}
function systranURL(url){return url;}
function hideselect()
{if(br!='IE')return;s=document.getElementsByTagName('select');for(i=0;i<s.length;i++){s[i].style.visibility='hidden';}}
function showselect()
{s=document.getElementsByTagName('select');for(i=0;i<s.length;i++){s[i].style.visibility='visible';}}
function notepad()
{if('function'==typeof window.initNotePad)initNotePad();}
function phplive()
{h=document.getElementsByTagName("head")[0];a=Array();default_img=Array();default_link=Array();extra_js=Array();a[0]=Array("phpLiveDiv",1,'','http://www.onionrings.com');a[1]=Array("englishPHP",4,'images/banner_mario.jpg','http://www.onionrings.com');a[2]=Array("spanishPHP",3,'images/banner_mario.jpg','');a[3]=Array("homePHPLive",5,'','','');for(i=0;i<a.length;i++){if(document.getElementById(a[i][0])){s=document.createElement('script');s.id='phpLiveScript';s.type='text/javascript';s.language='Javascript';s.src='/phplive/js/status_image.php?base_url=http://www.cabovillas.com/phplive&l=cabovillas_php&x=1&deptid='+a[i][1];h.appendChild(s);if(a[i][2])default_img[a[i][1]]=a[i][2];if(a[i][3])default_link[a[i][1]]=a[i][3];if(a[i][4])extra_js[a[i][1]]=a[i][4];setTimeout("php_live_display_"+a[i][1]+"('"+a[i][0]+"')",2000);}}}
function Goto(windowname,url){window.open(url,windowname,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=460,height=504")}
function GotoPanorama(windowname,url){window.open(url,windowname,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=510,height=540")}
var br
if(navigator.appName=="Netscape"&&navigator.appVersion.charAt(0)=="4"){br="N";}
else if(navigator.appName=="Microsoft Internet Explorer"&&document.all!=null){br="IE";}
else if(navigator.appName=="Netscape"&&document.getElementById!=null&&navigator.appVersion.charAt(0)=="5"){br="N5";}
else{br=null}
function go(box){var val=box.options[box.selectedIndex].value;if(val!=""){window.location.href=val;}}
function OpenWindow(page){var cal=window.open(systranURL(page),"popup","directories=no,height=500,location=no,menubar=no,scrollbars=yes,status=no,resizable=1,width=600");}
function OpenCalendar(page){var cal=window.open(systranURL(page),"AvailCal","fullscreen,directories=no,location=no,menubar=no,scrollbars=yes,status=yes,resizable=1");}
function addbookmark()
{var bookmarkurl=window.location
var bookmarktitle="Cabo San Lucas Mexico Vacations"
if(document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)}
var locations=Array();var numLoc=0;

var ptype = "villa";

function showVilla(){
	document.getElementById('villa').style.display = "block";
	document.getElementById('villa').style.visibility = "visible";
	document.getElementById('resort').style.display = "none";
	document.getElementById('resort').style.visibility = "hidden";
	document.getElementById('propstyle').value = "villa";
	ptype = "villa";
	return void(0);
}

function showResort(){
	document.getElementById('villa').style.display = "none";
	document.getElementById('villa').style.visibility = "hidden";
	document.getElementById('resort').style.display = "block";
	document.getElementById('resort').style.visibility = "visible";
	document.getElementById('propstyle').value = "Resort";
	ptype = "resort";
	return void(0);
}

function PopUp(URL,Window,w,h,x,y){var popupwin=window.open(URL,Window,"toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+w+",height="+h+",left="+x+",top="+y);}
function openPDF(){var msg="We recommend a broadband Internet connection to view this 8.6MB PDF. If you are on a 56k Modem we recommend against downloading this document.\n\nClick OK to download the Los Cabos Insider Guide PDF.\nClick Cancel to abort download.";if(confirm(msg)){var PDFwin=window.open("/PDF/LC_InsiderGuide.pdf","pdfwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=900,height=700,left=0,top=0");}}
function openRules(){var msg="We recommend a high-speed Internet connection of 100k or above to view this PDF. If you are on a 56k Modem we recommend against downloading this document.\n\nClick OK to download the Vacation Giveaway Contest Rules.\nClick Cancel to abort download.";if(confirm(msg)){var PDFwin=window.open("/pdf/vacation_giveaway.pdf","pdfwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=900,height=700,left=0,top=0");}}
function mapPopUp(URL,Window,w,h,x,y){var popupwin=window.open(URL,Window,"toolbar=no,location=no,directories=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",left="+x+",top="+y);popupwin.focus();}
function NLPopUp(){PopUp(systranURL('/newsletter_signup.asp'),'NL','850','600','25','25');}
function OpenOwner(){window.open("https://caboserver.com/owner/owner_login.asp","PWN3d","toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=900,height=600,left=0,top=0");}
function OpenFair(){PopUp('http://www.nextfares.com/?dn=6740528&to1=SJD','Test','800','560','40','40');}
function OpenRes(){window.open(systranURL('/reservation_request.asp'),'Res','fullscreen');}
function OpenVideo(){ViewingVideo(systranURL('mms://wn71.reliablehosting.com/customer01/intro.asf'));}
function Jump(Location){opener.location.href=Location;window.close()}
function ViewingVideo(sURL){var msg=("You must have an Internet Connection of 100k or above to view this Streaming Video. If you are on a 56k Modem you will not be able to view this Video..\n\nClick OK to View Video\nClick Cancel to abort viewing")
if(confirm(msg)==true)
location.href=sURL;}
function newImage(arg){if(document.images){rslt=new Image();rslt.src=arg;return rslt;}}
function changeImages(){if(document.images){for(var i=0;i<changeImages.arguments.length;i+=2){document[changeImages.arguments[i]].src=changeImages.arguments[i+1];}}}
browser=navigator.appName;version=navigator.appVersion;os=navigator.platform;ie="Microsoft Internet Explorer";nn="Netscape";
var br
if(navigator.appName=='Netscape'){if(document.layers){br="N"}
else if(document.getElementById){br="NS6"}}else{br="IE";}
function reDo(){window.location.reload()}
function setResize(){setTimeout("window.onresize=reDo",500);}
if(br=="N"){window.onload=setResize;}
function OpenScrollingPopup(URL,width,height){window.self.name="main";var now=new Date();var remote=window.open(systranURL(URL),"popup"+now.getTime(),"width="+width+",height="+height+",toolbar=0,location=0,directories=0,resizable=1,status=1,menubar=0,scrollbars=yes");}
function showLayer(strLayerName){if(document.all)
document.all[strLayerName].style.display='block';else if(document.layers)
document.layers[strLayerName].display='block';}
function hideLayer(strLayerName){if(document.all)
document.all[strLayerName].style.display='none';else if(document.layers)
document.layers[strLayerName].display='none';}
function swapImage(strImgName,strImgSrc){if(document.images)
document.images[strImgName].src=strImgSrc;}
function getCookie(strName){var strCookie=document.cookie;if(strCookie.length==0)return'';var strValue='';var intStart=strCookie.indexOf(strName+'=');if(intStart>-1){intStart+=strName.length+1;var intEnd=strCookie.indexOf(';',intStart+1);if(intEnd==-1)intEnd=strCookie.length;strValue=strCookie.substring(intStart,intEnd);}
return strValue;}
function setCookie(strName,strValue,strExp){document.cookie=strName+'='+strValue
+(document.location.hostname=='www.cabovillas.com'?'':'')
+(strExp==''?'':';expires='+strExp);}
function setCookieWithPath(strName,strValue,strPath,strExp){document.cookie=strName+'='+strValue
+(document.location.hostname=='www.cabovillas.com'?'':'')
+(strExp==''?'':';expires='+strExp);}
function deleteCookie(strName){var dtmExp=new Date();dtmExp.setTime(dtmExp.getTime()-3600000);setCookieWithPath(strName,'','/',dtmExp.toGMTString())}
function isNumericString(strOrig){if(strOrig.length==0)return false;var strChar;var strValidChars="1234567890$,";for(var i=0;i<strOrig.length;i++){strChar=strOrig.substring(i,i+1);if(strValidChars.indexOf(strChar,0)==-1)
return false;}
return true;}
function isValidEmail(strEmail){var strBadChars,strChar,strSuffix,intNumBadChars,intCount,intPos,intPosPeriod
strBadChars=' /:,#\'"`$~!%^&*();<>?\\|{}[]';intNumBadChars=strBadChars.length
for(intCount=0;intCount<intNumBadChars;++intCount){strChar=strBadChars.substring(intCount,1);if(strEmail.indexOf(strChar)>0)
return false;}
intPos=strEmail.indexOf('@')
if(intPos==-1)
return false;intPosPeriod=strEmail.indexOf('.',intPos);if(intPosPeriod==-1)
return false;if(strEmail.length-intPosPeriod<3)
return false;return true;}

function toggle(id){
	var im = document.getElementById(id).style.visibility;
	if (im == "hidden"){
		show(id);
	}else{
		hide(id);
	}
	return void(0);
}
function show(id){
	var is = id + "i";
	document.getElementById(id).style.visibility = "visible";
	document.getElementById(id).style.display = "block";
	document.getElementById(is).src = "http://www.cabovillas.com/GIF/minus.gif";
	return void(0);
}
function hide(id){
	var is = id + "i";
	document.getElementById(id).style.visibility = "hidden";
	document.getElementById(id).style.display = "none";
	document.getElementById(is).src = "http://www.cabovillas.com/GIF/plus.gif";
	return void(0);
}

function checkEmail(){
	var em = document.getElementById("Email").value;
	var ec = document.getElementById("EmailConfirm").value;

	if(em !== ec){
		alert("Your Email Address and your Confirm Email\n are NOT a match!\nPlease check your Email Address for accuracy.");
		return false;
	}else{
		return true;
	}
}

function toggleAdv(id,ref){
	var nid = id + ref;
	var im = document.getElementById(nid).style.visibility;
	if (im == "hidden"){
		showAdv(nid,ref);
	}else{
		hideAdv(nid,ref);
	}
	return void(0);
}
function showAdv(id,ref){
	var is = id + ref;
	document.getElementById(id).style.visibility = "visible";
	document.getElementById(id).style.display = "block";
	document.getElementById(is).src = "/GIF/minus.gif";
	return void(0);
}
function hideAdv(id,ref){
	var is = id + ref;
	document.getElementById(id).style.visibility = "hidden";
	document.getElementById(id).style.display = "none";
	document.getElementById(is).src = "/GIF/plus.gif";
	return void(0);
}