var kanhan;
var filepath;
kanhan = (document.location.toString().search("/gb/") != -1);
if (kanhan)
	filepath = "/SC/";
else
	filepath = "/TC/";

function simg(obj,src)
{
	if (kanhan)
		src = src.replace("/FileManager/TC/", "/FileManager/SC/");
	if (document.images){
		obj.src = src;
	}
}

function overTopMenu(obj)
{
	if (document.images){
		eval("document.images." + obj + ".src = '/FileManager" + filepath + "UTIL_UTEMPLATE/06bc/" + obj + "_over.gif'");
	}
}

function outTopMenu(obj)
{
	if (document.images){
		eval("document.images." + obj + ".src = '/FileManager" + filepath + "UTIL_UTEMPLATE/06bc/" + obj + ".gif'");
	}
}

function styleSheet(){
	var styleType='style.css';
	
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4)) {
		document.writeln('<link href="/FileManager' + filepath + 'UTIL_UTEMPLATE/06bc/css/nt_'+styleType+'" rel="STYLESHEET" type="text/css">');
	}else{
		document.writeln('<link href="/FileManager' + filepath + 'UTIL_UTEMPLATE/06bc/css/'+styleType+'" rel="STYLESHEET" type="text/css">');
	}
}

function initObj()
{
	if (kanhan)
	{
		var obj;
		var arrNodeID=new Array("pic939","pic940","pic941","pic942","pic943","pic945","pic946","pic947","Image19","Image20","Image261","main_pic");
		for (var i=0;i<arrNodeID.length;i++)
		{
			obj = document.getElementById(arrNodeID[i]);
			if (obj) obj.src = obj.src.replace("/FileManager/TC/", "/FileManager/SC/");
		}
		var arrLinks = document.getElementsByTagName("a");
		for (var i=0;i<arrLinks.length;i++)
		{
			arrLinks[i].href = arrLinks[i].href.replace("/FileManager/TC/", "/FileManager/SC/");
		}
	}
}

function showChiLangBtn()
{
	if (kanhan)
	{
		langid = 2;
		langAlt = "中文繁體";
	} else {
		langid = 3;
		langAlt = "中文簡體";
	}
	document.write('<td><A onmouseover="overTopMenu(\'lang_btn1\')" onmouseout="outTopMenu(\'lang_btn1\')" href="javascript:changeLanguage(' + langid + ')"><IMG id=lang_btn1 alt=' + langAlt + ' src="/FileManager' + filepath + 'UTIL_UTEMPLATE/06bc/lang_btn1.gif" border=0 name=lang_btn1></A></td>');
}

function changeLanguage(langid) {
	var lh = parent.location.href;
	var l = "";
	var was_ch = ((lh.search("index_tc")!=-1)?true:false);
	if (langid == 1) {
		l = "en";
		if (was_ch) lh = lh.replace("index_tc", "index");
	}
	if (langid == 2) {
		l = "tc";
		if (!was_ch) lh = lh.replace("index", "index_tc");
	}
	if (langid == 3) {
		l = "sc";
		if (!was_ch) lh = lh.replace("index", "index_tc");
	}
	lh = lh.replace("/tc/", "/"+l+"/");
	lh = lh.replace("/sc/", "/"+l+"/");
	lh = lh.replace("/en/", "/"+l+"/");
	parent.location.href = lh;
}
/*
function changeLanguage(langid)
{
	var sUrl = document.location.toString();
	if (sUrl.search("/gb/") != -1)
	{
		sUrl = sUrl.replace("//sc.info.gov.hk/gb/", "//");
		sUrl = sUrl.replace("//common.westcomzivo.com/gb/", "//");
		sUrl = sUrl.substring(0, sUrl.indexOf("/", sUrl.indexOf("//")+2 ));
	} else {
		sUrl = document.location.protocol + "//" + document.location.host;
	}
	if (langid == 1)
	{
		sUrl += oPageVar.NodeFullLink_EN;
	}
	if (langid == 2)
	{
		sUrl += oPageVar.NodeFullLink_TC;
	}
	if (langid == 3)
	{
		sUrl = oPageVar.NodeFullLink_SC;
		if (sUrl.search("westcomzivo.com") != -1)
			sUrl = sUrl.replace("//sc.info.gov.hk/", "//common.westcomzivo.com/");
		if(get_cookie('InfoGovHK')!='visited')
		{
			sTmp = "/tc/disclaimer/index.htm";
			if (sTmp.indexOf("?")==-1) sTmp += "?";
			else sTmp += "&";
			sUrl = sTmp + "Location=" + sUrl;
		}
	}
	document.location.href=sUrl;
}
*/
function showCopyRight()
{
	document.write("&copy;");
}

