var b_stopBit=0;var b_overide=0;var s_userAgent=window.navigator.userAgent;var KON=(s_userAgent.indexOf("KHTML")>-1)?1:0;var isMac=(navigator.userAgent.indexOf("Mac")>-1)?1:0;var isIE=(navigator.userAgent.indexOf("MSIE")>-1)?1:0;var isNN6=(o_navigator.indexOf("Netscape6")>-1)?1:0;var isMacIE=(isMac&&isIE)?1:0;var isOpera=(s_navigator.indexOf("opera")>-1)?1:0;var navTimer=null;var currentNav=0;var b_loaded=0;if(!Array.prototype.push){Array.prototype.push=function(e){this[this.length]=e;};}function $(){var element,elements,i;elements=[];for(i=0;i<arguments.length;i=i+1){element=arguments[i];if(typeof element==="string"){element=document.getElementById(element);}if(arguments.length===1){return element;}elements.push(element);}return elements;}function cDisplay(){var a_args,a_items,i;a_args=cDisplay.arguments;for(i=0;i<a_args.length;i=i+1){a_items=a_args[i].split(",");if($(a_items[0])){$(a_items[0]).style.display=a_items[1];}}}function cVis(){var a_args,a_items,i;a_args=cVis.arguments;for(i=0;i<a_args.length;i=i+1){a_items=a_args[i].split(",");document.getElementById(a_items[0]).style.visibility=a_items[1];}}var oairType;function getRadioSet(sSet){var oSet,aInput,aRadio,i;oSet=$(sSet);aInput=oSet.getElementsByTagName("input");aRadio=[];for(i=aInput.length-1;i>-1;i=i-1){if(aInput[i].type==="radio"){aRadio.push(aInput[i]);}}return aRadio;}function getCheckedRadio(aGroup){var oRadio,i;for(i=0;i<aGroup.length;i=i+1){if(aGroup[i].checked){oRadio=aGroup[i];}}return oRadio;}function cbDisplayCB(aCB,oCB){for(var i=aCB.length-1;i>-1;i=i-1){switch(aCB[i]!==oCB){case true:if(aCB[i]){aCB[i].style.position="absolute";}if(aCB[i]){aCB[i].style.visibility="hidden";}if(aCB[i]){aCB[i].style.display="none";}if(isMacIE){aCB[i].className="cbform";}break;case false:if(aCB[i]){aCB[i].style.position="relative";}if(aCB[i]){aCB[i].style.visibility="visible";}if(aCB[i]){aCB[i].style.display="block";}if(isMacIE){aCB[i].className="cbform cbformon";}break;}}}function cbChangeNavTab(oNav){var aNavList,i,oNavList;oNavList=$("cbNavList");aNavList=oNavList.childNodes;for(i=aNavList.length-1;i>-1;i=i-1){if(aNavList[i].nodeName==="LI"){aNavList[i].className=(aNavList[i].id==="cb"+oNav.value+"tab")?"cbNavon":"";}}}function formbit(s_form){var a_formbit,s_formbit;a_formbit=s_form.split("form");s_formbit=a_formbit[1];return s_formbit;}function multiroomchild(i_rooms,i_maxrooms,s_type,o_childrooms){o_childrooms.style.display="none";i_childrows=0;for(var i=0;i<i_maxrooms;i=i+1){o_children=document.getElementById(s_type+"_child"+(i+1));if(!o_children){break;}if(isNN6){o_children.focus();}i_ages=o_children.selectedIndex;o_childrow=document.getElementById(s_type+"_childroom"+(i+1));if(i_ages>0&&i<i_rooms){i_childrows=i_childrows+1;o_childrooms.style.display="block";o_childrow=document.getElementById(s_type+"_childroom"+(i+1));a_select=o_childrow.getElementsByTagName("select");for(var j=0;j<o_children.options.length-1;j=j+1){if(a_select[j]){a_select[j].parentNode.style.display=(j<i_ages)?"block":"none";}}o_childrow.style.display="block";}else{o_childrow.style.display="none";}}return i_childrows;}function multirooms(o_rooms){if(typeof o_rooms==="string"){o_rooms=document.getElementById(o_rooms);}var o_caller=o_rooms;s_type=formbit(o_rooms.form.name);o_rooms=document.getElementById(s_type+"_totalrooms");if(isNN6){o_rooms.focus();}i_rooms=parseInt(o_rooms.options[o_rooms.selectedIndex].text);o_multiroomchild=document.getElementById(s_type+"_multichildroom");if(o_rooms.options[o_rooms.selectedIndex].text.indexOf("+")===-1){if(document.getElementById("HO_grpmsg")){document.getElementById("HO_grpmsg").style.display="none";}i_maxrooms=parseInt(o_rooms.options[o_rooms.options.length-1].text);for(var i=0;i<i_maxrooms;i=i+1){if(document.getElementById(s_type+"_room"+(i+1))){document.getElementById(s_type+"_room"+(i+1)).style.display="none";}}for(var j=0;j<i_rooms;j=j+1){if(document.getElementById(s_type+"_room"+(j+1))){document.getElementById(s_type+"_room"+(j+1)).style.display="block";}}i_childrows=(o_multiroomchild)?multiroomchild(i_rooms,i_maxrooms,s_type,o_multiroomchild):0;}else{if(o_multiroomchild){o_multiroomchild.style.display="none";}if(document.getElementById("HO_grpmsg")){document.getElementById("HO_grpmsg").style.display="block";}for(var k=0;k<i_rooms;k=k+1){if(document.getElementById(s_type+"_room"+(k+1))){document.getElementById(s_type+"_room"+(k+1)).style.display="none";}}}if(isNN6){o_caller.focus();}if(isOpera){cVis(s_type+"_moreoptions,hidden",s_type+"_moreoptions,visible");}}function cb_nearByAirports(o_check){if(o_check.checked){cDisplay("exactDatesCSA,inline","exactDatesnoCSA,none","nearbymsg,inline","cb_air_pmd,none","cb_air_fd,none");}else{cDisplay("exactDatesCSA,none","exactDatesnoCSA,inline","nearbymsg,none","cb_air_pmd,inline","cb_air_fd,inline");}if(o_check.checked){cVis("airFHSubmit,hidden");}else{cVis("airFHSubmit,visible");}}function cb_airDateType(o_radio){if(o_radio==oairType){return ;}o_ul=o_radio.parentNode.parentNode;a_li=o_ul.getElementsByTagName("li");for(var i=0;i<a_li.length;i=i+1){a_li[i].className=null;}o_radio.parentNode.className="typeselected";a_msgspan=document.getElementById("cb_typeselectmsgtxt").getElementsByTagName("span");for(var j=0;j<a_msgspan.length;j=j+1){a_msgspan[j].style.display="none";}cDisplay(o_radio.value+",inline");switch(o_radio.value){case"exactDates":cDisplay("datedf,none","daterf,none","air_fromrowfd,none","air_torowfd,none");cDisplay("datelt,inline","datert,inline","air_fromrowed,block","air_torowed,block","exactDatesnoCSA,inline");cVis("cb_air_nba,visible","airFHSubmit,visible");break;case"plusMinusDates":cDisplay("datedf,inline","daterf,inline","air_fromrowed,block","air_torowed,block");cDisplay("datelt,none","datert,none","air_fromrowfd,none","air_torowfd,none");cVis("cb_air_nba,hidden","airFHSubmit,hidden");break;case"flexibleDates":cDisplay("air_fromrowfd,block","air_torowfd,block","air_fromrowed,none","air_torowed,none");cVis("cb_air_nba,hidden","airFHSubmit,hidden");break;default:}oairType=o_radio;}function childAges(o_select,s_div){o_div=document.getElementById(s_div);if(o_select.selectedIndex!==0){a_children=o_div.getElementsByTagName("div");o_div.style.display="block";for(i=0;i<a_children.length;i=i+1){if(i<o_select.selectedIndex){a_children[i].style.visibility="visible";}else{a_children[i].style.visibility="hidden";}}}else{o_div.style.display="none";}}function showFHCarMsg(s_display){$("cb_FHCarMsg").style.display=s_display;}function cbSetUp(){var aCB=$("cb_formFH","cb_formCO","cb_formHO","cb_formHCX","cb_formair");var oCB,oNav;if($("cbNavForm")){var oFormNav=$("cbNavForm");var oMultiRoom,oNearByAir,oAirType;var oSubNav=0;getRadioSet("cbNavForm");var aInput=oFormNav.getElementsByTagName("input");var aNav=[];var aSubNav=[];for(var i=0;i<aInput.length;i=i+1){if(aInput[i].name==="nav"){aNav.push(aInput[i]);}}for(var j=0;j<aNav.length;j=j+1){if(aNav[j].checked){oNav=aNav[j];}}for(var k=0;k<aInput.length;k=k+1){if(aInput[k].name===oNav.value+"nav"){aSubNav.push(aInput[k]);}}for(var l=aSubNav.length-1;l>-1;l=l-1){if(aSubNav[l].checked){oSubNav=aSubNav[l];aSubNav[l].parentNode.className="cbSubNavOn";}else{aSubNav[l].parentNode.className=null;}}if(!oSubNav){aSubNav[0].checked=true;oSubNav=aSubNav[0];}}else{oSubNav=cbSetUp.arguments[0];oCB=null;oNav=null;}switch(oSubNav.value){case"hcx":case"p_hcx":oCB=$("cb_formHCX");oMultiRoom=$("HCX_totalrooms");break;case"c_hcx":oCB=$("cb_formHCX");oMultiRoom=$("HCX_totalrooms");break;case"p_h_f":case"h_f":case"f_h":showFHCarMsg("none");oCB=$("cb_formFH");oMultiRoom=$("FH_totalrooms");break;case"p_h_f_c":case"h_f_c":case"c_f_h":case"f_h_c":showFHCarMsg("block");oCB=$("cb_formFH");oMultiRoom=$("FH_totalrooms");break;case"h":oCB=$("cb_formHO");oMultiRoom=$("HO_totalrooms");break;case"c":oCB=$("cb_formCO");$("FCO_pickupoption").selectedIndex=0;break;case"c_r":oCB=$("cb_formCO");break;case"f":oAirType=getCheckedRadio(getRadioSet("cb_typeselect"));oNearByAir=$("cb_nba_input");oCB=$("cb_formair");childAges($("air_children"),"cbairchildages");break;default:}if(oNav!==null){cbChangeNavTab(oNav);cbDisplayCB(aCB,oCB);}else{cbDisplayHCX(aCB,oCB);}if(oAirType){cb_airDateType(oAirType);}if(oNearByAir){cb_nearByAirports(oNearByAir);}if(oMultiRoom){multirooms(oMultiRoom);}b_loaded=1;}function cbChangeNav(oNavLink){oNavLink.previousSibling.checked=true;cbSetUp();return false;}function maintainState(o_input){if(!b_loaded){return false;}var a_bit=o_input.id.split("_");var s_bit=a_bit[1];var aCBsupported=["air","FH","HO","CO","act","HCX"];for(var i=aCBsupported.length-1;i>-1;i=i-1){s_formbit=aCBsupported[i];o_formelement=document.getElementById(s_formbit+"_"+s_bit);if(eval("document.form"+s_formbit)&&o_formelement!=o_input){if(o_formelement&&o_formelement!=o_input&&o_input.type!="radio"){if(o_formelement.type==="select-one"&&o_formelement.type==o_input.type){for(var j=o_formelement.length-1;j>-1;j=j-1){if(o_formelement.options[j].text==o_input.options[o_input.selectedIndex].text){o_formelement.options[j].selected=true;break;}}}else{if(o_formelement.type==o_input.type){o_formelement.value=o_input.value;}}}else{a_input=eval("document.form"+aCBsupported[i]+"."+o_input.name);if(a_input){for(var j=0;j<a_input.length;j=j+1){if(a_input[j]!=o_input&&a_input[j].value==o_input.value){a_input[j].checked="checked";}}}}}}}function carPUDO(o_select){sPfx=o_select.id.split("_");sPrefix=sPfx[0].toLowerCase();switch(o_select.options[o_select.selectedIndex].value){case"pu_air":if(document.getElementById(sPrefix+"_airport")){document.getElementById(sPrefix+"_airport").style.display="block";}if(document.getElementById(sPrefix+"_nearaddress")){document.getElementById(sPrefix+"_nearaddress").style.display="none";}if(document.getElementById(sPrefix+"_nearplace")){document.getElementById(sPrefix+"_nearplace").style.display="none";}break;case"pu_addr":if(document.getElementById(sPrefix+"_airport")){document.getElementById(sPrefix+"_airport").style.display="none";}if(document.getElementById(sPrefix+"_nearaddress")){document.getElementById(sPrefix+"_nearaddress").style.display="block";}if(document.getElementById(sPrefix+"_nearplace")){document.getElementById(sPrefix+"_nearplace").style.display="none";}break;case"pu_poi":if(document.getElementById(sPrefix+"_airport")){document.getElementById(sPrefix+"_airport").style.display="none";}if(document.getElementById(sPrefix+"_nearaddress")){document.getElementById(sPrefix+"_nearaddress").style.display="none";}if(document.getElementById(sPrefix+"_nearplace")){document.getElementById(sPrefix+"_nearplace").style.display="block";}break;default:window.location=o_select.options[o_select.selectedIndex].value;}}function cb_hoscope(o_select,s_state){if(o_select.value.toLowerCase()==="us"||o_select.value.toLowerCase()==="ca"){document.getElementById(s_state).style.visibility="visible";}else{document.getElementById(s_state).style.visibility="hidden";}}function addvars(url,o_form){s_url=new String(url);s_url+="&expr_path="+o_form.expr_path.value;if(o_form.name==="formHOgbl"){s_url+="&airport="+o_form.airport.value;}else{s_url+="&city="+o_form.city.value;}s_url+="&searchMode="+o_form.searchMode.value;o_hototalrooms=document.getElementById("HO_totalrooms");s_url+="&numRooms="+o_hototalrooms.options[o_hototalrooms.selectedIndex].text;s_url+="&leavingDate="+document.getElementById("HO_fromdate").value;s_url+="&returningDate="+document.getElementById("HO_todate").value;if(o_hototalrooms.options[o_hototalrooms.selectedIndex].text.indexOf("+")===-1){for(var i=1;i<o_hototalrooms.selectedIndex+2;i=i+1){o_adult=document.getElementById("HO_adult"+i);s_url+="&adult"+(i)+"="+o_adult.options[o_adult.selectedIndex].text;o_child=document.getElementById("HO_child"+i);s_url+="&child"+(i)+"="+o_child.options[o_child.selectedIndex].text;}}s_url+="&state="+o_form.state.value;if(o_form.cityCountryCode){s_url+="&cityCountryCode="+o_form.cityCountryCode.value;}parent.window.location=s_url;}function fixMacIEselect(s_formdivid,o_radio){o_formdiv=document.getElementById(s_formdivid);a_modOptions=o_formdiv.getElementsByTagName("select");if(a_modOptions){for(i=0;i<a_modOptions.length;i=i+1){a_modOptions[i].focus();a_modOptions[i].blur();}}o_radio.focus();}function loadpopunder(o_form){var i,j,win2,s_urlString,s_urladditions,popunder,winfeatures,s_theURL,i_s59Svc1,i_s59Svc2,i_gomezSvc,i_aarpSvc,i_aolsvc,i_tcyca1,i_tcyca2,i_tcymx1,i_tcymx2,i_tcyar1,i_tcyar2,i_tcyla1,i_tcyla2,s_theAdtoShow,s_theDomain,s_selectedForm,a_formPrefix,s_prefix,s_orig,s_dest,a_orig,a_dest,a_fromDate,a_fromMonth,a_fromYear,a_toDate,a_toMonth,a_toYear,startTime,endTime,noOfAdults,noOfRooms,cbAirnav;s_theURL=location.href;i_s59Svc1=s_theURL.indexOf("S59BT");i_s59Svc2=s_theURL.indexOf("S59LG");i_gomezSvc=s_theURL.indexOf("ROBOT-GOMEZ");i_aarpSvc=s_theURL.toUpperCase().indexOf("AARP");i_aolsvc=s_theURL.toUpperCase().indexOf("AOLSVC");i_tcyca1=s_theURL.toUpperCase().indexOf("TRAVELOCITY.CA");i_tcyca2=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM/CA");i_tcymx1=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM.MX");i_tcymx2=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM/MX");i_tcyar1=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM.AR");i_tcyar2=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM/AR");i_tcyla1=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM.LA");i_tcyla2=s_theURL.toUpperCase().indexOf("TRAVELOCITY.COM/LA");if(!b_overide&&i_s59Svc1===-1&&i_s59Svc2===-1&&i_gomezSvc===-1&&i_aarpSvc===-1&&i_aolsvc===-1&&i_tcyca1===-1&&i_tcyca2===-1&&i_tcymx1===-1&&i_tcymx2===-1&&i_tcyar1===-1&&i_tcyar2===-1&&i_tcyla1===-1&&i_tcyla2===-1){s_theDomain=document.location.hostname;s_selectedForm=o_form.name;a_formPrefix=s_selectedForm.substring(4);switch(s_selectedForm){case"formair":s_prefix="air";break;case"formFH":s_prefix="FH";break;case"formHO":s_prefix="HO";break;case"formHCX":s_prefix="HCX";break;default:s_prefix="air";}if(s_selectedForm==="formair"||s_selectedForm==="formFH"||s_selectedForm==="formHO"||s_selectedForm==="formHCX"){if(document.getElementById(s_prefix+"_from")){s_orig=document.getElementById(s_prefix+"_from").value.toUpperCase();}else{s_orig=null;}if(document.getElementById(s_prefix+"_to")){s_dest=document.getElementById(s_prefix+"_to").value.toUpperCase();}else{s_dest=null;}a_fromDate=document.getElementById(s_prefix+"_fromdate").value.split("/")[1];a_fromMonth=document.getElementById(s_prefix+"_fromdate").value.split("/")[0];a_fromYear=document.getElementById(s_prefix+"_fromdate").value.split("/")[2];a_toDate=document.getElementById(s_prefix+"_todate").value.split("/")[1];a_toMonth=document.getElementById(s_prefix+"_todate").value.split("/")[0];a_toYear=document.getElementById(s_prefix+"_todate").value.split("/")[2];if(document.getElementById("HCX_carpu")){if(String(document.getElementById("HCX_carpu").selectedIndex).length===1){startTime="&startTime=0"+document.getElementById("HCX_carpu").value;}else{startTime="&startTime="+document.getElementById("HCX_carpu").value;}}else{startTime=null;}if(document.getElementById("HCX_cardo")){if(String(document.getElementById("HCX_cardo").selectedIndex).length===1){endTime="&endTime=0"+document.getElementById("HCX_cardo").value;}else{endTime="&endTime="+document.getElementById("HCX_cardo").value;}}else{endTime=null;}if(document.getElementById(s_prefix+"_totalrooms")){noOfRooms=document.getElementById(s_prefix+"_totalrooms").selectedIndex+1;}else{noOfRooms=null;}if(s_prefix!=="air"){switch(noOfRooms){case 1:if(document.getElementById(s_prefix+"_adult1")){noOfAdults=document.getElementById(s_prefix+"_adult1").selectedIndex;}else{noOfAdults=null;}break;case 2:if(document.getElementById(s_prefix+"_adult1")){noOfAdults=document.getElementById(s_prefix+"_adult1").selectedIndex+document.getElementById(s_prefix+"_adult2").selectedIndex;}else{noOfAdults=null;}break;case 3:if(document.getElementById(s_prefix+"_adult1")){noOfAdults=document.getElementById(s_prefix+"_adult1").selectedIndex+document.getElementById(s_prefix+"_adult2").selectedIndex+document.getElementById(s_prefix+"_adult3").selectedIndex;}else{noOfAdults=null;}break;case 4:if(document.getElementById(s_prefix+"_adult1")){noOfAdults=document.getElementById(s_prefix+"_adult1").selectedIndex+document.getElementById(s_prefix+"_adult2").selectedIndex+document.getElementById(s_prefix+"_adult3").selectedIndex+document.getElementById(s_prefix+"_adult4").selectedIndex;}else{noOfAdults=null;}break;default:noOfAdults=noOfRooms;break;}switch(s_prefix){case"FH":noOfAdults=noOfAdults;break;case"HO":case"HCX":noOfAdults=noOfAdults+noOfRooms;break;default:noOfAdults=noOfRooms;break;}if(noOfRooms!==null){noOfRooms="&noOfRooms="+String(document.getElementById(s_prefix+"_totalrooms").selectedIndex+1);}}else{if(s_prefix==="air"){noOfAdults=document.getElementById("FO_adults").selectedIndex;if(document.getElementById("cbNav")&&!document.getElementById("cbpactab")){cbAirnav=document.getElementById("cbNav").getElementsByTagName("input");if(cbAirnav[1].checked){a_toDate=a_fromDate;a_toMonth=a_fromMonth;a_toYear=a_fromYear;}if(cbAirnav[2].checked){a_fromDate=document.getElementById("airmc_fromdate").value.split("/")[1];a_fromMonth=document.getElementById("airmc_fromdate").value.split("/")[0];a_fromYear=document.getElementById("airmc_fromdate").value.split("/")[2];a_toDate=a_fromDate;a_toMonth=a_fromMonth;a_toYear=a_fromYear;if(document.getElementById("airmc_from")){s_orig=document.getElementById("airmc_from").value.toUpperCase();}else{s_orig=null;}if(document.getElementById("airmc_to")){s_dest=document.getElementById("airmc_to").value.toUpperCase();}else{s_dest=null;}}if(document.getElementById("radioFlexDates").checked){a_fromDate="dd";a_fromMonth="mm";a_fromYear="yyyy";a_toDate="dd";a_toMonth="mm";a_toYear="yyyy";}}}}noOfAdults="&noOfAdults="+String(noOfAdults);}else{if((s_selectedForm==="formCO")&&(!document.getElementById("CO_fromdate"))){if(document.getElementById("FCO_pickupoption")){switch(document.getElementById("FCO_pickupoption").selectedIndex){case 0:if(document.getElementById("CO_to")){s_dest=document.getElementById("CO_to").value;}else{s_dest=null;}break;case 1:if(document.getElementById("CO_city")){s_dest=document.getElementById("CO_city").value;}else{s_dest=null;}break;}}else{if(document.getElementById("CO_to")){s_dest=document.getElementById("CO_to").value;}else{s_dest=null;}}a_fromDate=document.getElementById("co-fromdate").value.split("/")[1];a_fromMonth=document.getElementById("co-fromdate").value.split("/")[0];a_fromYear=document.getElementById("co-fromdate").value.split("/")[2];a_toDate=document.getElementById("co-todate").value.split("/")[1];a_toMonth=document.getElementById("co-todate").value.split("/")[0];a_toYear=document.getElementById("co-todate").value.split("/")[2];if(document.getElementById("CO_fromtime")){if(String(document.getElementById("CO_fromtime").selectedIndex).length===1){startTime="&startTime=0"+document.getElementById("CO_fromtime").value;}else{startTime="&startTime="+document.getElementById("CO_fromtime").value;}}else{startTime=null;}if(document.getElementById("CO_totime")){if(String(document.getElementById("CO_totime").selectedIndex).length===1){endTime="&endTime=0"+document.getElementById("CO_totime").value;}else{endTime="&endTime="+document.getElementById("CO_totime").value;}}else{endTime=null;}}}if(s_dest){a_dest=s_dest.split("");for(i=0;i<a_dest.length;i=i+1){if(a_dest[i]===" "){a_dest[i]="_";}}if(s_dest!==null){s_dest="&dest="+a_dest.join("");}}else{s_dest=null;}if(s_orig){a_orig=s_orig.split("");for(j=0;j<a_orig.length;j=j+1){if(a_orig[j]===" "){a_orig[j]="_";}}if(s_orig!==""){s_orig="&orig="+a_orig.join("");}}else{s_orig=null;}if(a_fromMonth.length===1){a_fromMonth="0"+a_fromMonth;}if(a_toMonth.length===1){a_toMonth="0"+a_toMonth;}if(a_fromDate.length===1){a_fromDate="0"+a_fromDate;}if(a_toDate.length===1){a_toDate="0"+a_toDate;}switch(s_prefix){case"FH":case"HCX":s_theAdtoShow="ad1";break;case"HO":s_theAdtoShow="ad2";break;case"air":s_theAdtoShow="ad3";break;case"CO":s_theAdtoShow="ad4";break;default:s_theAdtoShow="ad3";}switch(s_selectedForm){case"formCO":s_urladditions=startTime+endTime;break;case"formHCX":s_urladditions=noOfRooms+noOfAdults+startTime+endTime;break;case"formHO":s_urladditions=noOfRooms+noOfAdults;break;case"formFH":s_urladditions=noOfRooms+noOfAdults+s_orig;break;case"formair":s_urladditions=noOfAdults+s_orig;break;}popunder="/popWindow";winfeatures="left=150,top=200,width=500,height=250,scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=1,directories=0";s_urlString="?s_theDomain="+s_theDomain+"&s_selectedForm="+s_selectedForm+"&a_formPrefix="+a_formPrefix+"&a_fromDate="+a_fromDate+"&a_fromMonth="+a_fromMonth+"&startYear="+a_fromYear+"&endDate="+a_toDate+"&endMonth="+a_toMonth+"&endYear="+a_toYear+"&s_theAdtoShow="+s_theAdtoShow+s_dest;win2={init:function(){if(document.getElementById("FCO_pickupoption")){if(document.getElementById("FCO_pickupoption").selectedIndex!==2){win2.win=window.open(popunder+s_urlString+s_urladditions,"adWindow",winfeatures);win2.win.blur();win2.win.screenX=150;win2.win.screenY=200;}}else{win2.win=window.open(popunder+s_urlString+s_urladditions,"adWindow",winfeatures);win2.win.blur();win2.win.screenX=150;win2.win.screenY=200;}}};win2.init();window.focus();}}function loadPopOrNot(){var once_per_session,a_arguments,b_submit,s_popFlag,o_form;once_per_session=1;a_arguments=[];a_arguments=loadPopOrNot.arguments;b_submit=a_arguments[0];s_popFlag=a_arguments[1];o_form=a_arguments[2];if(b_submit&&s_popFlag=="1"){if(once_per_session===0){loadpopunder(o_form);}else{if(!GetCookie("popunder")){SetCookie("popunder","yes","1");loadpopunder(o_form);}}}}function cb_hosubmit(o_form){b_form=false;if(o_form.numRooms.options[o_form.numRooms.selectedIndex].text.indexOf("+")>-1){s_groople="/Groople?";s_groople+="Checkin="+o_form.leavingDate.value;s_groople+="&Checkout="+o_form.returningDate.value;if(o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()==="us"||o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()==="ca"){s_groople+="&City="+escape(o_form.city.value);if(o_form.state.options[o_form.state.selectedIndex].value!==null){s_groople+=",%20"+o_form.state.options[o_form.state.selectedIndex].value;}}else{s_groople+="&City="+escape(o_form.city.value)+",%20"+o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.substr(0,2);}s_groople+="&Rooms=5";window.open(s_groople,null,"width=954,height=730,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes");}else{var __toDate=document.getElementById("HO_todate");var __fromDate=document.getElementById("HO_fromdate");if((__toDate.value==="mm/dd/yyyy"||__toDate.value===null)&&(__fromDate.value==="mm/dd/yyyy"||__fromDate.value===null)){b_form=checkform(o_form,1,2,3,9);}else{b_form=checkform(o_form,1,2,3,8,9);}}return b_form;}function formCtrl(o_form){s_formName=o_form.name;var b_submit=false;var s_popFlag=arguments[1]||"0";var theURL=location.href.toLowerCase();switch(s_formName){case"formCO":o_select=document.getElementById("FCO_pickupoption");if(theURL.indexOf("travelocity.com/mx")!==-1||theURL.indexOf("travelocity.com.mx")!==-1||theURL.indexOf("travelocity.com/ar")!==-1||theURL.indexOf("travelocity.com.mx")!==-1||theURL.indexOf("travelocity.com/la")!==-1){switch(o_select.options[o_select.selectedIndex].value){case"pu_poi":b_submit=checkform(o_form,2,3,6);break;case"pu_addr":b_submit=checkform(o_form,6);break;default:b_submit=checkform(o_form,1,2,3,6);}}else{switch(o_select.options[o_select.selectedIndex].value){case"pu_poi":b_submit=checkform(o_form,2,3,8);break;case"pu_addr":b_submit=checkform(o_form,8);break;default:b_submit=checkform(o_form,1,2,3,8);}}break;case"formair":b_submit=checkform(document.formair,1,2,3,4,5,8);break;case"formFH":b_submit=checkform(o_form,1,2,3,4,8,9);break;case"formFOW":b_submit=checkform(o_form,1,2,3,4,5);break;case"formHO":b_submit=cb_hosubmit(o_form);break;case"formHCX":o_select=document.getElementById("HCX_pickupoption");if(o_select){switch(o_select.options[o_select.selectedIndex].value){case"pu_poi":b_submit=checkform(o_form,2,3,6);break;case"pu_addr":b_submit=checkform(o_form,6);break;default:b_submit=checkform(o_form,1,2,3,8,9);}}else{b_submit=checkform(o_form,1,2,3,8,9);}break;case"formact":b_submit=checkform(o_form,8);break;}loadPopOrNot(b_submit,s_popFlag,o_form);return b_submit;}function LinkSubmitGroople(o_form){groople_url="/Groople?";groople_url+="Checkin="+o_form.leavingDate.value;groople_url+="&Checkout="+o_form.returningDate.value;if(o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()==="us"||o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()==="ca"){groople_url+="&City="+escape(o_form.city.value);if(o_form.state.options[o_form.state.selectedIndex].value!==null){s_groople+=",%20"+o_form.state.options[o_form.state.selectedIndex].value;}}else{groople_url+="&City="+escape(o_form.city.value)+",%20"+o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.substr(0,2);}groople_url+="&Rooms=5";window.open(groople_url,null,"width=954,height=730,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes");}function getElementByValue(ElementCollection,Value){var i;for(i=0;i<ElementCollection.length;i=i+1){if(ElementCollection[i].value==Value){return ElementCollection[i];}}return null;}function SetCookie(cookieName,cookieValue,nDays){var today=new Date();var expire=new Date();if(nDays===null||nDays===0){nDays=1;}expire.setTime(today.getTime()+24*60*60*1000*nDays);document.cookie=cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();}function GetCookie(Name){var search=Name+"=";var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search);if(offset!==-1){offset+=search.length;end=document.cookie.indexOf(";",offset);if(end===-1){end=document.cookie.length;}returnvalue=unescape(document.cookie.substring(offset,end));}}return returnvalue;}function adjDate(o_form){var a_selectedForm,o_todays_date,a_currentYear,o_days,a_dateDiff,a_formPrefix,a_fromVal,a_fromMonth,o_selectedDate,o_toDate;if(b_stopBit===0){o_todays_date=new Date();a_currentYear=o_todays_date.getFullYear();o_days=[31,((a_currentYear%4===0&&a_currentYear%100!==0)||a_currentYear%400===0?29:28),31,30,31,30,31,31,30,31,30,31];a_dateDiff=3;if(o_form){a_selectedForm=o_form.name;}else{a_selectedForm=getCBform();}a_formPrefix=a_selectedForm.substring(4);a_fromVal=document.getElementById(a_formPrefix+"_fromdate").value;a_fromMonth=document.getElementById(a_formPrefix+"_frommonth").selectedIndex;if(a_fromVal>o_days[a_fromMonth]){document.getElementById(a_formPrefix+"_fromdate").options[eval(o_days[a_fromMonth]-1)].selected=true;a_fromVal=document.getElementById(a_formPrefix+"_fromdate").value;}o_selectedDate=new Date(a_currentYear,a_fromMonth,a_fromVal);o_toDate=o_selectedDate.setDate(o_selectedDate.getDate()+a_dateDiff);document.getElementById(a_formPrefix+"_tomonth").options[o_selectedDate.getMonth()].selected=true;document.getElementById(a_formPrefix+"_todate").options[(o_selectedDate.getDate()-1)].selected=true;maintainState(document.getElementById(a_formPrefix+"_tomonth"));maintainState(document.getElementById(a_formPrefix+"_todate"));maintainState(document.getElementById(a_formPrefix+"_fromdate"));maintainState(document.getElementById(a_formPrefix+"_frommonth"));}}function FHO_dates(oForm){var oPrefix=oForm.name.replace("form","");var dodVal=oForm.leavingDate.value;var doaVal=oForm.returningDate.value;var dodValues=dodVal.split("/");var dodMonth=dodValues[0];var dodDay=dodValues[1];var dodYear=dodValues[2];var doaValues=doaVal.split("/");var doaMonth=doaValues[0];var doaDay=doaValues[1];var doaYear=doaValues[2];switch(oPrefix){case"HO":$("dod_mm").value=dodMonth;$("dod_dd").value=dodDay;$("dod_yy").value=dodYear;$("doa_mm").value=doaMonth;$("doa_dd").value=doaDay;$("doa_yy").value=doaYear;break;case"FH":$("dateLeavingMonth").value=dodMonth;$("dateLeavingDay").value=dodDay;$("dateReturningMonth").value=doaMonth;$("dateReturningDay").value=doaDay;break;}}