var temp=true;

var temp2=true;

var temp3=true;

 

var counter1=0;

var counter2=0;

var counter3=0;

var showWebLinkingDisclosure=false;

var weblinkingDisclosure =  unescape('&Dagger;')+' &Eacute;ste es un v&iacute;nculo que le da acceso a un sitio web ajeno, no relacionado con HSBC. Al hacer clic en este v&iacute;nculo, usted abandonar&aacute; el sitio web de HSBC. Los sitios web ajenos no est&aacute;n bajo el control de HSBC, sus afiliados ni subsidiarias. El propietario del sitio web ajeno es el &uacute;nico responsable de los productos, servicios y contenidos de su sitio. Es posible que dicho sitio web tenga una pol&iacute;tica de privacidad distinta de HSBC y que sea menos seguro. HSBC ofrece estos v&iacute;nculos para su comodidad y no es responsable de los contenidos o la seguridad de los sitios web v&iacute;nculados.';

function hideIcon(){

counter1++;

 

if(counter1>1 ){

temp2=true;

temp3=true;

 

}

 

if(temp==true ){

document.getElementById('reduce').style.display= 'block';

document.getElementById('reduce').style.display= 'inline';

document.getElementById('expand').style.display= 'none';

document.getElementById('expand2').style.display= 'block';

document.getElementById('expand3').style.display= 'block';

document.getElementById('expand2').style.display= 'inline';

document.getElementById('expand3').style.display= 'inline';

document.getElementById('reduce2').style.display= 'none';

document.getElementById('reduce3').style.display= 'none';

temp=false; 

}else{

document.getElementById('reduce').style.display= 'none';

document.getElementById('expand').style.display= 'block';

document.getElementById('expand').style.display= 'inline';

temp=true;

};

 

}

 

function hideIcon2(){

counter2++;

 

if(counter2>1 ){

temp=true;

temp3=true;

}

if(temp2==true){

//alert('in true')

document.getElementById('reduce2').style.display= 'block';

document.getElementById('reduce2').style.display= 'inline';

document.getElementById('expand2').style.display= 'none';

 

document.getElementById('expand').style.display= 'block';

document.getElementById('expand3').style.display= 'block';

document.getElementById('expand').style.display= 'inline';

document.getElementById('expand3').style.display= 'inline';

document.getElementById('reduce').style.display= 'none';

document.getElementById('reduce3').style.display= 'none';

 

temp2=false; 

}else{

 

document.getElementById('reduce2').style.display= 'none';

document.getElementById('expand2').style.display= 'block';

document.getElementById('expand2').style.display= 'inline';

temp2=true;

};

 

}

 

function hideIcon3(){

counter3++;

 

if(counter3>1 ){

temp2=true;

temp=true;

}

 

if(temp3==true){

document.getElementById('reduce3').style.display= 'block';

document.getElementById('reduce3').style.display= 'inline';

document.getElementById('expand3').style.display= 'none';

 

document.getElementById('expand2').style.display= 'block';

document.getElementById('expand').style.display= 'block';

document.getElementById('expand2').style.display= 'inline';

document.getElementById('expand').style.display= 'inline';

document.getElementById('reduce2').style.display= 'none';

document.getElementById('reduce').style.display= 'none';

 

 

temp3=false; 

}else{

document.getElementById('reduce3').style.display= 'none';

document.getElementById('expand3').style.display= 'block';

document.getElementById('expand3').style.display= 'inline';

temp3=true;

};

 

}


function showLIImages(page) {

  if (page != null && page == 'open') {
     var li = document.getElementById('open-li');

     li.style.backgroundImage = 'url(images/nav_arrow_on.gif)'; 
     
     var a = null;
     
     for (var i = 0; i < li.childNodes.length; i++) {
     	if (li.childNodes[i].tagName == 'A') {
     		a = li.childNodes[i];  
     	}
     }
     if (a != null) {
     	a.style.color = 'black';
     }

  } 

  if (page != null && page == 'learn') {

     var li = document.getElementById('learn-li');

     li.style.backgroundImage = 'url(images/nav_arrow_on.gif)'; 
     var a = null;
     
     for (var i = 0; i < li.childNodes.length; i++) {
     	if (li.childNodes[i].tagName == 'A') {
     		a = li.childNodes[i];  
     	}
     }
     if (a != null) {
     	a.style.color = 'black';
     }

  } 

}



