function showMenuObj(){
	var menuObjID;

	if(Selected_ID==1)
		menuObjID=1;
	else if(Selected_ID==2)
		menuObjID=2;
	else if(Selected_ID==3)
		menuObjID=3;
	else if(Selected_ID==4)
		menuObjID=5;
	else if(Selected_ID==5)
		menuObjID=6;
	else if(Selected_ID==6)
		menuObjID=7;
	else if(Selected_ID==7)
		menuObjID=8;
//	else if(Selected_ID==8)
//		menuObjID=9;
	else if(Selected_ID==9)
		menuObjID=9;
	else if(Selected_ID==10)
		menuObjID=10;
	else if(Selected_ID==11)
		menuObjID=11;
	else if(Selected_ID==12)
		menuObjID=12;
	else if(Selected_ID==13)
		menuObjID=13;
	else if(Selected_ID==14)
		menuObjID=4;
	
	return menuObjID;
}

//function for check current Path
function getLocationPath(){
	var locPath=location.href.toString();
	var subPath='';

	if(location.href.toString().search('dev01.westcomzivo.com/gpcd')!=-1){
		subPath="ht"+"tp://dev01.westcomzivo.com/gpcd"
		HomePath="dev01.westcomzivo.com/gpcd"
	}
	if(location.href.toString().search('www0.cmab-gpcd.gov.hk')!=-1){
		subPath="ht"+"tp://www0.cmab-gpcd.gov.hk"
		HomePath="www0.cmab-gpcd.gov.hk"
	}
	if(location.href.toString().search('www.cmab-gpcd.gov.hk')!=-1){
		subPath="ht"+"tp://www.cmab-gpcd.gov.hk"
		HomePath="www.cmab-gpcd.gov.hk"
	}
	if(location.href.toString().search('se.cgi')!=-1){
//		subPath="ht"+"tp://www.cmab-gpcd.gov.hk"
		if(location.href.toString().search('/gb/')!=-1)
		{
			subPath="ht"+"tp://sc.info.gov.hk/gb/www.cmab-gpcd.gov.hk"
		}
		else
		{
			subPath="ht"+"tp://www.cmab-gpcd.gov.hk"
		}
		HomePath="www.cmab-gpcd.gov.hk"
	}

	if(location.href.toString().search('/text/')!=-1){
		if(location.href.toString().search('dev01.westcomzivo.com/gpcd')!=-1){
			subPath="ht"+"tp://dev01.westcomzivo.com/gpcd/text"
		}
		if(location.href.toString().search('www0.cmab-gpcd.gov.hk')!=-1){
			subPath="ht"+"tp://www0.cmab-gpcd.gov.hk/text"
		}
		if(location.href.toString().search('www.cmab-gpcd.gov.hk')!=-1){
			subPath="ht"+"tp://www.cmab-gpcd.gov.hk/text"
		}
	}
	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,gb_caption,url,offPic,onPic,hasChild,sitemap,navigationMenu)
{
	menuObj[x] = new Object();
	menuObj[x].id = sectionID;
	menuObj[x].caption = caption;
	menuObj[x].chiCaption = chi_caption;
	menuObj[x].gbCaption = gb_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,gb_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;
	subMenuObj[y].gbCaption = gb_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++;
}

