// generated Wed Nov 25 11:27:32 EST 2009

function onCar(i,autosubmit){formAlreadySubmitted=false;if(i>=0){if(rCarSrch.length>i){if(rCarSrch[i].cac.length>0){document.cars.location.value=rCarSrch[i].cac;document.cars.citycode1.value=rCarSrch[i].cac+"/"+rCarSrch[i].ccid}else{if(rCarSrch[i].ccntry=="US"){document.cars.location.value=rCarSrch[i].ccity+", "+rCarSrch[i].cstate}else{if(rCarSrch[i].ccntry=="CA"){document.cars.location.value=rCarSrch[i].ccity+", "+rCarSrch[i].cstate+" "+rCarSrch[i].ccntryname}else{document.cars.location.value=rCarSrch[i].ccity+", "+rCarSrch[i].ccntryname}}document.cars.citycode1.value=rCarSrch[i].ccid}var today=new Date();today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);var testInDate=new Date();testInDate.setTime(Date.parse(rCarSrch[i].cin));var testOutDate=new Date();testOutDate.setTime(Date.parse(rCarSrch[i].cout));if(testInDate!=null&&testInDate.getTime()>=today.getTime()){datePicker.pickupDate.setFromCanonical(rCarSrch[i].cin);datePicker.dropoffDate.setFromCanonical(rCarSrch[i].cout)}else{alert("T\u00E4m\u00E4n vuokra-autohaun p\u00E4iv\u00E4t ovat vanhentuneet. Anna uudet p\u00E4iv\u00E4t.");datePicker.pickupDate.clearDay();datePicker.dropoffDate.clearDay();autosubmit=false}selectByValue(document.cars.pickup_hour,rCarSrch[i].st1);selectByValue(document.cars.dropoff_hour,rCarSrch[i].st2);selectByValue(document.cars.provider,rCarSrch[i].brandid);document.cars.oneway[0].checked=(!rCarSrch[i].ow);document.cars.oneway[1].checked=(rCarSrch[i].ow);if(rCarSrch[i].ow){if(rCarSrch[i].cac.length>0){document.cars.location2.value=rCarSrch[i].cdac;document.cars.citycode2.value=rCarSrch[i].cdac+"/"+rCarSrch[i].cdocid}else{if(rCarSrch[i].cdocntry=="US"){document.cars.location2.value=rCarSrch[i].cdocity+", "+rCarSrch[i].cdostate}else{if(rCarSrch[i].ccntry=="CA"){document.cars.location2.value=rCarSrch[i].cdocity+", "+rCarSrch[i].cdostate+" "+rCarSrch[i].cdocntryname}else{document.cars.location2.value=rCarSrch[i].cdocity+", "+rCarSrch[i].cdocntryname}}document.cars.citycode2.value=rCarSrch[i].cdocid}}togglecar1way(!document.cars.oneway[0].checked)}if(autosubmit){if(carsubmit()){document.cars.submit();document.body.style.cursor="wait"}}}}function carsubmit(sp,provider){if(Profiler.isEnabled()){Profiler.clearAll();Profiler.markPoint("s0000")}cancelSmartBox();if(formAlreadySubmitted){return false}document.cars.sp.value=sp;document.cars.providername.value=provider;if(document.cars.location.value.length<1){alert("Valitse noutosijainti.");return false}else{if(document.cars.oneway[1].checked&&document.cars.location2.value.length<1){alert("Valitse palautussijainti.");return false}else{if(document.cars.pickup_date.value.length<1){alert("Näppäile noutopäivämäärä.");return false}else{if(datePicker.dropoffDate.fields().day<1){alert("Kirjoita palautuspäivä.");return false}else{var checkin=datePicker.pickupDate.valueAsDate();var checkout=datePicker.dropoffDate.valueAsDate();if(checkin.getTime()<today.getTime()){alert("Noutopäivä ei voi olla menneenä päivänä.");return false}else{if(checkout.getTime()<checkin.getTime()){alert("Palautuspäivän on oltava noutopäivän jälkeen.");document.cars.ret_date.value=addDays(checkin,7);return false}else{if(checkin.getTime()==checkout.getTime()&&(Math.round(document.cars.pickup_hour.value)>=Math.round(document.cars.dropoff_hour.value))){alert("Palautuspäivän on oltava noutopäivän jälkeen.");return false}}}}}}}if(comparewindows(document.cars)){if(document.cars.Search){document.cars.Search.disabled=true}swapButtons();document.lasttab.havesearched.value="true";formAlreadySubmitted=true;return true}else{popupBlockerMsg(document.cars);return false}}function togglecar1way(showSection){var showstyle=(navigator.appName.indexOf("Microsoft")>-1)?"block":"table-row";var finalstyle=(showSection)?showstyle:"none";try{document.getElementById("dropSpacer").style.display=finalstyle;document.getElementById("dropLabel").style.display=finalstyle;document.getElementById("dropInput").style.display=finalstyle}catch(ignored){}compare2chk()}function othercar(selectlist){if(selectlist.value.length>0){try{var newWindow=window.open(selectlist.value);newWindow.focus()}catch(e){}}}function pickup_date_changed(){var departing=datePicker.pickupDate.valueAsDate();var returning=datePicker.dropoffDate.valueAsDate();if(returning==null||departing>returning){datePicker.dropoffDate.setFromCanonical(addDays(departing,3))}}function changelocation(){if(document.cars.newlocation!=null){var i=document.cars.newlocation.selectedIndex;var newloc=document.cars.newlocation.options[i].value;document.cars.location.value=newloc;document.cars.citycode1.value="";document.cars.submit()}}function changedropofflocation(){if(document.cars.newdropofflocation!=null){var i=document.cars.newdropofflocation.selectedIndex;var newloc=document.cars.newdropofflocation.options[i].value;document.cars.location2.value=newloc;document.cars.citycode2.value="";document.cars.submit()}};

var jsck_fdcar_fi_fi="v287";
// generation time: 2ms
