﻿<!--
MM_preloadImages('/hsb/schi/image/tab_ebper2.gif','/hsb/schi/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('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="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('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="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('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="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('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="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,HEIGHT=460,WIDTH=" + launchedToolWidth);
		else if (properties=="win_a_no_toolbar")
			newWindow = window.open(winUrl,winName,"scrollbars,resizable,HEIGHT=460,WIDTH=" + launchedToolWidth);
		else if (properties=="win_b")
			newWindow = window.open(winUrl,winName,"scrollbars,HEIGHT=600,WIDTH=800");
		else if (properties=="win_b_no_scroll")
			newWindow = window.open(winUrl,winName,"scrollbars,HEIGHT=470,WIDTH=525");
		else if (properties=="win_c")
			newWindow = window.open(winUrl,winName,"scrollbars,menubar,toolbar,HEIGHT=460,WIDTH=" + lightLaunchedToolWidth);
		else if (properties=="win_d")
			newWindow = window.open(winUrl,winName,"scrollbars,resizable=no,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;">\n';
	html+='<table cellspacing=0 cellpadding=0 border=0 width=560><tr><td nowrap align=right>';
	if (option="lang") {
		html+='<a href="javascript:switchTrad();"><img src="/hsb/schi/image/tab_trad.gif" width="36" height="19" alt="\u7E41\u4F53\u4E2D\u6587" border="0"></a><img src="/hsb/com/spacer.gif" width=5 height=1 border=0><a href="javascript:switchEng();"><img src="/hsb/schi/image/tab_eng.gif" width="39" height="19" alt="\u82F1\u6587" border="0"></a><img src="/hsb/com/spacer.gif" width=5 height=1 border=0>';
	}
	html+='<a href="http://www.hangseng.com/hsb/chi/security/summary/index.html" target="_top"><img src="/hsb/schi/image/tab_lock.gif" border="0"></a><img src="/hsb/com/spacer.gif" width=10 height=1 border=0><a href="http://sc.hangseng.com/gb/www.hangseng.com/hsc.html" target="_top"><img src="/hsb/schi/image/tab_home.gif" width="23" height="23" alt="\u4E3B\u9875" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/chi/abo/cu/home/index.html?From=\'cHome_Tab\'&To=\'ContactUs\'" target="_top"><img src="/hsb/schi/image/tab_conus.gif" width="24" height="19" alt="\u8054\u7EDC\u672C\u884Cs" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/chi/oth/app/index.html?From=\'cHome_Tab\'&To=\'Forms\'" target="_top"><img src="/hsb/schi/image/tab_form.gif" width="21" height="19" alt="\u8868\u683C" border="0"></a><img src="/hsb/com/spacer.gif" width=11 height=1 border=0><a href="/hsb/chi/oth/cal/index.html?From=\'cHome_Tab\'&To=\'Calculators\'" target="_top"><img src="/hsb/schi/image/tab_calc.gif" width="15" height="19" alt="\u8BA1\u7B97\u8868" 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/schi/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=\'cHome_Tab\'&p=http://cn.hangseng.com/cn/chi/home/home.html" target="_blank"><img src="/hsb/schi/image/tab_mainla.gif" width="51" height="18" alt="\u5185\u5730\u670D\u52A1" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><!--a href="/hsb/chi/mar/onr/fp/index.html" target="_top"><img src="/hsb/schi/image/tab_fund.gif" width="35" height="19" alt="基金价格" border="0"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0--><a href="/hsb/com/redir.html?From=\'cHome_Tab\'&p=http://sc.hangseng.com/gb/www.hangseng.com/hsb/chi/per/invs/hsss/etf2/home/main.html" target="_blank"><img src="/hsb/schi/image/tab_etf2.gif" width="25" height="11" alt="\u4EA4\u6613\u6240\u4E70\u5356\u57FA\u91D1" border="0" vspace="4"></a><img src="/hsb/com/spacer.gif" width=7 height=1 border=0><a href="/hsb/com/redir.html?From=\'cHome_Tab\'&p=http://scmain.hangseng.com/gb/www.hsi.com.hk/c_family/family.html" target="_blank"><img src="/hsb/schi/image/tab_hsi2.gif" width="29" height="15" alt="\u6052\u751F\u6307\u6570" border="0" vapace="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=534px z-index=85 visibility=hide onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}
	else {
		html+='</div>\n';
		html+='<div id="layertabebank" style="position:absolute; top:86px; left:534px;" onMouseOver="stopTime();" onMouseOut="startTime();">\n';
	}

	var url =escape("http://www.hangseng.com/pibgp/getdpage.asp?link=d001&lang=chi&dm=prd1");
	html+='<a href="javascript:PopUp(\'/hsb/com/redir.html?From=\\\'cHome_Tab\\\'&p='+url+',\'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/schi/image/tab_ebper2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebper" src="/hsb/schi/image/tab_ebper.gif" width="68" height="14" alt="个人e-Banking" border="0"></a><br><a href="javascript:tab_hsbc_login_popup(\'c\',\'home\');" onMouseOver="hideAll(); showLayer(\'layertabebank\'); MM_swapImage(\'ebbiz\',\'\',\'/hsb/schi/image/tab_ebbiz2.gif\',1); stopTime()" onMouseOut="MM_swapImgRestore();startTime();"><img name="ebbiz" src="/hsb/schi/image/tab_ebbiz.gif" width="68" height="13" alt="\u5546\u4E1Ae-Banking" border="0"></a>';

	isNetscape4?html+='</layer>\n':html+='</div>\n';

	document.write(html);*/
}

function switchEng() {

	var 	x='';
	var 	s=new	String(parent.document.location);
	re0=/sc.hangseng.com\/gb\//g;
	s=s.replace(re0,"");
	
	var	b='/chi/';
	var	p=s.indexOf(b);
	var	h='http' + '://' ;
	var 	host=new String(parent.document.location.host);
	var	scmain=host+'/gb/';
	var	c='?From';
	var	q=s.indexOf(c);
	
	
	var	domain='';
	var 	re = /scmain.hangseng.com/i;
  var   re1 = /scmain.hangseng.com\/gb/g;
  var   re2 = /\/\/\//g;
  if (re.test(host)) {
		domain = 'main.hangseng.com';
		if (p>0){ 
			if(q>0){
				x=s.substr(0,p)+'/eng/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=s.substr(0,p)+'/eng/'+s.substr(p+b.length);
			}
			x=x.replace(re1,"");
			x=x.replace(re2,"//");
		}
		
	}else{
		domain = 'www.hangseng.com';
		if (p>0){ 
	/*		if(q>0){
				x=h+domain+'/hsb/eng/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=h+domain+'/hsb/eng/'+s.substr(p+b.length);
			}*/
			if(q>0){
				x=s.substr(0,p)+'/eng/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=s.substr(0,p)+'/eng/'+s.substr(p+b.length);
			}
	
		}
		// add on 24-Oct-05 to cater for Loan Calculators on eINVC server
		else {
			if (s.indexOf("eba.hangseng.com") > 0 && s.indexOf("lang=chs") > 0) {
				x = s.replace("lang=chs","lang=enu");
			}
		}
		// end 24-Oct-05
	
	}
	//alert('domain = "' + domain + '"');
	

	if (x!='')
		parent.location.href=x;

	//return false;
}

function switchTrad() {

	var 	x='';
	var 	s=new	String(parent.document.location);
	re0=/sc.hangseng.com\/gb\//g;
	s=s.replace(re0,"");
	var	b='/chi/';
	var	p=s.indexOf(b);
	var	h='http' + '://' ;
	
	var 	host=new String(parent.document.location.host);
	var	scmain=host+'/gb/';
	var	c='?From';
	var	q=s.indexOf(c);

	
	var	domain='';
	var 	re = /scmain.hangseng.com/i;
	var   re1 = /scmain.hangseng.com\/gb/g;
	var   re2 = /\/\/\//g;
        if (re.test(host)) {
		domain = 'main.hangseng.com';	
		
		if (p>0){ 
			if(q>0){
				x=s.substr(0,p)+'/chi/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=s.substr(0,p)+'/chi/'+s.substr(p+b.length);
			}
			x=x.replace(re1,"");
			x=x.replace(re2,"//");
		}

	}else{
		domain = 'www.hangseng.com';
		
		if (p>0){ 
			
			if(q>0){
				x=s.substr(0,p)+'/chi/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=s.substr(0,p)+'/chi/'+s.substr(p+b.length);
			}
			/*if(q>0){
				x=h+domain+'/hsb/chi/'+s.substr(p+b.length,q-(p+b.length));
			}else{
				x=h+domain+'/hsb/chi/'+s.substr(p+b.length);
			}*/
		}
		// add on 24-Oct-05 to cater for Loan Calculators on eINVC server
		else {
			if (s.indexOf("eba.hangseng.com") > 0 && s.indexOf("lang=chs") > 0) {
				x = s.replace("lang=chs","lang=cht");
			}
		}
		// end 24-Oct-05
	}
	

	if (x!='')
		parent.location.href=x;

	//return false;
}

function switchHome() {

	var 	x='';
	var 	s=new	String(parent.document.location);
	var	b='/chi/';
	var	p=s.indexOf(b);
	var	h='http' + '://' ;
	var 	host=new String(parent.document.location.host);
	var	scmain=host+'/gb/';

	//var	domain='';
	//domain=s.substr(h.length+scmain.length,p-(h.length+scmain.length));
		//alert('domain = "' + domain + '"');
	//var re = /hangseng.com/i;
        //if (!re.test(domain)) 
	//	domain = 'www.hangseng.com';

	var	domain='';
	var 	re = /main.hangseng.com/i;
        if (re.test(host)) 
		domain = 'main.hangseng.com';
	else
		domain = 'www.hangseng.com';
	
	if (p>0) { 
		x=h+scmain+domain+'/hsc.html';
	}

	if (x!='')
		parent.location.href=x;

	//return false;
}
function showratelogo(w) {
	var h = 54;
	document.write("<a href='http://sc.hangseng.com/gb/www.hangseng.com/hsb/chi/rate/prate/index.html' target='_top'>");
	if (w==133) {
		document.write("<img src='/hsb/schi/image/btn_p_01.gif' weight='" + w + "' height='" + h + "' border='0'>");
	} else {
		h = w * 74 / 181;
		document.write("<img src='/hsb/schi/image/btn_c.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/schi/image/mort_box_01.gif' width='7' height='27'>");
	document.write ("</td>");
	document.write ("<td><img src='/hsb/schi/image/mort_box_02.gif' width='167' height='27' alt=''></td>");
	document.write ("<td><img src='/hsb/schi/image/mort_box_03.gif' width='8' height='27' alt=''></td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td height='31' background='/hsb/schi/image/mort_box_04.gif'> <img src='/hsb/schi/image/mort_box_04.gif' width='7' height='19' alt=''></td>");
	document.write ("<td align='center' background='/hsb/schi/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/schi/rate/prate/index.html' target='_top'><img src='/hsb/schi/image/btn_p1.gif' width='28' height='21' align='top' border='0'></a> - ");
	//document.write ("P - ");
	document.write ("P-2.5 to P-");
	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/schi/image/mort_box_06.gif'> <img src='/hsb/schi/image/mort_box_06.gif' width='8' height='19' alt=''></td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td background='/hsb/schi/image/mort_box_10.gif'>&nbsp; </td>");
	document.write ("<td valign='top' bgcolor='#BBDDFF' class='box-content'><font color='#000000'>");
	document.write ("P = ");
	document.write ("<a href='http://sc.hangseng.com/gb/www.hangseng.com/hsb/chi/rate/prate/index.html'>");
	//document.write ("<img src='/hsb/schi/image/p_txt.gif' width='167' height='19' border='0'>");
	document.write ("恒生港元最优惠利率");
	document.write ("</a>");
	document.write ("<br><span class='notes'><font size='1' color='#666666'>*只供参考</font></span></font>");
	document.write ("<img src='/hsb/schi/image/spacer.gif' height='15'>");
	document.write ("</td>");
	document.write ("<td background='/hsb/schi/image/mort_box_12.gif'> </td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td> <img src='/hsb/schi/image/mort_box_16.gif' width='7' height='12' alt=''></td>");
	document.write ("<td valign='top'> <img src='/hsb/schi/image/mort_box_17.gif' alt='' width='167' height='12'></td>");
	document.write ("<td valign='top'> <img src='/hsb/schi/image/mort_box_18.gif' width='8' height='12' alt=''></td>");
	document.write ("</tr>");
	document.write ("</table>");
}

//-->
