<!--
MM_preloadImages('http://www.hangseng.com/hsb/eng/image/tab_ebper2.gif','http://www.hangseng.com/hsb/eng/image/tab_ebbiz2.gif');

var tab_appVersion = parseInt(navigator.appVersion);
var tab_appName = navigator.appName;
var tab_isMacintoshPPC = false;
var tab_isMacintosh68K = false;
var tab_isIE = false;
var tab_isAOL = false;
var tab_mac = false;
var tab_userAgent = navigator.userAgent.toLowerCase();
var tab_isGecko = false;
var tab_isSafari = false;

if ( navigator.product == 'Gecko' ) {
	if ( tab_userAgent.indexOf("safari") == -1 ) {
		tab_isGecko = true;
		}
		else {
		tab_isSafari = true;
		}
}

if (tab_appName == "Microsoft Internet Explorer") {	
	tab_isIE = true;
}

if ( navigator.appVersion.indexOf("Mac") != -1 ) {	
	if ( tab_userAgent.indexOf("pc)") !=-1 ) tab_isMacintoshPPC = true;	
	else tab_isMacintosh68K = true;
}

if(tab_isMacintoshPPC || tab_isMacintosh68K) tab_mac=true;
else tab_mac=false;

if ((navigator.userAgent.indexOf("AOL 5") != -1) || (navigator.userAgent.indexOf("AOL 6") != -1)) tab_isAOL = true;

function tab_hsbc_login_popup(lang,from) {
	if ((lang == 'e') && (from == "main")) {
		if (! tab_isGecko ) {
 			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://www.hangseng.com/business/e-banking','login', 'win_b');
			//tab_openWindow('http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://www.hangseng.com/business/e-banking','login', 'win_b');
			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://www.hangseng.com/business/e-banking','login', 'win_b');
			tab_openWindow('https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=en&country=US&source=http://www.hangseng.com/business/e-banking','login', 'win_b');
 		} else {
 			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://www.hangseng.com/business/e-banking";
			//window.top.location.href="http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://www.hangseng.com/business/e-banking";
			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://www.hangseng.com/business/e-banking";
			window.top.location.href="https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=en&country=US&source=http://www.hangseng.com/business/e-banking";
 		}
	}
	if ((lang == 'c') && (from == "main")) {
		if (! tab_isGecko ) {
 			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://www.hangseng.com/business/e-banking/cmain.htm','login', 'win_b');
			//tab_openWindow('http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm','login', 'win_b');
			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm','login', 'win_b');
			tab_openWindow('https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm','login', 'win_b');
 		} else {
 			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://www.hangseng.com/business/e-banking/cmain.htm";
			//window.top.location.href="http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm";
			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm";
			window.top.location.href="https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=zh&country=HK&source=http://www.hangseng.com/business/e-banking/cmain.htm";
 		}
	}
	if ((lang == 'e') && (from == "home")) {
		if (! tab_isGecko ) {
			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://main.hangseng.com/hse.html','login', 'win_b');
			//tab_openWindow('http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://main.hangseng.com/hse.html','login', 'win_b');
			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://main.hangseng.com/hse.html','login', 'win_b');
			tab_openWindow('https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=en&country=US&source=http://main.hangseng.com/hse.html','login', 'win_b');
 		} else {
 			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://main.hangseng.com/hse.html";
			//window.top.location.href="http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://main.hangseng.com/hse.html";
			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&&language=en&country=US&source=http://main.hangseng.com/hse.html";
			window.top.location.href="https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=en&country=US&source=http://main.hangseng.com/hse.html";
 		}
	}
	if ((lang == 'c') && (from == "home")) {
		if (! tab_isGecko ) {
 			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://main.hangseng.com/hsc.html','login', 'win_b');
			//tab_openWindow('http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html','login', 'win_b');
			//tab_openWindow('http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html','login', 'win_b');
			tab_openWindow('https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html','login', 'win_b');
	 	} else {
 			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&source=http://main.hangseng.com/hsc.html";
			//window.top.location.href="http://www.uat3b.netd.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html";
			//window.top.location.href="http://www.login.hsbc.com/code/public/en_US/login/login.jhtml?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html";
			window.top.location.href="https://www.login.hsbc.com/bibauth/logonStart?partnerid=HASE&language=zh&country=HK&source=http://main.hangseng.com/hsc.html";
 		}
	}
}

