﻿// Archivo JScript
/*************************************************************/
/* Rollover Menú Principal - Cambio de imagenes              */
/*************************************************************/

if (document.images) {            // Imagenes Activas
    home_on = new Image();
    home_on.src = "../img/ico_home_naranja_epay.gif";
    contacto_on = new Image();
    contacto_on.src = "../img/ico_contacto_naranja_epay.gif";
    localiza_on = new Image();
    localiza_on.src = "../img/ico_localiza_naranja_epay.gif";
    print_on = new Image();
    print_on.src = "../img/ico_print_naranja_epay.gif";

    transacciones_on = new Image();
    transacciones_on.src = "../img/ico_transacciones_gris.gif";
    consultas_on = new Image();
    consultas_on.src = "../img/ico_consultas_gris.gif";
	
                                // Imagenes Apagadas
    home_off = new Image(); 
    home_off.src = "../img/ico_home_gris.gif";
    contacto_off = new Image();
    contacto_off.src = "../img/ico_contacto_gris.gif";
    localiza_off = new Image();
    localiza_off.src = "../img/ico_localiza_gris.gif";
    print_off = new Image();
    print_off.src = "../img/ico_print_gris.gif";
    
    transacciones_off = new Image();
    transacciones_off.src = "../img/ico_transacciones_naranja_epay.gif";
    consultas_off = new Image();
    consultas_off.src = "../img/ico_consultas_naranja_epay.gif";
}
    
function imgBannerPromocion(){ 
    // Número de banners para la home en Array
    nBannerHome = 2;

    aBannersHome = new Array (
        "promos/ep_home_paysafecard.gif",
        "promos/ep_home_lebara.gif"
    );
    
    aBannersHomeLinks = new Array (
        "textos.aspx?idSc=23",
        "textos.aspx?idSc=20"
    );
    
    // Genera un número aleatorio entre nInferior y nSuperior (ambos incluidos)
    var nInferior = 0;
    var nSuperior = (nBannerHome -1);
    
	nRnd = Math.random() * (nSuperior - nInferior);
	nRnd = Math.round(nRnd);
	iBanner = parseInt(nInferior) + nRnd;
	
	var sHtml = '';
	
    sHtml+= '<a href="' + aBannersHomeLinks[iBanner] + '" alt="Promoción">';
	sHtml+= '<img src="../img/' + aBannersHome[iBanner] + '" alt="Promoción" border="0">';
    sHtml+= '</a>';
	
	document.write(sHtml);
} 

// Function 'activa' images.
function imgOn(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "_on.src");
    }
}

// Function to 'desactiva' images.
function imgOff(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "_off.src");
    }
}

function abrirVentana(tipo) {
	var ancho=700, alto=500;
	
	if (tipo == "mapaOfi"){
		sUrl = "win_mapa_oficina.html";
	} else if (tipo == "avisoMail"){
		ancho=420, alto=235;
		sUrl = "win_legal_mail.html";
	}
	
	ventana = open(sUrl,'Window','width='+ancho+',height='+alto+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no');
	ventana.focus();
}

