//commented by GLTc
//chLang: 	1. new URL = the current one with language key words replaced
//		2. change the current page to the new URL
//Parameter:	
//		1. code of language (eg, eng, chi, gbx)
//
function chLang(lang) {
	var link = parent.location.href;
	var endLink = link.length;
	var i;
	var n;
	var found = 0;
	
	for(i = 0; i <= endLink; i++) {
		n = i + 3;
		if (link.substring(i, n) == "eng") {
			chLink = link.substring(0, i) + lang + link.substring(n, endLink);
			break;
		}   else if (link.substring(i, n) == "chi") {
			chLink = link.substring(0, i) + lang + link.substring(n, endLink);
			break;
		}	else if (link.substring(i, n) == "gbx") {
			chLink = link.substring(0, i) + lang + link.substring(n, endLink);
			
		}
	}
	//alert(lang);
	parent.location.href = chLink;
}

//added by GLTc, cater for the current file structure
//chLangEx: 	1. new URL = the current one with language key words replaced
//		2. change the current page to the new URL
//Parameter:	
//		1. code of language (eg, /e_, /c_, /s_)
//
function chLangEx(lang) {
	var mHost = new String(top.location.hostname);
	var mHref = new String(top.location.href);
	var path = new String(top.location.pathname);

	if (lang == "/e_") {
		mHref = mHref.replace(/\/c_/,"/e_");
		//href = href.replace("/chi/","/eng/");
		if (mHost == "sc.hangseng.com") mHref = mHref.replace(/sc.hangseng.com\/gb\//,"");
	} else if (lang == "/c_") {
		mHref = mHref.replace(/\/e_/,"/c_");
		//href = href.replace("/eng/","/chi/");
		if (mHost == "sc.hangseng.com") mHref = mHref.replace(/sc.hangseng.com\/gb\//,"");
	} else if (lang == "/s_") {
		path = path.replace(/\/e_/,"/c_");
		//path = path.replace("/eng/","/chi/");
		mHref = "http://sc.hangseng.com/gb/" + mHost + path;
	}
//   alert (mHref);
	top.location.href = mHref;
}

function go(page) {
	if (page != 0)
		self.location.href = page;
}
function changePage(obj) {
    i = obj.issue.selectedIndex;
		location = obj.issue.options[i].value;                
}