function setParameters() { setFormDate(); // used to define the language used by resaweb (iso 639-1) document.sendForm.locale.value="fr" // preselect CNTRY (country of residence) with navigator language if (navigator.appName == 'Netscape') language = navigator.language.toUpperCase(); else language = navigator.browserLanguage.toUpperCase(); if(language!=null) { if(language.indexOf("-")!=-1) country = language.substr(3,2); else country = language.substr(0,2); } if(country=="US") country = "GB"; if(country=="EN") country = "GB"; var selectItem = document.destform.CNTRY; for(i=0;i=today auxToday=new Date() theToday=Date.UTC(auxToday.getFullYear(),auxToday.getMonth(),auxToday.getDate(),auxToday.getHours(),auxToday.getMinutes(),0) diff = depart - theToday if (depart< theToday || diff<7200000){ alert("Merci de sélectionner une date de départ valide.") return false } depart=Date.UTC(checkOutYear,checkOutMonth-1,checkOutDay,heuredepart,minutedepart,0) retour=Date.UTC(checkInYear,checkInMonth-1,checkInDay,heurearrive,minutearrive,0) nowaday=new Date(); intwoweeks=new Date( Date.UTC((nowaday.getFullYear()),nowaday.getMonth(),nowaday.getDate() + 14)); nowadayinsec=Date.UTC(nowaday.getFullYear(),nowaday.getMonth(),nowaday.getDate()); intwoweeksinsec=nowadayinsec+(86400000*17); diff=depart-intwoweeksinsec; if (depart >= retour){ alert("Merci de vous assurer que la date de retour se situe apr\u00E8s la date de d\u00E9part.") return false } iSTATIONCO=document.destform.dest.selectedIndex STATIONCO=document.destform.dest.options[document.destform.dest.selectedIndex].value STATIONLONG=STATIONCO.length; CTRCT=document.destform.ctrct.options[document.destform.ctrct.selectedIndex].value //CTRCT=''; if (CTRCT=="0") { window.alert("Sélectionnez votre programme"); return false; } if (iSTATIONCO==0 || STATIONCO=="0" || STATIONCO=="traitdebut" || STATIONCO=="traitfin" || STATIONCO=="null" ) { alert("Merci de choisir une destination."); return false; } iCNTRY=document.destform.CNTRY.selectedIndex if (iCNTRY==0) { alert("Merci de s\u00E9lectionner votre pays de r\u00E9sidence."); return false; } CNTRY=document.destform.CNTRY.options[iCNTRY].value iRENTALCNTRY=document.destform.cont.selectedIndex RENTALCNTRY=document.destform.cont.options[document.destform.cont.selectedIndex].value //Put values in form document.sendForm.STATIONCO.value=STATIONCO document.sendForm.STATIONCI.value=STATIONCO document.sendForm.RENTALCNTRY.value=RENTALCNTRY document.sendForm.CNTRY.value=CNTRY document.sendForm.CTRCT.value=CTRCT document.sendForm.DATECO.value= checkOutYear+checkOutMonth+checkOutDay+heuredepart+minutedepart document.sendForm.DATECI.value= checkInYear+checkInMonth+checkInDay+heurearrive+minutearrive // desturl = "http://emmenager.seloger.com.x-portail.poliris.net/156846/vehicules_liste.htm?urleuropcar=https://applications.europcar.com/resaweb/?locale=fr" desturl = "http://emmenager.seloger.com/156846/vehicules_liste.htm?urleuropcar=https://applications.europcar.com/resaweb/?locale=fr%26omnitureid=" for(var i=0;idocument.forms[0][SelectName].options.length-1) currentDaySelected=document.forms[0][SelectName].options.length-1; document.forms[0][SelectName].selectedIndex=currentDaySelected; } function setFormDate(){ today_aux=new Date(); //today is = today + 1 for select day and month today=new Date( Date.UTC((today_aux.getFullYear()),today_aux.getMonth(),today_aux.getDate() + 1)); tomorrow=new Date( Date.UTC((today.getFullYear()),today.getMonth(),today.getDate() + 1)); vyear=new String(today.getFullYear()) tyear=new String(tomorrow.getFullYear()) vday=today.getDate() vmonth=new String(today.getMonth()+1) if (vmonth.length==1) vmonth="0" + vmonth todayString=vday+'/'+vmonth+'/'+vyear; $('.date-pick').dpSetSelected(todayString); tday=tomorrow.getDate() tmonth=new String(tomorrow.getMonth()+1) if (tmonth.length==1) tmonth="0" + tmonth tomorrowString=tday+'/'+tmonth+'/'+tyear; $('.date-picker').dpSetSelected(tomorrowString); } function init(){ setParameters(); $("#cntry").prev('div.select-text').text($("#cntry").children('option:selected').text()); }