function switchOn(liId) {

  var li = document.getElementById(liId);

  li.style.backgroundImage = 'url(images/nav_arrow_on.gif)';

  var a = null;
     
  for (var i = 0; i < li.childNodes.length; i++) {
	if (li.childNodes[i].tagName == 'A') {
		a = li.childNodes[i];  
	}
   }
   if (a != null) {
	 a.style.color = 'black';
  }
}



function switchOff(liId) {

  var li = document.getElementById(liId);

  li.style.backgroundImage = 'url(images/nav_arrow_off.gif)';

  var a = null;
     
  for (var i = 0; i < li.childNodes.length; i++) {
    if (li.childNodes[i].tagName == 'A') {
      a = li.childNodes[i];  
    }
  }
  if (a != null) {
   	a.style.color = 'white';
  }
}


function submitOn() {
  
  var divOn  = document.getElementById('submitButtonOn');
  var divOff = document.getElementById('submitButtonOff');
  
  divOn.style.display = 'block';
  divOff.style.display = 'none';
  
}


function submitOut() {
  
  var divOn  = document.getElementById('submitButtonOn');
  var divOff = document.getElementById('submitButtonOff');
  
  divOn.style.display = 'none';
  divOff.style.display = 'block';
  
}

function toggleLayer(whichLayer)
{
if (document.getElementById)
 {
  var style2 = document.getElementById(whichLayer).style;
  style2.display = style2.display? "":"block";
 }
 else if (document.all)
 {
  var style2 = document.all[whichLayer].style;
  style2.display = style2.display? "":"block";
 }
 else if (document.layers)
 {
  var style2 = document.layers[whichLayer].style;
  style2.display = style2.display? "":"block";
 }
}

function swapClass(){
 var i,x,tB,j=0,tA=new Array(),arg=swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

function writeStyles(op,a){
if(op==0||document.getElementById){var tS="<sty"+"le type=\"text/css\">";
tS+=a+"<"+"/sty"+"le>";document.write(tS);document.close();}
}

writeStyles(1,'.closed p{ display:none;}.open p{ display:block;}');


function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="block"){
e.style.display="none"
}
else{
e.style.display="block"
}
return false;
}

function appendBrand()
{
	appendBrandToLinks();
	appendBrandToForms();
	enableTooltips();
}

function appendBrandToLinks()
{

	var links = document.getElementsByTagName("A");
	for (y=0; y<links.length; y++) 
	{
		link = links[y];
		if(link.href.indexOf("/ecare") != -1 && link.href.indexOf("#") == -1)
		{
			if(link.href.indexOf("javascript") == 0 || link.href.indexOf("javaScript") == 0 || link.href.indexOf("Javascript") == 0 || link.href.indexOf("JavaScript") == 0)
			{
				var startIndex = link.href.indexOf("'/");
				if(startIndex != -1){
					var endIndex = link.href.indexOf("'", startIndex+1);	
					var indexofQuesMark = link.href.indexOf("?", startIndex+1);	
					var newHref = "";
					if(indexofQuesMark != -1){
						newHref = link.href.substring(0, endIndex) + "&locale=" + locale + "&brand=" + brand + link.href.substring(endIndex); 
					}
					else{
					
						newHref = link.href.substring(0, endIndex) + "?&locale=" + locale + "&brand=" + brand + link.href.substring(endIndex); 
					}	
					link.href = newHref;
				}
			}
			else {
				var indexofQuesMark = link.href.indexOf("?");	
				
				if(indexofQuesMark != -1){
					link.href = link.href + "&locale=" + locale + "&brand=" + brand;
				}
				else{
					link.href = link.href + "?&locale=" + locale + "&brand=" + brand;
				}
			}
			
		}
	}
}

