﻿//function for loading christmas card
function popUpxmas(url) {

var sizer;
sizer =  window.open( url,'popupwindows', 'toolbar=0, width=600, height=450, scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left = 100,top = 200');
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//function for check current Path
function getLocationPath(){
	var locPath=location.href.toString();
	var targetString;
	var subPath='';
/*	
	if(location.href.toString().search('/en/')!=-1){
		targetString=location.href.search('/en/');
		subPath=locPath.substring(0, targetString);
		HomePath=subPath.substring(7);
	}
	if(location.href.toString().search('/tc/')!=-1){
		targetString=location.href.search('/tc/');
		subPath=locPath.substring(0, targetString);
		HomePath=subPath.substring(7);
	}
	if(location.href.toString().search('/gb/')!=-1){
		targetString=location.href.search('/gb/')+4;
		locationPath=locPath.substring(targetString);
		targetString=locPath.search('/tc/');
		subPath=locPath.substring(0, targetString);

		targetString=locationPath.search('/tc/');
		HomePath=locationPath.substring(0, targetString);
	}
	if(location.href.toString().search('TextOnly.pl')!=-1){
		subPath="TextOnly.pl?search=";
	}
	if(subPath==''){
		var lastSlash=location.href.toString().lastIndexOf('/');
		subPath=location.href.toString().substring(0, lastSlash);
	}
*/

	if(location.href.toString().search('smooas08:8080')!=-1){
		subPath="ht"+"tp://smooas08:8080/mapping"
	}
	if(location.href.toString().search('www0.landsd.gov.hk/mapping')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www0.landsd.gov.hk/mapping"
		}
		else
		{
			subPath="ht"+"tp://www0.landsd.gov.hk/mapping"
		}
		HomePath="www0.landsd.gov.hk/mapping"
	}
//alert(subPath);
	if(location.href.toString().search('www.landsd.gov.hk/mapping')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www.landsd.gov.hk/mapping"
		}
		else
		{
			subPath="ht"+"tp://www.landsd.gov.hk/mapping"
		}
		HomePath="www.landsd.gov.hk/mapping"
	}
	if(location.href.toString().search('www0.cms.landsd.gov.hk/mapping')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www0.cms.landsd.gov.hk/mapping"
		}
		else
		{
			subPath="ht"+"tp://www0.cms.landsd.gov.hk/mapping"
		}
		HomePath="www0.cms.landsd.gov.hk/mapping"
	}
	if(location.href.toString().search('www.cms.landsd.gov.hk/mapping')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www.cms.landsd.gov.hk/mapping"
		}
		else
		{
			subPath="ht"+"tp://www.cms.landsd.gov.hk/mapping"
		}
		HomePath="www.cms.landsd.gov.hk/mapping"
	}
	if(location.href.toString().search('ogciolandsd.arcotect.com/mapping')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/ogciolandsd.arcotect.com/mapping"
		}
		else
		{
			subPath="ht"+"tp://ogciolandsd.arcotect.com/mapping"
		}
		HomePath="ogciolandsd.arcotect.com/mapping"
	}
/*	if(location.href.toString().search('www0.landsd.gov.hk')!=-1 && location.href.toString().search('cgi-bin')!=-1){
		alert ('hello');
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www0.landsd.gov.hk"
		}
		else
		{
			subPath="ht"+"tp://www0.landsd.gov.hk"
		}
		HomePath="www0.landsd.gov.hk"
	}
	if(location.href.toString().search('www.landsd.gov.hk')!=-1 && location.href.toString().search('cgi-bin')!=-1){
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www.landsd.gov.hk"
		}
		else
		{
			subPath="ht"+"tp://www.landsd.gov.hk"
		}
		HomePath="www.landsd.gov.hk"
	}
	if(location.href.toString().search('se.cgi')!=-1){
		subPath="ht"+"tp://www.landsd.gov.hk"
		HomePath="www.landsd.gov.hk"
	}
*/
	if(location.href.toString().search('TextOnly.pl')!=-1){
		subPath="TextOnly.pl?search=";
	}
	if(subPath==''){
		var lastSlash=location.href.toString().lastIndexOf('/');
		subPath=location.href.toString().substring(0, lastSlash);
	}
	
	locationPath=subPath;


	//for Search Template
/*	if(location.href.toString().search('westcomzivo')!=-1){
		locationPath=prodURL;
	}*/

}

//function for Draw Print Button
function genPrintButton(){

	if(langID==1){ var altText='Print'; }else{ var altText='列印'; }

	document.writeln('<p><table border=0 cellspacing=0 cellpadding=0 width=100%>');
//	document.writeln('<tr valign=top><td align=right><a href="javascript:PrintDocument();"><img src="'+imagePath+'images/but_print.gif" border=0 align=top alt="'+altText+'"></a></td></tr>');
	if(!isText){
		document.writeln('<tr valign=top><td align=right><a href="javascript:PrintDocument();"><img src="'+imagePath+'images/but_print.gif" border=0 align=top alt="'+altText+'"></a></td></tr>');
	}else{
		document.writeln('<tr valign=top><td align=right><a href="javascript:PrintDocument();">'+altText+'</a></td></tr>');
	}
	document.writeln('');
	document.writeln('</table>');
}

//function for Print Function
function PrintDocument(){
	window.open(document.URL,'PrintPage','top=10,left=10,height=500,width=650,scrollbars=1');
}

//function for mouse over effect on left menu
function overTopMenu(obj)
{
      if (document.images){
		eval("document.images." + obj + ".src = '"+imagePath+"images/" + obj + "_f2.gif'");
      }
}

//function for mouse out effect on left menu
function outTopMenu(obj)
{
      if (document.images){
		eval("document.images." + obj + ".src = '"+imagePath+"images/" + obj + ".gif'");
      }
}

//function for switching image
function simg(obj,src)
{
      if (document.images){
              obj.src = src;
      }
}

