var ct;function timeNPlaceFunctions(){showHideLocByAPRAdd2();if(document.getElementById("sameLoc")){chkUnchkSameLoc(document.getElementById("sameLoc"))}showHideSrchRetrnLoc(document.getElementById("sameLoc"),"returnLocation");checkUsResident();showHideselCountryResi(document.getElementById("us_resident"),"countryOfRe","countrys");showHideCoupon(document.getElementById("txtcoupon"),"coupon","hide",document.getElementById("addCoupon"));if((document.getElementById("location"))&&(document.getElementById("return_location"))){txtFielddisabled(document.getElementById("location"),"pickDropFieldDisabled","pickDropField");txtFielddisabled(document.getElementById("return_location"),"pickDropFieldDisabled","pickDropField")}}if(window.addEventListener){window.addEventListener("load",timeNPlaceFunctions,true)}if(window.attachEvent){window.attachEvent("onload",timeNPlaceFunctions)}var defaultVal="";var PICKUP_FLAG="";var getCOR="";var DROPOFF_FLAG="";var getCORFromResForm="";function txtFielddisabled(D,C,B){var A=false;if(D.value==""){D.value=defaultVal;D.className=C}D.value==defaultVal?A=true:A=false;if(A==true){D.className=C}if(A==false){D.className=B}D.onfocus=function(){if(D.value==defaultVal){D.className=B;D.value=""}};D.onblur=function(){if(D.value==""){D.value=defaultVal;D.className=C}}}function checkUsResident(){if(document.getElementById("us_resident")){if(document.getElementById("us_resident").checked==false){document.getElementById("us_resident").checked=true}}}function testingSuggest(C,B){if(document.getElementById("divAnswer").style.display!="none"){var A=xstooltip_findPosY(C);var D=xstooltip_findPosY(document.getElementById("divAnswer"));if(D==A+20){B.cancelBubble=true}else{B.cancelBubble=false}}}function showHideCoupon(B,A,D,C){if(B){if(B.value!=""){if(C){C.style.display="none"}if(document.getElementById(A)){document.getElementById(A).className=" "}}if(document.getElementById("body")){changeHeight("component","body")}}}function updateRetun(B,A,D){if(document.getElementById(D).checked==true){var C=B.value;if(C.length>=3){document.getElementById(A).value=C}else{if((C.length<3)&&(document.getElementById(A).value!="")){document.getElementById(A).value=C}}}}function checkValue(A,F,B,I){var G=false;var E=0;if(A){E=1}if(E==1){var D=A.value;var H=document.getElementById(F).value;D==H?document.getElementById(B).checked=true:G=true}if(G){document.getElementById(B).checked=false;var C=A.value;document.getElementById(I).value=C}}function updateHiddenRtnFld(B,C,A){if(!B.checked){var D=document.getElementById(C);if(D.value.length>=3){document.getElementById(A).value=D.value}}}function showHideSrchRetrnLoc(B,A){if(null!=document.getElementById(A)){if(B){B.checked==true?document.getElementById(A).className="imgNone":document.getElementById(A).className="imgDisplay";if(document.getElementById("body")){changeHeight("component","body")}}}}function chkUnchkSameLoc(A){getChkBoxVal=="true"?A.checked=true:A.checked=false}function disableSearchByAddReturn(B){if(document.getElementById(B)){var C=document.getElementById(B).getElementsByTagName("INPUT");var A=document.getElementById(B).getElementsByTagName("SELECT");for(i=0;i<C.length;i++){C[i].disabled=true}for(j=0;j<A.length;j++){A[j].disabled=true}}}function enableSearchByAddReturn(B){if(document.getElementById(B)){var C=document.getElementById(B).getElementsByTagName("INPUT");var A=document.getElementById(B).getElementsByTagName("SELECT");for(i=0;i<C.length;i++){C[i].disabled=false}for(j=0;j<A.length;j++){A[j].disabled=false}}}function disableEnableThisField(E,F,A,C){var B=document.getElementById(A).className.match(/(\S+) /);var D=document.getElementById(C).className.match(/(\S+) /);if(document.getElementById(F).checked==true){document.getElementById(E).disabled=true;document.getElementById(A).className=B[0]+"disable";document.getElementById(C).className=D[0]+"imgNone"}else{document.getElementById(E).disabled=false;document.getElementById(A).className=B[0]+"imgNone";document.getElementById(C).className=D[0]+"imgDisplay"}}function disableThisField(A){if(document.getElementById(A)){document.getElementById(A).disabled=true}}function enableThisField(A){if(document.getElementById(A)){document.getElementById(A).disabled=false}}function showHideSearchLoc(C,B,D,E,F,A){if(C=="searchPicByAdd"){removeBorder("location","location_PU_tr")}else{if(C=="searchRtnByAdd"){removeBorder("return_location","return_location_PU_tr")}}if(D=="findairportOne"){if(null!=document.getElementById("location_tr")){A==0?(document.getElementById("location_tr").style.display="none"):(document.getElementById("location_tr").style.display="block")}}else{if(null!=document.getElementById("location_return_tr")){A==0?(document.getElementById("location_return_tr").style.display="none"):(document.getElementById("location_return_tr").style.display="block")}}document.getElementById(C).className="nonClicklink";A==0?(document.getElementById(D).style.display="none"):(document.getElementById(D).style.display="");document.getElementById(B).className="";document.getElementById(E).className="imgDisplay";document.getElementById(F).className="imgNone"}function toShowHideLinksForRtnLocs(B,A){var C=document.getElementById("rtnLocLinks");if(A==0){C.className="imgDisplay"}else{if((A!=0)&&(B=="srchReturn_APCity")){C.className="imgDisplay"}else{if((A!=0)&&(B=="srchPic_APCity")){if(document.getElementById("srchReturn_add").className!="imgDisplay"){C.className="imgNone"}else{if(document.getElementById("srchReturn_add").className=="imgDisplay"){C.className="imgDisplay"}}}}}}function doTheCheck(A){if(A.checked==true){sHideRateCode(0)}else{sHideRateCode(1)}}function showHideselCountryResi(C,B,A){if(C){if(C.checked==true){document.getElementById(B).className="imgNone";if(document.getElementById(A)!=null){document.getElementById(A).value=getCORFromResForm}}else{if(document.getElementById("rateCode")){document.getElementById(B).className="imgDisplay"}}}if(document.getElementById(A)){if(document.getElementById(A)!=null&&(document.getElementById(A).value=="US"||document.getElementById(A).value=="CA")){if(document.getElementById("rateCode")){document.getElementById("rateCode").className="imgNone"}if(document.getElementById("divAWD")){document.getElementById("divAWD").className="imgNone"}if(document.getElementById("divAWDUS")){document.getElementById("divAWDUS").className="imgDisplay"}}else{if(document.getElementById("rateCode")){document.getElementById("rateCode").className="imgDisplay"}if(document.getElementById("rateCode")){document.getElementById("divAWD").className="imgDisplay"}if(document.getElementById("rateCode")){document.getElementById("divAWDUS").className="imgNone"}}}}function sHideRateCode(A){if(A==1){document.getElementById("rateCode").style.display="block";document.getElementById("divAWDUS").className="imgNone";document.getElementById("divAWD").className="imgDisplay";changeHeight("component","body")}else{document.getElementById("rateCode").style.display="none";document.getElementById("divAWDUS").className="imgDisplay";document.getElementById("divAWD").className="imgNone";changeHeight("component","body")}}function showHideRateCode(C,D,B){var A=C.options[C.selectedIndex].value;if(A=="US"||A=="CA"){clearTimeout(ct);ct=setTimeout("sHideRateCode(0)",50)}else{clearTimeout(ct);ct=setTimeout("sHideRateCode(1)",50)}}function submitPage(C,B,A){if(document.getElementById(C).className=="imgDisplay"&&document.getElementById(B).className=="imgDisplay"){document.forms.RES_FORM.action="/car-rental/reservation/search-by-address.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByAddress&CHANGE_FLAG="+A}else{if(document.getElementById(C).className=="imgDisplay"&&document.getElementById(B).className=="imgNone"){document.forms.RES_FORM.action="/car-rental/reservation/search-by-address.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByCity&CHANGE_FLAG="+A}else{if(document.getElementById(C).className=="imgNone"&&document.getElementById(B).className=="imgDisplay"){document.forms.RES_FORM.action="/car-rental/reservation/search-by-address.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByCity&DROPOFF_FLAG=SearchByAddress&CHANGE_FLAG="+A}}}document.forms.RES_FORM.submit()}function submitPageForHome(C,B,A){if(document.getElementById(C).className=="imgDisplay"&&document.getElementById(B).className=="imgDisplay"){document.forms.RES_FORM.action="/car-rental/avisHome/search-by-address-home.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByAddress&CHANGE_FLAG="+A}else{if(document.getElementById(C).className=="imgDisplay"&&document.getElementById(B).className=="imgNone"){document.forms.RES_FORM.action="/car-rental/avisHome/search-by-address-home.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByCity&CHANGE_FLAG="+A}else{if(document.getElementById(C).className=="imgNone"&&document.getElementById(B).className=="imgDisplay"){document.forms.RES_FORM.action="/car-rental/avisHome/search-by-address-home.ac?LANDING_ACTION=refresh&PICKUP_FLAG=SearchByCity&DROPOFF_FLAG=SearchByAddress&CHANGE_FLAG="+A}}}document.forms.RES_FORM.submit()}function GetFormPostURL(B){var A="";if(location.hostname=="161.178.175.202"||location.hostname=="staging.avis.com"||location.hostname=="preview.avis.com"||location.hostname=="int.avis.com"||location.hostname=="e2dsavfev3ws01.cendant.com"){A="http://"+location.hostname+(location.port?(":"+location.port):"")+B}else{A="https://"+location.hostname+(location.port?(":"+location.port):"")+B}return A}function submitFindRes(){var A="/car-rental/reservation/display-reservation-submit.ac";document.forms.FIND_RES.action=GetFormPostURL(A);document.forms.FIND_RES.submit()}function submitloc(C,D,B){if(null!=document.getElementById("update_submit_button")){omnitureSubmit("Update")}var A="/car-rental/reservation/time-place-submit.ac";if(document.getElementById(C).checked){if(document.getElementById(D).className=="imgDisplay"){A="/car-rental/reservation/resolve-location.ac?PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByAddress"}}else{if(document.getElementById(D).className=="imgDisplay"&&document.getElementById(B).className=="imgDisplay"){A="/car-rental/reservation/resolve-location.ac?PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByAddress"}else{if(document.getElementById(D).className=="imgDisplay"&&document.getElementById(B).className=="imgNone"){A="/car-rental/reservation/resolve-location.ac?PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByCity"}else{if(document.getElementById(D).className=="imgNone"&&document.getElementById(B).className=="imgDisplay"){A="/car-rental/reservation/resolve-location.ac?PICKUP_FLAG=SearchByCity&DROPOFF_FLAG=SearchByAddress"}}}}document.forms.RES_FORM.action=GetFormPostURL(A);onSubmitCheck("location","return_location");document.forms.RES_FORM.submit();if(null!=document.getElementById("update_submit_button")){document.getElementById("update_submit_button").style.display="none";document.getElementById("update_submit_button_disabled").style.display="block";document.getElementById("cancel_reserve").style.display="none";if(null!=document.getElementById("grayout")){offsetheight=document.getElementById("grayout_area").offsetHeight+"px";offsetwidth=document.getElementById("grayout_area").offsetWidth+"px";document.getElementById("grayout").style.height=offsetheight;document.getElementById("grayout").style.width=offsetwidth;document.getElementById("grayout").style.display="block";document.getElementById("loader_img").style.display="block"}if(null!=document.getElementById("grayout_mc")){offsetheight=document.getElementById("multicurrency").offsetHeight+"px";offsetwidth=document.getElementById("multicurrency").offsetWidth+"px";document.getElementById("grayout_mc").style.height=offsetheight;document.getElementById("grayout_mc").style.width=offsetwidth;document.getElementById("grayout_mc").style.display="block"}}}function showHideLocByAPRAdd(){if(PICKUP_FLAG=="false"){showHideSearchLoc("searchPicByAdd","searchPicByCity","findairportOne","srchPic_add","srchPic_APCity",0)}else{showHideSearchLoc("searchPicByCity","searchPicByAdd","findairportOne","srchPic_APCity","srchPic_add",1)}if(DROPOFF_FLAG=="false"){showHideSearchLoc("searchRtnByAdd","searchRtnByCity","findairport2","srchReturn_add","srchReturn_APCity",0)}else{showHideSearchLoc("searchRtnByCity","searchRtnByAdd","findairport2","srchReturn_APCity","srchReturn_add",1)}}function showHideLocByAPRAdd2(){var A=document.location.toString();if(A.indexOf("PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByCity")!=-1){showHideSearchLoc("searchPicByAdd","searchPicByCity","findairportOne","srchPic_add","srchPic_APCity",0)}else{if(A.indexOf("PICKUP_FLAG=SearchByAddress&DROPOFF_FLAG=SearchByAddress")!=-1){showHideSearchLoc("searchPicByAdd","searchPicByCity","findairportOne","srchPic_add","srchPic_APCity",0);showHideSearchLoc("searchRtnByAdd","searchRtnByCity","findairport2","srchReturn_add","srchReturn_APCity",0);document.getElementById("sameLoc").checked=false}else{if(A.indexOf("PICKUP_FLAG=SearchByCity&DROPOFF_FLAG=SearchByAddress")!=-1){showHideSearchLoc("searchPicByCity","searchPicByAdd","findairportOne","srchPic_APCity","srchPic_add",1);showHideSearchLoc("searchRtnByAdd","searchRtnByCity","findairport2","srchReturn_add","srchReturn_APCity",0)}else{if((A.indexOf("PICKUP_FLAG")==-1)&&(A.indexOf("DROPOFF_FLAG")==-1)){if((PICKUP_FLAG!="")&&(DROPOFF_FLAG!="")){showHideLocByAPRAdd()}}}}}}function toggleRADiv(){var B=document.getElementById("findEreceipt");var A=B.selectedIndex;var C=B.options[A].value;if(C=="by_ra"){document.getElementById("by_ra").style.display="block";document.getElementById("divCOR").style.display="block";document.getElementById("by_conf").style.display="none";document.getElementById("by_login").style.display="none"}if(C=="by_conf"){document.getElementById("by_conf").style.display="block";document.getElementById("divCOR").style.display="block";document.getElementById("by_ra").style.display="none";document.getElementById("by_login").style.display="none"}if(C=="by_login"){document.getElementById("by_login").style.display="block";document.getElementById("divCOR").style.display="none";document.getElementById("by_ra").style.display="none";document.getElementById("by_conf").style.display="none"}}function submitRADiv(){var B=document.getElementById("selCountry");var D=B.selectedIndex;var A=B.options[D].value;var E=document.getElementById("strCountryConf");E.value=A;var C="/car-rental/rental/rental_info_conf_ra.ac";document.forms.rental_info_conf_ra.action=GetFormPostURL(C);document.forms.rental_info_conf_ra.submit()}function onSubmitCheck(A,D){var H=document.getElementById(A);var G=document.getElementById(D);if(H.value==defaultVal){H.value=""}if(G.value==defaultVal){G.value=""}var F=document.getElementById("location").value;var C=document.getElementById("pickupSelectedValue").value;if(C!=-1&&C!=F){document.getElementById("pickupCityFlag").value="false"}var B=document.getElementById("return_location").value;var E=document.getElementById("dropoffSelectedValue").value;if(E!=-1&&E!=B){document.getElementById("dropoffCityFlag").value="false"}return true}function setDropOffToDefault(A,C,E,F,G,D,H){if(!A.checked){var B=document.getElementById(C).value;var I=document.getElementById(E).value;if((B==I)||(!B)){document.getElementById(C).value=defaultVal;document.getElementById(C).className="pickDropFieldDisabled"}}}function isCookieDisabled(){var A=false;if(document.cookie.indexOf("AVIS_USER")==-1){A=true}return A}function validateForm(){var A=document.getElementById("sameLoc").checked;var D=document.getElementById("srchPic_APCity").className;var C=document.getElementById("srchReturn_APCity").className;var B=true;if(A){if(D=="imgDisplay"){B=validateField("location","location_PU_tr")}}else{if(D=="imgDisplay"&&C=="imgDisplay"){B=validateField("location","location_PU_tr")&validateField("return_location","return_location_PU_tr")}else{if(D=="imgNone"&&C=="imgDisplay"){B=validateField("return_location","return_location_PU_tr")}else{if(D=="imgDisplay"&&C=="imgNone"){B=validateField("location","location_PU_tr")}}}}if(B){onSubmitHomePage();submitloc("sameLoc","srchPic_add","srchReturn_add")}}function validateField(B,A){var C=document.getElementById(B).value;C=C.replace(/^\s+|\s+$/g,"");if(C==""||C==defaultVal){document.getElementById(A).className="imgDisplay";document.getElementById(B).style.border="2px solid red";document.getElementById(B).style.background="#e0e0e0";document.getElementById(B).focus();return false}return true}function removeBorder(B,A){document.getElementById(B).style.border="1px solid #9CBBD2";document.getElementById(B).style.background="";document.getElementById(A).className="imgNone"}function toShowHideRateCode(B,A){if(B.checked==true){if(A=="US"||A=="CA"){sHideRateCode(0)}else{sHideRateCode(1)}}}function modifyTimeandPlace(){document.getElementById("modify-hide").style.display="none";document.getElementById("modify_show").style.display="block";document.getElementById("findairportOne").style.display="inline-block";document.getElementById("findairport4").style.display="inline-block";if(document.getElementById("countryOfRe")){document.getElementById("countryOfRe").style.display="block"}if(document.getElementById("sameLoc")){var A=document.RES_FORM.elements["resForm.pickUpLocation"].value;var B=document.RES_FORM.elements["resForm.dropOffLocation"].value;if(document.getElementById("sameLoc").checked){if((B==A)||(!B)){document.getElementById("return_location").value=pickupLabel}else{document.RES_FORM.elements["resForm.dropOffLocation"].value=B}document.getElementById("return_location").disabled=true;document.getElementById("findairport3").style.display="none";document.getElementById("airportcolon").style.display="none";document.getElementById("searchRtnByAirport").style.display="none"}else{document.getElementById("airportcolon").style.display="inline-block";document.getElementById("searchRtnByAirport").style.display="inline-block";document.getElementById("findairport3").style.display="inline-block";document.RES_FORM.elements["resForm.dropOffLocation"].value=B}}}function cancelTimeandPlace(){omnitureSubmit("Cancel");document.getElementById("modify-hide").style.display="block";document.getElementById("modify_show").style.display="none"}function setmodifyDropOffToDefault(A,C,E,F,G,D,H){var I=document.RES_FORM.elements["resForm.pickUpLocation"].value;var B=document.RES_FORM.elements["resForm.dropOffLocation"].value;if(A.checked){if(I==""){document.RES_FORM.elements["resForm.dropOffLocation"].value=pickupLabel}else{if(I!=B||(!B)){document.RES_FORM.elements["resForm.dropOffLocation"].value=pickupLabel}else{document.RES_FORM.elements["resForm.dropOffLocation"].value=B}}document.RES_FORM.elements["resForm.dropOffLocation"].disabled=true;removeBorder("return_location","return_location_PU_tr");showHideSearchLoc("searchRtnByCity","searchRtnByAdd","findairport2","srchReturn_APCity","srchReturn_add",1);document.getElementById("findairport3").style.display="none";document.getElementById("airportcolon").style.display="none";document.getElementById("searchRtnByAirport").style.display="none"}else{document.getElementById("findairport3").style.display="inline-block";document.getElementById("airportcolon").style.display="inline-block";document.getElementById("searchRtnByAirport").style.display="inline-block";document.RES_FORM.elements["resForm.dropOffLocation"].disabled=false;if(document.RES_FORM.elements["resForm.dropOffLocation"].value==pickupLabel){document.RES_FORM.elements["resForm.dropOffLocation"].value=""}else{document.RES_FORM.elements["resForm.dropOffLocation"].value=B}}}function modifyflow(A){if(A=="step1"){omnitureFlowSubmit("make a Reservation");document.forms.RES_FORM.action="modify-Time-Place.ac";document.forms.RES_FORM.submit()}if(A=="step2"){omnitureFlowSubmit("Vehicle Selection");document.forms.RES_FORM.action="modify-car-group.ac";document.forms.RES_FORM.submit()}if(A=="step3"){omnitureFlowSubmit("Options");document.forms.RES_FORM.action="modify-options-protections.ac";document.forms.RES_FORM.submit()}};