styleSheet();
function ShowHeader(){

// ----- ^ TTemplateText ^ -----
document.write('<TABLE cellSpacing=0 cellPadding=0 width=760 align=center bgColor=#ffffff border=0>\n');
document.write('<TBODY>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD width=17><IMG alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/pix_left_01.jpg" border=0></TD>\n');
document.write('<TD width=167 bgColor=#efefef>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 border=0>\n');
document.write('<TBODY>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><IMG alt="二零零六年中期人口統計" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/logo.jpg" border=0></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic939, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_939_over.gif\');" onmouseout="simg(pic939, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_939.gif\');" href="/tc/whatsnew/index_tc.htm"><IMG id=pic939 alt=最新消息 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_939.gif" border=0 name=pic939></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic940, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_940_over.gif\');" onmouseout="simg(pic940, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_940.gif\');" href="/tc/press/index_tc.htm"><IMG id=pic940 alt=新聞稿和演辭 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_940.gif" border=0 name=pic940></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic941, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_941_over.gif\');" onmouseout="simg(pic941, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_941.gif\');" href="/tc/background/index_tc.htm"><IMG id=pic941 alt=背景資料 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_941.gif" border=0 name=pic941></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic942, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_942_over.gif\');" onmouseout="simg(pic942, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_942.gif\');" href="/tc/data/index_tc.htm"><IMG id=pic942 alt=數據發布 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_942.gif" border=0 name=pic942></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic943, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_943_over.gif\');" onmouseout="simg(pic943, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_943.gif\');" href="/tc/publicity/index_tc.htm"><IMG id=pic943 alt=宣傳物品 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_943.gif" border=0 name=pic943></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic945, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_945_over.gif\');" onmouseout="simg(pic945, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_945.gif\');" href="/tc/photo/index_tc.htm"><IMG id=pic945 alt=相片廊 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_945.gif" border=0 name=pic945></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic946, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_946_over.gif\');" onmouseout="simg(pic946, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_946.gif\');" href="/tc/faq/index_tc.htm"><IMG id=pic946 alt=常見問題 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_946.gif" border=0 name=pic946></A></TD></TR>\n');
document.write('<TR vAlign=top>\n');
document.write('<TD><A onmouseover="simg(pic947, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_947_over.gif\');" onmouseout="simg(pic947, \'/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_947.gif\');" href="/tc/links/index_tc.htm"><IMG id=pic947 alt=相關網址 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_947.gif" border=0 name=pic947></A></TD></TR></TBODY></TABLE></TD>\n');
document.write('<TD width=576>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 width=576 border=0>\n');
document.write('<TBODY>\n');
document.write('<TR>\n');
document.write('<TD vAlign=bottom height=36>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 border=0>\n');
document.write('<TBODY>\n');
document.write('<TR vAlign=bottom>\n');
document.write('<TD><IMG alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/pix_02.jpg" border=0></TD>\n');
document.write('<TD><A onmouseover="simg(Image19,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_print_over.gif\')" onmouseout="simg(Image19,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_print.gif\')" href="javascript:window.print();"><IMG id=Image19 alt=列印 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_print.gif" border=0 name=Image19></A></TD>\n');
document.write('<TD><A onmouseover="simg(Image20,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_sitemap_over.gif\')" onmouseout="simg(Image20,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_sitemap.gif\')" href="/tc/sitemap/index_tc.htm"><IMG id=Image20 alt=網頁指南 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_sitemap.gif" border=0 name=Image20 oSrc="/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_sitemap.gif"></A></TD>\n');
document.write('<TD><A onmouseover="simg(Image261,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_contact_over.gif\')" onmouseout="simg(Image261,\'/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_contact.gif\')" href="/tc/contactus/index_tc.htm"><IMG id=Image261 alt=聯絡我們 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_contact.gif" border=0 name=Image261 oSrc="/FileManager/TC/UTIL_UTEMPLATE/06bc/btn_contact.gif"></A></TD></TR></TBODY></TABLE></TD></TR>\n');
document.write('<TR>\n');
document.write('<TD><!-- Content -->\n');

// ----- v TTemplateText v -----
}