function getAcrobat(){
	var linkUrl='<a class="Link" href="http://www.adobe.com/products/acrobat/acrrwhatsnew.html" target="_blank">';
	var StrText='Please download the'+linkUrl+' Acrobat Reader</a><br>and <a class="Link" href="http://www.adobe.com/products/acrobat/cjkfontpack.html" target="_blank">Asian Font Packs</a> to view the documents.';
	if(langID==2){
		linkUrl='<a class="Link" href="http://www.chinese-t.adobe.com/products/acrobat/readstep2.html" target="_blank">';
		StrText='如想觀看以上文件，請下載'+linkUrl+'Acrobat Reader</a> 。';
	}
	var StrImg='<img src="'+locationPath+'/images/acrobat.gif" border=0 align=top alt="Acrobat Reader">';
		
	document.writeln('<p><table border=0 cellspacing=0 cellpadding=2 width=565><tr valign=top>');
	if(!isText)
	document.writeln('<td width=1%>'+linkUrl+StrImg+'</a></td>');
	document.writeln('<td class="maincontent" width=99%>'+StrText+'</td>');
	document.writeln('</tr></table>');
}

function getRealPlayer(){
	var StrText='You can use RealPlayer to view the videos in Real Media format. RealPlayer is available free at <a class="text_link" href="javascript:externalLink(\'http://www.real.com/\');">www.real.com</a>.';
	if(langID==2) StrText='以上短片須使用RealPlayer觀看, 此軟件可於<a class="text_link" href="javascript:externalLink(\'http://www.real.com/\');">www.real.com</a>免費下載:';
	var StrImg='<img src="'+locationPath+'/images/realplayer.gif" border=0 align=top alt="RealPlayer">';
		
	document.writeln('<p><table border=0 cellspacing=0 cellpadding=2 width=565><tr valign=top>');
	if(!isText)
		document.writeln('<td width=1%><a href="javascript:externalLink(\'http://www.real.com/\');">'+StrImg+'</a></td>');
	document.writeln('<td width=99%>'+StrText+'</td>');
	document.writeln('</tr></table>');
}

function addMenu(sectionID, caption, chi_caption,url,offPic,onPic,hasChild,sitemap,navigationMenu)
{
	menuObj[x]	= new Object();
	menuObj[x].id = sectionID;
	menuObj[x].caption = caption;
	menuObj[x].chiCaption = chi_caption;
	if(url.search('http://')!=-1){
		menuObj[x].url = url;
		menuObj[x].popup = ' target="_blank"'
	}else{
		menuObj[x].url = locationPath+langPath+url;
		menuObj[x].popup = ''
	}
	menuObj[x].onPic = imagePath + "images/menu/" + onPic;
	menuObj[x].offPic = imagePath + "images/menu/" + offPic;
	menuObj[x].hasChild = hasChild;
	menuObj[x].sitemap = sitemap;
	menuObj[x].navigationMenu = navigationMenu;
	x++;
}

function addSubMenu(menuID, subSectionID, caption, chi_caption,url,sitemap,navigationMenu)
{
	subMenuObj[y] = new Object();
	subMenuObj[y].id = subSectionID;
	subMenuObj[y].menuID = menuID;
	subMenuObj[y].caption = caption;
	subMenuObj[y].chiCaption = chi_caption;
	if(url.search('http://')!=-1){
		subMenuObj[y].url = url;
		subMenuObj[y].popup = ' target="_blank"'
	}else if(url.search('.pdf')!=-1){
		subMenuObj[y].url = url;
		subMenuObj[y].popup = ' target="_blank"'
	}else if(url.search('javascript:')!=-1){
		subMenuObj[y].url = url;
		subMenuObj[y].popup = ''
	}else{
		subMenuObj[y].url = locationPath+langPath+url;
		subMenuObj[y].popup = ''
	}
	subMenuObj[y].sitemap = sitemap;
	subMenuObj[y].navigationMenu = navigationMenu;
	y++;
//	z++;

}

function addHomeIcon(ID, caption, chi_caption, url, chi_url, Pic)
{
	HomeIconObj[z]	= new Object();
	HomeIconObj[z].id = ID;
	HomeIconObj[z].caption = caption;
	HomeIconObj[z].chiCaption = chi_caption;
	HomeIconObj[z].url = url;
	HomeIconObj[z].chi_url = chi_url;
	HomeIconObj[z].pic = Pic;
	z++;
}