function addHomeIcon(ID, caption, chi_caption, gb_caption, url, chi_url, Pic)
{
	HomeIconObj[z] = new Object();
	HomeIconObj[z].id = ID;
	HomeIconObj[z].caption = caption;
	HomeIconObj[z].chiCaption = chi_caption;
	HomeIconObj[z].gbCaption = gb_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>');
		if(printPage!=1){ getTopMenu();	}
		if(printPage!=1){
			/*document.writeln('<tr valign=top>');
				document.writeln('<td colspan="2"><img src="'+imagePath+'images/mourning.gif" border="0"></td>');
			document.writeln('</tr>');*/
			document.writeln('<tr valign=top>');
				document.writeln('<td colspan="2"><img src="'+locationPath+'/images/main_vis.jpg" border="0"></td>');
			document.writeln('</tr>');
		}
		document.writeln('<tr valign=top>');
		if(printPage!=1){ getLeftMenu(); }
/*		document.writeln('	<td width=607><img src="'+locationPath+'/images/top_pic.jpg" border=0 align=top alt=""></td>');
		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 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==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==1){
			getHomeIcon();
		}*/
		document.writeln('<tr valign=top>');
		document.writeln('	<td>');
		getFooter();
		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>');
			}
			if(langID==2){
				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>');
			}
			if(langID==3){
				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].gbCaption+'"></a></td>');
			}
			rows++;
			if(rows>=6){
				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>');
			}
			if(langID==2){
				document.writeln('			<td><a href="'+HomeIconObj[i].chi_url+'" target="_blank">'+HomeIconObj[i].chiCaption+'</a></td>');
			}
			if(langID==3){
				document.writeln('			<td><a href="'+HomeIconObj[i].chi_url+'" target="_blank">'+HomeIconObj[i].gbCaption+'</a></td>');
			}			
			rows++;
			if(rows>=6){
				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 background="'+imagePath+'images/bkgdtexture.gif"><img src="'+imagePath+'images/spacer.gif" border="0" height=1 width=40 alt=""></td>';
	}else{
		var extarSpacer = '<td background="'+imagePath+'images/bkgdtexture.gif"><img src="'+imagePath+'images/spacer.gif" border="0" height=1 width=49 alt=""></td>';
	}

	var gicSearchForm;

	gicSearchForm='<form name="frmSearch" action="'+arClfTopMenu[langID][1]+'" method="get">\n';