function ShowFooter(){

// ----- ^ TTemplateText ^ -----
document.write('<!-- End of Content --></TD>\n');
document.write('<TR>\n');
document.write('<TD>\n');
document.write('<TABLE height=22 cellSpacing=0 cellPadding=0 width=576 border=0>\n');
document.write('<TBODY>\n');
document.write('<TR>\n');
document.write('<TD width=332 height=22>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 align=center border=0>\n');
document.write('<TBODY>\n');
document.write('<TR>\n');
document.write('<SCR'+'IPT>showChiLangBtn()</SCR'+'IPT>\n');
document.write('<TD><A onmouseover="overTopMenu(\'lang_btn2\')" onmouseout="outTopMenu(\'lang_btn2\')" href="javascript:changeLanguage(1)"><IMG id=lang_btn2 alt=English src="/FileManager/TC/UTIL_UTEMPLATE/06bc/lang_btn2.gif" border=0 name=lang_btn2></A></TD></TR></TBODY></TABLE></TD>\n');
document.write('<TD width=244 height=22><IMG height=22 alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/pix_03.gif" width=244></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>\n');
document.write('<TR>\n');
document.write('<TD><IMG height=71 alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/pix_left_02.jpg" width=17></TD>\n');
document.write('<TD><IMG height=71 alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/nav_pix_01.jpg" width=167></TD>\n');
document.write('<TD><IMG height=71 alt="" src="/FileManager/TC/UTIL_UTEMPLATE/06bc/pix_04.jpg" width=576></TD></TR>\n');
document.write('<TR>\n');
document.write('<TD height="100%">&nbsp;</TD>\n');
document.write('<TD colSpan=2 height="100%">\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>\n');
document.write('<TBODY>\n');
document.write('<TR>\n');
document.write('<TD><A href="http://www.censtatd.gov.hk" target=_blank><IMG alt=政府統計處 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/logo_01.jpg" border=0></A></TD>\n');
document.write('<TD><A href="http://www.gov.hk" target=_blank><IMG alt=香港政府一站通 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/logo_02.gif" border=0></A></TD>\n');
document.write('<TD><A href="http://www.brandhk.gov.hk/brandhk/" target=_blank><IMG alt=香港品牌形象 src="/FileManager/TC/UTIL_UTEMPLATE/06bc/logo_03.jpg" border=0></A></TD>\n');
document.write('<TD width="100%">&nbsp;</TD></TR>\n');
document.write('<TR>\n');
document.write('<TD class=copyright vAlign=top colSpan=4>版權所有 不得轉載\n');
document.write('<SCR'+'IPT>showCopyRight()</SCR'+'IPT>\n');
document.write('2006 政府統計處</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><A class=Link href="/tc/whatsnew/index.htm"></A><A class=Link href="/tc/press/index.htm"></A><A class=Link href="/tc/background/index.htm"></A><A class=Link href="/tc/data/index.htm"></A><A class=Link href="/tc/faq/index.htm"></A><A class=Link href="/tc/whatsnew/index_tc.htm"></A><A class=Link href="/tc/press/index_tc.htm"></A><A class=Link href="/tc/background/index_tc.htm"></A><A class=Link href="/tc/data/index_tc.htm"></A><A class=Link href="/tc/faq/index_tc.htm"></A>\n');
document.write('<SCR'+'IPT>initObj()</SCR'+'IPT>\n');

// ----- v TTemplateText v -----


}

