﻿
function busquedaOnLoad(){
document.getElementById('words').value=scripts.textoBusqueda;
//las siguientes lineas deben ser el load de los controles
}
function busquedaEnter(e){
var keyPressed;
    if (document.all){
        keyPressed = e.keyCode;
    } 
    else{
        keyPressed = e.which;
    }
    if (keyPressed == 13){ 
	    busqueda()
    } 
}
function busqueda(){
    quitarTexto('words');
   document.getElementById('form1').action=scripts.actionFormBusqueda;
    document.getElementById('form1').submit();
}


function colocarTexto(cTexto){
    if (document.getElementById(cTexto).value==''){
        if (cTexto=='words'){
            document.getElementById(cTexto).value=scripts.textoBusqueda;
        }
        else if (cTexto=='cityP'){
            document.getElementById(cTexto).value=scripts.textoCiudad;
        }
         else if (cTexto=='cityP2'){
            document.getElementById(cTexto).value=scripts.textoCiudad;
        }
         else if (cTexto=='B_LOCATION_1P'){
            document.getElementById(cTexto).value=scripts.textoDepartingFrom;
        }
         else if (cTexto=='E_LOCATION_1P'){
            document.getElementById(cTexto).value=scripts.textoTravelingTo;
        }
          else if (cTexto=='txtOrigenFlightP'){
            document.getElementById(cTexto).value=scripts.textoDepartingFrom;
        }
         else if (cTexto=='txtDistinoFlightP'){
            document.getElementById(cTexto).value=scripts.textoTravelingTo;
        }
        
        else{
            document.getElementById(cTexto).value=scripts.textoDiscountCode;  
        }
    }
}


function quitarTexto(cTexto){
    if ((document.getElementById(cTexto).value==scripts.textoBusqueda)&&(cTexto=='words')){
        document.getElementById(cTexto).value='';
    }
     else if ((document.getElementById(cTexto).value==scripts.textoCiudad)&&(cTexto=='cityP')){
            document.getElementById(cTexto).value='';
        }
   else if ((document.getElementById(cTexto).value==scripts.textoCiudad)&&(cTexto=='cityP2')){
            document.getElementById(cTexto).value='';
        }
    else if ((document.getElementById(cTexto).value.length>3)&&(cTexto=='B_LOCATION_1P')){
            document.getElementById(cTexto).value='';
        }    
        
         else if ((document.getElementById(cTexto).value.length>3)&&(cTexto=='E_LOCATION_1P')){
            document.getElementById(cTexto).value='';
        }    
        
         else if ((document.getElementById(cTexto).value==scripts.textoDepartingFrom)&&(cTexto=='txtOrigenFlightP')){
            document.getElementById(cTexto).value='';
        }    
        
         else if ((document.getElementById(cTexto).value==scripts.textoTravelingTo)&&(cTexto=='txtDistinoFlightP')){
            document.getElementById(cTexto).value='';
        }    
        
    else if (document.getElementById(cTexto).value==scripts.textoDiscountCode){
        document.getElementById(cTexto).value='';
    }
}

function cargarMultiClty(){
    window.location=scripts.urlMultiCity;
}

function cerrarCalendarPaises(){
    document.getElementById('psContent').style.visibility ='hidden';
     document.getElementById('psContent2').style.visibility ='hidden';
     document.getElementById('contenedorCalendarGlobal').style.visibility ='hidden';
                                                                            

}

function alertaGenerica(textoAlerta){
    /*document.getElementById('divAlerta').style.visibility ='visible';
    document.getElementById('spanAlerta').innerHTML=textoAlerta;*/
    
     document.getElementById('msgPop').innerHTML=textoAlerta;
    
    var mpe = $find('mpeDualLoginAtempt');
    mpe.show();
 
    

}
function cerrarAlertaGenerica(){
    document.getElementById('divAlerta').style.visibility ='hidden';
}





