﻿//<%--Hace peticion HTTP a Anuncio.aspx para logar--%>
function LogTagAnt(type, ref) 
{
    // LLAMAR A LAS NUEVAS ESTADISTICAS
    return true;
}

//<%--Hace peticion HTTP a ServiciosInfo.aspx para logar--%>
function LogTag(type, ref) 
{
    // LLAMAR A LAS NUEVAS ESTADISTICAS
    return true;
}

//<%--loga agendize guardar --%>
function jinfoqformulario(ref) {
    if (ref.length > 0) { LogTag("ISFSE", ref); }
}

//<%--loga agendize guardar --%>
function jinfoqformularioMplus(ref) {
   
    if (ref.length > 0) { LogTag("MPFSE", ref); }
}

//<%--loga nueva pagina --%>
function jinfoqpagina(ref) {
    if (ref.length > 0) { LogTag("IS", ref); }
}

//<%--loga nueva pagina del MPLUS Nuevo--%>
function jinfoqpaginaMplus(ref) {
    if (ref.length > 0) { LogTag("MP", ref); }
}

//<%--logar booking  --%>
function jinfoqbooking(ref) {
    if (ref.length > 0) 
        { LogTag("ISBK", ref); }
}

//<%--logar booking  --%>
function jinfoqbookingMplus(ref) {
    if (ref.length > 0) 
        { LogTag("MPBK", ref); }
}

//<%--logar Hojear QDQ Guia Util  --%>
function jinfoplus_HojearGuia(ref) {
    if (ref.length > 0) 
        { LogTag("MPGU", ref); }
}


//<%--logar powered by qdq  --%>
function jinfoqpowered (type,ref) {
    if (ref.length > 0) 
        { LogTag(type,ref); }
}

function jinfoplus_imprimir(ref) {
    if (ref.length > 0) {
        LogTag("ISIM", ref);
        jinfoqpagina(ref);
    }
}

function jinfoplus_imprimirMplus(ref) {
    
    if (ref.length > 0) {
       
        LogTag("MPIM", ref);
        jinfoqpaginaMplus(ref);
    }
}

//<%--loga agendize guardar --%>
function jinfoqguardar(ref) {
    if (ref.length > 0) { LogTag("ISSA", ref); }
}

//<%--loga agendize guardar --%>
function jinfoqguardarMplus(ref) {
    if (ref.length > 0) { LogTag("MPSA", ref); }
}

//<%--loga agendize enviar --%>
function jinfoqenviar(ref) {
    if (ref.length > 0) { LogTag("ISSE", ref); }
}

//<%--loga agendize enviar --%>
function jinfoqenviarMplus(ref) {
    if (ref.length > 0) { LogTag("MPSE", ref); }
}

function jinfoqllamada(ref) {
    if (ref.length > 0) {
    	sendTag2('es','ISLG',ref);
        //LogTag("ISLG", ref);
    }
}

function jinfoqllamadaMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPLG", ref);
    }
}

//<%--loga favorito --%>
function jinfoqfavorito(ref) {
    if (ref.length > 0) {
        LogTag("ISFA", ref);
    }
}

//<%--loga favorito --%>
function jinfoqfavoritoMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPFA", ref);
    }
}

//<%--loga email --%>
function jinfoqemail(ref) {
    if (ref.length > 0) {
        LogTag("ISEM", ref);
    }
}

//<%--loga email --%>
function jinfoqemailMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPEM", ref);
    }
}

//<%--loga web --%>
function jinfoqWebClient(ref) {
    if (ref.length > 0) {
        LogTag("ISWC", ref);
    }
}

//<%--loga web --%>
function jinfoqWebClientMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPWC", ref);
    }
}

//<%--Mainmenu logging--%>
function jLogNav(type,ref) {
	LogTag(type,ref);
	return false;
}

function jLogServicio(type,ref) {
	LogTag(type,ref);
	return true;
}

