<!--
// E2242 - Muestra pantalla con 3 frames
var wName="";
if (window.name!="") wName=window.name.toLowerCase();
if(window==top && wName!="ccmain" && wName!="pop" && wName.indexOf("pop")==-1 && wName!="pdf" && wName.indexOf("minisite")==-1 && wName!="general" && wName!="obrasocial" && wName!="tarifes" && wName!="seguretat" && wName!="seguridad" && wName!="avisolegal" &&
  (location.href.indexOf("/caixacat/")!=-1 || location.href.indexOf("/CDA/")!=-1) &&
  location.href.indexOf("redirect.html")==-1 && location.href.indexOf("/CMA/")==-1 && location.href.indexOf("/CMA2/")==-1 && location.href.indexOf("flow.jsp")==-1)
	top.location.replace("/CDA/caixacat/redirect.html?link="+location.href);

var undefined;
var openerWindow=window;

function getOpenerWindow() {
	if (window.opener && window.opener != undefined && window.opener.closed==false && window.opener.top && window.opener.top != undefined)	{
		openerWindow = window.opener.top;
	}
}		

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
        if (winName == 'General' || winName == 'ObraSocial')//Incluye webMail, Ahorro, Ascat y Telentradas
        {
			if(parent.ccmenupub.windowGeneral && !parent.ccmenupub.windowGeneral.closed)
				parent.ccmenupub.windowGeneral.close();
			if (features != "")
				parent.ccmenupub.windowGeneral=window.open(theURL,'General','toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=550,height=320,left=170,top=110,alwaysRaised=yes');
			else if (winName == 'ObraSocial')//features esta vacio para ObraSocial y contratacion e-compte
				parent.ccmenupub.windowGeneral=window.open(theURL,'General','width=790,height=540,left=0,top=0,xscreen=0,yscreen=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0,alwaysRaised=1');
			else  //Contratacion e-compte
			{
				//parent.ccmenupub.windowGeneral=window.open(theURL,'General','scrollbars=yes,width=630,height=361,left=161,top=183,resizable=yes,alwaysRaised=yes');
				widthGeneral='650';
				heightGeneral='420';

				if (window.screen) {
					leftGeneral = (screen.availWidth - widthGeneral)/2;
					topGeneral = (screen.availHeight - heightGeneral)/2;
				}
				else
				{
					leftGeneral='75';
					topGeneral='60';
				}
				parent.ccmenupub.windowGeneral=window.open(theURL,'General','scrollbars=yes,resizable=yes,width='+widthGeneral+',height='+heightGeneral+',left='+leftGeneral+',top='+topGeneral+',alwaysRaised=yes');
			}
			parent.ccmenupub.windowGeneral.focus();
       }
       else if (winName == 'pop' || winName == 'Pdf')//pop-ups
       {
			if(parent.ccmenupub.windowPopUp && !parent.ccmenupub.windowPopUp.closed)
				parent.ccmenupub.windowPopUp.close();
			parent.ccmenupub.windowPopUp=window.open(theURL,'pop','scrollbars=yes,resizable=yes,width=550,height=320,left=170,top=110,alwaysRaised=yes');
			parent.ccmenupub.windowPopUp.focus();
       }
       else if (winName == 'ccmain')//pop-ups
       {
       		if (openerWindow && openerWindow!=undefined && openerWindow.closed==false){
				openerWindow.location.href=theURL;
				openerWindow.focus();
       		} else {
				 var newWin=window.open(theURL,'CaixaCatalunya','');
				 newWin.focus();
			}
       }
       else
            window.open(theURL,winName,features);

}

var openertop;
function obreWP(theURL) {
	try {
		if(!openertop) {
			if(top && top.opener && top.opener.top) {
				openertop=top.opener.top;
			}
		}
		var x = openertop.location.href;
		openertop.location.href=theURL;
		openertop.focus();
	} catch (Ex) {
 		var newWin=window.open(theURL,'CaixaCatalunya','');
 		newWin.focus();
	}
}

