


/*
.........................
:: funciones ::
.........................
*/


var ventana = null;

function cerrarVentana()
{
     if (ventana != null)
     {
         ventana.close();
     }
}


function cardOn(theCard, theImg){
	document.getElementById(theCard).innerHTML="<img src='"+theImg+"' width='109' height='69'/>";
	}
	
function cardOff(theCard, theImg){
	document.getElementById(theCard).innerHTML="<img src='"+theImg+"' width='109' height='69'/>";
	}
	

function fejemplo() 
{
	wncet = window.open("http://www.cajaespana.es/ejemplo_mobipay.htm","Codigo1","scrollbars=0,channelmode=0,resizable=0,fullscreen=0,location=0,border=0,directories=0,menubar=0,toolbar=0,statusbar=0,width=780,height=450,screenX=5,screenY=5");
	wncet.focus();
}
function ejemplo(url){
		var w=780;
		var h=460;
		var winL = (screen.width - (w+10)) / 2;
		var winA = (screen.height - (h+60)) / 2;
		winprops = 'height='+h+',width='+w+',top='+winA+',left='+winL+',status=no,toolbar=no,menubar=no,location=no,noresizable';
		ventana = window.open(url,"CMA", winprops);
	}

function PrintThisPage(nombreCapa) 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=no,resizable=no,Titlebar=no"; 
   sOption+="scrollbars=no,width=1,height=1,left=10,top=0"; 
   
   var sWinHTML

   sWinHTML = eval("document.getElementById('" + nombreCapa + "').innerHTML");

   sWinHTML=sWinHTML.split("<A").join("<B");
   sWinHTML=sWinHTML.split("</A>").join("</B>");

   sWinHTML=sWinHTML.split("<a").join("<b");
   sWinHTML=sWinHTML.split("</a>").join("</b>");

   sWinHTML=sWinHTML.split("<!--imprimir-->").join("<!--");
   sWinHTML=sWinHTML.split("<!--finimprimir-->").join("-->");



   var winprint=window.open("","CMA",sOption); 
   winprint.document.open();

   winprint.document.write("<html><head><title>Imprimir</title><LINK href='/corporativo/estilos/NWcajaespanaCorporativo.css' rel='Stylesheet'><style>.content {position: relative; width: 632px; border: none; margin: 5 5 5 0px;} .innerLimiter {position: relative; width: 632; border: none; margin: 5 5 5 0px;}</style></head><body>"); 
   winprint.document.write("<div id='innerContentImprimir'>");
   winprint.document.write(sWinHTML);
   winprint.document.write("</div>");
   winprint.document.write('</body></html>'); 
   winprint.document.close(); 
   winprint.focus(); 
   winprint.print();
   winprint.close();
   
}



function leadingZero(nr)
{
	if (nr < 10) nr = "0" + nr;
	return nr;
}


function popup(url,ancho,alto)
{
		var w=ancho;
		var h=alto;
		var winL = (screen.width - (w+10)) / 2;
		var winA = (screen.height - (h+60)) / 2;
		winprops = 'height='+h+',width='+w+',top='+winA+',left='+winL+',status=no,toolbar=no,menubar=no,location=no,noresizable,scrollbars=yes';
		ventana = window.open(url,"CMA", winprops);
}

function popupRegalo(url,ancho,alto)
{
		var w=ancho;
		var h=alto;
		var winL = (screen.width - (w+10)) / 2;
		var winA = (screen.height - (h+60)) / 2;
		winprops = 'height='+h+',width='+w+',top='+winA+',left='+winL+',status=no,toolbar=no,menubar=no,location=no,noresizable,scrollbars=no';
		ventana = window.open(url,"CMA", winprops);
}

function fecha()
{
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
	   year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
	   daym="0"+daym

	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
	var montharray=new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre")
                document.write(dayarray[day]+", "+daym+" de "+montharray[month]+" de "+year)

}

function activarCapa(capa)
{
      document.getElementById("capaparticulares").style.visibility = "hidden";
      document.getElementById("capainfocajaesp").style.visibility = "hidden";			
      document.getElementById("capainfoinversores").style.visibility = "hidden";
      document.getElementById("capaempresas").style.visibility = "hidden";
      document.getElementById("capapromociones").style.visibility = "hidden";
      document.getElementById(capa).style.visibility = "visible";
}

/* *** INICIO Manejo de Cookies para Personalizacion de navegacion. *** */
    function SetCook(nomb,valor,expir)
    {
        document.cookie=nomb + '=' + escape(valor) + ((expir==null) ? "" : (";expires="+expir.toGMTString())) + "; path=/" ;
        return true;
    }//Fin SetCook

    function GetCook(nomb)
    {
        if(document.cookie.length>0)
        {
            var busc=nomb+"=";
            offset=document.cookie.indexOf(busc);
            if(offset !=-1)
            {
                offset+=busc.length;
                end=document.cookie.indexOf(";",offset);
                if(end==-1)
                    end=document.cookie.length;
                return unescape(document.cookie.substring(offset,end));
            }
        }
        return '';
    }//Fin GetCook
    
    function DelCook(nom, path, domain)
    {
        if (GetCook(nom))
        {
            document.cookie = nom + "=" + "; path=/"+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    }    

    function RecuerdaNavegacion()
    {
        var valCook=GetCook('CajaEspanaEsNavegacion');
        var hoy=new Date();
        var expires=new Date();
        valCook=document.location;
        expires.setTime(hoy.getTime() + 1000*60*24*365);
        SetCook('CajaEspanaEsNavegacion',valCook,expires);
    }//Fin RecuerdaNavegacion()

    function NavegaUltimoVisitado(swReferer)
    {
        var valCook=GetCook('CajaEspanaEsNavegacion');
        alert(valCook);
        if(valCook!='')
        {
            if(valCook!=document.location)
            {
                if(!swReferer)
                    document.location=valCook;
            }
        }
    }//Fin NavegaUltimoVisitado()
/* *** FIN Manejo de Cookies para Personalizacion de navegacion. *** */
/* *** FUNCION movida de la plantilla de páqina del Portada Corporativo (ARG0902) *** */
function swapImage(obj)
{
    var aux=obj.src;
    obj.src=obj.lowsrc;
    obj.lowsrc=aux;
}