function buscar(){if(document.indexx.buscavuelo1_txtVueloIda.value==""){eAlert.showAlert("Escribe el origen, te aparecera una lista y selecciona uno de ellos.","buscavuelo1_txtVueloIda");document.indexx.buscavuelo1_txtVueloIda.focus();return (false);return;}if(document.indexx.buscavuelo1_txtVueloVuelta.value==""){eAlert.showAlert("Escribe el destino, te aparecera una lista y selecciona uno de ellos.","buscavuelo1_txtVueloVuelta");document.indexx.buscavuelo1_txtVueloVuelta.focus();return (false);}if(document.indexx.origen.value==""){eAlert.showAlert("Por favor, vuelve a escribir el origen.","buscavuelo1_txtVueloIda");document.indexx.buscavuelo1_txtVueloIda.value="";document.indexx.buscavuelo1_txtVueloIda.focus();return (false);}if(document.indexx.destino.value==""){eAlert.showAlert("Por favor, vuelve a escribir el destino.","buscavuelo1_txtVueloVuelta");document.indexx.buscavuelo1_txtVueloVuelta.value="";document.indexx.buscavuelo1_txtVueloVuelta.focus();return (false);}if(document.indexx.destino.value.toUpperCase()==document.indexx.origen.value.toUpperCase()){eAlert.showAlert("El origen y el destino no pueden ser el mismo.","buscavuelo1_txtVueloVuelta");document.indexx.buscavuelo1_txtVueloVuelta.focus();return (false);}if(document.indexx.buscavuelo1_txtDesde.value==""){eAlert.showAlert("La fecha de salida no puede estar vac&iacute;a.","buscavuelo1_txtDesde");document.indexx.buscavuelo1_txtDesde.focus();return (false);}else{if(!validateDate(document.indexx.buscavuelo1_txtDesde.value,"fecha de salida",true,true,false)){eAlert.showAlert("La fecha de salida no tiene el formato correcto.","buscavuelo1_txtDesde");document.indexx.buscavuelo1_txtDesde.focus();return (false);}else{if(!validateDate(document.indexx.buscavuelo1_txtDesde.value,"fecha de salida",true,true,false,true)){eAlert.showAlert("La fecha de salida no puede ser anterior a hoy.","buscavuelo1_txtDesde");document.indexx.buscavuelo1_txtDesde.focus();return (false);}}}document.indexx.buscavuelo1_txtDesde.value=parseDate(document.indexx.buscavuelo1_txtDesde.value);var _1="idayvuelta";if(document.indexx.buscavuelo1_RadioI.checked){_1="ida";}if(_1=="idayvuelta"){if(document.indexx.buscavuelo1_txtHasta.value==""){eAlert.showAlert("La fecha de llegada no puede estar vac&iacute;a.","buscavuelo1_txtHasta");document.indexx.buscavuelo1_txtHasta.focus();return (false);}else{if(!validateDate(document.indexx.buscavuelo1_txtHasta.value,"fecha de llegada",true,true,false)){eAlert.showAlert("La fecha de regreso no tiene el formato correcto.","buscavuelo1_txtHasta");document.indexx.buscavuelo1_txtHasta.focus();return (false);}document.indexx.buscavuelo1_txtHasta.value=parseDate(document.indexx.buscavuelo1_txtHasta.value);var _2=getDays(document.indexx.buscavuelo1_txtDesde.value,document.indexx.buscavuelo1_txtHasta.value);if(_2<0){eAlert.showAlert("La fecha de regreso debe ser igual o posterior a la fecha de salida.","buscavuelo1_txtHasta");document.indexx.buscavuelo1_txtHasta.focus();return (false);}var _3=new Date();var _4=_3.getMonth()+1;var _5=_3.getDate();var _6=_3.getFullYear();var _7=(_4+"/"+_5+"/"+_6);_7=_7.split("/");var _8=new Date(_7[0]+"/"+_7[1]+"/"+_7[2]);var _9=document.indexx.buscavuelo1_txtDesde.value;_9=_9.split("/");var _a=new Date(_9[1]+"/"+_9[0]+"/"+_9[2]);var _b=Math.abs(Math.round((_8-_a)/86400000));if(_b>330){eAlert.showAlert("No hay vuelos disponibles para esta fecha de salida.","buscavuelo1_txtDesde");document.indexx.buscavuelo1_txtDesde.focus();return (false);}var _c=document.indexx.buscavuelo1_txtHasta.value;_c=_c.split("/");var _d=new Date(_c[1]+"/"+_c[0]+"/"+_c[2]);var _e=Math.abs(Math.round((_8-_d)/86400000));if(_e>330){eAlert.showAlert("No hay vuelos disponibles para esta fecha de regreso.","buscavuelo1_txtHasta");document.indexx.buscavuelo1_txtHasta.focus();return (false);}}var _f=getDays(document.indexx.buscavuelo1_txtDesde.value,document.indexx.buscavuelo1_txtHasta.value);}document.indexx.buscavuelo1_origen2.value=document.indexx.origen.value;document.indexx.buscavuelo1_destino2.value=document.indexx.destino.value;return (true);}function idavuelta(){var _10="";if(document.indexx.buscavuelo1_RadioI.checked){_10="ida";}if(_10=="ida"){document.indexx.buscavuelo1_txtHasta.value="";document.getElementById("volver").style.visibility="hidden";document.getElementById("volver").style.display="none";}else{document.getElementById("volver").style.visibility="visible";document.getElementById("volver").style.display="block";}}