function ocultarCapa(strCpa, doc) {
	if(!doc)
		cpa = MM_findObj(strCpa)
	else
		cpa = MM_findObj(strCpa, doc)
	if(document.layers)
		cpa.visibility = 'hide';
	else
		cpa.style.visibility = 'hidden';
}

function ocultar(idx) {

	if (document.all) {for (var i in document.links) document.links[i].onfocus = document.links[i].blur}
	switch(idx) {
		case 1:	ocultarCapa('cpaIdiom');
				ocultarCapa('cpaIdiom1?ccup','ccup');
			break;
		case 2:
				ocultarCapa('cpaCont2');
				ocultarCapa('cpaCont1?ccup','ccup');
			break;
	}
}

function ocultarTodas(){
	ocultar(parent.cpaVis);
	cpaVis='';
	parent.cpaVis='';
	ocultarCapa('cpaTruco');
}
function mustPreload()
{
	if(navigator.appName=="Microsoft Internet Explorer" && navigator.userAgent.indexOf("Mac")!=-1)
		return false;
	else if(navigator.userAgent.indexOf('MSIE 4.0')!=-1)
		return false;
	else
		return parent.ccmain!=undefined && top.frames.ccmain==self && parent.libsCCOn!=undefined && parent.ccup!=undefined;
}
if(mustPreload())
{
	window.onunload=stopPreload;
	window.onblur=stopPreload;
}
function stopPreload()
{
	if(mustPreload()&&parent.libsCCOn.stop!=undefined)
		parent.libsCCOn.stop();
	return false;
}
function startPreload()
{
	if(mustPreload()&&parent.ccup.preloaded!=true&&parent.libsCCOn.prepa==true&&parent.libsCCOn.start!=undefined)
			parent.libsCCOn.start();
	return false;
}
function navegador_homologat() {
	var agt = navigator.userAgent.toLowerCase();

	var isWin=(agt.indexOf('win')!=-1);	// Windows
	var isMac=(agt.indexOf('mac')!=-1);	// Mac
	var isGecko=(agt.indexOf('gecko')!=-1) && (agt.indexOf('6.2')!=-1);	// Netscape 6.2
	if(!isWin && !isMac) {	// NO ES NI WINDOWS NI MAC
		return false;
	}

	if(isWin) {	// WINDOWS
		if(isGecko) {		// NETSCAPE 6
			return true;
		}
		if(agt.indexOf('msie')!=-1 && agt.indexOf('opera')<0) {	// QUALSEVOL VERSIO EXPLORER ADMESA
			return true;
		} else 	if(agt.indexOf('mozilla')!=-1) {	// VERSIONS NETSCAPE: 4.06 / 4.51 / 4.73 / 4.76
			return ((agt.indexOf('4.06')!=-1) || (agt.indexOf('4.51')!=-1) || (agt.indexOf('4.73')!=-1) || (agt.indexOf('4.76')!=-1));

		}
	} else { 	// MAC
		if(agt.indexOf('ie')!=-1 && agt.indexOf('5.0')!=-1) {	// NOMES IE VERSIO 5.0
			return true;
		} else if(agt.indexOf('mozilla')!=-1 && agt.indexOf('4.77')!=-1) { // NOMES NS VERSIO 4.77
			return true;

		}
	}
	return false; 		// QUALSEVOL ALTRE CAS
}

