﻿// JavaScript Document
    function submit_search() {
        if (document.getElementById('txt_search').value.length > 0 && document.getElementById('txt_search').value != 'Search your text here') {
            document.forms.frm_search.QueryExpr.value = document.getElementById('txt_search').value;
            document.forms.frm_search.submit();
        } else {
        alert('Please fill in your search criteria');
        }
    }
	function url_forwardToFriends_click() {
		document.location.href = "/scripts/forward_to_friend.aspx?hkcflang=E&url=" + escape(document.location.href);
	}

	function go(page) {
		if (page != 0)
			self.location.href = page;
	}

	function chLang(lang) {
		var currentPath=location.href.toString();
		var switchTc='/tc/';
		var switchEn='/en/';
		var switchSc = '/sc/';
		var hkcfEn = 'hkcflang=E';
		var hkcfTc = 'hkcflang=C';
	
		switch (lang){
			case '/sc/':
				currentPath=currentPath.replace(switchTc, switchSc);
				currentPath=currentPath.replace(switchEn, switchSc);
				break;
			case '/en/':
				currentPath=currentPath.replace(switchTc, switchEn);
				currentPath=currentPath.replace(switchSc, switchEn);
				currentPath=currentPath.replace(hkcfTc,  hkcfEn);
				break;
			case '/tc/':
				currentPath=currentPath.replace(switchEn, switchTc);
				currentPath=currentPath.replace(switchSc, switchTc);
				currentPath=currentPath.replace(hkcfEn,  hkcfTc);
				break;
			default:
		}
	
		document.location=currentPath;
	}

document.writeln("<div class=\"topArea\">");
document.writeln("        <a href=\"/en/index.html\" class=\"logolink\"><img src=\"../images/spacer.gif\" /></a>");
document.writeln("            <span class=\"toptxt\">");
document.writeln("            <a href=\"javascript:chLang('/tc/')\">繁</a>  | <a href=\"javascript:chLang('/en/')\"> Eng</a> |  <a href=\"sitemap.html\">Sitemap</a>  &nbsp; &nbsp;<br>");
document.writeln("            <input type=\"text\" value=\"Search your text here\" class=\"input\" id=\"txt_search\" onclick=\"this.select();\" /> <a onclick=\"submit_search();\" style=\"cursor:pointer;\"><input type=\"button\" class=\"btnGo\"></a>  &nbsp; ");
document.writeln("            <label><a id=\"url_forwardToFriends\" onclick=\"url_forwardToFriends_click();\" style=\"cursor:pointer;\">Forward to a Friend <input type=\"button\" class=\"Forward\"></a></label>&nbsp; ");
document.writeln("            <label>print <input type=\"button\" onClick=\"window.print();return false;\"  class=\"btnPrint\" onMouseOver=\"this.className='btnPrintOn'\" onMouseOut=\"this.className='btnPrint'\"></label> &nbsp; ");
document.writeln("            text size");
document.writeln("             <input type=\"button\" onClick=\"changeFontL();\"  class=\"btnSize1\" onMouseOver=\"this.className='btnSize1On'\" onMouseOut=\"this.className='btnSize1'\"> ");
document.writeln("             <input type=\"button\" onClick=\"changeFontS();\"  class=\"btnSize2\" onMouseOver=\"this.className='btnSize2On'\" onMouseOut=\"this.className='btnSize2'\">");
document.writeln("           </span>");
document.writeln("");
document.writeln("            <form name=\"frm_search\" method=\"get\" action=\"/scripts/search.aspx\">");
document.writeln("            <input type=\"hidden\" name=\"hkcflang\" value=\"E\" />");
document.writeln("            <input type=\"hidden\" name=\"QueryExpr\" value=\"\" />");
document.writeln("            </form>");
document.writeln("");
document.writeln("        </div>");