function overTopMenu(obj)
{
      if (document.images){
			eval("document.images." + obj + ".src = '/FileManager/EN/UTIL_UTEMPLATE/06bc/" + obj + "_over.gif'");
      }
}

function outTopMenu(obj)
{
      if (document.images){
			eval("document.images." + obj + ".src = '/FileManager/EN/UTIL_UTEMPLATE/06bc/" + obj + ".gif'");
      }
}

function initObj()
{
	var nodeid = oThisNode.NodeID;
	if (oThisNode.LevelNo > 2)
	{
		for( var i = 0; i < oPageVar.Parents.length; i++ ){
			if( oPageVar.Parents[i].LevelNo == 2){
				nodeid = oPageVar.Parents[i].NodeID;
				break;
			}
		}
	}
	var obj = document.getElementById("head_img");
	if (obj) obj.src = "/FileManager/EN/UTIL_UTEMPLATE/06bc/hd_" + nodeid + ".gif";
	
	obj = document.getElementById("pic"+nodeid);
	if (obj) obj.src = "/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_" + nodeid + "_over.gif";

	obj = document.getElementById("link"+nodeid);
	if (obj) obj.onmouseout = "";

	if(window.name=='PrintPage')
		window.print();
}

function styleSheet(){
	var styleType='style.css';
	
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4)) {
		document.writeln('<link href="/FileManager/EN/UTIL_UTEMPLATE/06bc/css/nt_'+styleType+'" rel="STYLESHEET" type="text/css">');
	}else{
		document.writeln('<link href="/FileManager/EN/UTIL_UTEMPLATE/06bc/css/'+styleType+'" rel="STYLESHEET" type="text/css">');
	}
}

function getRevisionDate(){
	var monthArray=new Array();
	monthArray[0]='January';
	monthArray[1]='February';
	monthArray[2]='March';
	monthArray[3]='April';
	monthArray[4]='May';
	monthArray[5]='June';
	monthArray[6]='July';
	monthArray[7]='August';
	monthArray[8]='September';
	monthArray[9]='October';
	monthArray[10]='November';
	monthArray[11]='December';
	var rDate = oDateTimeInfo.StartTime;
	var rDateText = "Last revision date: ";
	if (oDateTimeInfo.ReviewTime > rDate) {
		rDate = oDateTimeInfo.ReviewTime;
		rDateText = "Last review date: ";
	}
	if (oDateTimeInfo.RevisionTime > rDate) {
		rDate = oDateTimeInfo.RevisionTime;
		rDateText = "Last revision date: ";
	}
	rDateText += rDate.getDate()+' '+monthArray[rDate.getMonth()]+' '+rDate.getFullYear();
	document.write(rDateText);
}

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/");
	}
	document.location.href=sUrl;
}
*/
function showCopyRight()
{
	document.write("&copy;");
}

function PopImg(img, nodeid, page,x,y){
	var url = "/en/popup/index.htm";
	var sUrl = document.location.toString();
	if (sUrl.search("/gb/") != -1)
		url = sUrl.substring(0, sUrl.indexOf("/", sUrl.indexOf("/gb/")+4 )) + url;
	url += ((url.indexOf("?")==-1)?"?":"&") + "img="+img+"&fromnodeID="+nodeid;
	eval("nw = window.open(url, page,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=0,width=" + x + ",height=" + y + "')");
	if ( nw.focus != null)
	{nw.focus();}
}

function PrintDocument(){
	window.open(document.URL,'PrintPage','top=10,left=10,height=500,width=650,scrollbars=1');
}

