﻿// JScript File	
function entrarAgencias_() 
{
    this.url = "";
  
    this.execu = function (ageEmail,agePassword) {
            var params = "?email=" + escape(ageEmail) + "&password=" + escape(agePassword);
            location.href =  this.url + params
    } 
}

/*function entrarAgencias(ageEmail,agePassword){ var url="<%=SSLserverRoot%>agency/login.aspx?email=" + escape(ageEmail) + "&password=" + escape(agePassword); location.href=url; }*/
        
function botonEncima(name){ document.getElementById("td_"+name).className="botonOver"; }

function botonFuera(name){ MM_swapImage("img_"+name,'','/images/vstravel/boton_izq.gif',1); document.getElementById("td_"+name).className="boton"; }


function panelBuscando_() 
{     
    this.idioma = "";
    
    this.execu = function () {

        document.getElementById("divTodo").style.display="none"; 
        document.getElementById("divBuscando").style.visibility="visible";
        document.getElementById('divBuscando').src='/reserve/searching.aspx?idi=' + this.idioma; 
    }
}

/*function panelBuscando() { document.getElementById("divTodo").style.display="none"; document.getElementById("divBuscando").style.visibility="visible";document.getElementById('divBuscando').src='/reserve/searching.aspx?idi=<%=Juniper.internacional.idioma.idioma%>'; }*/
        

function panelPublicidad(visible) 
{
   if (visible) {            
       document.getElementById("divTodo").style.display="none";
       document.getElementById("divPublicidad").style.visibility="visible";
   }
   else {
       document.getElementById("divTodo").style.display="block";
       document.getElementById("divPublicidad").style.visibility="hidden";
   }        
}
        
function activarPublicidad() 
{
    panelPublicidad(true);
    timer_publicidad = setTimeout("desactivarPublicidad()", 6500);
}
        
        
function desactivarPublicidad() 
{
     if (timer_publicidad) {
         clearTimeout(timer_publicidad);
         timer_publicidad  = 0;
      }
      panelPublicidad(false);
}


function abrir_nueva_()
{
    this.url = "";
    
    this.execu = function () {
        window.open(this.url,'ResA');
    }


}

/*function abrir_nueva(){ window.open('<%=BookingEngine.canal.canalDefecto.UrlBase%>reservaG','ResA'); }*/

function abrirPopUp(url){ window.open(url,"NW" + Date().tostring,"resizable=yes,menubars=no,toolbars=no,status=no,scrollbars=yes,width=650,height=580,left=50,top=50"); }

function mostrarCesta()
{
	var fcs = document.getElementById("CalFrameCesta");
	var cs = document.getElementById("cesta");
	if (cs.style.display=="none"){
		cs.style.display="";
		document.getElementById("CalFrameCesta").style.width=document.getElementById("cesta").clientWidth;
		document.getElementById("CalFrameCesta").style.height=document.getElementById("cesta").clientHeight;
		document.getElementById("CalFrameCesta").style.left=document.getElementById("cesta").style.left;
		document.getElementById("CalFrameCesta").style.top=document.getElementById("cesta").style.top;
		fcs.style.display="";
	
	}else{
		fcs.style.display="none";
		cs.style.display="none";
	}
}
        
function cancelarCesta(url){if (confirm("Esta acción cancelará su cesta de la compra actual, ¿desea continuar?")){ window.location.href="/home/cancelarCesta.aspx?urlSalida="+url; }}

function mostrarObj(id){ var objGet = document.getElementById(id); objGet.style.display = "block"; objGet.style.visibility = "visible"; }

function ocultarObj(id){ var objGet = document.getElementById(id); objGet.style.display = "none"; objGet.style.visibility = "hidden"; }


function jsCheckLoc_()
{
    this.url = '';
    
    this.execu = function () {
            var localizador = document.getElementById('ResLoca');
            var emailCliente = document.getElementById('ResMail');
            if (localizador.value != "" && emailCliente.value != "" ){
                this.url += "&ResLoca="+ localizador.value;
                this.url += "&ResMail="+ emailCliente.value;
                window.location.href = this.url;
            }else{ alert("Faltan campos para localizar su reserva");
            }
   }
}


/*function jsCheckLoc(){
    var url;
    var localizador = document.getElementById('ResLoca');
    var emailCliente = document.getElementById('ResMail')
    if (localizador.value != "" && emailCliente.value != "" ){
        url  = "<%=SSLserverRoot()%>reserve/check.aspx?accion=check";
        url += "&ResLoca="+ localizador.value;
        url += "&ResMail="+ emailCliente.value;
        window.location.href = url;
     }else{ alert("Faltan campos para localizar su reserva"); }
}*/

  
function subscribirse_() {
  this.idioma = '';
  this.url = '';
  
  this.execu = function() {
        if (!isEml(document.getElementById("subsEmail").value)){
	        if(this.idioma == 'es') alert("Por favor, revise su correo electrónico.");
	        else if (this.idioma == 'en') alert("Please, review your e-mail.");			        
	    }else{
	        window.open(this.url + "&nomCon="+document.getElementById("subsNombre").value+"&mailCon="+escape(document.getElementById("subsEmail").value)+"&idioma=" + this.idioma,"","width=200,height=60,resizable=no,menubar=no,scrollbars=no,screenX=400,screenY=300'");
	    }
	    return false; 
    }
}

    
/*function subscribirse(){
	if (!isEml(document.getElementById("subsEmail").value)){
	var idioma = '<%=Juniper.Internacional.Idioma.idioma%>';
	if(idioma == 'es') alert("Por favor, revise su correo electrónico.");
	else if (idioma == 'en') alert("Please, review your e-mail.");			        
	}else{
	     window.open("http://<%=System.Configuration.ConfigurationManager.appsettings("Mailing.url")%>/public/insertarContacto.aspx?idUsu=<%=System.Configuration.ConfigurationManager.appsettings("Mailing.Usuario")%>&idCat=<%=System.Configuration.ConfigurationManager.appsettings("Mailing.CatOferta")%>&nomCon="+document.getElementById("subsNombre").value+"&mailCon="+escape(document.getElementById("subsEmail").value)+"&idioma=<%=Juniper.Internacional.Idioma.idioma%>","","width=200,height=60,resizable=no,menubar=no,scrollbars=no,screenX=400,screenY=300'");
	}
	return false;
} */



function InitialLoading(mensajeDestinos, mensajePropuestas) 
{
	var so05 = new SWFObject("/images/flash/propuestas.swf", "fnuestrasPropuestas1", "100%", "34", "8", "#fff");
	so05.addVariable("texto", mensajeDestinos);
	so05.addVariable("urldestino", "/home/");
	so05.addParam("wmode", "transparent");
	so05.write("DestinosRecomendados");
    		   
	var so05 = new SWFObject("/images/flash/propuestas.swf", "fnuestrasPropuestas2", "100%", "34", "8", "#fff");		    
	so05.addVariable("texto", mensajePropuestas);
	so05.addVariable("urldestino", "/home/");
	so05.addParam("wmode", "transparent");
	so05.write("nuestrasPropuestas");

    		  
}
    		
		   
function cambiarIdioma(p_idioma)
{

	var v_search = window.location.search;
	if(v_search.indexOf('?')==0){ v_search = v_search.substring(1,v_search.length); }
	var v_aux = "?";
	var v_params = v_search.split('&');
	for(var i = 0; i < v_params.length; i++)
	{
		if (v_params[i].indexOf("idioma=")>-1){ continue; }
		if (v_params[i] != ""){ v_aux += v_params[i]+"&"; }
	}
	window.location.search = v_aux + "idioma=" + p_idioma;			    
    		     
}