//<%--loga foto --%>
function jinfoqfoto(ref) {
    if (ref.length > 0) {
        LogTag("ISLFO", ref);
    }
}

//<%--loga foto --%>
function jinfoqfotoMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPLFO", ref);
    }
}

//<%--loga foto --%>
function jinfoqfotoMplusPeq(ref) {
    if (ref.length > 0) {
        LogTag("MPFO", ref);
    }
}

//<%--loga foto --%>
function jinfoqfoto360(ref) {
    if (ref.length > 0) {
        LogTag("ISL360", ref);
    }
}

//<%--loga foto --%>
function jinfoqfoto360Mplus(ref) {
    if (ref.length > 0) {
        LogTag("MPL360", ref);
    }
}

//<%--loga foto --%>
function jinfoqfoto360MplusPeq(ref) {
    if (ref.length > 0) {
        LogTag("MP360", ref);
    }
}

//<%--loga itinerario --%>
function jinfoqitinerario(ref) {
    if (ref.length > 0) {
        LogTag("ISLIT", ref);
    }
}

//<%--loga itinerario --%>
function jinfoqitinerarioMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPLIT", ref);
    }
}

function jinfoqitinerarioMplusPeq(ref) {
    if (ref.length > 0) {
        LogTag("MPIT", ref);
    }
}

//<%--loga 3d --%>
function jinfoqvista3d(ref) {
    if (ref.length > 0) {
        LogTag("ISL3D", ref);
    }
}

//<%--loga 3d --%>
function jinfoqvista3dMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPL3D", ref);
    }
}

function jinfoqvista3dMplusPeq(ref) {
    if (ref.length > 0) {
        LogTag("MP3D", ref);
    }
}

//<%--loga mapa --%>
function jinfoqmapa(ref) {
    if (ref.length > 0) {
        LogTag("ISLMA", ref);
    }
}

//<%--loga mapa --%>
function jinfoqmapaMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPLMA", ref);
    }
}

function jinfoqmapaMplusPeq(ref) {
    if (ref.length > 0) {
        LogTag("MPMA", ref);
    }
}

//<%--loga foto Pequeña--%>
function jinfoqfotoPeq(ref) {
    if (ref.length > 0) {
        LogTag("ISSFO", ref);
    }
}

//<%--loga foto Pequeña--%>
function jinfoqfoto360Peq(ref) {
    if (ref.length > 0) {
        LogTag("ISS360", ref);
    }
}

//<%--loga itinerario Pequeña --%>
function jinfoqitinerarioPeq(ref) {
    if (ref.length > 0) {
        LogTag("ISSIT", ref);
    }
}

//<%--loga 3d Pequeña--%>
function jinfoqvista3dPeq(ref) {
    if (ref.length > 0) {
        LogTag("ISS3D", ref);
    }
}

//<%--loga mapa Pequeña--%>
function jinfoqmapaPeq(ref) {
    if (ref.length > 0) {
        LogTag("ISSMA", ref);
    }
}


//<%--loga facebook --%>
function jinfoqfacebook(ref) {
    if (ref.length > 0) {
        LogTag("ISNFR", ref);
    }
}

//<%--loga facebook --%>
function jinfoqfacebookMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPNFR", ref);
    }
}

//<%--loga delicious --%>
function jinfoqdelicious(ref) {
    if (ref.length > 0) {
        LogTag("ISNDE", ref);
    }
}

//<%--loga delicious --%>
function jinfoqdeliciousMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPNDE", ref);
    }
}

//<%--loga twitter--%>
function jinfoqtwitter(ref) {
    if (ref.length > 0) {
        LogTag("ISNTW", ref);
    }
}

//<%--loga twitter--%>
function jinfoqtwitterMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPNTW", ref);
    }
}

//<%--loga google Buzz--%>
function jinfoqBuzz(ref) {
    if (ref.length > 0) {
        LogTag("ISNBZ", ref);
    }
}

