function getCalendarText(text) {switch (text) {case 1 :return "Seleccione la fecha de entrada";break;case 2 :return "cerrar";break;}} function getDayOfWeekLabel(day) {switch (day) {case 1 :return "Lun";break;case 2 :return "Mar";break;case 3 :return "Mie";break;case 4 :return "Jue";break;case 5 :return "Vie";break;case 6 :return "Sab";break;case 7 :return "Dom";break;}} function getMonthLabel(month) {switch (month) {case 1 :return "Enero";break;case 2 :return "Febrero";break;case 3 :return "Marzo";break;case 4 :return "Abril";break;case 5 :return "Mayo";break;case 6 :return "Junio";break;case 7 :return "Julio";break;case 8 :return "Agosto";break;case 9 :return "Septiembre";break;case 10 :return "Octubre";break;case 11 :return "Noviembre";break;case 12 :return "Diciembre";break;}} function wr_initStrValidate () { txtWait = "Por favor, espere mientras comprobamos la información introducida"; txtBadDate = "La fecha es incorrecta"; txtBadNNight = "Por favor introduzca nuevamente la duración de su estancia"; } function validate_form(Fsearch){ var dayIndex; var monthIndex; var yearIndex; wr_initStrValidate(); dayIndex = Fsearch.CD.selectedIndex; monthIndex = Fsearch.CM.selectedIndex; yearIndex = Fsearch.CY.selectedIndex; window.status=txtWait; if (dayIndex==0 || monthIndex==0 || yearIndex==0){ alert(txtBadDate); if (dayIndex==0) Fsearch.CD.focus(); else if (monthIndex==0) Fsearch.CM.focus(); else Fsearch.CY.focus(); window.status=""; return false; } function isNumofnights(NN){ var digits="0123456789"; var s = NN.value; var isaNumber = true; var i = 0; for(i=0;i= nextYear.getTime()) { tempDate.setDate(nextYear.getDate() - 1); } displayMonth = tempDate.getMonth(); var displayYear = tempDate.getYear(); if (displayYear < 1000) displayYear += 1900; tempDate = new Date(displayYear, displayMonth + 1, 1); if (tempDate.getTime() >= nextYear.getTime()) { displayMonth -= 1; } if (displayYear > currYear) displayMonth += 12; } } var calendarWinOpen = false; var calendarWindow = null; function openCalendarWin() { var windowOptions = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=yes,width=525,height=300"; calendarWindow = this.open("","calendarWindow",windowOptions); calendarWindow.callingForm = this; calendarWinOpen = true; } function closeCalendarWindow() { if (calendarWinOpen) { calendarWinOpen = false; calendarWindow.close(); } } // Calendar main entry point function popUpCalendar (dayFldName, monthFldName, yearFldName, formFldName) { dayFld = dayFldName; monthFld = monthFldName; yearFld = yearFldName; formName = formFldName; wr_init(); openCalendarWin(); redrawCalendar(); } // repaint the calendar function redrawCalendar() { calendarWindow.callingForm = this; calendarWindow.document.open(); calendarTitle = "" + txtCalendar + ""; calendarWindow.document.write(calendarTitle); var firstOfMonth = new Date(currYear, displayMonth, 1); drawCalendar(firstOfMonth); calendarWindow.document.write(htmlBuffer); calendarWindow.document.close(); calendarWindow.callingForm = this; calendarWindow.focus(); } // fill the calling forms date and month function fillDate(returnDay, returnMonth, returnYear) { var d = returnDay; var m = returnMonth; var y = returnYear; eval("document.forms['" + formName + "']." + dayFld + ".selectedIndex=" + d); eval("document.forms['" + formName + "']." + monthFld + ".selectedIndex=" + m); eval("document.forms['" + formName + "']." + yearFld + ".selectedIndex=" + y); closeCalendarWindow(); } // set the month function changeMonth (increment) { var nextMonth = displayMonth; if (increment == 1) nextMonth++ ; else nextMonth-- ; if ((nextMonth - currMonth >= 13) || (nextMonth < currMonth)) { nextMonth = currMonth; } displayMonth = nextMonth; redrawCalendar(); } // generate the calendar document function drawCalendar (theDate) { var y = theDate.getYear(); if (y < 1000) y += 1900; var monthNum = theDate.getMonth(); var nextDate = new Date(y, monthNum + 1, 1); htmlBuffer = ""; htmlBuffer += ""; htmlBuffer += "
" htmlBuffer += txtSelectDate; htmlBuffer += ""; // Get the last day of the month before the first month we drew. var tempDate = new Date (y, monthNum, 1); tempDate.setDate(tempDate.getDate() - 1); if (tempDate.getTime() >= today.getTime()) { htmlBuffer += ""; htmlBuffer += txtPrevious; htmlBuffer += ""; } // Get the first day of the month after the last month we drew. tempDate = new Date (y, monthNum + 2, 1); if (tempDate.getTime() < nextYear.getTime()) { htmlBuffer += "   "; htmlBuffer += txtNext; htmlBuffer += ""; } htmlBuffer += "

"; htmlBuffer += ""; htmlBuffer += ""; htmlBuffer += "" htmlBuffer += "
"; drawOneMonth(theDate); htmlBuffer += ""; drawOneMonth(nextDate); htmlBuffer += "
"; htmlBuffer += " 
"; htmlBuffer += txtClose; htmlBuffer += "
"; } function drawOneMonth(theDate) { var d; var monthNum = theDate.getMonth(); htmlBuffer += "

  "; htmlBuffer += monthName[monthNum+1]; var dispYear = theDate.getYear(); if (dispYear < 1000) dispYear += 1900; htmlBuffer += " " + dispYear; htmlBuffer += "

"; htmlBuffer += "
"; htmlBuffer += ""; htmlBuffer += ""; for (d = 1; d <= 7; d++) { htmlBuffer += ""; } htmlBuffer += ""; drawBody(theDate); htmlBuffer += "
" + dayName[d] + "
"; } // generate the calendar body function drawBody (theDate) { var w; var d; var y = theDate.getYear(); if (y < 1000) y += 1900; var myDate = new Date (y, theDate.getMonth(), 1); var monthNum = myDate.getMonth(); firstSunday (myDate); for (w=0; w<6; w++) { htmlBuffer += ""; for (d=0; d<7; d++) { htmlBuffer += " "; if (myDate.getMonth() != monthNum) { // this square on the calendar is not part of the month } else { var date = myDate.getDate(); var date_str; if (date < 10) date_str = "0" + date; else date_str = "" + date; htmlBuffer += " "; if (myDate.getTime() >= today.getTime() && myDate.getTime() < nextYear.getTime()) { // create a link y = (myDate.getYear() - today.getYear()) + 1; var m = myDate.getMonth() + 1; htmlBuffer += "