/*-------------------------------------function for check current Path----------------------------------------*/
function getLocationPath(){
	var locPath=location.href.toString();
	var targetString;
	var subPath='';
	if(location.href.toString().search('cmab.westcomzivo.com')!=-1){
		subPath="ht"+"tp://cmab.westcomzivo.com"
		HomePath="cmab.westcomzivo.com"
	}
	if(location.href.toString().search('www0.cmab.gov.hk')!=-1){
		subPath="ht"+"tp://www0.cmab.gov.hk"
		HomePath="www0.cmab.gov.hk"
	}
	if(location.href.toString().search('www.cmab.gov.hk')!=-1){
		subPath="ht"+"tp://www.cmab.gov.hk"
		HomePath="www.cmab.gov.hk"
	}
	if(location.href.toString().search('se.cgi')!=-1){
		subPath="ht"+"tp://www.cmab.gov.hk"
		HomePath="www.cmab.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;

}
/*-------------------------------------function for check current Path End----------------------------------------*/



/*------------------------------------Print function ----------------------------------------------------------------------*/
//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%>');
	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');
}
/*------------------------------------Print function End ---------------------------------------------------------------*/


/*------------------------------------Mouse Over, Mouse Out, Swap Image ------------------------------------*/

//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;
      }
}

/*------------------------------------Mouse Over, Mouse Out, Swap Image End ------------------------------*/


/*------------------------------------Get External download --------------------------------------------------------*/

//Acrobat Reader
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/accrasianfontpack.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?c=hk" target="_blank">';
		StrText='如想觀看以上文件，請下載'+linkUrl+'Acrobat Reader</a>及<a class="Link" href="http://www.chinese-t.adobe.com/products/acrobat/acrrasianfontpack.html?c=hk" target="_blank">亞洲及中歐字型套件<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>');
}


//Real Player
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>');
}

/*------------------------------------Get External download End --------------------------------------------------*/


/*------------------------------------Left Menu--------------------------------------------------------------------------*/

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{
	
		// NEW
		// for Perl /cgi-bin/
		if (

			/*
			(menuID == 4 && subSectionID == 3)
			|| (menuID == 4 && subSectionID == 6)
			|| 
			(menuID == 5 && subSectionID == 1)
			|| (menuID == 5 && subSectionID == 2)
			
			|| */
			(menuID == 6 && subSectionID == 1)
			|| (menuID == 6 && subSectionID == 2)
			
		){
			// for Perl /cgi-bin/
			// http://www.cab.gov.hk/cgi-bin/cab/en_press.cgi
			subMenuObj[y].url = locationPath+url;
		} else {
			// original , static html page
			subMenuObj[y].url = locationPath+langPath+url;
		}
		
		subMenuObj[y].popup = ''
	}
	subMenuObj[y].sitemap = sitemap;
	subMenuObj[y].navigationMenu = navigationMenu;
	y++;
//	z++;

}

/*------------------------------------Left Menu End -------------------------------------------------------------------*/


/*------------------------------------Layout Template ---------------------------------------------------------------*/

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();	}
		document.writeln('<tr valign=top>');
		if(printPage!=1){ getLeftMenu(); }
		document.writeln('	<td width=607><img src="'+locationPath+'/images/topbar_2.jpg" border=0 align=top alt="">');
		/*
		document.writeln('	</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('	<div style="background:url('+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=18><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=18 height=20></td>');
		document.writeln('			<td width="100%"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" width=1 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('		</div>');
		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/table_buttom.gif" border=0 align=top alt=""></td>');
		document.writeln('		</tr>');
		document.writeln('		<tr valign=top>');
		document.writeln('			<td><img src="'+locationPath+'/images/banner_bottom-line.gif" border=0 align=top alt=""></td>');
		document.writeln('		</tr>');*/
		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=bottom>');
		document.writeln('	<td>');
		getFooter();
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}else{
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('<tr valign=bottom>');
		document.writeln('	<td>');
		getFooter();
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}
}