//<%--loga google Buzz--%>
function jinfoqBuzzMplus(ref) {
    if (ref.length > 0) {
        LogTag("MPNBZ", ref);
    }
}


function CambiarIdioma(cliente, estilo)
{
     var page=document.location.pathname;
     var comboValue
     var sel= document.getElementById('CBidioma');
     var selIndex = sel.selectedIndex;
     comboValue = sel.options[selIndex].value;

    if ((document.domain.indexOf("infoplusec.qdq.com") != -1) ||(document.domain.indexOf("infoplus.qdq.com") != -1) || (document.domain.indexOf("infoqdq") != -1) ||
        (document.domain.indexOf("qdqinfo") != -1) || (document.domain.indexOf("qdqplus") != -1)||
        (document.domain.indexOf("desinfo.qdq.com") != -1))
        {
        document.location.href= '/' + cliente + comboValue + '/inicio/' ;
        }
        else
        {
        document.location.href= '/' + cliente + comboValue + '/inicio/' ;
        }
    
 }
 
function CambiarIdiomaModal(cliente, estilo)
{
     var page=document.location.pathname;
     var comboValue
     var sel= document.getElementById('CBidioma');
     var selIndex = sel.selectedIndex;
     comboValue = sel.options[selIndex].value;
        
    if ((document.domain.indexOf("infoplus.qdq.com") != -1) || (document.domain.indexOf("infoqdq") != -1) ||
        (document.domain.indexOf("qdqinfo") != -1) || (document.domain.indexOf("qdqplus") != -1)||
        (document.domain.indexOf("desinfo.qdq.com") != -1))
        {
        document.location.href= '/MP/' + cliente + '/' + comboValue + '/presentacion/' ;
        }
        else
        {
        document.location.href= '/MP/' + cliente + '/' + comboValue + '/presentacion/' ;
        }
    
 }
 
 function CambiarIdiomaModalProducto(cliente, prod, estilo)
{
     var page=document.location.pathname;
     var comboValue
     var sel= document.getElementById('CBidioma');
     var selIndex = sel.selectedIndex;
     comboValue = sel.options[selIndex].value;
        
    if ((document.domain.indexOf("infoplus.qdq.com") != -1) || (document.domain.indexOf("infoqdq") != -1) ||
        (document.domain.indexOf("qdqinfo") != -1) || (document.domain.indexOf("qdqplus") != -1)||
        (document.domain.indexOf("desinfo.qdq.com") != -1))
        {
        document.location.href= '/MP/' + cliente + '/PROD/' + prod + '/' + comboValue + '/presentacion/' ;
        }
        else
        {
        document.location.href= '/MP/' + cliente + '/PROD/' + prod + '/' + comboValue + '/presentacion/' ;
        }
    
 }

//<%--loga proximidad --%>
function jinfoqproximidad2(ref,url,prov,mun,calle,num) {
    if (ref.length > 0) {
        LogTag("ISLPR", ref);
    }
    
    var strUrl = '';
    strUrl = url;
    mun = mun.replace('/','\%');
    //<%-- mun = replaceAll(mun,"/","%");--%>
    calle = calle.replace('.','');
    if (num != '') num = num.replace('.','');
    //<%-- escape() function para escapar --%>
    strUrl += "/" + escape(jlimpacampominus(prov));
    strUrl += "/" + escape(jlimpacampominus(mun));
    strUrl += "/" + escape(jlimpacampominus(calle));
    if (num != '') strUrl += "/" + escape(jlimpacampominus(num));
    strUrl += "/";
    //location.href = strUrl;
    window.open(strUrl,'_blank');
    return true;
}

