Hotellguiden
var currentDate = new Date(); var currentYear = 1900 + currentDate.getYear(); var dailyMS = 24*60*60*1000; var arrivalDate = new Date(currentDate.getTime() + 7*dailyMS); var departureDate = new Date(currentDate.getTime() + 14*dailyMS); var arrivalYear = 1900+arrivalDate.getYear(); var arrivalMonth = 1+arrivalDate.getMonth(); var arrivalDay = arrivalDate.getDate(); var departureYear = 1900+departureDate.getYear(); var departureMonth = 1+departureDate.getMonth(); var departureDay = departureDate.getDate(); var a=document.frm; if ((a.checkin_monthday.selectedIndex == 0) && (a.checkin_month.selectedIndex == 0) && (a.checkin_year.selectedIndex == 0) && (a.checkout_monthday.selectedIndex == 0) && (a.checkout_month.selectedIndex == 0) && (a.checkout_year.selectedIndex == 0)){ a.checkin_monthday.options[arrivalDay-1].selected = true; a.checkin_month.options[arrivalMonth-1].selected = true; a.checkin_year.options[arrivalYear-currentYear].selected = true; a.checkout_monthday.options[departureDay-1].selected = true; a.checkout_month.options[departureMonth-1].selected = true; a.checkout_year.options[departureYear-currentYear].selected = true; }