// For all top level pages
// Need to exclude Mac: somehow the top != self statement is causing abnormal
// behavior in Mac

//hbx tracking code starts here


var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
var hbx=_hbEvent("pv");hbx.vpc="HBX0200u";hbx.gn="vendorweb.citibank.com";

//BEGIN EDITABLE SECTION
//CONFIGURATION VARIABLES
hbx.acct="DM57061446AB;DM5707193LEW;DM570712CDMA";//ACCOUNT NUMBER(S)
hbx.pn="PUT+PAGE+NAME+HERE";//PAGE NAME(S)
hbx.mlc="CONTENT+CATEGORY";//MULTI-LEVEL CONTENT CATEGORY
hbx.pndef="index.htm";//DEFAULT PAGE NAME
hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
function _hbOnPrePVR(){
if(_mlc != 0){
_mlc = "/EMEA/Spain" + _mlc
}
}

//OPTIONAL PAGE VARIABLES
//ACTION SETTINGS
hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
hbx.lt="auto";//LINK TRACKING
hbx.dlf="n";//DOWNLOAD FILTER
hbx.dft="n";//DOWNLOAD FILE NAMING
hbx.elf="n";//EXIT LINK FILTER

//INSERT CUSTOM EVENTS

//END EDITABLE SECTION

//REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER)


document.write("<script language='javascript1.1' src='/spain/consumer/spanish/js/hbx.js'></script>");
//<!--END VISUAL SCIENCES CODE-->


//hbx tracking code ends here

		$.ajax({
			// carga del html de las cabeceras
			  url: "/spain/consumer/spanish/js/header.htm",
			  cache: false,
			  success: function(html){
				$("#includeheader").append(html);

				$("#tab_"+tab+"").addClass("selected");
				$("#link_tab_"+tab+"").addClass("tselected");

				///////////////
						switch ( header )
						{ 
							case "home": 
							  $(document).ready(function(){
								// cargamos la cabecera de la home
								$("#headerhome").removeClass("oculto");
								//$("#headerhome").remove();
								$("#headerciti").remove();
								$("#headergold").remove();
							  });
									break;
									
							case "citi": 
							  $(document).ready(function(){
								// cargamos la cabecera de la home
								$("#headerciti").removeClass("oculto");
								$("#headerhome").remove();
								$("#headergold").remove();
							  });
									break;
									
							case "gold": 
							  $(document).ready(function(){
								// cargamos la cabecera de la home
								$("#headergold").removeClass("oculto");
								$("#headerhome").remove();
								$("#headerciti").remove();
							  });
									break;
				
							default://Instrucción o bloque de instrucciones
							;
						}
				
				///////////////////////////						
				
		  }
		});
		
		

	function OpenWin()
	{

		NewWindow('/spain/consumer/spanish/localiz/index.htm', 'cliente','1500','1000','yes');
		//NewWindow('/spain/consumer/spanish/localiz/index.htm', 'cliente', ',type=fullWindow,fullscreen,scrollbars=yes');

	}
	
	var win = null;
	function NewWindow(mypage,myname,w,h)
	{
	LeftPosition=0;
	TopPosition=0;
		//LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		//TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
		win = window.open(mypage,myname,settings)
	}

	
	function getCookie(showIcard)

	{

		if (document.cookie.length>0)

		  {

		  c_start=document.cookie.indexOf(showIcard + "=")

			c_start=c_start + showIcard.length+1 

			c_end=document.cookie.indexOf(";",c_start)

			if (c_end==-1) c_end=document.cookie.length

			return unescape(document.cookie.substring(c_start,c_end))

		  }

		  else

		  return null;



	} 


function OpenIcard()

	{


		var strURL;

 

		if (getCookie('showIcard') != 1){

			strURL ='/spain/consumer/spanish/dni_pophome.htm';
			
			NewWindow(strURL, 'cliente','650','565','yes');

		}else{

			strURL = 'https://www.cardsonline.citibank.es/ICardServlet?F=WE_CIT_SIG&C=ES&L=ES';

			NewWindow(strURL, 'cliente',screen.availWidth,screen.availHeight,'yes');

		}

	}

	function showInversis()

	{


		var strURL;

 

		if (getCookie('showInversis') != 1){

			strURL ='/spain/consumer/spanish/inversiones/pop.htm';
			
			NewWindow(strURL, 'cliente','650','565','yes');

		}else{

			strURL = 'http://www.inversis.com/citibank';

			NewWindow(strURL, 'cliente',screen.availWidth,screen.availHeight,'yes');

		}

	}

	function OpenAccount()

	{


		var strURL;

 

	if (getCookie('showCuentas_new') != 1){

			strURL ='/spain/consumer/spanish/funciona/p_cuentas.htm';
			
			NewWindow(strURL, 'cliente','600','650','yes');

		}else{

			strURL = 'https://www.production.citibank.es/ESGCB/JPS/portal/SignonLocaleSwitch.do?locale=es_ES';

			NewWindow(strURL, 'cliente',screen.availWidth,screen.availHeight,'yes');

		}

	}

	function OpenAccountEng()
	{

	var strURL;

	if (getCookie('showCuentas_neweng') != 1){

			strURL ='/spain/consumer/spanish/funciona/p_cuentas_en.htm';
			
			NewWindow(strURL, 'cliente','600','650','yes');

		}else{

			strURL = 'https://www.production.citibank.es/ESGCB/JPS/portal/SignonLocaleSwitch.do?locale=en_ES';

			NewWindow(strURL, 'cliente',screen.availWidth,screen.availHeight,'yes');
		}

	}

	function OpenTarjetasES()
	{

	var strURL;

	if (getCookie('showTarjetas') != 1){

			strURL ='/spain/consumer/spanish/funciona/p_tarjetas.htm';
			
			NewWindow(strURL, 'cliente','600','650','yes');

		}else{

			strURL = 'https://www.production.citibank.es/ESGCB/JSO/signon/DisplayUsernameSignon.do';

			NewWindow(strURL, 'cliente',screen.availWidth,screen.availHeight,'yes');
		}

	}