function adaptahasta(form, en_dia, en_mesanyo, sa_dia, sa_mesanyo){ // Obtenemos los combos var comboDiaIni = eval("document."+form+"."+en_dia); var comboMesAnyoIni = eval("document."+form+"."+en_mesanyo); var comboDiaFin = eval("document."+form+"."+sa_dia); var comboMesAnyoFin = eval("document."+form+"."+sa_mesanyo); // Obtenemos los valores de los combos var dia=comboDiaFin.options[comboDiaFin.selectedIndex].value; var mesano=comboMesAnyoFin.options[comboMesAnyoFin.selectedIndex].value.split("-"); var mes=mesano[0]; var anyo=mesano[1]; var diad=comboDiaIni.options[comboDiaIni.selectedIndex].value; var mesanod=comboMesAnyoIni.options[comboMesAnyoIni.selectedIndex].value.split("-"); var mesd=mesanod[0]; var anyod=mesanod[1]; var hoy=new Date(); if ((mesd != "") && (diad != "")){ // Hay fecha desde seleccionada if ((mes == "") || (dia == "")){ // Los combos de entrada alguno no esta cargado loadDate( DateAdd(diad,mesd-1,anyod,1,0,0),comboDiaFin,comboMesAnyoFin); } else { // El combo de fecha salida esta tambien seleccionado fdesde = new Date(anyod, mesd-1, diad); fhasta = new Date(anyo, mes-1, dia); if (fhasta.getTime() <= fdesde.getTime()){ // La fecha de salida es anterior a la fecha de entrada loadDate( DateAdd(diad,mesd-1,anyod,1,0,0),comboDiaFin,comboMesAnyoFin); } } } } function actualizar_noches(capa, form, en_dia, en_mesanyo, sa_dia, sa_mesanyo, noches) { // Obtenemos los combos var comboDiaIni = eval("document."+form+"."+en_dia); var comboMesAnyoIni = eval("document."+form+"."+en_mesanyo); var comboDiaFin = eval("document."+form+"."+sa_dia); var comboMesAnyoFin = eval("document."+form+"."+sa_mesanyo); var txtNoches = eval("document."+form+"."+noches); // Obtenemos los valores de los combos var enx_mesano = comboMesAnyoIni.value.split("-"); var sax_mesano = comboMesAnyoFin.value.split("-"); var n_noches = restafechas(comboDiaIni.value,enx_mesano[0],enx_mesano[1],comboDiaFin.value,sax_mesano[0],sax_mesano[1]); if (n_noches>0){ if( n_noches==1){ document.getElementById(capa).innerHTML =n_noches+" night"; } else{ document.getElementById(capa).innerHTML =n_noches+" nights"; } } else document.getElementById(capa).innerHTML= " " txtNoches.value = n_noches; } function Calendar_initialize(form, en_dia, en_mesanyo, sa_dia, sa_mesanyo){ yxLinks = new Array(" ","close"); yxMonths = new Array("Jan","Feb", "Mar","Apr", "May","Jun", "Jul","Aug", "Sep","Oct", "Nov","Dec"); yxMonthsLarge = new Array("January","February", "March","April", "May","June", "July","August", "September ","October", "November","December "); yxDays = new Array("Monday","Tuesday", "Wednesday","Thursday", "Friday","Saturday", "Sunday"); valueMonth = new Array( "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"); Calendar_errors = new Array("Sorry. It seems that the date you have given should be for a previous period.", "The arrival date you have set is in the past. Please try again with another arrival date. If you still have problems, e-mail us at helpme.web@solmelia.com.", "Sorry. It seems that the departure date you have given is for a date in the past.", "Sorry. It seems that the departure date you have given comes before your arrival date.", "Sorry. It seems that the departure date you have given comes before your arrival date.", "Sorry. Our online booking engine does not accept bookings for periods greater than two months. Please check your dates and try again. If you still have a problem, please send us an e-mail explaining the problem to helpme.web@solmelia.com or call your nearest Sol Meliá Customer Service centre. We would be delighted to help you. "); addCalendar("Calendar1", "Please select at least one night for your stay from the calendar", en_mesanyo, en_dia, form); addCalendar("Calendar2", "Please select at least one night for your stay from the calendar", sa_mesanyo, sa_dia, form); } function actualizarCombosFecha(form,en_dia,en_mesanyo,sa_dia,sa_mesanyo,capanoches,noches,entrada,salida,actualizarFechaSalida){ if (actualizarFechaSalida) adaptahasta(form,en_dia,en_mesanyo,sa_dia,sa_mesanyo); if (noches != null) actualizar_noches(capanoches,form,en_dia,en_mesanyo,sa_dia,sa_mesanyo,noches); if (entrada!=null) printLayerWeekDay(entrada,form,en_mesanyo, en_dia); correctDate2(form, en_dia, en_mesanyo); if (salida!=null)printLayerWeekDay(salida,form,sa_mesanyo, sa_dia); correctDate2(form, sa_dia, sa_mesanyo); }