function getheaderHTML(){
	if(Selected_ID>=10){
		var bg=Selected_ID;
	}else{
		var bg="0"+Selected_ID;
	}
	if(!isText)
	{
		document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=760 height="100%">');
		if(printPage!=1){ getTopMenu();	}
		document.writeln('<tr valign=top><td valign=top height="100%"><table border=0 cellspacing=0 cellpadding=0 height="100%">');		
		document.writeln('<tr valign=top>');

		if(printPage!=1){ getLeftMenu(); }

		document.writeln('	<td width=610 valign=top height="5%"><img src="'+imagePath+'/images/main_v.jpg" border=0 align=top alt=""></td>');
		document.writeln('</tr>');

		document.writeln('<tr valign=top>');
		document.writeln('	<td height=5%>');
		getTopic();
		document.writeln('	</td>');
		document.writeln('</tr>');
	
		document.writeln('<tr valign=top>');
		document.writeln('	<td height=300 background="'+locationPath+'/images/bg_'+bg+'.gif">');
		document.writeln('		<table border=0 cellspacing=0 cellpadding=0 width=100% background="'+locationPath+'/images/spacer.gif">');
		document.writeln('		<tr valign=top>');
		document.writeln('			<td rowspan=2 width=20><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=20 height=20></td>');
		document.writeln('			<td width="572"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=572 height=10></td>');
		document.writeln('			<td rowspan=2 width=20><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=20 height=10></td>');
		document.writeln('		</tr>');

		document.writeln('		<tr valign=top>');
		document.writeln('			<td>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=0>');
		if(printPage!=1){ getTopMenu();	}
		document.writeln('<tr valign=top>');
		if(printPage!=1){ getLeftMenu(); }
		document.writeln('</tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
		getTopic();
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
	}
}

function getfooterHTML(){
	if(!isText){
		document.writeln('			<br>');
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('		</table>');
		document.writeln('	</td>');
		document.writeln('</tr>');

		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
		document.writeln('		<table border=0 cellspacing=0 cellpadding=0>');
		document.writeln('		<tr valign=top>');
		document.writeln('			<td><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=1 height=8></td>');
		document.writeln('		</tr>');
		document.writeln('		</table>');
		document.writeln('	</td>');
		document.writeln('</tr>');
		if(Selected_ID==3 && Selected_Sub==1){
			getHomeIcon();
		}
		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
		getFooter();
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}else{
		document.writeln('	</td>');
		document.writeln('</tr>');
		if(Selected_ID==3 && Selected_Sub==1){
			getHomeIcon();
		}
		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
		getFooter();
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
		document.writeln('</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}
}

function getHomeIcon(){
	var rows=0;

	document.writeln('<tr valign=top>');
	document.writeln('	<td>');
	document.writeln('		<!-- Home Icon Area -->');
	document.writeln('		<p>');
	document.writeln('		<table border=0 cellspacing=2 cellpadding=2 align=center>');
	document.writeln('		<tr valign=top>');
	if(!isText){
		for(var i=1;i<z;i++){
			if(langID==1){
				document.writeln('			<td align=center><a href="'+HomeIconObj[i].url+'" target="_blank"><img src="'+imagePath+'images/icon/'+HomeIconObj[i].pic+'" border=0 align=top alt="'+HomeIconObj[i].caption+'"></a></td>');
			}else{
				document.writeln('			<td align=center><a href="'+HomeIconObj[i].chi_url+'" target="_blank"><img src="'+imagePath+'images/icon/'+HomeIconObj[i].pic+'" border=0 align=top alt="'+HomeIconObj[i].chiCaption+'"></a></td>');
			}
			rows++;
			if(rows>=5){
				document.writeln('		</tr>');
				document.writeln('		<tr valign=top>');
				rows=0;
			}
		}
	}else{
		for(var i=1;i<z;i++){
			if(langID==1){
				document.writeln('			<td><a href="'+HomeIconObj[i].url+'" target="_blank">'+HomeIconObj[i].caption+'</a></td>');
			}else{
				document.writeln('			<td><a href="'+HomeIconObj[i].chi_url+'" target="_blank">'+HomeIconObj[i].chiCaption+'</a></td>');
			}
			rows++;
			if(rows>=5){
				document.writeln('		</tr>');
				document.writeln('		<tr valign=top>');
				rows=0;
			}
		}
	}
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('		<!-- Home Icon Area -->		');
	document.writeln('	</td>');
	document.writeln('</tr>');
}

//function for generating the top menu
function getTopMenu(){
	
	if(langID==1){
/*		var extarSpacer = '<td align="left" valign="bottom" background="'+imagePath+'images/mainbar5c.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=187 alt=""></td>';
*/
		var extarSpacer = '<td align="left" valign="top" background="'+imagePath+'images/mainbar5c.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=187 alt=""></td>';
                     /* '<td align="left" valign="bottom"><img name="mainbar5" src="'+imagePath+'images/mainbar5c.gif" width=187 height=22 border="0"></td>';  */

	}else{
		var extarSpacer = '<td align="left" valign="bottom" background="'+imagePath+'images/mainbar5c.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=206 alt=""></td>';  
										/* '<td align="left" valign="bottom"><img name="mainbar5" src="'+imagePath+'images/mainbar5.gif" width=206 height=22 border="0"></td>';  */
	}

	var gicSearchForm;
	
	gicSearchForm='<form name="frmSearch" action="'+arClfTopMenu[langID][1]+'" method="get">\n';
	gicSearchForm+='<input type="hidden" name="tpl_id" value="smo">\n';
	gicSearchForm+='<input type="hidden" name="ui_lang" value="'+arClfTopMenu[langID][23]+'">\n';
	gicSearchForm+='<input type="hidden" name="ui_charset" value="'+arClfTopMenu[langID][24]+'">\n';
	gicSearchForm+='<input type="hidden" name="gp0" value="smo_home">\n';
	gicSearchForm+='<input type="hidden" name="gp1" value="smo_home">\n';
	gicSearchForm+='<input type="hidden" name="web" value="this">\n';
	
	if(!isText){
		document.writeln('	<tr>');
		document.writeln('	<td colspan="2">');
		document.writeln('		<table width="680" border="0" cellpadding="0" cellspacing="0" background="'+locationPath+'/images/bg.gif">');
		document.writeln(gicSearchForm);
		document.writeln('		<tr align="left" valign="top">');
		document.writeln('			<td colspan="4" class="sidebar" background="'+imagePath+'images/bkgdtexture.gif" valign="top" bgcolor="#FAFAEB"><a href="ht'+'tp://'+HomePath+'/welcome.htm"><img src="'+imagePath+'images/branding.gif" border=0 alt="'+arClfTopMenu[langID][3]+'"></a></td>');
/*		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB">&nbsp;</td>');*/
		document.writeln('			<td colspan="5" background="'+imagePath+'images/bkgdtexture.gif" valign="top" align=right bgcolor="#FAFAEB"><a href="'+arClfTopMenu[langID][5]+'" target="_top"><img name="BrandHK" src="'+imagePath+'images/brandHK.gif" border="0" alt="'+arClfTopMenu[langID][6]+'"></a></td>');
		document.writeln('		</tr>');
		document.writeln('		<tr align="left" valign="bottom">');
/*06122006		document.writeln('			<td background="'+locationPath+langPath+'images/bkgdtexture.gif"><a href="http://www.info.gov.hk/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')"><img name="mainbar1" src="'+imagePath+'images/mainbar1.gif" border="0" alt="'+arClfTopMenu[langID][7]+'"></a></td>'); */

	if(langID==1){
		document.writeln('			<td background="'+locationPath+langPath+'images/bkgdtexture.gif"><a href="http://www.gov.hk/en/residents/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')"><img name="mainbar1" src="'+imagePath+'images/mainbar1.gif" border="0" alt="'+arClfTopMenu[langID][7]+'"></a></td>'); 
  }else  	{
  	document.writeln('			<td background="'+locationPath+langPath+'images/bkgdtexture.gif"><a href="http://www.gov.hk/tc/residents/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')"><img name="mainbar1" src="'+imagePath+'images/mainbar1.gif" border="0" alt="'+arClfTopMenu[langID][7]+'"></a></td>'); 
}

/*		document.writeln('			<td align="left" valign="bottom"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][9]+'\')" onMouseOut="outTopMenu(\'mainbar2\')" onMouseOver="overTopMenu(\'mainbar2\')"><img name="mainbar2" src="'+imagePath+'images/mainbar2.gif" border="0" alt="'+arClfTopMenu[langID][10]+'"></a></td>');  */
		document.writeln('			<td align="left"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][12]+'\')" onMouseOut="outTopMenu(\'mainbar3\')" onMouseOver="overTopMenu(\'mainbar3\')"><img name="mainbar3" src="'+imagePath+'images/mainbar3.gif" border="0" alt="'+arClfTopMenu[langID][13]+'"></a></td>');
		document.writeln('			<td align="left"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][15]+'\')" onMouseOut="outTopMenu(\'mainbar4\')" onMouseOver="overTopMenu(\'mainbar4\')"><img name="mainbar4" src="'+imagePath+'images/mainbar4.gif" border="0" alt="'+arClfTopMenu[langID][16]+'"></a></td>');
		document.writeln(extarSpacer);    

	
		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif"><a href="javascript:document.frmSearch.submit();" onMouseOut="outTopMenu(\'mainbar6\')" onMouseOver="overTopMenu(\'mainbar6\')"><img name="mainbar6" src="'+imagePath+'images/mainbar6.gif" border="0" alt="'+arClfTopMenu[langID][17]+'"></a></td>');

		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif"><input type="text" name="query" size="'+arClfTopMenu[langID][4]+'" class="search"></td>');     

		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif"><a href="javascript:document.frmSearch.submit();" onMouseOut="outTopMenu(\'mainbar8\')" onMouseOver="overTopMenu(\'mainbar8\')"><img name="mainbar8" src="'+imagePath+'images/mainbar8.gif" border="0" alt="'+arClfTopMenu[langID][17]+'"></a></td>');
		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif"><a href="'+locationPath+langPath+'sitemap/index.htm" onMouseOut="outTopMenu(\'mainbar9\')" onMouseOver="overTopMenu(\'mainbar9\')"><img name="mainbar9" src="'+imagePath+'images/mainbar9.gif" border="0" alt="'+arClfTopMenu[langID][18]+'"></a></td>');
		document.writeln('			<td background="'+imagePath+'images/bkgdtexture.gif"><a href="'+locationPath+langPath+'contact/enquiries.htm" onMouseOut="outTopMenu(\'mainbar10\')" onMouseOver="overTopMenu(\'mainbar10\')"><img name="mainbar10" src="'+imagePath+'images/mainbar10.gif" border="0" alt="'+arClfTopMenu[langID][19]+'"></a></td>');
		document.writeln('		</tr>');
		document.writeln('		<tr align="left" valign="bottom">');
		document.writeln('			<td height=2 colspan="10" bgcolor="#BB3333"><img src="'+imagePath+'images/reddot.gif" width="680" height="2" alt="" border=0></td>');
		document.writeln('		</tr>');
		document.writeln('		</form>');
		document.writeln('		</table>');
		document.writeln('		</td>');
		document.writeln('	</tr>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=1 width=100%>');
		document.writeln(gicSearchForm);
		document.writeln('<tr valign=top>');
		document.writeln('	<td><p class="Title"><b>'+arClfTopMenu[langID][3]+'</b></p></td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=middle>');
/*		document.writeln('	<td><br>[ <a href="http://www.info.gov.hk/" target="_blank">'+arClfTopMenu[langID][7]+'</a> ]&nbsp;&nbsp;');
*/
		document.writeln('	<td><br>[ <a href="http://sc.info.gov.hk/TuniS/www.gov.hk/tc/residents/ " target="_blank">'+arClfTopMenu[langID][7]+'</a> ]&nbsp;&nbsp;');
		document.writeln('[ <a href="javascript:changeLanguage(\''+arClfTopMenu[langID][22]+'\')">'+arClfTopMenu[langID][21]+'</a> ]&nbsp;&nbsp;');
		document.writeln('[ <a href="javascript:changeLanguage(\''+arClfTopMenu[langID][12]+'\')">'+arClfTopMenu[langID][13]+'</a> ]&nbsp;&nbsp;');
		document.writeln('[ <a href="javascript:changeLanguage(\''+arClfTopMenu[langID][15]+'\')">'+arClfTopMenu[langID][16]+'</a> ]&nbsp;&nbsp;');
//		document.writeln('[ <a href="'+arClfTopMenu[langID][1]+'">'+arClfTopMenu[langID][17]+'</a> ]&nbsp;&nbsp;');
		document.writeln('[ <a href="javascript:document.frmSearch.submit();">'+arClfTopMenu[langID][17]+'</a> ]&nbsp;&nbsp;');
		document.writeln('<input type="text" name="query" size="'+arClfTopMenu[langID][4]+'">');
		document.writeln('[ <a href="'+locationPath+langPath+'sitemap/index.htm">'+arClfTopMenu[langID][18]+'</a> ]&nbsp;&nbsp;');
		document.writeln('[ <a href="'+locationPath+langPath+'contact/index.htm">'+arClfTopMenu[langID][19]+'</a> ]</td>');
		document.writeln('</tr>');
		document.writeln('</form>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td><hr width=100%></td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}
}

function changeLanguage(l) {
	var lh = parent.location.href;
	lh = lh.replace("/tc/", l);
	lh = lh.replace("/sc/", l);
	lh = lh.replace("/en/", l);
	parent.location.href = lh;
}

/*
function changeLanguage(switchLang){
	var currentPath=location.href.toString();
	var switchTc='/tc/';
	var switchEn='/en/';
if(location.href.toString().search('www0.landsd.gov.hk')!=-1)
{
	var switchGraphic=/\/cgi-bin\/landsd\/TextOnly\.pl\?search\=/;
	var switchText="/cgi-bin/landsd/TextOnly.pl?search=";
}
else
{
	var switchGraphic=/\/cgi-bin\/landsd\/TextOnly\.pl\?search\=/;
	var switchText="/cgi-bin/landsd/TextOnly.pl?search=";
}
	var urlVars=document.location.search;

if(location.href.toString().search('se.cgi')!=-1){
	switch (switchLang){
		case '/graphics/':
			currentPath=currentPath.replace(switchGraphic, "");
//			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			break;
		case '/text/':
			if(langID==1){
				alert("Search function for text only version is not available")
			}else{
				alert("本網站並沒有提供純文字版本的搜尋功能")
			}
			break;
		case '/gb/':
//			currentPath='http://'+gb_urlPath+locationPath.substring(7, locationPath.length)+switchTc;
			currentPath=currentPath.replace('http://', 'http://'+gb_urlPath);
			currentPath=currentPath.replace("mode=86", "mode=87");
			break;
		case '/en/':
			currentPath=currentPath.replace("mode=87", "mode=86");
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		case '/tc/':
			currentPath=currentPath.replace("mode=86", "mode=87");
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		default:
	}
}
else{
	switch (switchLang){
		case '/graphics/':
			currentPath=currentPath.replace(switchGraphic, "");
//			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			break;
		case '/text/':
			currentPath=currentPath.replace(switchEn, switchText+switchEn);
			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			break;
		case '/gb/':
//			currentPath='http://'+gb_urlPath+locationPath.substring(7, locationPath.length)+switchTc;
			currentPath=currentPath.replace('http://', 'http://'+gb_urlPath);
			currentPath=currentPath.replace(switchEn, switchTc);
			break;
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		case '/tc/':
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		default:
	}
}
	if(!isText){
		document.location=currentPath;
	}else{
		if(urlVars==''){
			document.location=document.location+'?search=/tc/sitemap/index.htm';
		}else{
			document.location=currentPath;
		}
	}
//	alert(currentPath);
	
}
*/
function getCaption(menu, i){
	var showAlt;
	
	if(langID==1)
		eval('showAlt='+menu+'['+i+'].caption');
	else
		eval('showAlt='+menu+'['+i+'].chiCaption');
	return showAlt;
}

function getLeftMenu(){
	if(!isText){
		document.writeln('<td rowspan=6 width=148 background="'+locationPath+'/images/btn_bg.gif" height="100%" valign="top">');

		document.writeln('	<table border=0 cellspacing=0 cellpadding=0 width=148>');
		for(var i=1;i<x;i++){
			if(menuObj[i]){
				if(menuObj[i].navigationMenu=="Y"){
					if (Selected_ID==menuObj[i].id){
						var pic = menuObj[i].onPic;
					}else{
						var pic = menuObj[i].offPic;
					}
					var outAction = "onMouseOut=\"simg(pic"+i+", '"+pic+"');";
					var overAction = " onMouseOver=\"simg(pic"+i+", '"+menuObj[i].onPic+"');";
					
					if (menuObj[i].hasChild =="Y"){
						outAction = outAction + "MM_showHideLayers('LeftLayer_"+i+"','','hidden',"+i+"); return true;";
						overAction = overAction + "MM_showHideLayers('LeftLayer_"+i+"','','show',"+i+"); return true;";
					}
					outAction = outAction + "\""
					overAction = overAction + "\" "
					document.writeln('<tr><td colspan=2><a href="'+menuObj[i].url+'"'+ outAction + overAction + menuObj[i].popup+ '><img name="pic'+i+'" id="pic'+i+'" src="' + pic +  '" alt="'+getCaption("menuObj", i)+'" border=0></a></td></tr>');
					
				}
			}
		}
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2><img src="'+locationPath+'/images/btn_bottom.gif" border=0 align=top alt=""></td>');
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2><img src="'+locationPath+'/images/btn_bg.gif" border=0 align=top alt=""></td>');
		document.writeln('	</tr>');
		document.writeln('	</table>');
		document.writeln('</td>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=1 width=100%><tr valign=top><tr valign=top><td>');
		for(var i=1;i<x;i++){
			if(menuObj[i]){
				if(menuObj[i].navigationMenu=="Y"){
					if(menuObj[i].id!=Selected_ID){
						document.writeln('[ <a href="'+menuObj[i].url+'"'+ menuObj[i].popup+ '>'+getCaption("menuObj", i)+'</a> ]&nbsp;');
					}else{
						document.writeln('[ <b><a href="'+menuObj[i].url+'"'+ menuObj[i].popup+ '>'+getCaption("menuObj", i)+'</a></b> ]&nbsp;');
					}
				}
			}
		}
if (langID==1)
{
		document.writeln('[ <a href="'+locationPath+langPath+'issues/hkrates160th.htm">Hong Kong Rates 160th Anniversary</a> ]');
}
else
{
		document.writeln('[ <a href="'+locationPath+langPath+'issues/hkrates160th.htm">香港差餉160周年</a> ]');
}
		document.writeln('</td></tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td colspan=100><hr width=100%></td>');
		document.writeln('</tr>');
		if(menuObj[Selected_ID].hasChild=="Y"){
			getSubMenu();
		}
		document.writeln('</table>');
	}
}

function getSubMenu(){
	var nextLine=0;
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==Selected_ID){
				if(nextLine==0){
					document.writeln('<tr>');
					document.writeln('	<td>');
				}
				nextLine++;
	
				if (subMenuObj[i].id != Selected_Sub){
					document.writeln("[ <a href='"+subMenuObj[i].url+"'>"+getCaption('subMenuObj', i)+"</a> ]&nbsp;&nbsp;");
				}else{
					document.writeln("[ <b>"+getCaption('subMenuObj', i)+"</b> ]&nbsp;&nbsp;");
				}
			}
		}
	}
	
	document.writeln('<tr valign=top>');
	document.writeln('	<td><hr width=100%></td>');
	document.writeln('</tr>');
}

function getMenuPath(ID, sub_ID, showlink){
	var strText;
	
	if(showlink)
		strText = "<a href='"+menuObj[Selected_ID].url+"' class='path_link'>"+getCaption('menuObj', ID)+"</a>"
	else
		strText = getCaption('menuObj', ID)
	
	return strText;
}

function getSubMenuPath(ID, sub_ID, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	else
		langText=".chiCaption";
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==ID){
				if (subMenuObj[i].id == sub_ID){
					if(showlink)
						strText = "<a href='"+subMenuObj[i].url+"'"+subMenuObj[i].popup+" class='path_link'>"+eval('subMenuObj[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getTopic(){
	var showPath;
	if(exLink!=null)
		showPath = exLink;
	var checkList = new Array()
		checkList[0] = "Selected_Sub"
		checkList[1] = "Selected_ID"
	var functionList = new Array()
		functionList[0] ="getSubMenuPath" 
		functionList[1] ="getMenuPath" 
	
/*	for (var i in checkList){
		if(eval(checkList[i]) > 0){
			if(showPath==null){
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", false)");
			}else{
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", true)") + "<span class='path_arrow'> > </span>" + showPath;
			}
		}
	}
	showPath = "<span class='path_arrow'> > </span>" + showPath;*/
	
	

			
	var functionNum;
	functionNum = 1;
	

				
	if(Selected_ID<10)
		var titleNum="0"+Selected_ID;
	else
		var titleNum=Selected_ID;
		
	if(Selected_ID>0){
		if (Selected_ID==20)
			var title = '<tr valign=top><td><img src="'+imagePath+'images/title_left.gif" border=0 align=top alt=""></td><td><img src="' +imagePath+'../../'+imagePath.substring(imagePath.length-3)+'images/title/title_22.gif" border=0 align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td></tr>';
		else
			var title = '<tr valign=top><td><img src="'+imagePath+'images/title_left.gif" border=0 align=top alt=""></td><td><img src="' +imagePath+'images/title/title_'+titleNum+'.gif" border=0 align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td></tr>';
		}else{
			var title = ' ';
			}
	

	if(Selected_Sub>0){
		functionNum = 0;
		if(Selected_Sub<10){
			titleNum=titleNum+"_0"+Selected_Sub;
		}else{
			titleNum=titleNum+"_"+Selected_Sub;
		}
	}
	
	if(Selected_Sub>0){
		var sub_title = '<tr><td><img src="'+imagePath+'images/spacer.gif" border=0 align=top alt="" width=24 height=24></td><td><img src="'+imagePath+'images/sub_title/title_'+titleNum+'.gif" border=0 align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td></tr>';
		}else{
			var sub_title =' ';
			}
	

		
	
	if(Selected_ID==1){
		menuObj[1].caption = "Commissioner's Message";
		menuObj[1].chiCaption = "署長的話";
	}

	if(!isText){		
		document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=612 background="'+imagePath+'images/spacer.gif">');
		document.writeln(title);
		document.writeln('<tr><td colspan=2><img src="'+imagePath+'images/spacer.gif" border=0 align=top alt="" width=1 height=5></td></tr>');
		document.writeln(sub_title);
		document.writeln('</table>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=0>');
		document.writeln('<tr><td><h2>'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'</h2></td></tr>');
		document.writeln('</table>');
	}
}

var resizeFlag;
var footerY = 600;

function moveDivs(layerObj, inObj){
	layerObj.top  = inObj;
} 

function moveTopDivs(layerObj, inObjTop, inObjLeft){
	layerObj.top  = inObjTop;
	layerObj.left  = inObjLeft;
} 

function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx,y:ly}
}

function init(){
	setTopLayerPosition(true);

	if(printPage==1){
		window.print();
	}
}

//function for setting the top button
function setTopLayerPosition(resizeFlag){
	if(topButton=='Y'){
		if (document.all && document.all["footer_layer"]!=null)
		{
	//		footerY = getDim(document.images.leftMenuLineBottom).y;
			moveTopDivs(document.all["footer_layer"].style, getDim(document.images.backtotopspacer).y, getDim(document.images.backtotopspacer).x)
			if (getDim(document.images.backtotopspacer).y > footerY)
			{
				if (resizeFlag)
				{document.all["footer_layer"].style.visibility = "visible"}
			}
		}
		if (document.layers && document.layers["footer_layer"])
		{
	//		footerY = document.images["leftMenuLineBottom"].y;
			moveTopDivs(document.layers["footer_layer"], document.images["backtotopspacer"].y, document.images["backtotopspacer"].x);
			if (document.images["backtotopspacer"].y > footerY)
			{
				if (resizeFlag)
				{document.layers["footer_layer"].visibility = "show"}
			}
		}
		if (!document.all && document.getElementById && document.getElementById("footer_layer")!=null)
		{
	//		footerY = document.images["leftMenuLineBottom"].y;
			moveTopDivs(document.getElementById("footer_layer").style, document.images["backtotopspacer"].y, document.images["backtotopspacer"].x);
			if (document.images["backtotopspacer"].y > footerY)
			{
				if (resizeFlag)
				{document.getElementById("footer_layer").style.visibility = "visible"}
			}
		}
	}
}

onresize=setTopLayerPosition;

function genLeftLayer(ID){
	if (document.layers)
		{document.writeln('<layer name=LeftLayer_'+ID+' top=0 left=0 width=26 height=26 visibility="hide" OnMouseOver="MM_showHideLayers(\'LeftLayer_'+ID+'\',\'\',\'show\','+ID+'); return true;" OnMouseOut="MM_showHideLayers(\'LeftLayer_'+ID+'\',\'\',\'hidden\','+ID+'); return true;">');}
	else
		{document.writeln('<div id="LeftLayer_'+ID+'" style="position:absolute; left:0; top:0; width:26; height:26; z-index:1; visibility: hidden"> ');}
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" OnMouseOver="MM_showHideLayers(\'LeftLayer_'+ID+'\',\'\',\'show\','+ID+'); return true;" OnMouseOut="MM_showHideLayers(\'LeftLayer_'+ID+'\',\'\',\'hidden\','+ID+'); return true;">');
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==ID){
				var outAction = " onMouseOut=\"simg(submenu_"+ID+"_"+subMenuObj[i].id+", '"+imagePath + "images/submenu/title_"+ID+"_"+subMenuObj[i].id+".gif');\"";
				var overAction = " onMouseOver=\"simg(submenu_"+ID+"_"+subMenuObj[i].id+", '"+imagePath + "images/submenu/title_"+ID+"_"+subMenuObj[i].id+"_o.gif');\"";
				
				document.writeln('	<tr>');
				document.writeln('		<td><a href="'+subMenuObj[i].url+'"'+overAction+outAction+subMenuObj[i].popup+'><img src="'+imagePath+'images/submenu/title_'+ID+'_'+subMenuObj[i].id+'.gif" name="submenu_'+ID+'_'+subMenuObj[i].id+'" alt="'+getSubMenuPath(ID, subMenuObj[i].id, false)+'" border=0></a></td>');
				document.writeln('	</tr>');				
			}
		}
	}
	document.writeln('</table>');
	if (document.layers)
		{document.writeln('</layer>');}
	else
		{document.writeln('</div>');}			
}