/*	gicSearchForm=gicSearchForm+'<INPUT name="mode" type="hidden" value="'+arClfTopMenu[langID][2]+'">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="lmode" type="hidden" value="1">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="pq" type="hidden" value="">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="pg" type="hidden" value="">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="pn" type="hidden" value="0">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="qm" type="hidden" value="0">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="la" type="hidden" value="1">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="de" type="hidden" value="0">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="so" type="hidden" value="0">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="nu" type="hidden" value="10">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="ca" type="hidden" value="0">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="ta" type="hidden" value="all">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="fu" type="hidden" value="">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="fd" type="hidden" value="">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="ma" type="hidden" value="100">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="ft_1" type="hidden" value="alltype">\n';
	gicSearchForm=gicSearchForm+'<INPUT name="gr_1" type="hidden" value="'+arClfTopMenu[langID][20]+'">';*/
	gicSearchForm=gicSearchForm+'<INPUT name="exact_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="any_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="none_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="gp0" type="hidden" value="cmab_gpcd_home">';
	gicSearchForm=gicSearchForm+'<INPUT name="gp1" type="hidden" value="cmab_gpcd_home">';
	gicSearchForm=gicSearchForm+'<INPUT name="p_size" type="hidden" value="10">';
	gicSearchForm=gicSearchForm+'<INPUT name="doc_type" type="hidden" value="all">';
	gicSearchForm=gicSearchForm+'<INPUT name="last_mod" type="hidden" value="#-1">';
	gicSearchForm=gicSearchForm+'<INPUT name="ui_lang" type="hidden" value="'+arClfTopMenu[langID][24]+'">';
	gicSearchForm=gicSearchForm+'<INPUT name="r_lang" type="hidden" value="all">';
	gicSearchForm=gicSearchForm+'<INPUT name="ui_charset" type="hidden" value="'+arClfTopMenu[langID][25]+'">';
	gicSearchForm=gicSearchForm+'<INPUT name="tpl_id" type="hidden" value="cmab_gpcd">';
	gicSearchForm=gicSearchForm+'<INPUT name="a_submit" type="hidden" value="false">';
	gicSearchForm=gicSearchForm+'<INPUT name="web" type="hidden" value="this">';
	if(location.href.toString().search('/text/')!=-1){
		gicSearchForm=gicSearchForm+'<INPUT name="txtonly" type="hidden" value="1">';
	}
	else
	{
		gicSearchForm=gicSearchForm+'<INPUT name="txtonly" type="hidden" value="0">';
	}

	if(!isText){
		document.writeln('	<tr>');
		document.writeln('	<td colspan="2">');
		document.writeln('		<table width="760" border="0" cellpadding="0" cellspacing="0" background="'+locationPath+'/images/bg.gif">');
		document.writeln(gicSearchForm);
		document.writeln('		<tr align="left" valign="top">');
		document.writeln('			<td class="sidebar" background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB">');
		document.writeln('				<table width="760" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('				<tr valign="top">');
		document.writeln('					<td class="sidebar" background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="ht'+'tp://'+HomePath+'"><img src="'+imagePath+'images/branding.gif" border=0 alt="'+arClfTopMenu[langID][3]+'"></a></td>');
		document.writeln('					<td background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB" width="100%">&nbsp;</td>');
		document.writeln('					<td background="'+imagePath+'images/bkgdtexture.gif" colspan="2" valign="bottom" align=right bgcolor="#FAFAEB"><a href="'+arClfTopMenu[langID][5]+'" target="_blank"><img name="BrandHK" src="'+imagePath+'images/brandhk.gif" border="0" alt="'+arClfTopMenu[langID][6]+'"></a></td>');
		document.writeln('				</tr>');
		document.writeln('				</table>');
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('		<tr align="left" valign="top">');
		document.writeln('			<td class="sidebar" background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB">');
		document.writeln('				<table width="760" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('				<tr valign="bottom">');
		document.writeln('					<td background="'+locationPath+langPath+'images/bkgdtexture.gif"><a href="'+arClfTopMenu[langID][23]+'" 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><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><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><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('					<td><img src="'+imagePath+'images/mainbar5.gif" border="0"></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" align=center><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" bgcolor="#FAFAEB"><a href="'+locationPath+langPath+'contact/index.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('					<td background="'+imagePath+'images/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="javascript:alert(\''+arClfTopMenu[langID][26]+'\')" 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('				</table>');
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('		<tr align="left" valign="top">');
		document.writeln('			<td height=2 colspan="10" bgcolor="#BB3333"><img src="'+imagePath+'images/reddot.gif" width="760" 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="'+arClfTopMenu[langID][23]+'" 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('[ <a href="javascript:alert(\''+arClfTopMenu[langID][26]+'\')">'+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(switchLang){
	var currentPath=location.href.toString();
	var switchTc='/tc/';
	var switchGb='/gb/';
	var switchEn='/en/';
	var switchText='/text';
if(location.href.toString().search('www0.cmab-gpcd.gov.hk')!=-1)
{
	var switchGraphic=/\/cgi-bin\/rvd1\/TextOnly\.pl\?search\=/;
}
else
{
	var switchGraphic=/\/cgi-bin\/rvd\/TextOnly\.pl\?search\=/;
}
//	var urlVars=document.location.search;
//	alert(urlVars);
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=287", "mode=288");
			break;
		case '/en/':
			currentPath=currentPath.replace("mode=288", "mode=287");
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		case '/tc/':
			currentPath=currentPath.replace("mode=287", "mode=288");
			currentPath=currentPath.replace(gb_urlPath, "");
			break;
		default:
	}
}
else{
	switch (switchLang){
		case '/graphics/':
			currentPath=currentPath.replace(switchText, "");
//			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			break;
		case '/text/':
			currentPath=currentPath.replace(switchEn, switchText+switchEn);
			currentPath=currentPath.replace(switchTc, switchText+switchTc);
			currentPath=currentPath.replace(switchGb, switchText+switchGb);
			break;
		case '/gb/':
//			currentPath='http://'+gb_urlPath+locationPath.substring(7, locationPath.length)+switchTc;
			currentPath=currentPath.replace(switchTc, switchGb);
			currentPath=currentPath.replace(switchEn, switchGb);
			break;
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(switchGb, switchEn);
			break;
		case '/tc/':
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(switchGb, switchTc);
			break;
		default:
	}
}
document.location=currentPath;
//	alert(currentPath);
}

function getCaption(menu, i){
	var showAlt;

	if(langID==1)
		eval('showAlt='+menu+'['+i+'].caption');
	if(langID==2)
		eval('showAlt='+menu+'['+i+'].chiCaption');
	if(langID==3)
		eval('showAlt='+menu+'['+i+'].gbCaption');
	return showAlt;
}

function getLeftMenu(){
if(langID==1)
	var newImgAlt="2008 Legislative Council Election";
else if(langID==2)
	var newImgAlt="2008ミ猭穦匡羭";
else if(langID==3)
	var newImgAlt="2008年立法会选举";

	menuObjID=showMenuObj();
	if(!isText){
//		document.writeln('<td rowspan=6 width=153 background="'+locationPath+'images/left_bg.gif">');
		document.writeln('<td rowspan=5 width=153>');
		document.writeln('	<table border=0 cellspacing=0 cellpadding=0 width=153>');
		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><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><td align="center"><br><a href="ht'+'tp://www.elections.gov.hk" target="_blank"><img src="'+locationPath+'/images/2008_LegCo_Election.jpg" alt="'+newImgAlt+'" border="0"></a></td></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;');
					}
				}
			}
		}
		document.writeln('</td></tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td colspan=100><hr width=100%></td>');
		document.writeln('</tr>');
		if(menuObj[menuObjID].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){
	menuObjID=showMenuObj();
	
	var strText;
	
	if(showlink)
		strText = "<a href='"+menuObj[menuObjID].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";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".gbCaption";
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
//		alert(subMenuObj[i].menuID+"/"+ID)
			if (subMenuObj[i].menuID==menuObj[ID].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(){
	menuObjID=showMenuObj();
	
	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+"]")+"("+menuObjID+", "+Selected_Sub+", false)");
			}else{
				showPath = eval(eval("functionList["+i+"]")+"("+menuObjID+", "+Selected_Sub+", true)") + "<span class='path_arrow'> > </span>" + showPath;
			}
		}
	}
	showPath;