function pintaPiePagina() {
	document.write('<!-- PiePagina - INI -->');
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr align="center">');
	document.write('	<td><img src="/caixacat/eng/ccpublic/img_comun/form_shadow01.gif" alt="separator" width="589" height="6"></td>');
	document.write('</tr>');
	document.write('<tr align="center">');
	document.write('	<td align="center" class=ccpeu>');
	//document.write('		<a href="/caixacat/eng/ccpublic/contacte.htm" target="ccmain"><img src="/caixacat/eng/ccpublic/img_comun/bn_lineat2b.gif" alt="Contact" width="121" height="27" align="right" border="0" hspace="20" vspace="4"></a>');
	document.write('		<a href="javascript:;" onClick="MM_openBrWindow(\'/caixacat/eng/ccpublic/avisolegal.htm\',\'avisolegal\',\'scrollbars=yes,width=400,height=320\')">Legal notice&nbsp;</a>');
	document.write('		<a href="/caixacat/eng/ccpublic/seguretat/seg_online.htm">&nbsp;-&nbsp;&nbsp;Security&nbsp;</a>');
	document.write('		<a href="javascript:;" onClick="MM_openBrWindow(\'/caixacat/eng/ccpublic/tarif_comi.htm\',\'Tarifes\',\'scrollbars=yes,width=510,height=300\')">-&nbsp;&nbsp;Table of notices and rates</a>');
	document.write('	</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('<!-- PiePagina - FIN -->');

	// Petició H1699 - Marcadors
	document.write('<scr'+'ipt language="JavaScript" src="/caixacat/js/marcadors.js"></scr'+'ipt>');
}

var windowAnekis;
function openAnekis(){
	var idioma = "en_UK";
	var ori = "ptplus";
	var link = "https://www.caixacatalunya.anekis.biz/CCAT/web/Init.do?cc_lang="+idioma;

	var url = "/caixacat/bn_promo.htm?idioma="+idioma+"&origen"+ori+"=&link="+link;

	if(windowAnekis && !windowAnekis.closed){
		windowAnekis.close();
	}
	windowAnekis=window.open(url,'anekis','toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=550,height=320,left=170,top=110,alwaysRaised=yes');
}

var windowInfoEmpresa;
function infoEmpresa(){
	var idioma = "en_UK";
	var ori = "infohome";
	var link = "https://www.caixacatalunya.es/NASApp/ceconline/flow.jsp%3Fsource%3Dwebpublic%26destination%3DJBIVSubscripcionNewsEmpresasE.jsp%26lang%3D"+idioma+"%26typebrowser%3DIE";

	var url = "/caixacat/bn_promo.htm?idioma="+idioma+"&origen="+ori+"&link="+link;
	
	if(windowInfoEmpresa && !windowInfoEmpresa.closed){
		windowInfoEmpresa.close();
	}
	windowInfoEmpresa=window.open(url,'infoEmpresa','scrollbars=yes,resizable=yes,width=620,height=400,alwaysRaised=yes');
}

function pintaflash (plugin, strAviso, paramtd, pathfitxer, width, height, textAlt) {
	if (plugin) {
		document.write('<td ' + paramtd + '>');
		document.write(' <object id="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"'); 	 
		if (textAlt && textAlt!=null && textAlt!='')
			document.write(' alt="' + textAlt + '"');
		document.write(' width="' + width + '" height="' + height + '" border="0">');
		document.write('  <param name=movie value="' + pathfitxer + '">'); 	 
		document.write('  <param name=quality value=high>'); 	 
		document.write('  <param name="wmode" value="transparent">'); 	 
		document.write('  <param name="menu" value="false">'); 	 
		document.write('  <param name="SCALE" value="noborder">'); 	 
		document.write('    <embed src="' + pathfitxer + '" quality=high pluginspage="//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"'); 	 
		if (textAlt && textAlt!=null && textAlt!='')
			document.write(' alt="' + textAlt + '"');
		document.write(' width="' + width + '" height="' + height + '" wmode="transparent" menu="false" scale="noborder">');
		document.write('    </embed>'); 	 
		document.write(' </object>'); 	 
		document.write('</td>'); 	
	} else {
		document.write('<td bgcolor="#DFDFDF" ' + paramtd + '>');
		document.write(strAviso);
		document.write('</td>'); 
	}
}

//-->