function getLeftMenu(){
	if (window.name!='PrintPage')
	{
		document.writeln('<TD width=10><IMG alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_pix_left.jpg" border=0></TD>');
		document.writeln('<TD width=147>');
		document.writeln('<TABLE cellSpacing=0 cellPadding=0 border=0>');
		document.writeln('<TBODY><!-- need write a js for the effect of menu onmouse over -->');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A href="/en/index.htm"><IMG alt="2006 Population By-census" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_logo.gif" border=0></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link939 onmouseover="simg(pic939, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_939_over.gif\');" onmouseout="simg(pic939, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_939.gif\');" href="/en/whatsnew/index.htm"><IMG id=pic939 alt="What\'s New" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_939.gif" border=0 name=pic939></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link940 onmouseover="simg(pic940, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_940_over.gif\');" onmouseout="simg(pic940, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_940.gif\');" href="/en/press/index.htm"><IMG id=pic940 alt="Press Release and Speeches" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_940.gif" border=0 name=pic940></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link941 onmouseover="simg(pic941, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_941_over.gif\');" onmouseout="simg(pic941, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_941.gif\');" href="/en/background/index.htm"><IMG id=pic941 alt="Background Information" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_941.gif" border=0 name=pic941></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link942 onmouseover="simg(pic942, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_942_over.gif\');" onmouseout="simg(pic942, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_942.gif\');" href="/en/data/index.htm"><IMG id=pic942 alt="Data Dissemination" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_942.gif" border=0 name=pic942></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link943 onmouseover="simg(pic943, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_943_over.gif\');" onmouseout="simg(pic943, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_943.gif\');" href="/en/publicity/index.htm"><IMG id=pic943 alt="Publicity Materials" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_943.gif" border=0 name=pic943></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link945 onmouseover="simg(pic945, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_945_over.gif\');" onmouseout="simg(pic945, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_945.gif\');" href="/en/photo/index.htm"><IMG id=pic945 alt="Photo Gallery" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_945.gif" border=0 name=pic945></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link946 onmouseover="simg(pic946, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_946_over.gif\');" onmouseout="simg(pic946, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_946.gif\');" href="/en/faq/index.htm"><IMG id=pic946 alt="Frequently Asked Questions" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_946.gif" border=0 name=pic946></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><A id=link947 onmouseover="simg(pic947, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_947_over.gif\');" onmouseout="simg(pic947, \'/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_947.gif\');" href="/en/links/index.htm"><IMG id=pic947 alt=Links src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_947.gif" border=0 name=pic947></A></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><IMG alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_nav_pix_01.gif" border=0></TD></TR></TBODY></TABLE></TD>');
	}
}

function getTopMenu(){
	if (window.name!='PrintPage')
	{
		document.writeln('<TD>');
		document.writeln('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>');
		document.writeln('<TBODY>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD width=9 height=32><IMG alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_pix_07.jpg" border=0></TD>');
		document.writeln('<TD vAlign=bottom height=32>');
		document.writeln('<TABLE height=22 cellSpacing=0 cellPadding=0 width="100%" border=0>');
		document.writeln('<TBODY>');
		document.writeln('<TR>');
		document.writeln('<TD width="100%" height=22>');
		document.writeln('<TABLE cellSpacing=0 cellPadding=0 border=0>');
		document.writeln('<TBODY>');
		document.writeln('<TR>');
		document.writeln('<TD><A onmouseover="overTopMenu(\'lang_btn1\')" onmouseout="outTopMenu(\'lang_btn1\')" href="javascript:changeLanguage(2)"><IMG id=lang_btn1 alt="Traditional Chinese" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/lang_btn1.gif" border=0 name=lang_btn1></A></TD>');
		document.writeln('<TD><A onmouseover="overTopMenu(\'lang_btn2\')" onmouseout="outTopMenu(\'lang_btn2\')" href="javascript:changeLanguage(3)"><IMG id=lang_btn2 alt="Simplified Chinese" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/lang_btn2.gif" border=0 name=lang_btn2></A></TD></TR></TBODY></TABLE></TD>');
		document.writeln('<TD width=239 height=22>');
		document.writeln('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>');
		document.writeln('<TBODY>');
		document.writeln('<TR>');
		document.writeln('<TD><A onmouseover="overTopMenu(\'btn_print\')" onmouseout="outTopMenu(\'btn_print\')" href="javascript:PrintDocument();"><IMG alt=Print src="/FileManager/EN/UTIL_UTEMPLATE/06bc/btn_print.gif" border=0 name=btn_print></A></TD>');
		document.writeln('<TD><A onmouseover="overTopMenu(\'btn_sitemap\')" onmouseout="outTopMenu(\'btn_sitemap\')" href="/en/sitemap/index.htm"><IMG alt="Site Map" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/btn_sitemap.gif" border=0 name=btn_sitemap></A></TD>');
		document.writeln('<TD><A onmouseover="overTopMenu(\'btn_contact\')" onmouseout="outTopMenu(\'btn_contact\')" href="/en/contactus/index.htm"><IMG alt="Contact Us" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/btn_contact.gif" border=0 name=btn_contact></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>');
		document.writeln('<TR vAlign=top>');
		document.writeln('<TD><IMG alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_pix_08.jpg" border=0></TD>');
		document.writeln('<TD background=/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_main_vis.jpg height=96><IMG height=96 alt="2006 Population By-census" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=1 border=0></TD></TR>');
		document.writeln('<TR>');
		document.writeln('<TD width=9><IMG height=1 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=9 border=0></TD>');
		document.writeln('<TD background=/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_bg.gif>');
		document.writeln('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>');
		document.writeln('<TBODY>');
		document.writeln('<TR>');
		document.writeln('<TD width=20 rowSpan=2><IMG height=50 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=25></TD>');
	}
}