//<%--loga proximidad --%>
function jinfoqproximidad2Peq(ref,url,prov,mun,calle,num) {
    if (ref.length > 0) {
        LogTag("ISSPR", ref);
    }
    
    var strUrl = '';
    strUrl = url;
    mun = mun.replace('/','\%');
    //<%-- mun = replaceAll(mun,"/","%");--%>
    calle = calle.replace('.','');
    if (num != '') num = num.replace('.','');
    //<%-- escape() function para escapar --%>
    strUrl += "/" + escape(jlimpacampominus(prov));
    strUrl += "/" + escape(jlimpacampominus(mun));
    strUrl += "/" + escape(jlimpacampominus(calle));
    if (num != '') strUrl += "/" + escape(jlimpacampominus(num));
    strUrl += "/";
    //location.href = strUrl;
    window.open(strUrl,'_blank');
    return true;
}

function jinfocallejero(ref,url,prov,mun,coordx,coordy,calle,num,lang)
{
    if (ref.length > 0) {
    	sendTag2(lang, "ISSPR", ref);
    }
    
    var strUrl = '';
    strUrl = url;
    mun = mun.replace('/','\%');
    //<%-- mun = replaceAll(mun,"/","%");--%>
    calle = calle.replace('.','');
    if (num != '') num = num.replace('.','');
    //<%-- escape() function para escapar --%>
    strUrl += "/" + escape(jlimpacampominus(prov));
    strUrl += "/" + escape(jlimpacampominus(mun));
    strUrl += "/x/" + escape(coordx);
    strUrl += "/y/" + escape(coordy);
    strUrl += "/calle/" + escape(jlimpacampominus(calle));
    if (num != '') strUrl += "/num/" + escape(jlimpacampominus(num));
    strUrl += "/pais/034/";
    //location.href = strUrl;
    window.open(strUrl,'_blank');
    return true;
}
/*<%--SE USA la de jlibip
function jlimpacampominus(strin) 
{
    var str1conv='ÁÀÃÂÄáàãâäÉÈÊËéèêëÌÍÎÏìíîïÒÓÔÕÖòóôõöÙÚÜÛÇÑùúüûçñ;:.\\"[](){}<>!&^%$#`\'?/-';
    var str2conv='AAAAAaaaaaEEEEeeeeIIIIiiiiOOOOOoooooUUUUCNuuuucn                          ';
    var strout='';
    
    for	(i=0; i < strin.length; i++) 
    {
        j=str1conv.indexOf(strin.charAt(i));
        if (j==-1) 
            strout=strout+strin.charAt(i);
        else 
            strout=strout+str2conv.charAt(j);
    }
    return (strout);
}--%>*/

//<%--Abre en una ventana la url mandada--%>

function Janela_Centro(pagina, nome, w, h, scroll) {

    if (screen.width > w) {var winl = (screen.width - w) / 2;}
    else {var winl = 0;}
    
    if (screen.height > h) {var wint = (screen.height - h) / 2;}
    else {var wint = 0;}

    wint-=20;
    if (wint<0) {wint=0;}
    winprops = 'toolbar=no,menubar=no,location=no,'+'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
    try
    {
        win = this.open(pagina, nome, winprops);
    }
    catch(e){}

    try
    {
        if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }
    catch(e){}
}

function Janela_Centro_Full(pagina,nome,w,h,scroll) {
    if (screen.width > w) {var winl = (screen.width - w) / 2;}
    else {var winl = 0;}

    if (screen.height > h) {var wint = (screen.height - h) / 2;}
    else {var wint = 0;}

    wint-=20;
    if (wint<0) {wint=0;}
    winprops = 'toolbar=yes,menubar=no,location=yes,'+'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

    try
    {
      win = this.open(pagina, nome, winprops);
    }
    catch(e){}

    try
    {
      if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }
    catch(e){}
}
function replaceAll_X(cadena, valor, valor_nuevo) {
	 while(cadena.indexOf(valor) >= 0) {
	 	cadena = cadena.replace(valor, valor_nuevo); 
	} 
	return cadena; 
}
