<!--
var menu_timerID=null;
var menu_timerOn=false;
var menu_timeOut=300;
var menu_check=false;
var menu_count=8;

function activateMenu() {
	menu_check=true;
	hideAll();
}

function hideAll() {
	for (var i=0;i<menu_count;i++) hideLayer('layernav'+i);
}

function showLayer(l) {
	if (!menu_check) return;
	document.getElementById(l).style.visibility="visible";
}

function hideLayer(l) {
	if (!menu_check) return;
	document.getElementById(l).style.visibility="hidden";
}

function startTime() {
	if (!menu_timerOn) {
		menu_timerID=setTimeout("hideAll()", menu_timeOut);
		menu_timerOn=true;
	}
}

function stopTime() {
	if (menu_timerOn) {
		clearTimeout(menu_timerID);
		menu_timerID=null;
		menu_timerOn=false;
	}
}

function overColor(obj) {	obj.style.backgroundColor='#A3C27C'; }
function normColor(obj) {	obj.style.backgroundColor='#EAFCCC'; }

function switchEng() {
	var d=new String(location.hostname);
	var c=new String(location.href);
	c=c.replace(/\/c_/,"/e_");
	c=c.replace("/chi/","/eng/");
	if (d=="sc.hangseng.com") c=c.replace(/sc.hangseng.com\/gb\//,"");
	location.href=c;
}

function switchTrad() {
	var d=new String(top.location.hostname);
	var c=new String(top.location.href);
	c=c.replace(/\/e_/,"/c_");
	c=c.replace("/eng/","/chi/");
	if (d=="sc.hangseng.com") c=c.replace(/sc.hangseng.com\/gb\//,"");
	top.location.href=c;
}

function switchSimp() {
	var d=new String(top.location.hostname);
	var c=new String(top.location.pathname);
	var e=new String(top.location.search);

//alert (location.search);
	
	//add location.search for Mortgage selector, by Hao 20061114
	// "/mortgage_selector/selector01.html" -- "/mortgage_selector/selector05.html"
	var selector = /\/mortgage_selector\/selector0[1-5]\.html/i;

	if (selector.test(c)) 		//detect simplified chinese
		c+= location.search;
	
	//end add
	
	c=c.replace(/\/e_/,"/c_");
	c=c.replace("/eng/","/chi/");
	top.location.href="http://sc.hangseng.com/gb/"+d+c+e;
}
-->