scripts={
"textoSalidaMayorRegreso":"The depart date must be more or equal than the return date",
"CamposReq":"You must at least fill one of the following fields:",
"DigiteEmail":"- Type a valid E-mail:",
"DigiteFtnum":"- Invalid DISTANCIA Number",
"urlDistanciaNoAuth":"http://distancia.taca.com/eng/dis/jli/jlilogdis.asp?id=57 ",
"Agosto":"August",
"Noviembre":"November",
"CamposReqUno":"You must fill only one of the following fields:",
"Martes":"Tu",
"textoAdultoXInfante":"You must select at least one adult per infant",
"logouturl":"http://www.taca.com/eng/dis/jli/jlilogout.asp",
"DigiteReserva":"- Invalid Reservation Code",
"urlMultiCity":"http://www.taca.com/eng/pyr/ibe/ibemuldes.asp?id=15",
"textoSelectRooms":"Select numer of rooms",
"textoDiscountCode":"Discount Coupon",
"textoTusmillas":"Total Miles: {0}",
"DigiteCiudadSalida":"- Type a valid Depart City: SAL",
"Jueves":"Th",
"textoReturn":"Return",
"apellidoReq":"- Last Name is Required",
"procesando":"Please Wait...",
"actionFormHotels":"http://travel.ian.com/index.jsp?currencyCode=USD&locale=en&cid=250591",
"textoTravelingTo":"Traveling To",
"urlPackage":"http://travel.wwte1.com/pubspec/scripts/eap.asp?goto=PACKAGEWIZ&eapid=45106-30001&jurl=/pubspec/scripts/eap.asp&opts=spec&rfrr=-34980",
"Miercoles":"We",
"textohoraRegreso":"Please provide your return time",
"textoSeleccioneFRegresoH":"Check-out date  is Required",
"textoSeleccioneFRegresoC":"Drop-off date is Required",
"textoNoEncontroVuelos":"Flights not found",
"Sabado":"Sa",
"textoDepart":"Depart",
"textoSelectCiudad":"Please select a city",
"actionFormCheck":"script/che/checkinans.asp",
"textoDeparted":"Departed",
"textoArrive":"Arrive",
"textoPick":"Pick-up date",
"textoDrop":"Drop-of date",
"textoDeparture":"Check-out date",
"textoCiudad":"City",
"textoAdulsRequired":"Adults is required",
"DigiteEticket":"- Invalid E-Ticket Number",
"CodReserv":"- Reservation Code:",
"DigiteNombre":"- Invalid First Name",
"autenticacionInvalida":"Invalid User",
"infantadult":"Infants must travel with adult fare in Business Class, please include any infants travelling in the adult’s list option.  ",
"textoSeleccionarSalida":"Please make sure you select your departing city",
"nombreReq":"- First Name is Required",
"actionFormBookTravel":"http://www.taca.com/script/ibe/iberesp.asp",
"textoEvening":"Evening",
"textoAfternoon":"Afternoon",
"textoErrorAutenticacion":"There was an error contacting the autentication service, please try again later.",
"Octubre":"October",
"hotSearch":"hotSearch",
"textoDepartingFrom":"Departing From",
"Enero":"January",
"Email":"- E-mail:",
"Etick":"- E-ticket:",
"Abril":"April",
"Marzo":"March",
"Lunes":"Mo",
"Julio":"July",
"Junio":"June",
"Domingo":"Su",
"textoSalidaMayorRegresoC":"Drop-off date must be more or equal than Pick-up date ",
"textoSalidaMayorRegresoH":"The Check-out date must be more or equal than the Check-in date",
"textoSalidaMayorActual":"The depart date must be more or equal than today ",
"AceptarTerms":"You must agree terms and conditions:",
"textoCompleteParams":"Please complete the searching parameters",
"textoNoHayDestinos":"There are no destinations for the selected city",
"textoPickTime":"Pick-Up Time",
"textoSeleccioneFSalida":"Please provide your departing date",
"Distancia":"- Distancia:",
"actionFormCars":"http://www.travelnow.com/index.jsp?currencyCode=USD",
"textoArrival":"Check-in date",
"textoSeleccioneFRegreso":"Please select the return date ",
"textohoraSalida":"Please provide your departing time",
"Viernes":"Fr",
"ErrorAutenticacion":"Autentication Error",
"textoSalidaMayorActualC":"Pick-up date must be more or equal than today ",
"textoSalidaMayorActualH":"The Check-in date must be more or equal than today ",
"actionFormPackage":"http://travel.wwte1.com/pubspec/scripts/eap.asp?goto=jump&eapid=45106-30001&jurl=/pubspec/scripts/eap.asp",
"textoBusqueda":"Search",
"logout":"logout",
"carSearch":"carSearch",
"textoSeleccionarDestino":"Please make sure you select your city of destination",
"Febrero":"February",
"Diciembre":"December",
"textoClassCars":"Please select a type of car",
"textoHello":"Hello",
"textoSeleccioneFSalidaC":"Pick-up date is Required",
"textoSeleccioneFSalidaH":"Check-in date is Required ",
"actionFormBusqueda":"http://search.taca.com/cgi-bin/htsearch",
"textoDropTime":"Drop-Off Time",
"textoSeleccionarTipoPasajeros":"You need to select at least one type of passenger",
"textoMorning":"Morning",
"Septiembre":"September",
"DigiteApellido":"- Invalid Last Name",
"ciudadSalidaReq":"- Depart City is Required",
"textoRutaInvalida":"We don’t fly from  {0}, {1} ({2}) to {3}, {4} ({5}), please select another route",
"Mayo":"May",
"urlDistanciaAuth":"https://distancia.taca.com/dis/eng/dis/edc/edcestatm.asp?id=6 "
};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();