//function for generating the top menu
function getTopMenu(){
	
	if(langID==1){
//		var extarSpacer = '<td background="'+imagePath+'images/mainbar5.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=55 alt=""></td>';
		var extarSpacer = '<td background="'+imagePath+'images/mainbar5.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=187 alt=""></td>';
	}else{
//		var extarSpacer = '<td background="'+imagePath+'images/mainbar5.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=145 alt=""></td>';
		var extarSpacer = '<td background="'+imagePath+'images/mainbar5.gif" bgcolor="#FAFAEB"><img name="mainbar5" src="'+imagePath+'images/spacer.gif" border="0" height=1 width=204 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_home">';
	gicSearchForm=gicSearchForm+'<INPUT name="gp1" type="hidden" value="cmab_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">';
	gicSearchForm=gicSearchForm+'<INPUT name="a_submit" type="hidden" value="false">';
	gicSearchForm=gicSearchForm+'<INPUT name="web" type="hidden" value="this">';
	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 colspan="5" 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" colspan="2" valign="bottom" 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('		</table>');
		document.writeln('		<table width="760" border="0" cellpadding="0" cellspacing="0" background="'+locationPath+'/images/bg.gif">');
		document.writeln('		<tr align="left" valign="top">');
		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 align="left" valign="top"><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" valign="top"><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" valign="top"><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 valign="bottom" background="'+imagePath+'images/bkgdtexture.gif" align=center><input type="text" name="query" size="'+arClfTopMenu[langID][4]+'" class="search" style="height:17px"></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('		</tr>');
		document.writeln('		<tr align="left" valign="top">');
		document.writeln('			<td height=2 colspan="9" 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="http://www.info.gov.hk/" 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="qu" 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(switchLang){
	var currentPath=location.href.toString();
	var switchGb='/gb/';
	var switchTc='/tc/';
	var switchEn='/en/';

	
if(location.href.toString().search('www0.cmab.gov.hk')!=-1)
{
	var switchGraphic=/\/cgi-bin\/cmab\/TextOnly\.pl\?search\=/;
	var switchText="/cgi-bin/cmab/TextOnly.pl?search=";
}
else
{
	var switchGraphic=/\/cgi-bin\/cmab\/TextOnly\.pl\?search\=/;
	var switchText="/cgi-bin/cmab/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=37", "mode=38");
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/en_", "/cgi-bin/cmab/tc_");
			
			break;
		case '/en/':
			currentPath=currentPath.replace("mode=38", "mode=37");
			currentPath=currentPath.replace(gb_urlPath, "");
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/en_", "/cgi-bin/cmab/tc_");
			
			break;
		case '/tc/':
			currentPath=currentPath.replace("mode=37", "mode=38");
			currentPath=currentPath.replace(gb_urlPath, "");
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/en_", "/cgi-bin/cmab/tc_");
			
			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, switchGb);
			currentPath=currentPath.replace(switchTc, switchGb);
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/en_", "/cgi-bin/cmab/tc_");
			
			break;
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(switchGb, switchEn);
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/tc_", "/cgi-bin/cmab/en_");
			
			//currentPath=currentPath.replace(gb_urlPath, "");
			break;
		case '/tc/':			
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(switchGb, switchTc);
			// 2005-11-18 | westcom | sunny.ho
			currentPath=currentPath.replace("/cgi-bin/cmab/en_", "/cgi-bin/cmab/tc_");
			
			//currentPath=currentPath.replace(gb_urlPath, "");
			break;
		default:
	}
}

	if(typeof(isPress) != 'undefined'){
		currentPath = currentPath.substring(0, currentPath.lastIndexOf("/")+1) + "press.htm";
	}

	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');
	if(langID==2)
		eval('showAlt='+menu+'['+i+'].chiCaption');
	if(langID==3)
		eval('showAlt='+menu+'['+i+'].gbCaption');
	return showAlt;
}