function appendBrandToURL(URL)
{
	var indexofQuesMark = URL.indexOf("?");	

	if(indexofQuesMark != -1){
		URL = URL + "&locale=" + locale + "&brand=" + brand;
	}
	else{
		URL = URL + "?&locale=" + locale + "&brand=" + brand;
	}

	return URL;
}

function appendBrandToForms()
{
	var forms  = document.getElementsByTagName("form");
	if(locale !='' && brand !='')
	{
		for (x=0; x<forms.length; x++) 
		{
			form = forms[x];
			form.action =  form.action+"?&locale="+locale+"&brand="+brand;

		}
		
	}
}
function appendBrandToVerdForms()
{
	var forms  = document.getElementsByTagName("form");
	if(locale !='' && brand !='')
	{
		for (x=0; x<forms.length; x++) 
		{
			form = forms[x];
			form.action =  form.action+"&locale="+locale+"&brand="+brand;

		}
		
	}
}

function hrefClickToAppendedURL(URL)
{
	document.location.href =  appendBrandToURL( URL);
}
<!--  June07 Release Back button Implementation Start -->
function validateCookie()
{
	//alert("Validate Cookie");
	 var _cookie = document.cookie.split(';');
	 var _cookieName = functionalPortfolio + "_Cookie"; 		

	
		if(_cookie.length == 0)
		{
			document. cookie = functionalPortfolio + '_Cookie=';	
			window.location="/ecare/pleaselogin?&locale="+locale+"&brand="+brand;
		}
		 for(var i=0;i < _cookie.length;i++)
		{
			var _cookieParam = _cookie[i];
			
			while (_cookieParam.charAt(0)==' ')
			{ 
				 _cookieParam = _cookieParam.substring(1,_cookieParam.length);
				
			}
		
			if (_cookieParam.indexOf(_cookieName) == 0)
			{
				  if((_cookieParam.substring(_cookieName.length,_cookieParam.length)).indexOf("TempCookie") < 0  )
				  {
						  window.location="/ecare/pleaselogin?&locale="+locale+"&brand="+brand;
				 }
			}	
		}
	
 }

function createCookie(){
	
}

function eraseCookie()
{
	//	alert("Erase Cookie");
	document. cookie = functionalPortfolio + '_Cookie=;path=/ecare/';

}
<!--  June07 Release Back button Implementation End -->
<!--  Feb08 Release disable scroll start -->
function setOnFocus(fieldID){
	document.getElementById(fieldID).focus();
}
<!--  Feb08 Release disable scroll ends -->
<!-- Aug08 release start here -->
function getSiteId(portfolioName)
{
	var siteId;
	if (portfolioName == "HS")
	{
		siteId=30;
	}else if(portfolioName == "HB")
		{
		siteId=1;
		}
		else if(portfolioName == "OB")
			{
			siteId=4;
			}
			else if(portfolioName == "UP")
				{
				siteId=2
				}
				else if(portfolioName == "PS")
					{
					siteId=52;
					}
					else if(portfolioName == "EM")
						{
						siteId=13;
						}
						else if(portfolioName == "UN")
							{
							siteId=13;
							}

	return siteId;

}

//Added for Yodlee Tab Interface
function YodleeBillPayOpenNewWindow(URL)
{	var bool = YodleeBillPay(URL);
	//if(bool==true){
	//var url = appendBrandToURL("/ecare/showpayment");
	//document.location.href = url;
	//}
}

function YodleeBillPay(URL)
{	
	var url1 = appendBrandToURL(URL); 
	paymentwindow = window.open(url1,'UtilityBillPayWin','screenX=0,screenY=0,left=0,top=0,width=800,height=550,resizable=yes,scrollbars=yes,toolbar=no,locationbar=no,personalbar=no,menubar=no');
	paymentwindow.focus();
	return true;
}

<!-- Aug08 release end here -->