styleSheet()

function ShowHeader(){

// ----- ^ TTemplateText ^ -----
document.write('<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>\n');
document.write('<TBODY>\n');
document.write('<TR vAlign=top>\n');
document.write('<SCR'+'IPT>\n');
document.write('getLeftMenu();\n');
document.write('getTopMenu();\n');
document.write('</SCR'+'IPT>\n');
document.write('<TD width=554 height=80><!-- show the header image-->\n');
document.write('<P><IMG id=head_img alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" align=top border=0></P></TD>\n');
document.write('<TD width=20 rowSpan=2><IMG height=50 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=25></TD></TR>\n');
document.write('<TR>\n');
document.write('<TD class=text><!-- content here!!!! -->\n');

// ----- v TTemplateText v -----
}

function ShowFooter(){

// ----- ^ TTemplateText ^ -----
document.write('<!-- content end --></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR><TR><TD background="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_pix_low_bg.gif" colSpan="3">\n');
document.write('<DIV align=right><IMG height=15 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/sub_pix_low.gif" width=760></DIV></TD></TR><TR vAlign="top"><TD colSpan="3">\n');
document.write('<P>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>\n');
document.write('<TBODY>\n');
document.write('<TR>\n');
document.write('<TD><IMG height=1 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=5 border=0></TD>\n');
document.write('<TD vAlign=top align=middle>\n');
document.write('<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>\n');
document.write('<TBODY>\n');
document.write('<TR bgColor=#ffffff>\n');
document.write('<TD bgColor=#ffffff height=15><B>2006</B> <IMG height=11 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/copy.gif" width=12> | <A class=footer href="/en/impnotices/index.htm"><STRONG>Important notices</STRONG></A> | <A class=text_link href="/en/privacy_policy/index.htm"><STRONG>Privacy policy</STRONG></A></TD><!-- show revision date -->\n');
document.write('<TD align=right bgColor=#ffffff height=15>\n');
document.write('<SCR'+'IPT>getRevisionDate()</SCR'+'IPT>\n');
document.write('</TD>\n');
document.write('<TD align=right width=25 bgColor=#ffffff height=15><IMG height=15 alt="" src="/FileManager/EN/UTIL_UTEMPLATE/06bc/spacer.gif" width=25></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR></P></TD></TR><TR><TD>&nbsp;</TD> <TD colSpan="2" vAlign="top"><SPAN class=copyright>Copyright\n');
document.write('<SCR'+'IPT>showCopyRight()</SCR'+'IPT>\n');
document.write('2006 Census and Statistics Department. All rights reserved.</SPAN></TD></TR></TBODY></TABLE>\n');
document.write('<SCR'+'IPT>\n');
document.write('initObj()\n');
document.write('</SCR'+'IPT>\n');

// ----- v TTemplateText v -----


}

