<!--
// E2242 - Muestra pantalla con 3 frames
var wName="";
if (window.name!="") wName=window.name.toLowerCase();

if(window==top && wName!="pop" && wName.indexOf("pop")==-1 && wName!="pdf" && wName.indexOf("minisite")==-1 && wName!="general" && wName!="obrasocial" && wName!="tarifes" &&
  (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) { //v3.0
  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); 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);

}

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.2
			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
}

//-->