function tab_openWindow(winUrl, winName, properties) {
	var launchedToolWidth = 788;
	var lightLaunchedToolWidth = 652;
	if ( tab_mac && tab_isIE ) {
		launchedToolWidth -= 16;
		lightLaunchedToolWidth -= 16;
	}

	if (!tab_isAOL) {
		if (properties=="win_a")
			newWindow = window.open(winUrl,winName,"scrollbars,menubar,toolbar,resizable,status=1,HEIGHT=460,WIDTH=" + launchedToolWidth);
		else if (properties=="win_a_no_toolbar")
			newWindow = window.open(winUrl,winName,"scrollbars,resizable,status=1,HEIGHT=460,WIDTH=" + launchedToolWidth);
		else if (properties=="win_b")
			newWindow = window.open(winUrl,winName,"scrollbars=1,status=1,HEIGHT=600,WIDTH=800");
		else if (properties=="win_b_no_scroll")
			newWindow = window.open(winUrl,winName,"scrollbars,status=1,HEIGHT=470,WIDTH=525");
		else if (properties=="win_c")
			newWindow = window.open(winUrl,winName,"scrollbars,menubar,toolbar,status=1,HEIGHT=460,WIDTH=" + lightLaunchedToolWidth);
		else if (properties=="win_d")
			newWindow = window.open(winUrl,winName,"scrollbars,resizable=no,status=1,HEIGHT=460,WIDTH=" + lightLaunchedToolWidth);
		else
			newWindow = window.open(winUrl,winName,properties);
		newWindow.focus();
	}
	else
		location.href=winUrl;
}