function getLeftMenu(){
	if(!isText){
		document.writeln('<td rowspan=6 width=153 background="'+locationPath+'images/left_bg.gif">');
		document.writeln('	<table border=0 cellspacing=0 cellpadding=0 width=153>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2><img src="'+locationPath+'/images/topbar_1.jpg" border=0 align=top alt=""></td>');
		document.writeln('	</tr>');
		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 align="center"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" height="15"></td>');
		document.writeln('	</tr>');
		/*document.writeln('	<tr valign=top>');
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/equalsdofs_sex.htm" ><img src="'+imagePath+'images/eofs_so.jpg" border=0 align=top title="Equal Opportunities (Sexual Orientation) Funding Scheme" alt="Equal Opportunities (Sexual Orientation) Funding Scheme"></td>');
	}
	if (langID == 2){
	document.writeln('		<td colspan=2 align="center"><a href="../issues/equalsdofs_sex.htm" ><img src="'+imagePath+'images/eofs_so.jpg" border=0 align=top title="平等機會(性傾向)資助計劃" alt="平等機會(性傾向)資助計劃 "></a></td>');
	}
	if (langID == 3){
	document.writeln('		<td colspan=2 align="center"><a href="../issues/equalsdofs_sex.htm" ><img src="'+imagePath+'images/eofs_so.jpg" border=0 align=top title="平等机会(性倾向)资助计划" alt="平等机会(性倾向)资助计划 "></a></td>');
	}

		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');*/
		document.writeln('	<tr valign=top>');
		
	//if (langID == 1){
	//document.writeln('		<td colspan=2 align="center"><a href="../press/reports_human.htm#arc1" ><img src="'+imagePath+'images/Child_banner.jpg" border=0 align=top title="Consultation on the report under the Convention on the Rights of the Child" alt="Consultation on the report under the Convention on the Rights of the Child"></td>');
//	}
	
	//else {
	//document.writeln('		<td colspan=2 align="center"><a href="../press/reports_human.htm#arc1" ><img src="'+imagePath+'images/Child_banner.jpg" border=0 align=top title="兒童權利公約報告的公眾諮詢" alt="兒童權利公約報告的公眾諮詢 "></a></td>');
	//}

	//	document.writeln('	</tr>');
	//	document.writeln('	<tr><td>&nbsp;</td></tr>');
	document.writeln('	<tr valign=top>');
	
	/*
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/popup_xmas09.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/banner_xmas_en.gif" border=0 align=top title="Merry Christmas! Click here to show the ecard"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/popup_xmas09.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/banner_xmas_tc.gif" border=0 align=top title="聖誕快樂! 按此觀看心意卡"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/popup_xmas09_sc.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/banner_xmas_sc.gif" border=0 align=top title="圣诞快乐!按此观看心意卡"></a></td>');
	}
	
	document.writeln('	<tr valign=top>');
	document.writeln('	</tr>');
	document.writeln('	<tr><td>&nbsp;</td></tr>');
	*/
	/*
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/newyears_2010/en/CMAB_ec_CNY10_1001.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/CMAB_ec_CNY10_banner.gif" border=0 align=top title="Happy Lunar New Year"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/newyears_2010/tc/CMAB_ec_CNY10_1001.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/CMAB_ec_CNY10_banner.gif" border=0 align=top title="恭賀新禧"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup/newyears_2010/sc/CMAB_ec_CNY10_1001.html\',\'no\',\'no\',100,100,'+screen.width+','+screen.height+')"><img src="'+imagePath+'images/CMAB_ec_CNY10_banner.gif" border=0 align=top title="恭贺新禧"></a></td>');
	}
	
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	*/
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.cmab-cd2012.gov.hk" target="_blank"><img src="'+imagePath+'images/banner_cmab_en.gif" border=0 align=top title="Public Consultation on the Methods for Selecting the Chief Executive and for Forming the Legislative Council in 2012"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.cmab-cd2012.gov.hk" target="_blank"><img src="'+imagePath+'images/banner_cmab_tc.gif" border=0 align=top title="二零一二年行政長官及立法會產生辦法公眾諮詢"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.cmab-cd2012.gov.hk" target="_blank"><img src="'+imagePath+'images/banner_cmab_sc.gif" border=0 align=top title="二零一二年行政长官及立法会产生办法公众谘询"></a></td>');
	}
	
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/competition.htm"><img src="'+imagePath+'images/equal_opportunities_en.jpg" border=0 align=top title="Equal Opportunities (Sexual Orientation) Slogan and Logo Design Competition"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/competition.htm"><img src="'+imagePath+'images/equal_opportunities_tc.jpg" border=0 align=top title="平等機會（性傾向）標語創作及標誌設計比賽"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/competition.htm"><img src="'+imagePath+'images/equal_opportunities_sc.jpg" border=0 align=top title="平等机会（性倾向）标语创作及标志设计比赛"></a></td>');
	}
	/*
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');

	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/child_funding.htm"><img src="'+imagePath+'images/child_banner_en.gif" border=0 align=top title="Children\'s Rights Education Funding Scheme 2010-11"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/child_funding.htm"><img src="'+imagePath+'images/child_banner_tc.gif" border=0 align=top title="二○一○至一一年度兒童權利教育活動資助計劃"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/child_funding.htm"><img src="'+imagePath+'images/child_banner_sc.gif" border=0 align=top title="二○一○至一一年度儿童权利教育活动资助计划"></a></td>');
	}
	*/

	/*
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../../popup_xmas09.html" target="_blank"><img src="'+imagePath+'images/banner_xmas_en.gif" border=0 align=top title="Merry Christmas! Click here to show the ecard"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="../../popup_xmas09.html" target="_blank"><img src="'+imagePath+'images/banner_xmas_tc.gif" border=0 align=top title="聖誕快樂! 按此觀看心意卡"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="../../popup_xmas09.html" target="_blank"><img src="'+imagePath+'images/banner_xmas_sc.gif" border=0 align=top title="圣诞快乐!按此观看心意卡"></a></td>');
	}
	
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup_xmas09.html\',\'no\',\'no\',100,100,550,320)"><img src="'+imagePath+'images/banner_xmas_en.gif" border=0 align=top title="Merry Christmas! Click here to show the ecard"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup_xmas09.html\',\'no\',\'no\',100,100,550,320)"><img src="'+imagePath+'images/banner_xmas_tc.gif" border=0 align=top title="聖誕快樂! 按此觀看心意卡"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp3(\'../../popup_xmas09.html\',\'no\',\'no\',100,100,550,320)"><img src="'+imagePath+'images/banner_xmas_sc.gif" border=0 align=top title="圣诞快乐!按此观看心意卡"></a></td>');
	}
	*/
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/personal.htm" target="_self"><img src="'+imagePath+'images/public_consultation_en.gif" border=0 align=top title="Public Consultation on Review of the Personal Data (Privacy) Ordinance"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/personal.htm" target="_self"><img src="'+imagePath+'images/public_consultation_tc.gif" border=0 align=top title="檢討 <<個人資料 (私隱) 條例>> 的公眾諮詢"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/personal.htm" target="_self"><img src="'+imagePath+'images/public_consultation_sc.gif" border=0 align=top title="检讨 <<个人资料 (私隐) 条例>> 的公众咨询"></a></td>');
	}
	
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../press/reports_human.htm#International_Covenant"><img src="'+imagePath+'images/international_covenant_en.jpg" border=0 align=top title="Public consultation on the report under the International Covenant on Economic, Social and Cultural Rights" alt="Public consultation on the report under the International Covenant on Economic, Social and Cultural Rights"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="../press/reports_human.htm#International_Covenant"><img src="'+imagePath+'images/international_covenant_tc.jpg" border=0 align=top title="《經濟、社會與文化權利的國際公約》報告的公眾諮詢" alt="《經濟、社會與文化權利的國際公約》報告的公眾諮詢"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="../press/reports_human.htm#International_Covenant"><img src="'+imagePath+'images/international_covenant_sc.jpg" border=0 align=top title="《经济、社会与文化权利的国际公约》报告的公众谘询" alt="《经济、社会与文化权利的国际公约》报告的公众谘询"></a></td>');
	}
	
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.cmab.gov.hk/tf/" target="_blank"><img src="'+imagePath+'images/trust_fund.jpg" border=0 align=top title="Trust Fund in Support of Reconstruction in the Sichuan Earthquake Stricken Areas" alt="Trust Fund in Support of Reconstruction in the Sichuan Earthquake Stricken Areas"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.cmab.gov.hk/tf/" target="_blank"><img src="'+imagePath+'images/trust_fund.jpg" border=0 align=top title="支援四川地震災區重建工作信託基金" alt="支援四川地震災區重建工作信託基金"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.cmab.gov.hk/tf/" target="_blank"><img src="'+imagePath+'images/trust_fund.jpg" border=0 align=top title="支援四川地震灾区重建工作信托基金" alt="支援四川地震灾区重建工作信托基金"></a></td>');
	}
	
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
		
		
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="../issues/voting.htm" ><img src="'+imagePath+'images/prisoners_voting.gif" border=0 align=top title="Public Consultation on Prisoners\' Voting Right" alt="Public Consultation on Prisoners\' Voting Right"></td>');
	}
	if (langID == 2){
	document.writeln('		<td colspan=2 align="center"><a href="../issues/voting.htm" ><img src="'+imagePath+'images/prisoners_voting.gif" border=0 align=top title="有關在囚人士投票權的公眾諮詢" alt="有關在囚人士投票權的公眾諮詢"></a></td>');
	}
	if (langID == 3){
	document.writeln('		<td colspan=2 align="center"><a href="../issues/voting.htm" ><img src="'+imagePath+'images/prisoners_voting.gif" border=0 align=top title="有关在囚人士投票权的公众谘询" alt="有关在囚人士投票权的公众谘询"></a></td>');
	}
	
	document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
		
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.basiclaw-mission.com" target="_blank"><img src="'+imagePath+'images/basic_law_game_site.jpg" border=0 align=top alt="Basic Law game site"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.basiclaw-mission.com" target="_blank"><img src="'+imagePath+'images/basic_law_game_site.jpg" border=0 align=top alt="羅基本失蹤事件簿"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="http://www.basiclaw-mission.com" target="_blank"><img src="'+imagePath+'images/basic_law_game_site.jpg" border=0 align=top alt="罗基本失踪事件簿"></td>');
	}
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
		
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/en/issues/pa_report.htm"><img src="'+imagePath+'images/pas.gif" border=0 align=top alt="Further Development of the Political Appointment System"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/tc/issues/pa_report.htm"><img src="'+imagePath+'images/pas.gif" border=0 align=top alt="進一步發展政治委任制度報告書"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/gb/issues/pa_report.htm"><img src="'+imagePath+'images/pas.gif" border=0 align=top alt="进一步发展政治委任制度报告书"></td>');
	}
		document.writeln('	</tr>');
		document.writeln('	<tr><td>&nbsp;</td></tr>');
		document.writeln('	<tr valign=top>');
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp(\''+locationPath+'/en/5day.htm\',260,198)"><img src="'+locationPath+'/images/5day_icon.jpg" border=0 align=top alt="5-day week"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp(\''+locationPath+'/tc/5day.htm\',260,198)"><img src="'+locationPath+'/images/5day_icon.jpg" border=0 align=top alt="5天工作周"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="javascript:PopUp(\''+locationPath+'/gb/5day.htm\',260,198)"><img src="'+locationPath+'/images/5day_icon.jpg" border=0 align=top alt="5天工作周"></td>');
	}
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2 align="center"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" height="15"></td>');
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/en/issues/council.htm"><img src="'+imagePath+'images/pearl_icon.gif" border=0 align=top alt="The Greater Pearl River Delta Business Council"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/tc/issues/council.htm"><img src="'+imagePath+'images/pearl_icon.gif" border=0 align=top alt="大珠三角商務委員會"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/gb/issues/council.htm"><img src="'+imagePath+'images/pearl_icon.gif" border=0 align=top alt="大珠三角商务委员会"></td>');
	}
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2 align="center"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" height="15"></td>');
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/rru"><img src="'+imagePath+'images/rru_icon.gif" border=0 align=top alt="Race Relations Unit" title="Race Relations Unit"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/rru"><img src="'+imagePath+'images/rru_icon.gif" border=0 align=top alt="種族關係組" title="種族關係組"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/rru"><img src="'+imagePath+'images/rru_icon.gif" border=0 align=top alt="种族关系组" title="种族关系组"></td>');
	}
	document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2 align="center"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" height="15"></td>');
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/en/issues/equal_gender.htm"><img src="'+imagePath+'images/genderIdentity.gif" border=0 align=top alt="Gender Identity and Sexual Orientation Unit" title="Gender Identity and Sexual Orientation Unit"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/tc/issues/equal_gender.htm"><img src="'+imagePath+'images/genderIdentity.gif" border=0 align=top alt="性別認同及性傾向小組" title="性別認同及性傾向小組"></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="'+locationPath+'/gb/issues/equal_gender.htm"><img src="'+imagePath+'images/genderIdentity.gif" border=0 align=top alt="性别认同及性倾向小组" title="性别认同及性倾向小组"></td>');
	}
	document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
		document.writeln('		<td colspan=2 align="center"><img src="'+locationPath+'/images/spacer.gif" border=0 align=top alt="" height="15"></td>');
		document.writeln('	</tr>');
		document.writeln('	<tr valign=top>');
	if (langID == 1){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.access.gov.hk/en/code.htm" target="_blank"><img src="'+imagePath+'images/code.gif" border=0 align=top title="Code on Access to Information" alt="Code on Access to Information"></td>');
	}
	if (langID == 2){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.access.gov.hk/tc/code.htm" target="_blank"><img src="'+imagePath+'images/code.gif" border=0 align=top title="公開資料守則" alt="公開資料守則"></a></td>');
	}
	if (langID == 3){
		document.writeln('		<td colspan=2 align="center"><a href="ht'+'tp://www.access.gov.hk/sc/code.htm" target="_blank"><img src="'+imagePath+'images/code.gif" border=0 align=top title="公开资料守则" alt="公开资料守则"></a></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;');
					}
				}
			}
		}
		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";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".gbCaption";
	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_Sub>0){
		functionNum = 0;
		if(Selected_Sub<10){
			titleNum=titleNum+"_0"+Selected_Sub;
		}else{
			titleNum=titleNum+"_"+Selected_Sub;
		}
	}
	