//	showPath = "<span class='path_arrow'> > </span>" + showPath;
//	alert(showPath)
	var functionNum;
	functionNum = 1;

	if(Selected_ID<10)
		var titleNum="0"+Selected_ID;
	else
		var titleNum=Selected_ID;
	
	if(Selected_Sub>0){
		functionNum = 0;
		if(Selected_Sub<10){
			subTitleNum=titleNum+"0"+Selected_Sub;
		}else{
			subTitleNum=titleNum+Selected_Sub;
		}
	}
	
/*	if(Selected_ID==1){
		menuObj[1].caption = "Commissioner's Message";
		menuObj[1].chiCaption = "竝杠";
	}*/

	if(!isText){
		document.writeln('<table width="607" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('<tr>');
		document.writeln('	<td height="13">');
		document.writeln('		<table width="607" height="13" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('		<tr>');
		document.writeln('			<td width="24" height="13">&nbsp;</td>');
		document.writeln('			<td width="583"><span class="path_higlight">'+showPath+'</span></td>');
		document.writeln('		</tr>');
		document.writeln('		</table>');
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('	<td width="607" height="36"><p><img src="'+imagePath+'images/title/hd_'+titleNum+'.gif" border=0 align=top alt="'+eval(eval("functionList[1]")+"("+menuObjID+", 0, false)")+'"></p></td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('	<td height="24" valign="top">');
		document.writeln('		<table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('		<tr>');
		document.writeln('        	<td width="38" height="24"><img src="'+locationPath+'/images/hd_pix_01.jpg" border="0"></td>');
		document.writeln('          <td valign="top" background="'+locationPath+'/images/sub_hd_bg.gif" class="sub_hd">');
		if(Selected_Sub>0){
//			document.writeln('				<img src="'+imagePath+'images/title/sub_hd_'+subTitleNum+'.gif" border=0 align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'">');
			document.writeln('				'+eval(eval("functionList["+functionNum+"]")+"("+menuObjID+", "+Selected_Sub+", false)")+'');
		}
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('        </table>');
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}else{
		document.writeln('<table border=0 cellspacing=0 cellpadding=0>');
		document.writeln('<tr><td><h2>'+eval(eval("functionList["+functionNum+"]")+"("+menuObjID+", "+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/layer_btn_"+ID+"_"+subMenuObj[i].id+".gif');\"";
				var overAction = " onMouseOver=\"simg(submenu_"+ID+"_"+subMenuObj[i].id+", '"+imagePath + "images/submenu/layer_btn_"+ID+"_"+subMenuObj[i].id+"-over.gif');\"";
				
				document.writeln('	<tr>');
				document.writeln('		<td><a href="'+subMenuObj[i].url+'"'+overAction+outAction+subMenuObj[i].popup+'><img src="'+imagePath+'images/submenu/layer_btn_'+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==2) altText='';
	if(langID==3) altText='页首';
	
	var altBack='Back';
	if(langID==2) altBack='';
	if(langID==3) altBack='回上页';
	
	var copyYear='2007';
	var noticesLink=locationPath+langPath+'notices/index.htm';
	var noticeText='Important notices';
	var revisionText='Last revision date: ';	
//	var reviewText='Last review date: ';
	if (revisionDate==''||revisionDate=='MM/DD/YYYY') revisionDate='07/11/2007';
//	if (reviewDate==''||reviewDate=='MM/DD/YYYY') reviewDate='07/11/2007';
	if (langID==2){
		noticeText='璶ボ';
		revisionText='璹ら戳 ';	
//		reviewText='滦浪ら戳 ';	
	}
	if (langID==3){
		noticeText='重要告示';
		revisionText='修订日期： ';	
//		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()+'ら';
	if (langID==3) 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()+'ら';
	if (langID==3) 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="600" 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="2"><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"><b>'+copyYear+'</b> &copy; | <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 height="15" align="right" bgcolor="#FFFFFF" class="footer">'+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=2><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">&nbsp;</td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=top>');
		document.writeln('	<td colspan=2><hr width=100%></td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('	<td class="footer"><b>'+copyYear+'</b> &copy; | <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='<img src="'+locationPath+'/images/bullet_1.gif" border=0 alt="*">';
		bulletPath2='<img src="'+locationPath+'/images/bullet_2.gif" border=0 alt="*">';
	}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 nowrap>'+bulletPath1+'&nbsp;</td><td width=100%><a href="'+menuObj[i].url+'"'+menuObj[i].popup+' class="Link">'+getCaption('menuObj', i)+'</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 nowrap>&nbsp;</td><td width=100%><table border=0 cellspacing=0 cellpaddding=3 width=100%>');
					for(var j=1;j<y;j++){
						if (subMenuObj[j].menuID==menuObj[i].id)
							document.write('	<tr valign=top><td nowrap>'+bulletPath2+'&nbsp;</td><td width=100%><a href="'+subMenuObj[j].url+'"'+subMenuObj[j].popup+' class="Link">'+getCaption('subMenuObj', j)+'</a></td></tr>');
					}
					document.writeln('	</table></td></tr>');
				}else{
				document.writeln('</tr>');
				}
			}
		}
	}
	document.writeln('</table>');
}

function getSectionList(){
	var bulletPath1;
	if(!isText){
		bulletPath1='<img src="'+locationPath+'/images/bullet_1.gif" border=0 alt="*">';
	}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") && (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();}
}