//function for generating the layer for top button
function genfooterLayer(){
	var altText='Top';
	
	if(langID!=1) altText='頁首';

	if (document.layers)
		{document.writeln('<layer name=footer_layer top=0 left=0 width=26 height=26 visibility="hide">');}
	else
		{document.writeln('<div id="footer_layer" style="position:absolute; left:0; top:0; width:26; height:26; z-index:1; visibility: hidden"> ');}
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('<tr valign=top>');
	document.writeln('	<td><a href="#top"><img src="'+imagePath+'images/btn_top.gif" alt="'+altText+'" border="0" name="backtotopfoot"></a></p></td>');
	document.writeln('</tr>');
	document.writeln('</table>');
	if (document.layers)
		{document.writeln('</layer>');}
	else
		{document.writeln('</div>');}		
		
	for(var i=1;i<x;i++){
		if(menuObj[i]){
			if (menuObj[i].hasChild =="Y"){
				genLeftLayer(i);
			}
		}
	}	
	
}

//function for generating the footer
function getFooter(){
	var altText='Top';
	if(langID!=1) altText='頁首';
	
	var altBack='Back';
	if(langID!=1) altBack='回上頁';
	
	var copyYear='2005';
	var noticesLink=locationPath+langPath+'notices/index.htm';
	var noticeText='Important notices';
	//-------------
	var privacyLink=locationPath+langPath+'privacy/index.htm';
	var privacyText='Privacy policy';
	//-------------
	var revisionText='Last revision date: ';	
	var reviewText='Last review date: ';	
	if (revisionDate==''||revisionDate=='MM/DD/YYYY') revisionDate='11/28/2005';
	if (reviewDate==''||reviewDate=='MM/DD/YYYY') reviewDate='MM/DD/YYYY';
	if (langID==2){
		noticeText='重要告示';
		revisionText='修訂日期： ';	
		//-------------
		privacyText='私隱政策';
		//-------------
		reviewText='覆檢日期： ';	
	}
	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 reDate=new Date(Date.parse(revisionDate))
	var showDate=reDate.getDate()+' '+monthArray[reDate.getMonth()]+' '+reDate.getFullYear();
	if (langID==2) showDate=reDate.getFullYear()+'年'+(reDate.getMonth()+1)+'月'+reDate.getDate()+'日';
	
	var reDate2=new Date(Date.parse(reviewDate))
	var showDate2=reDate2.getDate()+' '+monthArray[reDate2.getMonth()]+' '+reDate2.getFullYear();
	if (langID==2) showDate2=reDate2.getFullYear()+'年'+(reDate2.getMonth()+1)+'月'+reDate2.getDate()+'日';
	//generate the topic image to the buffer variable
	if(!isText){
		document.writeln('<p>');
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		if(topButton=='Y')
			document.writeln('	<tr valign=top><td colspan=2 align=right><img src="'+imagePath+'images/spacer.gif" name="backtotopspacer" width=38 height=20></td></tr>');
		document.writeln('	<tr>');
		document.writeln('		<td><img src="'+imagePath+'images/spacer.gif" alt="" border="0" width=5 height=1></td>');
		document.writeln('		<td valign="top" align="center"> ');
		document.writeln('		<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('		<tr bgcolor="#FFFFFF">');
		document.writeln('			<td colspan="3"><img src="'+imagePath+'images/botdot.jpg" alt="" width="100%" height="3" border=0></td>');
		document.writeln('		</tr>');
		document.writeln('		<tr bgcolor="#FFFFFF">');
		//-------------
		document.writeln('			<td height="15" bgcolor="#FFFFFF" class="footer" height="5%"><b>'+copyYear+'</b> <img src="'+imagePath+'../images/copy.gif" alt="" width="12" height="11"> | <b><a href="'+noticesLink+'" class="footer">'+noticeText+'</a></b> | <b><a href="'+privacyLink+'" class="footer">'+privacyText+'</a></b></td>');
		//-------------
		document.writeln('			<td height="15" align="right" bgcolor="#FFFFFF" class="footer" height="5%">&nbsp;</td>');
		document.writeln('			<td height="15" align="right" bgcolor="#FFFFFF" class="footer" height="5%">'+revisionText+showDate+'</td>');
		document.writeln('		</tr>');
		document.writeln('		</table>');
		document.writeln('		</td>');
		document.writeln('	</tr>');
		document.writeln('</table><br>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=1 width=100%>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td colspan=3><hr width=100%></td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td>[ <a href="#">'+altText+'</a> ]</td>');
		document.writeln('	<td align="right" colspan=2>&nbsp;</td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td colspan=3><hr width=100%></td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('	<td class="footer"><b>'+copyYear+'</b> | <b><a href="'+noticesLink+'" class="footer">'+noticeText+'</a></b></td>');
		document.writeln('	<td height="15" align="right" bgcolor="#FFFFFF" class="footer">'+reviewText+showDate2+'</td>');
		document.writeln('	<td align="right" class="footer">'+revisionText+showDate+'</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}
}

function getSiteMap(){
	var bulletPath1;
	var bulletPath2;
	if(!isText){
		bulletPath1='<ul type="square"><li>';
		bulletPath2='<ul type="circle"><li>';
	}else{
		bulletPath1='*';
		bulletPath2='*';
	}
	
	document.writeln('<table border=0 cellspacing=0 cellpadding=3 width=100%>');
	for(var i=1;i<x;i++){
		if(menuObj[i]){
			if(menuObj[i].sitemap=="Y"){
				document.write('<tr valign=top><td width=100%><a href="'+menuObj[i].url+'"'+menuObj[i].popup+' class="Link">'+bulletPath1+getCaption('menuObj', i)+'</ul></a></td>');
//				document.write('	<li><a href="'+menuObj[i].url+'">'+getCaption('menuObj', i)+'</a>');
				if(menuObj[i].hasChild=="Y" || menuObj[i].hasChild=="L"){
					document.writeln('	<tr valign=top><td width=100%><table border=0 cellspacing=0 cellpaddding=3 width=100%>');
					for(var j=1;j<y;j++){
						if (subMenuObj[j].menuID==i)
							document.write('	<tr valign=top><td width=20>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width=100%><a href="'+subMenuObj[j].url+'"'+subMenuObj[j].popup+' class="Link">'+bulletPath2+getCaption('subMenuObj', j)+'</ul></a></td></tr>');
					}
					document.writeln('	</table></td></tr>');
				}else{
				document.writeln('</tr>');
				}
			}
		}
	}
	document.writeln('</table>');
}

function getSectionList(){
	var bulletPath1;
	if(!isText){
		bulletPath1='<ul type="circle"><li>';
	}else{
		bulletPath1='*';
	}

	document.writeln('<table border=0 cellspacing=0 cellpadding=3 width=100%>');
	for(var j=1;j<y;j++){
		if (subMenuObj[j].menuID==Selected_ID)
			document.write('<tr valign=top><td nowrap>'+bulletPath1+'&nbsp;</td><td width=100%><a href="'+subMenuObj[j].url+'"'+subMenuObj[j].popup+' class="Link">'+getCaption('subMenuObj', j)+'</a></td></tr>');
	}
	document.writeln('</table>');
}

function styleSheet(){
	var styleType='style.css';
	
	if(!isText){
		if(langID!=1)
			styleType=styleType.replace('.css', '_tc.css'); 

		if ((navigator.appName == "Netscape")) {		
//06Nov2006_wai		if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4)) {
			document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/nt_'+styleType+'" rel="STYLESHEET" type="text/css">');
		}else{
			document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/'+styleType+'" rel="STYLESHEET" type="text/css">');
		}
	}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	var k;
	y=19;
	isNS4 = (document.layers) ? true : false;
	isIE4 = (document.all && !document.getElementById) ? true : false;
	isIE5 = (document.all && document.getElementById) ? true : false;
	isNS6 = (!document.all && document.getElementById) ? true : false;
	for (i=0, k=1; i<(args.length-3); i+=3, k+=1) {
    	if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			if (obj.style) { obj=obj.style; }
			if (v=='show') {
				if (!document.layers) {   // all others
					if (isNS6) {
//						w = window.innerWidth;
						eval('moveTopDivs(document.getElementById("LeftLayer_'+args[3]+'").style, document.images["pic'+args[3]+'"].y, document.images["pic'+args[3]+'"].x + document.images["pic'+args[3]+'"].width)');
					}else {
//						w = window.document.body.clientWidth;
						eval('moveTopDivs(document.all["LeftLayer_'+args[3]+'"].style, getDim(document.images.pic'+args[3]+').y, getDim(document.images.pic'+args[3]+').x+ document.images["pic'+args[3]+'"].width)');
					}
				}else {  //NN4
					eval('moveTopDivs(document.layers["LeftLayer_'+args[3]+'"], document.images["pic'+args[3]+'"].y, document.images["pic'+args[3]+'"].x + document.images["pic'+args[3]+'"].width)');
				}		
			}
			v=(v=='show')?'visible':(v='hide')?'hidden':v; 
			obj.visibility=v; 
		}
	}
}

function PopWin(url,page,x,y){
	if(isText){
		var lastSlash=location.href.toString().lastIndexOf('/');
		url=location.href.toString().substring(0, lastSlash)+'/'+url;
	}
	eval("nw = window.open(url, page,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=0,width=" + x + ",height=" + y + "')");
	if ( nw.focus != null)
	{nw.focus();}
}

function ShowVideo(lang, video) {

	var destPage = lang + "Pages" + "/" + video + ".htm";

	videowin = window.open(destPage, "blank", "statusbar=1,toolbar=0,resizable=1");
	
	videowin.focus();

	return;
}

// for smo web only

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}




// function MM_findObj(n, d) { //v4.01

//  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

// d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

//  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

//  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

//  if(!x && d.getElementById) x=d.getElementById(n); return x;

// }



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

    function openWin53(page) {
         newWin1 = window.open(page, "metaWindow",  "resize = yes, toolbar=yes,menubar=yes, scrollbars=yes, resizable=yes, width=600, height=350");
}
	
	

	