/*	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=607 background="'+imagePath+'images/spacer.gif">');
		document.writeln('<tr valign="top">');
		document.writeln('<td rowspan="3" width="18"><img src="'+imagePath+'images/path_img_1.gif" width="18" height="24"></td>');
		document.writeln('<td width="10"><img src="'+imagePath+'images/path_img_2.gif" width="10" height="10"></td>');
		document.writeln('<td background="'+imagePath+'images/path_bg_1.gif" width="100%"><img src="'+imagePath+'images/spacer.gif" width="10" height="10"></td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('<td bgcolor="0399FA" width="10"><img src="'+imagePath+'images/path_img_3.gif" width="10" height="14"></td>');
		document.writeln('<td bgcolor="0399FA">');
		document.writeln('<p><span class="path_higlight">'+showPath+'</span></p>');
		document.writeln('</td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('<td width="10"><img src="'+imagePath+'images/path_img_4.gif" width="10" height="12"></td>');
		document.writeln('<td width="100%" background="'+imagePath+'images/path_bg_2.gif"><img src="'+imagePath+'images/spacer.gif" width="10" height="12"></td>');
		document.writeln('</tr>');
		document.writeln('</table>');
		document.writeln('<table width="607" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('<tr valign="top">');
		document.writeln('<td rowspan="2" width="18"><img src="'+imagePath+'images/spacer.gif" width="18" height="18"></td>');
		document.writeln('<td width="10" bgcolor="D3ECF8"><img src="'+imagePath+'images/hd_img_1.gif" width="10" height="25"></td>');
		document.writeln('<td bgcolor="D3ECF8" valign="bottom" width="579">');
		document.writeln('<p class="topic"><span class="topic">'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'</span></p>');
		document.writeln('</td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('<td width="10"><img src="'+imagePath+'images/hd_img_2.gif" width="10" height="10"></td>');
		document.writeln('<td bgcolor="D3ECF8"><img src="'+imagePath+'images/spacer.gif" width="10" height="10"></td>');
		document.writeln('</tr>');
		document.writeln('</table>');



//		document.writeln('<tr><td bgcolor="0399FA" width="10"><img src="'+imagePath+'images/spacer.gif" border=0 align=top alt="" width=10 height=24></td><td width=600 class="path_higlight">'+showPath+'</td></tr>');
//		document.writeln('<tr><td colspan=2 background="'+locationPath+'/images/path_line.gif"><img src="'+imagePath+'images/spacer.gif" border=0 align=top alt="" width=1 height=5></td></tr>');
//		document.writeln('<tr><td colspan=2><img src="'+imagePath+'images/title/heading_'+titleNum+'.gif" border=0 align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td></tr>');
	}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/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==2) altText='頁首';
	if(langID==3) altText='页首';

	if (document.layers)
		{document.writeln('<layer name=footer_layer top=0 left=0 width=62 height=12 visibility="hide">');}
	else
		{document.writeln('<div id="footer_layer" style="position:absolute; left:0; top:0; width:62; height:12; 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" onMouseOut="simg(backtotopfoot,\''+imagePath+'images/btn_gototop.gif\')" onMouseOver="simg(backtotopfoot,\''+imagePath+'images/btn_gototop_over.gif\')"><img src="'+imagePath+'images/btn_gototop.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='2005';
	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='06/01/2005';
	if (reviewDate==''||reviewDate=='MM/DD/YYYY') reviewDate='06/01/2005';
	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="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=62 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"><b>'+copyYear+'</b> <img src="'+imagePath+'../images/copy.gif" alt="" width="12" height="11"> | <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=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>');
	}
}

/*------------------------------------Layout Template End ---------------------------------------------------------*/


