var HM_DOM = (document.getElementById) ? true : false; var HM_NS4 = (document.layers) ? true : false; var HM_IE = (document.all) ? true : false; var HM_IE4 = HM_IE && !HM_DOM; var HM_Mac = (navigator.appVersion.indexOf("Mac") != -1); var HM_IE4M = HM_IE4 && HM_Mac; var HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE && !HM_IE4M)); if(!HM_IsMenu) event = null; var zz, zv, d, fTSR; var gBF=false; var g_MINY = 1601; var g_MAXY = 4500; var g_month = 0; var g_day = 0; var g_year = 0; var g_yLow = 1990; var g_eC=null; var g_eCV=""; var rgMC = Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var codigoPais; d = new Date(); fTSR=0; zv = d.getTime(); zz = "&zz="+zv; var esletra = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-ÑñáéíóúüÁÉÍÓÚÜ&"; var esetckt = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-"; var esnumero = "0123456789"; var DiasPorMes=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; ns4 = (document.layers)? true:false ie4 = (document.all)? true:false ie5=(ie4 && navigator.userAgent.indexOf('MSIE 5')>0); var x = 0; var y = 0; var trk = 0; var offsetx=-85; var offsety=14; var diaSeleccionado= ""+diaSeleccionado; function callayerWrite(txt){ if (ns4) { var lyr = document.ptsDiv.document lyr.write(txt) lyr.close() } else if (ie4) document.all["calendario"].innerHTML = txt } function MM_SIR(){ var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i'+i+''); else document.write(""); i++; } } /*Como escriu_options pero para el anio*/ function anyo_options(ini, fi, sel){ var i=parseInt(ini); while (i<=parseInt(fi)){ if (i==iniAnio) document.write(""); else document.write(""); i++; } } var elementType; var fe_dia ; var fe_mes; var fe_anyo; var fs_dia; var fs_mes; var fs_anyo; var fe; var fs; function Calendario(tipo,pais_an,x ,y, elementTyp, fe_di, fe_me, fe_any, fs_di, fs_me, fs_any, fe_date, fs_date){ elementType = elementTyp; fe_dia = fe_di; fe_mes = fe_me; fe_anyo = fe_any; fs_dia = fs_di; fs_mes = fs_me; fs_anyo = fs_any; fe = fe_date; fs = fs_date; // Las fechas q se seleccionen en el calendario desplegable pueden querer ser almacenadas en 2 tipos de elementos del formulario //desde el que se llama al calendario: // - o en un type select, en cuyo caso tendremos una select para el dia de entrada (fe_dia), otra para el mes de entrada(fe_mes), año de entrada //(fe_anyo), dia de salida (fs_dia), mes de salida (fs_mes), año de salida (fs_anyo) // - o en un type input text, en cuyo caso tendremos un input text para la fecha de entrada (fe) y otro para la fecha de salida (fs) if ( elementType ==null){ elementType = 'input'; fe = document.AIR.fechaI; fs = document.AIR.fechaV; } if (x!=null){ xCalendario=x; yCalendario=y; }else{ xCalendario="245"; yCalendario="320"; } tipoFecha=tipo; pais=pais_an; if(pais_an.substring(3,5)=="es") { codigoPais = 0; } else if(pais_an.substring(3,5)=="pt") { codigoPais = 1; } else if(pais_an.substring(3,5)=="en") { codigoPais = 2; } if (calendario.style.visibility=="visible") { cerrarCalendario(); return; } abrirCalendario(tipo, codigoPais); } function showObject(obj){ if (ns4) obj.visibility = "show" else if (ie4) obj.visibility = "visible" } function hideObject(obj){ if (ns4) obj.visibility = "hide" else if (ie4) obj.visibility = "hidden" } function abrirCalendario(tipoFecha, codigoPais) { try { cerrarCalendario(); } catch(err) {} var text_cal=""; // Miramos segun el codigo pais para poner el idioma de los meses if (codigoPais == 0) { var nombresMeses = new Array("ENERO", "FEBRERO", "MARZO", "ABRIL", "MAYO", "JUNIO", "JULIO", "AGOSTO", "SEPTIEMBRE", "OCTUBRE", "NOVIEMBRE", "DICIEMBRE"); } else if (codigoPais == 1) { var nombresMeses = new Array("JANEIRO", "FEVEREIRO", "MAR?O", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"); } else if (codigoPais == 2) { var nombresMeses = new Array("JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"); } else { var nombresMeses = new Array("ENERO", "FEBRERO", "MARZO", "ABRIL", "MAYO", "JUNIO", "JULIO", "AGOSTO", "SEPTIEMBRE", "OCTUBRE", "NOVIEMBRE", "DICIEMBRE"); } fecha_real =new Date(); anio_real = fecha_real.getFullYear(); mes_real = fecha_real.getMonth(); dia_real = fecha_real.getDate(); if (tipoFecha=='I') { if (elementType.toLowerCase()=='input') { fechaInputSeleccionada=fe.value.substring(fe.value.indexOf("/"),fe.value.length); diaYaSeleccionado=1*fe.value.substring(0,fe.value.indexOf('/')); } else { if (fe_mes.options[fe_mes.selectedIndex].value.length==1) { fechaInputSeleccionada='/'+'0'+fe_mes.options[fe_mes.selectedIndex].value+'/'+fe_anyo.options[fe_anyo.selectedIndex].value.substring(2,4); } else { fechaInputSeleccionada='/'+fe_mes.options[fe_mes.selectedIndex].value+'/'+fe_anyo.options[fe_anyo.selectedIndex].value.substring(2,4); } if (fe_dia.options[fe_dia.selectedIndex].value.length==1) { diaYaSeleccionado='0'+fe_dia.options[fe_dia.selectedIndex].value; } else { diaYaSeleccionado=fe_dia.options[fe_dia.selectedIndex].value; } } } else if(tipoFecha=='V') { if (elementType.toLowerCase()=='input') { fechaInputSeleccionada=fs.value.substring(fs.value.indexOf("/"),fs.value.length); diaYaSeleccionado=1*fs.value.substring(0,fs.value.indexOf('/')); } else { if (fs_mes.options[fs_mes.selectedIndex].value.length==1) { fechaInputSeleccionada='/'+'0'+fs_mes.options[fs_mes.selectedIndex].value+'/'+fs_anyo.options[fs_anyo.selectedIndex].value.substring(2,4); } else { fechaInputSeleccionada='/'+fs_mes.options[fs_mes.selectedIndex].value+'/'+fs_anyo.options[fs_anyo.selectedIndex].value.substring(2,4); } if (fs_dia.options[fs_dia.selectedIndex].value.length==1) { diaYaSeleccionado='0'+fs_dia.options[fs_dia.selectedIndex].value; } else { diaYaSeleccionado=fs_dia.options[fs_dia.selectedIndex].value; } } } else if (tipoFecha=='CI') { fechaInputSeleccionada=document.FormRicerca.calendarioI.value.substring(document.FormRicerca.calendarioI.value.indexOf("/"),document.FormRicerca.calendarioI.value.length); diaYaSeleccionado=1*document.FormRicerca.calendarioI.value.substring(0,document.FormRicerca.calendarioI.value.indexOf('/')); } else if (tipoFecha=='CV') { fechaInputSeleccionada=document.FormRicerca.calendarioV.value.substring(document.FormRicerca.calendarioV.value.indexOf("/"),document.FormRicerca.calendarioV.value.length); diaYaSeleccionado=1*document.FormRicerca.calendarioV.value.substring(0,document.FormRicerca.calendarioV.value.indexOf('/')); } else if (tipoFecha=="FI") { fechaInputSeleccionada=fe.value; diaYaSeleccionado=fe.value; } else if (tipoFecha=="FV") { fechaInputSeleccionada=fe.value; diaYaSeleccionado=fe.value; } ano = "" +Hoy.getYear(); mes = (Hoy.getMonth()+1); mes = (mes<10?"0":"")+mes; fechaSeleccionada="/"+mes+"/"+ano.substring(2,4); var Anyo=Hoy.getYear(); //Si el año es anterior a 2000 debe sumarse 1900 a la cantidad obtenida //El anyo se contabiliza a partir de 1900 var EsteDia=Hoy.getDate(); //Actualizacion del mes de Febrero (por los anyos bisiestos) if (((Anyo % 4 == 0) && (Anyo % 100 != 0)) || (Anyo % 400 == 0)) DiasPorMes[1] = 29; //Numero de dias del mes actual NDias =DiasPorMes[Hoy.getMonth()]; //Calculo que dia de la semana es el primero del mes PrimerDia=Hoy; PrimerDia.setDate(1); //Obtengo el dia de hoy (p.e, 10-11-1999) y calculo q dia de la semana //es el dia 1 del mismo mes y anyo (p.e, 1-11-1999) Comienzo=PrimerDia.getDay(); if (Comienzo==0) { Comienzo=6; } else { Comienzo=PrimerDia.getDay()-1; } //Escritura en la pantalla de la tabla correspondiente al mes actual text_cal="" text_cal=text_cal+""; calendario.outerHTML = text_cal; calendario.style.visibility = "visible"; var IfrRef = document.getElementById('DivShim'); IfrRef.style.width = calendario.offsetWidth; IfrRef.style.height = calendario.offsetHeight; IfrRef.style.top = calendario.style.top; IfrRef.style.left = calendario.style.left; IfrRef.style.zIndex = calendario.style.zIndex - 1; IfrRef.style.display = "block"; }//fin de abrir calendario function cerrarCalendario(){ calendario.style.visibility="hidden"; var IfrRef = document.getElementById('DivShim'); IfrRef.style.display = "none"; } function verDiaSeleccionado(tipoFecha,cual){ //miramos si el calendario es el superior o el inferior if(cual=="S"){ mesActual=Hoy.getMonth()+1; anoActual=Hoy.getYear(); } else if(cual=="I"){ mesActual=HoyCal2.getMonth()+1; anoActual=HoyCal2.getYear(); } anoActual=""+anoActual; mesActual= ""+mesActual; mesActual = mesActual.length==2 ? mesActual : "0"+mesActual; diaSeleccionado= ""+diaSeleccionado; diaSeleccionado = diaSeleccionado.length==2 ? diaSeleccionado : "0"+diaSeleccionado; if (tipoFecha=="I"){ if (elementType=='input'){ fe.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4); }else{ i=0; while (i0 && cad.charAt(lg-1)==' ';lg--); for (i=0;i getDaysInMonth(mes-1,any)){ dia = dia - getDaysInMonth(mes-1,any); mes ++; if (mes > 12){ mes = mes - 12; any ++; } } form.fs_dia.selectedIndex = dia; form.fs_mes.selectedIndex = mes; i = 0; while (i < form.fs_anyo.length ) { if (form.fs_anyo.options[i].text == any.toString(10)){ form.fs_anyo.selectedIndex = i; return; } else i++; } } return; } function actualizar_Noches(childForm){ var form; salir =false; for (i=0;ianyE) || (anyS==anyE && mesS>mesE) ) || ((anyS==anyE && mesS==mesE) && diaS>diaE) ){ if (diaE==diaS && mesE==mesS && anyE==anyS) { nits=0; }else { nits=0; while (diaE!=diaS || mesE!=mesS || anyE!=anyS){ diaE++; nits++; if (diaE > getDaysInMonth(mesE-1,anyE)){ diaE = diaE - getDaysInMonth(mesE-1,anyE); mesE ++; if (mesE > 12){ mesE = mesE - 12; anyE ++; } } } } } else //fs es anterior a fe! nits=0; if (nits > 0 && nits < form.noches.length) form.noches.selectedIndex = nits; else form.noches.selectedIndex = 0; } return; } function es_numero(cadena,lg){ if (lg != cadena.length) {return 1;} for (i=0;i 5) checkstr += "- "+msg1+"\n"; if ( num_adultos == 0 ) checkstr += "- "+msg2+"\n"; if (!GetInputDate(fechaI.value)) checkstr += "- "+msg3+"\n"; else { var dDateValue=(g_year*100+g_month)*100+g_day; D_Day.value=g_day; D_Month.value="20" + g_year+(g_month<10?"0":"")+g_month; var departureDate = new Date(g_year, g_month-1, g_day, 8, 0, 0); if (!GetInputDate(fechaV.value)) checkstr += "- "+msg4+"\n"; else { var rDateValue=(g_year*100+g_month)*100+g_day; R_Day.value=g_day; R_Month.value="20" + g_year+(g_month<10?"0":"")+g_month; if (rDateValue < dDateValue) checkstr += "- "+msg5+"\n"; } } if (D_City.value=="") checkstr += "- "+msg6+"\n"; if (A_City.value == "") checkstr += "- "+msg7+"\n"; if(checkstr!=""){ alert(checkstr); return; } for (i=1 ;i<=num_adultos;i++) eval("PaxType"+i+".value='ADT'"); for (i=(num_adultos+1) ;i<=(num_adultos+num_ninios);i++) eval("PaxType"+i+".value='CHD'"); fecha = fechaI.value; pos1 = fecha.indexOf("/"); trozo1 = fecha.substring(fecha.indexOf("/")+1); pos2 = trozo1.indexOf("/"); D_Day.value = fecha.substring(0,pos1); D_Month.value = "20" + trozo1.substring(pos2+1,trozo1.length)+trozo1.substring(0,pos2); fecha = fechaV.value; pos1 = fecha.indexOf("/"); trozo1 = fecha.substring(fecha.indexOf("/")+1); pos2 = trozo1.indexOf("/"); R_Day.value = fecha.substring(0,pos1); R_Month.value = trozo1.substring(0,pos2); R_Month.value = "20" + trozo1.substring(pos2+1,trozo1.length)+trozo1.substring(0,pos2); submit(); } } function openwindow(direccion, name, cadena){ var winf = window.open(direccion,name,cadena); winf.focus(); } function abrirventana(varHttp, lenX, lenY, bScroll) { var winf = open(varHttp, null, "width=" + lenX + ",height=" + lenY + ",status=no,menubar=no,scrollbars=" + bScroll + ",resizable=no"); winf.focus(); } function GetInputDate(t) { var l = t.length; if(0 == l) return false; var cSp = '\0'; var sSp1 = ""; var sSp2 = ""; for(var i=0; i g_MAXY || m < 1 || m > 12) return false; if(d < 1 || d > GetMonthCount(m,y)) return false; g_month = m; g_day = d; g_year = y; return true; } function DefYr(m,d){ var dt = new Date(); var yCur = (dt.getYear() < 1000) ? 1900+dt.getYear() : dt.getYear(); if(m-1 < dt.getMonth() || (m-1 == dt.getMonth() && d < dt.getDate())) return 1+yCur; else return yCur; } function atoi(s){ var t=0; for(var i=0; i= '0' && c <= '9'); } function GetMonthCount(m,y){ var c = rgMC[m-1]; if((2 == m) && IsLeapYear(y)) c++; return c; } function IsLeapYear(y){ if(0 == y % 4 && ((y % 100 != 0) || (y % 400 == 0))) return true; else return false; } function isEmptyString(s){ return (s == null || (typeof s == "string" && /^s*$/.test(s))); } function EMailOk(s_email) { var addressPattern = /^[^\s\n]+\@[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,4}$/; if (! addressPattern.test(s_email)) return false; return (s_email.length <= 128); } function DS(action, attrs, target){ form = document.LinkForm; if (form != null){ if (attrs != null){ for (var name in attrs){ if (form[name]){ form[name].value = attrs[name]; } } } if (action){ form.action = action; } if (target){ form.target = target; } else { form.target = "_self"; } form.submit(); } } function QuitarAcentos(st) { st = st.replace(/á/gi,"a"); st = st.replace(/à/gi,"a"); st = st.replace(/â/gi,"a"); st = st.replace(/ä/gi,"a"); st = st.replace(/ª/gi,"a"); st = st.replace(/é/gi,"e"); st = st.replace(/è/gi,"e"); st = st.replace(/ê/gi,"e"); st = st.replace(/ë/gi,"e"); st = st.replace(/ì/gi,"i"); st = st.replace(/í/gi,"i"); st = st.replace(/î/gi,"i"); st = st.replace(/ï/gi,"i"); st = st.replace(/ò/gi,"o"); st = st.replace(/ó/gi,"o"); st = st.replace(/ô/gi,"o"); st = st.replace(/ö/gi,"o"); st = st.replace(/ú/gi,"u"); st = st.replace(/ù/gi,"u"); st = st.replace(/û/gi,"u"); st = st.replace(/ü/gi,"u"); st = st.replace(/ç/gi,"c"); return st; } function Location(url, elementcode, elementname){ locCodeHolder = elementcode; locDescHolder = elementname; window.open(url,'Aeropuertos', 'resizable=yes,toolbars=no,scrollbars=yes,screenX=0,screenY=0,width=633,height=550'); } function setLocationCode(code){ locCodeHolder.value = code; } function setLocationDesc(name){ locDescHolder.value = name; } function redondeo2decimales2(importe){ var suma = (importe*100)%parseInt(importe*100) >=.5 ? 1 :0; alert("SUMA=["+suma+"]"); var res = ((parseInt(importe*100)+suma)/100); alert("RESTA=["+res+"]"); var cadena = res + ""; alert("CADENA=["+cadena+"]"); var longitud = cadena.length ; alert("LOGITUD=["+longitud+"]"); longitud = longitud-3; alert("LOGITUD2=["+longitud+"]"); if (cadena.indexOf(".") != -1) longitud=longitud-3; var res1 = ""; var incremento = longitud % 3; if (incremento < 0){ res1=cadena; return res1; } else{ if (incremento == 0) incremento = 3; for (var i = 0; i < longitud;) { res1 += cadena.substr(i, incremento); i += incremento; if (i <= longitud){ res1 += ","; incremento = 3; } } res1 += cadena.substr(longitud, 3); if (cadena.indexOf(".") != -1) res1 += cadena.substr(longitud+3, 3); return res1; } } function redondeo2decimales(importe){ var original=parseFloat(importe); var result=Math.round(original*100)/100; return result; } // sceciliano // a partir de un nº pasado como string como 1er parametro, se le pone el nº de decimales especificado en su 2º parametro. function obtainNumDecimal(campo,numDec){ campo=campo+"."; var array_campo = campo.split("."); var dec ="."; if (array_campo[1].length < numDec ){ dec = dec + array_campo[1]; while (dec.length < numDec+1 ) dec = dec+"0"; } else dec = dec+array_campo[1].substring(0,numDec); campo=array_campo[0]+dec; return campo; } /*Retorna la cadena sin espacios*/ function SinEspacios(cadena){ var s = new String(cadena); var i=0; do { s = s.replace(" ",""); i=i+1; } while ((s.search(/\s*/)!=-1) && (i<15)); return(s); } /*Retorna la cadena sin espacios a derecha ni a izquierda*/ function Trim(str){ cad = LTrim(RTrim(str)); return cad; } /*Retorna la cadena sin espacios a la izquierda*/ function LTrim(str){ for (var i = 0; i < str.length && str.charAt(i) == ' '; i++); return str.substring(i); } /*Retorna la cadena sin espacios a la derecha*/ function RTrim(str){ for (var i = str.length; i > 0 && str.charAt(i - 1) == ' '; i--); return str.substring(0, i); } /*convierte eñes en enes*/ function ene(palabra){ for(var i=0; i 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.depTime.value != "" || flightForm.retTime.value != ""){ flightForm.resultType[1].checked = true; } 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); // try{cookieForms('save', 'flightForm');}catch(err){} flightForm.submit(); } } function muestraCalIda(pais,ruta){ var sp =pais; var path = ruta; var browser=navigator.appName; if (browser=="Microsoft Internet Explorer"){ document.write(''); document.write(''); document.write(''); } } function muestraCalVuelta(pais,ruta){ var browser=navigator.appName; var sp = pais; var path = ruta; if (browser=="Microsoft Internet Explorer"){ document.write(''); document.write(''); document.write(''); document.write(''); } } function goSubmitBuscador2007(dat){ var str = ""; // Quito acentos flightForm.depCity.value = QuitarAcentos(flightForm.depCity.value); flightForm.arrCity.value = QuitarAcentos(flightForm.arrCity.value); var msg=""; //groupval(str, nom, islg, isln, isnm) 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)); msg = doconcat(msg,groupval(flightForm.fe_dia.value,'Dia de salida',0,1,1)); msg = doconcat(msg,groupval(flightForm.fe_mesanyo.value,'Mes de salida',0,1,1)); var fechadep = flightForm.fe_mesanyo.value + "" + flightForm.fe_dia.value; //comprobamos vuelos directos if (flightForm.direct.checked) { flightForm.directOnly.value = 'S'; } else { flightForm.directOnly.value = 'N'; } if (flightForm.queryType[0].checked){ msg = doconcat(msg,groupval(flightForm.fs_dia.value,'Dia de llegada',0,1,1)); msg = doconcat(msg,groupval(flightForm.fs_mesanyo.value,'Mes de llegada',0,1,1)); 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");} flightForm.owOrRt.value="R"; } else { flightForm.owOrRt.value="O"; } //veo si la fecha de salida es mayor de 2 dias var now = new Date(); now.setTime(dat); now.setDate(now.getDate()); 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.depTime.value != "" || flightForm.retTime.value != ""){ flightForm.resultType[1].checked = true; } 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); // try{cookieForms('save', 'flightForm');}catch(err){} flightForm.submit(); } } function goSubmitBuscadorVH2007(dat){ var str = ""; // Quito acentos flightHotelForm.depCity.value = QuitarAcentos(flightHotelForm.depCity.value); flightHotelForm.arrCity.value = QuitarAcentos(flightHotelForm.arrCity.value); var msg=""; //groupval(str, nom, islg, isln, isnm) msg = doconcat(msg,groupval(flightHotelForm.depCity.value,'Ciudad de salida',1,1,0)); msg = doconcat(msg,groupval(flightHotelForm.arrCity.value,'Ciudad de llegada',1,1,0)); msg = doconcat(msg,groupval(flightHotelForm.fe_dia.value,'Dia de salida',0,1,1)); msg = doconcat(msg,groupval(flightHotelForm.fe_mesanyo.value,'Mes de salida',0,1,1)); var fechadep = flightHotelForm.fe_mesanyo.value + "" + flightHotelForm.fe_dia.value; if (flightHotelForm.queryType.checked){ msg = doconcat(msg,groupval(flightHotelForm.fs_dia.value,'Dia de llegada',0,1,1)); msg = doconcat(msg,groupval(flightHotelForm.fs_mesanyo.value,'Mes de llegada',0,1,1)); var fecharet = flightHotelForm.fs_mesanyo.value + "" + flightHotelForm.fs_dia.value; if (fecharet < fechadep) {msg = doconcat(msg,"La fecha de llegada tiene que ser mayor que la de salida \n");} flightHotelForm.owOrRt.value="R"; } else { flightHotelForm.owOrRt.value="O"; } //veo si la fecha de salida es mayor de 2 dias var now = new Date(); now.setTime(dat); now.setDate(now.getDate()); 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 * flightHotelForm.paxAdt.options[flightHotelForm.paxAdt.selectedIndex].value; var nChd = 1 * flightHotelForm.paxChd.options[flightHotelForm.paxChd.selectedIndex].value; var nInf = 1 * flightHotelForm.paxInf.options[flightHotelForm.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(flightHotelForm.depTime.value != "" || flightHotelForm.retTime.value != ""){ flightHotelForm.resultType[1].checked = true; } if (msg != ''){alert(msg);} else{ str = flightHotelForm.fe_mesanyo.value; flightHotelForm.depDate.value = flightHotelForm.fe_dia.value+"/"+str.substring(4)+"/"+str.substring(0,4); str = flightHotelForm.fs_mesanyo.value; flightHotelForm.retDate.value = flightHotelForm.fs_dia.value+"/"+str.substring(4)+"/"+str.substring(0,4); // try{cookieForms('save', 'flightHotelForm');}catch(err){} flightHotelForm.submit(); } } function cerrarCapaErrores() { document.getElementById("capaErrores").style.visibility = 'hidden'; document.getElementById("capaErrores").style.display = 'none'; }