function createTab() {
	/*html="";

	isNetscape4?html+='<layer name="layertab" top=86px left=200px z-index=80>\n':html+='<div id="layertab" style="position:absolute; top:86px; left:200px; z-index=80;">\n';
	html+='<table cellspacing=0 cellpadding=0 border=0 width=565><tr><td nowrap align=right>';
	if (option="lang") {
		html+='<a href="javascript:switchSimple();"><img src="/hsb/eng/image/tab_sim.gif" width="34" height="19" alt="Simplified Chinese" border="0"></a><img src="/hsb/com/spacer.gif" width=5 height=1 border=0><a href="javascript:switchTrad();"><img src="/hsb/eng/image/tab_trad.gif" width="36" height="19" alt="Traditional Chinese" border="0"></a><img src="/hsb/com/spacer.gif" width=5 height=1 border=0>';
	}
	html+='<a href="http://www.hangseng.com/hsb/eng/security/summary/index.html" target="_top"><img src="/hsb/eng/image/tab_lock.gif"  width="30" height="20" border="0"></a><img src="/hsb/com/spacer.gif" width=8 height=1 border=0><a href="http://www.hangseng.com/hse.html" target="_top"><img src="/hsb/eng/image/tab_home.gif" width="23" height="23" alt="Home" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/eng/abo/cu/home/index.html?From=\'eTab\'&To=\'ContactUs\'" target="_top"><img src="/hsb/eng/image/tab_conus.gif" width="24" height="19" alt="Contact Us" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/eng/oth/app/index.html?From=\'eTab\'&To=\'Forms\'" target="_top"><img src="/hsb/eng/image/tab_form.gif" width="21" height="19" alt="Forms" border="0"></a><img src="/hsb/com/spacer.gif" width=11 height=1 border=0><a href="/hsb/eng/oth/cal/index.html?From=\'eTab\'&To=\'Calculators\'" target="_top"><img src="/hsb/eng/image/tab_calc.gif" width="15" height="19" alt="Calculators" border="0"></a><img src="/hsb/com/spacer.gif" width=9 height=1 border=0><a href="#" onMouseOver="hideAll(); showLayer(\'layertabebank\'); stopTime()" onMouseOut="startTime();"><img src="/hsb/eng/image/tab_ebank.gif" width="19" height="19" alt="e-Banking" border="0"></a><img src="/hsb/com/spacer.gif" width=8 height=1 border=0><a href="/hsb/com/redir.html?From=\'eTab\'&p=http://cn.hangseng.com/cn/eng/home/home.html" target="_blank"><img src="/hsb/eng/image/tab_mainla.gif" width="42" height="19" alt="Mainland Services" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><!--<a href="/hsb/eng/mar/onr/fp/index.html" target="_top"><img src="/hsb/eng/image/tab_fund.gif" width="35" height="19" alt="Fund Prices" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0>--><a href="/hsb/com/redir.html?From=\'eTab\'&p=http://www.hangseng.com/hsb/eng/per/invs/hsss/etf2/home/main.html" target="_blank"><img src="/hsb/eng/image/tab_etf2.gif" width="25" height="11" alt="Exchange Traded Fund" border="0" vspace="4"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/com/redir.html?From=\'eTab\'&p=http://www.hsi.com.hk" target="_blank"><img src="/hsb/eng/image/tab_hsi2.gif" width="29" height="12" alt="Hang Seng Indexes" border="0" vspace="1"></a><img src="/hsb/com/spacer.gif" width=12 height=1 border=0>';
	html+='</td></tr></table>\n';

	if (isNetscape4) {
		html+='</layer>\n';
		html+='<layer name="layertabebank" top=86px left=531px z-index=85 visibility=hide onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}
	else {
		html+='</div>\n';
		html+='<div id="layertabebank" style="position:absolute; top:86px; left:531px;" onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}

	html+='<a href="javascript:PopUp(\'/hsb/com/redir.html?From=\\\'eTab\\\'&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:tab_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 switchTrad() {
	var 	x='';
	var 	s=new String(parent.document.location);

	s=s.replace("sc.hangseng.com\/gb\/","");

	var	b='/eng/';
	var	p=s.indexOf(b);
	var	c='?From'
	var	q=s.indexOf(c);
	var 	h=new String(parent.document.location.host);

	if (p>0){ 
		if(q>0){
			x=s.substr(0,p)+'/chi/'+s.substring(p+b.length,q);
		}else{
			x=s.substr(0,p)+'/chi/'+s.substr(p+b.length);
		}
	}
	else {
		// add on 24-Oct-05 to cater for Loan Calculators on eINVC server
		if (s.indexOf("eba.hangseng.com") > 0 && s.indexOf("lang=enu") > 0) {
			x = s.replace("lang=enu","lang=cht");
		} else {
		// end 24-Oct-05
		 	b='http' + '://';
			x=b+h+'/hsc.html?From=\'eHome_Tab\'&To=\'cHome\'';
		}
	}

	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);

	s=s.replace("sc.hangseng.com\/gb\/","");

	var 	a='http' + '://';
	var	b='/eng/';
	var	p=s.indexOf(b);
	var	c='?From'
	var	q=s.indexOf(c);

	var	sc='';
	var 	re = /main.hangseng.com/i;
        if (re.test(h)) 
		sc = 'scmain.hangseng.com';
	else
		sc = 'sc.hangseng.com';

	if (p>0){ 
		if(q>0){
			x=a+sc+'/gb/'+s.substr(a.length,p-a.length)+'/chi/'+s.substring(p+b.length,q);
		}else{
			x=a+sc+'/gb/'+s.substr(a.length,p-a.length)+'/chi/'+s.substr(p+b.length);
		}
	}
	else {
		// add on 24-Oct-05 to cater for Loan Calculators on eINVC server
		if (s.indexOf("eba.hangseng.com") > 0 && s.indexOf("lang=enu") > 0) {
			x = s.replace("lang=enu","lang=chs");
		} else {
		// end 24-Oct-05
		 	b='http' + '://';
			x=b+sc+'/gb/'+h+'/hsc.html?From=\'eHome_Tab\'&To=\'scHome\'';
		}
	}

	if (x!='')
		parent.location.href=x;
	//return false;
}

function showratelogo(w) {
	var h = 54;
	document.write("<a href='http://www.hangseng.com/hsb/eng/rate/prate/index.html' target='_top'>");
	if (w==133) {
		document.write("<img src='/hsb/eng/image/btn_p_01.gif' weight='" + w + "' height='" + h + "' border='0'>");
	} else {
		h = w * 74 / 181;
		document.write("<img src='/hsb/eng/image/btn_e.jpg' weight='" + w + "' height='" + h + "' border='0'>");
	}
	document.write("</a>");
}

function show_mortgage_rate() {
	//var r = showprimerate();
	document.write ("<table width='180' height='103' border='0' cellpadding='0' cellspacing='0'>");
	document.write ("<tr>");
	document.write ("<td height='27'>");
	document.write ("<img src='/hsb/eng/image/mort_box_01.gif' width='7' height='27'>");
	document.write ("</td>");
	document.write ("<td>");
	document.write ("<img src='/hsb/eng/image/mort_box_02.gif' width='167' height='27' alt=''>");
	document.write ("</td>");
	document.write ("<td><img src='/hsb/eng/image/mort_box_03.gif' width='8' height='27' alt=''></td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td height='31' background='/hsb/eng/image/mort_box_04.gif'> <img src='/hsb/eng/image/mort_box_04.gif' width='7' height='19' alt=''></td>");
	document.write ("<td align='center' background='../../../bus/fin/sme/images/spacer.gif' bgcolor='#BBDDFF'><font color='#D93923'><strong><font size='2' face='Arial, Helvetica, sans-serif'>");
	//document.write ("<a href='http://www.hangseng.com/hsb/eng/rate/prate/index.html' target='_top'>");
	//document.write ("<img src='/hsb/eng/image/btn_p1.gif' width='28' height='21' align='top' border='0'>");
	//document.write ("P - ");
	document.write ("P-2.5% to P-");
	//document.write ("</a>");
	showspread();
	document.write ("% p.a.*</font></strong></font><font size='2' face='Arial, Helvetica, sans-serif'><strong> </strong></font></td>");
	document.write ("<td background='/hsb/eng/image/mort_box_06.gif'> <img src='/hsb/eng/image/mort_box_06.gif' width='8' height='19' alt=''></td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td background='/hsb/eng/image/mort_box_10.gif'>&nbsp; </td>");
	document.write ("<td valign='top' bgcolor='#BBDDFF' class='box-content'>");
	document.write ("P = ");
	document.write ("<a href='http://www.hangseng.com/hsb/eng/rate/prate/index.html'>");
	//document.write ("<img src='/hsb/eng/image/p_txt.gif' width='167' height='19' border='0'>");
	document.write ("Hang Seng's HKD Prime Rate");
	document.write ("</a><br>");
	document.write ("<font color='#666666'>*");
	document.write ("<span class='notes'><font size='1'>For reference only</font></span></font>");
	document.write ("</td>");
	document.write ("<td background='/hsb/eng/image/mort_box_12.gif'> </td>");
	document.write ("</tr>");
	document.write ("<tr>");
	//document.write ("<td><img src='/hsb/eng/image/mort_box_16.gif' width='7' height='12' alt=''></td>");
	document.write ("<td background='/hsb/eng/image/mort_box_16.gif' width='7' height='12' alt=''></td>");
	document.write ("<td valign='top'> <img src='/hsb/eng/image/mort_box_17.gif' alt='' width='167' height='12'></td>");
	document.write ("<td valign='top'> <img src='/hsb/eng/image/mort_box_18.gif' width='8' height='12' alt=''></td>");
	document.write ("</tr>");
	document.write ("</table>");
}
//-->