/*------------------------------------ Other Common Function ----------------------------------------------------*/

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('<tr valign=top><td nowrap><li type="square"></li></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==i)
							document.write('	<tr valign=top><td nowrap><li type="disc"></li></td><td width=100%><a href="'+subMenuObj[j].url+'"'+subMenuObj[j].popup+' class="Link">'+getCaption('subMenuObj', j)+'</a></td></tr>');
//							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.write('<tr valign=top><td nowrap><li></li></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==2)
			styleType=styleType.replace('.css', '_tc.css');
		if(langID==3)
			styleType=styleType.replace('.css', '_gb.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();}
}

function PopUp(url,x,y) {
  eval("nw = window.open(url,'content1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,pageXOffset=100,pageYOffset=100,top=0,left=0,width=" + x + ",height=" + y + "')");
  if ( nw.focus != null){
    nw.focus();
  }
}

function PopUp2(url,x,y) {
  eval("nw = window.open(url,'content1','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,pageXOffset=100,pageYOffset=100,top=0,left=0,width=" + x + ",height=" + y + "')");
  if ( nw.focus != null){
    nw.focus();
  }
}

function PopUp3(url,a,b,c,d,e,f) {
  eval("nw = window.open(url,'content1','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=" + a + ",resizable=" + b + ",pageXOffset=100,pageYOffset=100,top=" + c + ",left=" + d + ",width=" + e + ",height=" + f + "')");
  if ( nw.focus != null){
    nw.focus();
  }
}

function externalLink(url)
{eval("nw = window.open(url, 'external','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=0,width=400,height=600')");
	if ( nw.focus != null)
	{nw.focus();}
}

function documentPopUp(url)
{eval("nw = window.open(url, 'document','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=0,width=400,height=600')");
	if ( nw.focus != null)
	{nw.focus();}
}
 /*------------------------------------ Other Common Function End ---------------------------------------------*/