<!--
MM_preloadImages('/hsb/eng/image/tab_ebper2.gif','/hsb/eng/image/tab_ebbiz2.gif');
//Define global variables
var timerID = null;
var timerOn = false;
var timecount = 1000;
//var what = null;
var newbrowser = true;
var check = false;

function reDo() {
	window.location.reload()
}

window.onresize = reDo;

function initMenu() {
	check = true;
	hideAll();
}

// Turns the layers on and off
function showLayer(layerName) {
	if (check) {
		if (what =="none") {
			return;
		}
		else if (what == "moz") {
			document.getElementById(layerName).style.visibility="visible";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	else {
		// Please wait for the page to finish loading
		return;
	}
}

function hideLayer(layerName) {
	if (check) {
		if (what =="none") {
			return;
		}
		else if (what == "moz") {
			document.getElementById(layerName).style.visibility="hidden";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else {
		// Please wait for the page to finish loading
		return;
	}
}

function hideAll() {
	hideLayer('layertabebank');
}

function startTime() {
	if (timerOn == false) {
		timerID=setTimeout( "hideAll()" , timecount);
		timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

function createTab() {
	var	html="";
	html+='<table cellspacing=0 cellpadding=0 border=0 width=741>\n';
	html+='<tr>\n';
	html+='<td align=right>';
//	html+='<a href="javascript:switchSimple();"><img src="/hsb/eng/image/tab_sim.gif" width="23" height="23" alt="Simplified Chinese" border="0"></a>';
//	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="javascript:switchTrad();"><img src="/hsb/eng/image/tab_trad.gif" width="36" height="19" alt="Traditional Chinese" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="/hse.html" target="_top"><img src="/hsb/eng/image/tab_home.gif" width="23" height="23" alt="Home" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="/hsb/eng/abo/cu/home/index.html?From=\'eHot_Offer\'&To=\'ContactUs\'" target="_top"><img src="/hsb/chi/image/tab_conus.gif" width="24" height="19" alt="Contact Us" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="#" onMouseOver="showLayer(\'layertabebank\'); stopTime()" onMouseOut="startTime();"><img src="/hsb/eng/image/tab_ebank.gif" width="19" height="19" alt="e-Banking" border="0"></a>';
	html+='</td>\n';
	html+='</tr>\n';
	html+='</table>\n';
	document.write(html);
}

function createPopupTab(tableWidth) {
	var	html="";
	html+='<table cellspacing=0 cellpadding=0 border=0 width='+tableWidth+'>\n';
	html+='<tr>\n';
	html+='<td align=right>';
//	html+='<a href="javascript:switchSimple();"><img src="/hsb/eng/image/tab_sim.gif" width="23" height="23" alt="Simplified Chinese" border="0"></a>';
//	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="javascript:switchTrad();"><img src="/hsb/eng/image/tab_trad.gif" width="26" height="23" alt="Traditional Chinese" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="/hse.html" target="_blank"><img src="/hsb/eng/image/tab_home.gif" width="23" height="23" alt="Home" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="/hsb/eng/abo/cu/home/index.html?From=\'eHot_Offer\'&To=\'ContactUs\'" target="_blank"><img src="/hsb/chi/image/tab_conus.gif" width="24" height="19" alt="Contact Us" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="#" onMouseOver="showLayer(\'layertabebank\'); stopTime()" onMouseOut="startTime();"><img src="/hsb/eng/image/tab_ebank.gif" width="19" height="19" alt="e-Banking" border="0"></a>';
	html+='<img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='<a href="javascript:;" onclick="window.close()"><img src="images/tab_close.gif" width="56" height="20" border="0" alt="Close"></a>';
	html+='</td>\n';
	html+='</tr>\n';
	html+='</table>\n';
	document.write(html);
}

function switchTrad() {
	var 	x='';
	var 	s=new String(parent.document.location);
	var	b='/hsb/eng/';
	var	p=s.indexOf(b);
	var	c='?From'
	var	q=s.indexOf(c);

	if (p>0){ 
		if(q>0){
			x=s.substr(0,p)+'/hsb/chi/'+s.substring(p+b.length,q);
		}else{
			x=s.substr(0,p)+'/hsb/chi/'+s.substr(p+b.length);
		}
	}

	if (x!='')
		parent.location.href=x;
	//return false;
}

function switchSimple() {
	var 	x='';
	var 	h=new String(parent.document.location.host);
	var 	s=new String(parent.document.location);
	var 	a='http' + '://';
	var	b='/hsb/eng/';
	var	p=s.indexOf(b);
	var	c='?From'
	var	q=s.indexOf(c);

	var	sc='';
	var 	re = /testhase/i;
        if (re.test(h)) 
		sc = 'uat.sc.hangseng.com';
	else
		sc = 'sc.hangseng.com';

	if (p>0){ 
		if(q>0){
			x=a+sc+'/gb/'+s.substr(a.length,p-a.length)+'/hsb/chi/'+s.substring(p+b.length,q);
		}else{
			x=a+sc+'/gb/'+s.substr(a.length,p-a.length)+'/hsb/chi/'+s.substr(p+b.length);
		}
	}

	if (x!='')
		parent.location.href=x;
	//return false;
}

function ShowEBankMenu() {
	var	html="";
	if (isNetscape4) {
		html+='</layer>\n';
		html+='<layer name="layertabebank" top=86px left=638px z-index=85 visibility=hide onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	} else {
		html+='</div>\n';
		html+='<div id="layertabebank" style="position:absolute; top:86px; left:638px; visibility:hidden;" onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}

	html+='<a href="javascript:PopUp(\'/hsb/com/redir.html?From=\\\'eHot_Offer\\\'&p=https://ebanking.hangseng.com/\',\'ebanking\',\'width=800,height=450,top=0,left=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,resizable=1\');" onMouseOver="hideAll(); showLayer(\'layertabebank\'); MM_swapImage(\'ebper\',\'\',\'/hsb/eng/image/tab_ebper2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebper" src="/hsb/eng/image/tab_ebper.gif" width="85" height="14" alt="Personal e-Banking" border="0"></a><br><a href="javascript:hsbc_login_popup(\'e\',\'home\');" onMouseOver="hideAll(); showLayer(\'layertabebank\'); MM_swapImage(\'ebbiz\',\'\',\'/hsb/eng/image/tab_ebbiz2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebbiz" src="/hsb/eng/image/tab_ebbiz.gif" width="85" height="13" alt="Business e-Banking" border="0"></a>';

	isNetscape4?html+='</layer>\n':html+='</div>\n';

	document.write(html);
}

function ShowPopupEBankMenu(leftPos) {
	var	html="";
	if (isNetscape4) {
		html+='</layer>\n';
		html+='<layer name="layertabebank" top=86px left='+leftPos+'px z-index=85 visibility=hide onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	} else {
		html+='</div>\n';
		html+='<div id="layertabebank" style="position:absolute; top:86px; left:'+leftPos+'px; visibility:hidden;" onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}

	html+='<a href="javascript:PopUp(\'/hsb/com/redir.html?From=\\\'eHot_Offer\\\'&p=https://ebanking.hangseng.com/\',\'ebanking\',\'width=800,height=450,top=0,left=0,status=1,scrollbars=1,toolbar=0,location=0,menubar=0,resizable=1\');" onMouseOver="hideAll(); showLayer(\'layertabebank\'); MM_swapImage(\'ebper\',\'\',\'/hsb/eng/image/tab_ebper2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebper" src="/hsb/eng/image/tab_ebper.gif" width="85" height="14" alt="Personal e-Banking" border="0"></a><br><a href="javascript:hsbc_login_popup(\'e\',\'home\');" onMouseOver="hideAll(); showLayer(\'layertabebank\'); MM_swapImage(\'ebbiz\',\'\',\'/hsb/eng/image/tab_ebbiz2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebbiz" src="/hsb/eng/image/tab_ebbiz.gif" width="85" height="13" alt="Business e-Banking" border="0"></a>';

	isNetscape4?html+='</layer>\n':html+='</div>\n';

	document.write(html);
}

//-->
