var numpaxes = 9; var Meses=arrMes[0]; function goSubmit(dat){ var str = ""; // Quito los acentos flightForm.depCity.value = QuitarAcentos(flightForm.depCity.value); flightForm.arrCity.value = QuitarAcentos(flightForm.arrCity.value); var msg=""; // comprobamos origen y destino. msg = doconcat(msg,groupval(flightForm.depCity.value,'Ciudad de salida',1,1,0)); msg = doconcat(msg,groupval(flightForm.arrCity.value,'Ciudad de llegada',1,1,0)); // comprobamos las fechas de ida if (flightForm.fe_diasIda.value == ''){ msg = doconcat(msg,"Debe seleccionar una fecha de salida \n"); } var fechadep = flightForm.fe_mesanyo.value + "" + flightForm.fe_dia.value; if (flightForm.queryType[0].checked){ if (flightForm.fs_diasVuelta.value == ''){ msg = doconcat(msg,"Debe seleccionar una fecha de vuelta \n"); } var fecharet = flightForm.fs_mesanyo.value + "" + flightForm.fs_dia.value; if (fecharet < fechadep){ msg = doconcat(msg,"La fecha de llegada tiene que ser mayor que la de salida \n"); } } //me fijo que la fecha de salida sea mayor a 2 dias // SACA LA HORA DEL SERVIDOR var now = new Date(); now.setTime(dat); now.setDate(now.getDate()+1); var strnow = now.getFullYear()+""+addcero(now.getMonth()+1)+""+addcero(now.getDate()); if (fechadep < strnow){ msg = doconcat(msg,"Error. No puede buscar vuelos para fechas pasadas. \n"); } var nAdt = 1 * flightForm.paxAdt.options[flightForm.paxAdt.selectedIndex].value; var nChd = 1 * flightForm.paxChd.options[flightForm.paxChd.selectedIndex].value; var nInf = 1 * flightForm.paxInf.options[flightForm.paxInf.selectedIndex].value; if (nInf > nAdt)msg = doconcat(msg,"El n?mero bebes no puede superar al de adultos \n"); if ((nAdt + nChd) > 9)msg = doconcat(msg,"El n?mero total de ad?ltos y ni?os no puede ser mayor a nueve. \n"); if ((nInf + nChd) > (nAdt * 2) )msg = doconcat(msg,"El n?mero bebes y ni?os no puede superar, al doble del numero de adultos \n"); if ( flightForm.depCity.value == flightForm.arrCity.value ){ msg ="El origen y el destino no pueden coincidir."; } if (msg != ''){ alert(msg); } else{ str = flightForm.fe_mesanyo.value; flightForm.depDate.value = flightForm.fe_dia.value+"/"+str.substring(4)+"/"+str.substring(0,4); str = flightForm.fs_mesanyo.value; flightForm.retDate.value = flightForm.fs_dia.value+"/"+str.substring(4)+"/"+str.substring(0,4); flightForm.submit(); } } function addcero(str) { var str2 = "0"+str; return str2.substring(str2.length-2); } function combo(){ var indice=document.forms.flightForm.depCity.selectedIndex; limpiaOptions (); menu(indice); } function limpiaOptions (){ for (m=document.forms.flightForm.arrCity.options.length-1;m>0;m--) document.forms.flightForm.arrCity.options[m]=null; }