﻿var locaPath = location.href.toString();
var currentLang = 'en';
var IE = document.all?true:false;

//function for check current Path
function getLocationPath(){
	var patt1 = /\//g;
	
	if(locaPath.search('/tc/')!=-1){
		currentLang = 'tc';
	}else if(locaPath.search('/sc/')!=-1){
		currentLang = 'sc';
	}else{
		currentLang = 'en';
	}
	locationPath = locaPath.substring(0, locaPath.lastIndexOf('/'+currentLang+'/'));
}

//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>');
	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>');
	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>');
	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>');
	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, schi_caption, url, offPic, onPic, hasChild, sitemap, navigationMenu)
{
	menuObj[a] = new Object();
	menuObj[a].id = sectionID;
	menuObj[a].caption = caption;
	menuObj[a].chiCaption = chi_caption;
	menuObj[a].schiCaption = schi_caption;
	if(url.search('http://')!=-1){
		menuObj[a].url = url;
		menuObj[a].popup = ' target="_blank"'
	}else{
		menuObj[a].url = locationPath+langPath+url;
		menuObj[a].popup = ''
	}
	menuObj[a].onPic = imagePath + "images/menu/" + onPic;
	menuObj[a].offPic = imagePath + "images/menu/" + offPic;
	menuObj[a].hasChild = hasChild;
	menuObj[a].sitemap = sitemap;
	menuObj[a].navigationMenu = navigationMenu;
	a++;
}

function addSubMenu(menuID, subSectionID, caption, chi_caption, schi_caption, url, hasChild, sitemap, navigationMenu)
{
	subMenuObj[b] = new Object();
	subMenuObj[b].id = subSectionID;
	subMenuObj[b].menuID = menuID;
	subMenuObj[b].caption = caption;
	subMenuObj[b].chiCaption = chi_caption;
	subMenuObj[b].schiCaption = schi_caption;
	if(url.search('http://')!=-1){
		subMenuObj[b].url = url;
		subMenuObj[b].popup = ' target="_blank"'
	}else if(url.search('.pdf')!=-1){
		subMenuObj[b].url = url;
		subMenuObj[b].popup = ' target="_blank"'
	}else if(url.search('javascript:')!=-1){
		subMenuObj[b].url = url;
		subMenuObj[b].popup = ''
	}else{
		subMenuObj[b].url = locationPath+langPath+url;
		subMenuObj[b].popup = ''
	}
	subMenuObj[b].hasChild = hasChild;
	subMenuObj[b].sitemap = sitemap;
	subMenuObj[b].navigationMenu = navigationMenu;
	b++;
}

function addSubMenu2(menuID, subSectionID, subSectionID2, caption, chi_caption, schi_caption, url, hasChild, sitemap, navigationMenu)
{
	subMenuObj2[c] = new Object();
	subMenuObj2[c].id = subSectionID;
	subMenuObj2[c].id2 = subSectionID2;
	subMenuObj2[c].menuID = menuID;
	subMenuObj2[c].caption = caption;
	subMenuObj2[c].chiCaption = chi_caption;
	subMenuObj2[c].schiCaption = schi_caption;
	if(url.search('http://')!=-1){
		subMenuObj2[c].url = url;
		subMenuObj2[c].popup = ' target="_blank"'
	}else if(url.search('.pdf')!=-1){
		subMenuObj2[c].url = url;
		subMenuObj2[c].popup = ' target="_blank"'
	}else if(url.search('javascript:')!=-1){
		subMenuObj2[c].url = url;
		subMenuObj2[c].popup = ''
	}else{
		subMenuObj2[c].url = locationPath+langPath+url;
		subMenuObj2[c].popup = ''
	}
	subMenuObj2[c].hasChild = hasChild;
	subMenuObj2[c].sitemap = sitemap;
	subMenuObj2[c].navigationMenu = navigationMenu;
	c++;
}

function addSubMenu3(menuID, subSectionID, subSectionID2, subSectionID3, caption, chi_caption, schi_caption, url, hasChild, sitemap, navigationMenu){
	subMenuObj3[d] = new Object();
	subMenuObj3[d].id = subSectionID;
	subMenuObj3[d].id2 = subSectionID2;
	subMenuObj3[d].id3 = subSectionID3;
	subMenuObj3[d].menuID = menuID;
	subMenuObj3[d].caption = caption;
	subMenuObj3[d].chiCaption = chi_caption;
	subMenuObj3[d].schiCaption = schi_caption;
	if(url.search('http://')!=-1){
		subMenuObj3[d].url = url;
		subMenuObj3[d].popup = ' target="_blank"'
	}else if(url.search('.pdf')!=-1){
		subMenuObj3[d].url = url;
		subMenuObj3[d].popup = ' target="_blank"'
	}else if(url.search('javascript:')!=-1){
		subMenuObj3[d].url = url;
		subMenuObj3[d].popup = ''
	}else{
		subMenuObj3[d].url = locationPath+langPath+url;
		subMenuObj3[d].popup = ''
	}
	subMenuObj3[d].hasChild = hasChild;
	subMenuObj3[d].sitemap = sitemap;
	subMenuObj3[d].navigationMenu = navigationMenu;
	d++;
}

function addSubMenu4(menuID, subSectionID, subSectionID2, subSectionID3, subSectionID4, caption, chi_caption, schi_caption, url, hasChild, sitemap, navigationMenu){
	subMenuObj4[e] = new Object();
	subMenuObj4[e].id = subSectionID;
	subMenuObj4[e].id2 = subSectionID2;
	subMenuObj4[e].id3 = subSectionID3;
	subMenuObj4[e].id4 = subSectionID4;
	subMenuObj4[e].menuID = menuID;
	subMenuObj4[e].caption = caption;
	subMenuObj4[e].chiCaption = chi_caption;
	subMenuObj4[e].schiCaption = schi_caption;
	if(url.search('http://')!=-1){
		subMenuObj4[e].url = url;
		subMenuObj4[e].popup = ' target="_blank"'
	}else if(url.search('.pdf')!=-1){
		subMenuObj4[e].url = url;
		subMenuObj4[e].popup = ' target="_blank"'
	}else if(url.search('javascript:')!=-1){
		subMenuObj4[e].url = url;
		subMenuObj4[e].popup = ''
	}else{
		subMenuObj4[e].url = locationPath+langPath+url;
		subMenuObj4[e].popup = ''
	}
	subMenuObj4[e].hasChild = hasChild;
	subMenuObj4[e].sitemap = sitemap;
	subMenuObj4[e].navigationMenu = navigationMenu;
	e++;
}

function getheaderHTML(){
	if(Selected_ID>=10){
		var bg=Selected_ID;
	}else{
		var bg="0"+Selected_ID;
	}
	document.writeln('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('<tr>');
	/*if(Selected_ID>0){
	document.writeln('	<td align="center">');
	document.writeln('		<table width="1000" height="100%" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('		<tr>');
	document.writeln('			<td width="1000" height="25"><img src="'+locationPath+'/images/top.jpg" border="0" width="1000" height="25" ></td>');
	document.writeln('		</tr>');
	}else{
	}*/
	document.writeln('	<td align="center" valign="top">');
	document.writeln('		<table width="1000" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('		<tr>');
	document.writeln('			<td width="1000" height="25"><img src="'+locationPath+'/images/top.jpg" border="0" width="1000" height="25" ></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	/*if(Selected_ID>0){
	document.writeln('			<td bgcolor="#FFFFFF">');
	}else{
	}*/
	document.writeln('			<td bgcolor="#FFFFFF" valign="top">');
	/*if(Selected_ID>0){
	document.writeln('				<table width="779" height="100%" border="0" cellpadding="0" cellspacing="0">');
	}else{
	}*/
	document.writeln('				<table width="779" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('				<tr>');
	document.writeln('					<td width="747" height="65" valign="top">');
	if(printPage!=1){ getTopMenu();	}
	document.writeln('					</td>');
	document.writeln('					<td width="32">&nbsp;</td>');
	document.writeln('				</tr>');
	if(Selected_ID>0){
		document.writeln('				<tr>');
		document.writeln('					<td><img src="'+locationPath+'/images/sub_line_01.jpg" border="0"></td>');
		document.writeln('					<td><img src="'+locationPath+'/images/sub_line_02.jpg" border="0"></td>');
		document.writeln('				</tr>');
		document.writeln('				<tr>');
		document.writeln('					<td width="747" valign="top">');
		getTopic();
	}
}

function getsearchbloxheaderHTML(){
	document.write('<tr>');
	document.write('<td valign=top><table border=0 cellpadding=0 cellspacing=0 width=980>');
	document.write('<tbody><tr>');
	document.write('<td></td><td><table border=0 cellpadding=0 cellspacing=0 width=980>');
	document.write('<tbody><tr>');
	document.write('<td><img src="'+locationPath+'/images/spacer.gif" width="20"></td><td>');
}
                    
function getfooterHTML1(){


	
	if(Selected_ID>0&&topButton=="Y"){
		document.writeln('<p id="bottom"><img src="'+locationPath+'/images/footer_dot_line.gif" width="727" height="16">');
	}
	if(backButton=="Y")
	{
		document.writeln('<a href="'+backButtonLink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'btn_back\',\'\',\''+imagePath+'images/btn_back_over.gif\',1)"><img src="'+imagePath+'images/btn_back.gif" name="btn_back" border="0" id="btn_back" alt="'+arClfTopMenu[langID][9]+'"></a>');	
	}
	if(topButton=="Y")
	{
		document.writeln('<a href="'+topButtonLink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'btn_top\',\'\',\''+imagePath+'images/btn_top_over.gif\',1)"><img src="'+imagePath+'images/btn_top.gif" name="btn_top" border="0" id="btn_top" alt="'+arClfTopMenu[langID][10]+'"></a>');	
	}
	if(Selected_ID>0){
		document.writeln('											<br></p></td>');
		document.writeln('											<td>&nbsp;</td>');
		document.writeln('										</tr>');
		document.writeln('										</table>');
		document.writeln('									</td>');
		document.writeln('								</tr>');
		document.writeln('								</table>');
		document.writeln('							</td>');
		document.writeln('							<td width="165" valign="top">');
		document.writeln('								<table width="165" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('								<tr>');
		document.writeln('									<td valign="top"><img src="'+locationPath+'/images/sub_nav_pix_01.jpg" border="0"></td>');
		document.writeln('								</tr>');
		document.writeln('								<tr>');
		document.writeln('									<td width="165" valign="top" bgcolor="#505050">');
//		getRightMenu();
	}
}

function getfooterHTML2(){
		document.writeln('									</td>');
		document.writeln('								</tr>');
	if(Selected_ID>0){
		document.writeln('								<tr>');
		document.writeln('									<td align="right" valign="top" bgcolor="#505050"><img src="'+locationPath+'/images/sub_nav_pix_02.gif" border="0"></td>');
		document.writeln('								</tr>');
	}
		document.writeln('								</table>');
		document.writeln('							</td>');
		document.writeln('						</tr>');
		document.writeln('						</table>');
		document.writeln('					</td>');
	if(Selected_ID>0){
		//document.writeln('					<td><img src="'+locationPath+'/images/spacer.gif" width="20" height="600"></td>');
		document.writeln('					<td><img src="'+locationPath+'/images/spacer.gif" width="20"></td>');
	}else{
		document.writeln('					<td><img src="'+locationPath+'/images/spacer.gif" width="20"></td>');
	}
		document.writeln('				</tr>');
		document.writeln('				<tr>');
		document.writeln('					<td valign="top"><p>&nbsp;</p></td>');
		document.writeln('					<td align="right" valign="bottom"><img src="'+locationPath+'/images/corner.gif" border="0"></td>');
		document.writeln('				</tr>');
		document.writeln('				</table>');
		document.writeln('			</td>');
		document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td background="'+locationPath+'/images/pattern.gif" class="footer_text" align="left">');
	getFooter();
	document.writeln('			</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

//function for generating the top menu
function getTopMenu(){
	document.writeln('<table width="968" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('<tr>');
	document.writeln('	<td width="21" valign="bottom">&nbsp;</td>');
	document.writeln('	<td width="100"><a href="'+imagePath+'index.asp" style="float:left; display:block;"><img src="'+imagePath+'images/logo.gif" border="0" alt="'+arClfTopMenu[langID][1]+'" title="'+arClfTopMenu[langID][1]+'"></a></td>');
	document.writeln('	<td valign="top">');
	document.writeln('		<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('		<form name="search" action="'+locationPath+'/searchblox/servlet/SearchServlet" method="post"><tr>');
	document.writeln('		<input type="hidden" name="col" value="5">');
	if (langID==3){
		document.writeln('		<input type="hidden" name="xsl" value="shuntak_sc.xsl">');
	}else if (langID==2){
		document.writeln('		<input type="hidden" name="xsl" value="shuntak_tc.xsl">');
	}else{
		document.writeln('		<input type="hidden" name="xsl" value="shuntak.xsl">');
	}
	document.writeln('		<input type="hidden" name="fe" value="utf-8">');
//	document.writeln('			<td rowspan="2" width="250"><div style="float:right; display:block; padding-top: 5px; padding-left: 15px;"><a target="_blank" href="http://www.mzweb.com.br/irgr/irgr2010/vote/Default.aspx"><img border="0" src="/images/btn_globalrankings.gif" /></a></div></td>')
	document.writeln('			<td rowspan="2" width="250"></td>')
	document.writeln('			<td height="34" align="right" valign="top" style="padding-top:5px"><label> <input type="text" name="query" height="10"> </label> <a href="javascript:document.forms.search.submit();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image32\',\'\',\''+locationPath+'/images/btn_go_over.gif\',1)"><img src="'+locationPath+'/images/btn_go.gif" name="Image32" width="19" height="12" border="0" id="Image32" align="absmiddle" ALT="Search" title="Search"></a><img src="'+locationPath+'/images/top_dot_line.gif" width="5" height="12" align="absmiddle"><a href="'+menuObj[8].url+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image34\',\'\',\''+imagePath+'images/btn_sitemap_over.gif\',1)"><img src="'+imagePath+'images/btn_sitemap.gif" name="Image34" border="0" align="absmiddle" id="Image34" ALT="'+arClfTopMenu[langID][2]+'"></a><img src="'+locationPath+'/images/top_dot_line.gif" width="5" height="12" align="absmiddle"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][3]+'\')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image36\',\'\',\''+locationPath+'/images/btn_en_over.gif\',1)"><img src="'+locationPath+'/images/btn_en.gif" name="Image36" border="0" align="absmiddle" id="Image36" ALT="'+arClfTopMenu[langID][4]+'"></a><img src="'+locationPath+'/images/top_dot_line.gif" width="5" height="12" align="absmiddle"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][5]+'\')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image38\',\'\',\''+locationPath+'/images/btn_tc_over.gif\',1)"><img src="'+locationPath+'/images/btn_tc.gif" name="Image38" border="0" align="absmiddle" id="Image38" ALT="'+arClfTopMenu[langID][6]+'"></a><img src="'+locationPath+'/images/top_dot_line.gif" width="5" height="12" align="absmiddle"><a href="javascript:changeLanguage(\''+arClfTopMenu[langID][7]+'\')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image40\',\'\',\''+locationPath+'/images/btn_sc_over.gif\',1)"><img src="'+locationPath+'/images/btn_sc.gif" name="Image40" border="0" align="absmiddle" id="Image40" ALT="'+arClfTopMenu[langID][8]+'"></a></td>');
	document.writeln('		</tr></form>');
	document.writeln('		<tr>');
	document.writeln('			<td align="right">');
	document.writeln('				<table border="0" cellspacing="0" cellpadding="0">');
	document.writeln('				<tr>');
	for(var i=1;i<a;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+"');";
				outAction = outAction + "\""
				overAction = overAction + "\" "
				document.writeln('<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>');
			}
		}
	}
	document.writeln('				</tr>');
	document.writeln('				</table>');
	document.writeln('			</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

function changeLanguage(switchLang){
//	windowObject.close(); //close pop up
	var currentPath=location.href.toString();
	var TempCurrpath = currentPath.split("#");
	currentPath = TempCurrpath[0];
	var switchEn='/en/';
	var switchTc='/tc/';
	var switchSc='/sc/';
	var urlVars=document.location.search;

//	alert(urlVars);
	switch (switchLang){
		case '/en/':
			currentPath=currentPath.replace(switchTc, switchEn);
			currentPath=currentPath.replace(switchSc, switchEn);
			break;
		case '/tc/':
			currentPath=currentPath.replace(switchEn, switchTc);
			currentPath=currentPath.replace(switchSc, switchTc);
			break;
		case '/sc/':
			currentPath=currentPath.replace(switchEn, switchSc);
			currentPath=currentPath.replace(switchTc, switchSc);
			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+'].schiCaption');
	return showAlt;
}

function getSubMenu(){
	var nextLine=0;
	for(var i=1;i<b;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, sub_ID2, sub_ID3, sub_ID4, showlink){
	var strText;
	
	if(showlink)
		strText = "<a href='"+menuObj[Selected_ID].url+"'>"+getCaption('menuObj', ID)+"</a>"
	else
		strText = getCaption('menuObj', ID)
	
	return strText;
}

function getSubMenuPath(ID, sub_ID, sub_ID2, sub_ID3, sub_ID4, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".schiCaption";
	for(var i=1;i<b;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+">"+eval('subMenuObj[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getSubMenuLink(ID, sub_ID, sub_ID2, sub_ID3){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".schiCaption";
	for(var i=1;i<b;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==ID){
				if (subMenuObj[i].id == sub_ID){
					strText = subMenuObj[i].url;
				}
			}
		}
	}

	return strText;
}

function getSubMenuPath2(ID, sub_ID, sub_ID2, sub_ID3, sub_ID4, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".schiCaption";
	for(var i=1;i<c;i++){
		if (subMenuObj2[i])
		{
			if (subMenuObj2[i].menuID==ID){
				if (subMenuObj2[i].id == sub_ID && subMenuObj2[i].id2 == sub_ID2){
					if(showlink)
						strText = "<a href='"+subMenuObj2[i].url+"'"+subMenuObj2[i].popup+">"+eval('subMenuObj2[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj2[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getSubMenuPath3(ID, sub_ID, sub_ID2, sub_ID3, sub_ID4, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".schiCaption";
	for(var i=1;i<d;i++){
		if (subMenuObj3[i])
		{
			if (subMenuObj3[i].menuID==ID){
				if (subMenuObj3[i].id == sub_ID && subMenuObj3[i].id2 == sub_ID2 && subMenuObj3[i].id3 == sub_ID3){
					if(showlink)
						strText = "<a href='"+subMenuObj3[i].url+"'"+subMenuObj3[i].popup+">"+eval('subMenuObj3[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj3[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getSubMenuPath4(ID, sub_ID, sub_ID2, sub_ID3, sub_ID4, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	if(langID==2)
		langText=".chiCaption";
	if(langID==3)
		langText=".schiCaption";
	for(var i=1;i<e;i++){
		if (subMenuObj4[i])
		{
			if (subMenuObj4[i].menuID==ID){
				if (subMenuObj4[i].id == sub_ID && subMenuObj4[i].id2 == sub_ID2 && subMenuObj4[i].id3 == sub_ID3 && subMenuObj4[i].id4 == sub_ID4){
					if(showlink)
						strText = "<a href='"+subMenuObj4[i].url+"'"+subMenuObj4[i].popup+">"+eval('subMenuObj4[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj4[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getTopic(){
	var showPath;
	if(exLink!=null)
		showPath = exLink;
	var checkList = new Array()
		checkList[0] = "Selected_Sub4"
		checkList[1] = "Selected_Sub3"
		checkList[2] = "Selected_Sub2"
		checkList[3] = "Selected_Sub"
		checkList[4] = "Selected_ID"
	var functionList = new Array()
		functionList[0] ="getSubMenuPath4"
		functionList[1] ="getSubMenuPath3"
		functionList[2] ="getSubMenuPath2"
		functionList[3] ="getSubMenuPath"
		functionList[4] ="getMenuPath"
	
	for (var i in checkList){
		if(eval(checkList[i]) > 0){
			if(showPath==null){
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", "+Selected_Sub2+", "+Selected_Sub3+", "+Selected_Sub4+", true)");
			}else{
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", "+Selected_Sub2+", "+Selected_Sub3+", "+Selected_Sub4+", true)") + "<span class='path_arrow'> > </span>" + showPath;
			}
		}
	}
	showPath = "<span class='path_arrow'><a href=\""+imagePath+"index.asp\">"+altHome[langID]+"</a> > </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){
			titleNum=titleNum+"_0"+Selected_Sub;
		}else{
			titleNum=titleNum+"_"+Selected_Sub;
		}
	}*/

	document.writeln('<table width="747" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('<tr>');
	document.writeln('	<td width="52" valign="top" background="'+locationPath+'/images/sub_left_bg.gif"><img src="'+locationPath+'/images/banner_b_'+titleNum+'.jpg" border="0"></td>');
	document.writeln('	<td width="530" height="87" valign="top" bgcolor="#f6f6f6">');
	document.writeln('		<table width="530" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('		<tr>');
	document.writeln('			<td width="530" height="87" valign="top"><img src="'+imagePath+'images/banner_a_'+titleNum+'.jpg" border="0" alt="'+eval(eval("functionList[3]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'" title="'+eval(eval("functionList[3]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td valign="top">');
	document.writeln('				<table width="751" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('				<tr>');
	document.writeln('					<td width="727" height="32" bgcolor="#FFFFFF"><span class="path">'+showPath);
	if(document.URL.toString().search(/careerdetail|careerlist/)==-1){
		getTopicEnd()
	}
}

function getTopicEnd(){
	document.writeln('</span></td>');
	document.writeln('					<td width="24" bgcolor="#FFFFFF"><img src="'+locationPath+'/images/spacer.gif" width="24" height="32"></td>');
	document.writeln('				</tr>');
	document.writeln('				<tr>');
	document.writeln('					<td height="43" background="'+locationPath+'/images/sub_pix_02.gif">&nbsp;</td>');
	document.writeln('					<td background="'+locationPath+'/images/sub_pix_02.gif"><img src="'+locationPath+'/images/spacer.gif" width="24" height="43"></td>');
	document.writeln('				</tr>');
	document.writeln('				<tr>');
	document.writeln('					<td>');
}

function getRightMenu()
{
	document.writeln('<table width="165" border="0" cellpadding="0" cellspacing="0">');
	
	for(var j=1;j<b;j++){
		if (subMenuObj[j].menuID==Selected_ID){
			if(subMenuObj[j].id==Selected_Sub && Selected_Sub2 == 0 && Selected_Sub3 == 0){
				document.writeln('<tr><td><ul class="one_nav_hover"><li><a href="'+((langID==1)?subMenuObj[j].url:subMenuObj[j].url.replace('=e','=c'))+'"'+subMenuObj[j].popup+'>'+getCaption('subMenuObj', j)+'</a></li></ul></td></tr>');
			}else{
				document.writeln('<tr><td><ul class="one_nav"><li><a href="'+((langID==1)?subMenuObj[j].url:subMenuObj[j].url.replace('=e','=c'))+'"'+subMenuObj[j].popup+'>'+getCaption('subMenuObj', j)+'</a></li></ul></td></tr>');
			}
			if(subMenuObj[j].hasChild=="Y" || subMenuObj[j].hasChild=="L"){
				document.writeln('<tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%">');
				for(var k=1;k<c;k++){
					if (subMenuObj2[k].menuID==Selected_ID && subMenuObj2[k].id==subMenuObj[j].id){
						if(subMenuObj[j].id==Selected_Sub && subMenuObj2[k].id2==Selected_Sub2 && Selected_Sub3 == 0){
							document.writeln('<tr><td><ul class="two_nav_hover"><li><a href="'+subMenuObj2[k].url+'"'+subMenuObj2[k].popup+'>'+getCaption('subMenuObj2', k)+'</a></li></ul></td></tr>');						
						}else{
							document.writeln('<tr><td><ul class="two_nav"><li><a href="'+subMenuObj2[k].url+'"'+subMenuObj2[k].popup+'>'+getCaption('subMenuObj2', k)+'</a></li></ul></td></tr>');						
						}
						if(subMenuObj2[k].hasChild=="Y" || subMenuObj2[k].hasChild=="L"){
							document.writeln('<tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%">');
							for(var l=1;l<d;l++){
								if (subMenuObj3[l].menuID==Selected_ID && subMenuObj3[l].id==subMenuObj[j].id && subMenuObj3[l].id2==subMenuObj2[k].id2){
									if(subMenuObj[j].id==Selected_Sub && subMenuObj2[k].id2==Selected_Sub2 && subMenuObj3[l].id3==Selected_Sub3 && Selected_Sub4 == 0){
										document.writeln('<tr><td><ul class="three_nav_hover"><li><a href="'+subMenuObj3[l].url+'"'+subMenuObj3[l].popup+'>'+getCaption('subMenuObj3', l)+'</a></li></ul></td></tr>');
									}else{
										document.writeln('<tr><td><ul class="three_nav"><li><a href="'+subMenuObj3[l].url+'"'+subMenuObj3[l].popup+'>'+getCaption('subMenuObj3', l)+'</a></li></ul></td></tr>');									
									}
								}
								// Peter
								if(subMenuObj3[l].hasChild=="Y" || subMenuObj3[l].hasChild=="L"){
									document.writeln('<tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%">');
									for(var m=1;m<e;m++){
										if (subMenuObj4[m].menuID==Selected_ID && subMenuObj4[m].id==subMenuObj[j].id && subMenuObj4[m].id2==subMenuObj2[k].id2 && subMenuObj4[m].id3==subMenuObj3[l].id3){
											if(subMenuObj[j].id==Selected_Sub && subMenuObj2[k].id2==Selected_Sub2 && subMenuObj3[l].id3==Selected_Sub3 && subMenuObj4[m].id4==Selected_Sub4){
												document.writeln('<tr><td><ul class="four_nav_hover"><li><a href="'+subMenuObj4[m].url+'"'+subMenuObj4[m].popup+'>'+getCaption('subMenuObj4', m)+'</a></li></ul></td></tr>');
											}else{
												document.writeln('<tr><td><ul class="four_nav"><li><a href="'+subMenuObj4[m].url+'"'+subMenuObj4[m].popup+'>'+getCaption('subMenuObj4', m)+'</a></li></ul></td></tr>');									
											}
										}
									}
									document.writeln('</table></td></tr>');
								}
								// Peter
							}
							document.writeln('</table></td></tr>');
						}
					}
				}
				document.writeln('</table></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;
	//alert('top='+inObjTop+', '+'inObjLeft='+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<b;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<a;i++){
		if(menuObj[i]){
			if (menuObj[i].hasChild =="Y"){
				genLeftLayer(i);
			}
		}
	}	
}

//function for generating the footer
function getFooter(){
	document.writeln('<table width="779" border="0" cellspacing="0" cellpadding="0" style="padding-top:6px;padding-bottom:6px">');
	document.writeln('<tr>');
	document.writeln('	<td width="21">&nbsp;</td>');
	document.writeln('	<td class="footer_text"><a href="'+menuObj[11].url+'">'+arClfTopMenu[langID][11]+'</a> | <a href="'+menuObj[9].url+'">'+arClfTopMenu[langID][12]+'</a> | <a href="'+menuObj[10].url+'">'+arClfTopMenu[langID][13]+'</a> | <a href="/'+((langID==1)?'en':(langID==2)?'tc':'sc')+'/investor/mailing.asp">'+arClfTopMenu[langID][14]+'</a><br>'+arClfTopMenu[langID][15]+'</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

function getSiteMap(){
	var bulletPath1;
	var bulletPath2;
	var bulletPath3;
	var bulletPath4;
	var bulletPath5;
	
	bulletPath1='<img src="'+locationPath+'/images/bullet.gif" border=0 alt="*">';
	bulletPath2='<img src="'+locationPath+'/images/subNav_bullet_01.gif" border=0 alt="*">';
	bulletPath3='<img src="'+locationPath+'/images/subNav_bullet_02.gif" border=0 alt="*">';
	bulletPath4='<img src="'+locationPath+'/images/subNav_bullet_03.gif" border=0 alt="*">';
	bulletPath5='<img src="'+locationPath+'/images/subNav_bullet_04.gif" border=0 alt="*">';
	
	document.writeln('<table border=0 cellspacing=0 cellpadding=3 width=100%>');
	for(var i=1;i<a;i++)
	{
		if(menuObj[i])
		{
			if(menuObj[i].sitemap=="Y")
			{
				document.write('<tr valign=top><td nowrap>'+bulletPath1+'&nbsp;</td><td width=100% class="text"><a href="'+menuObj[i].url+'"'+menuObj[i].popup+'>'+getCaption('menuObj', i)+'</a></td></tr>');
				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<b;j++)
					{
						if (subMenuObj[j].menuID==i)
						{
							document.write('	<tr valign=top><td nowrap>'+bulletPath2+'&nbsp;</td><td width=100% class="text"><a href="'+((langID==1)?subMenuObj[j].url:subMenuObj[j].url.replace('=e','=c'))+'"'+subMenuObj[j].popup+'>'+getCaption('subMenuObj', j)+'</a></td></tr>');		
							if(subMenuObj[j].hasChild=="Y" || subMenuObj[j].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 k=1;k<c;k++)
								{
									if (subMenuObj2[k].menuID==i && subMenuObj2[k].id==subMenuObj[j].id)
									{
										document.write('	<tr valign=top><td nowrap>'+bulletPath3+'&nbsp;</td><td width=100% class="text"><a href="'+subMenuObj2[k].url+'"'+subMenuObj2[k].popup+'>'+getCaption('subMenuObj2', k)+'</a></td></tr>');
										if(subMenuObj2[k].hasChild=="Y" || subMenuObj2[k].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 l=1;l<d;l++)
											{
												if (subMenuObj3[l].menuID==i && subMenuObj3[l].id==subMenuObj[j].id && subMenuObj3[l].id2==subMenuObj2[k].id2)
												{
													document.write('<tr valign=top><td nowrap>'+bulletPath4+'&nbsp;</td><td width=100% class="text"><a href="'+subMenuObj3[l].url+'"'+subMenuObj3[l].popup+'>'+getCaption('subMenuObj3', l)+'</a></td></tr>');
													if(subMenuObj3[l].hasChild=="Y" || subMenuObj3[l].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 m=1;m<e;m++)
														{
															if (subMenuObj4[m].menuID==i && subMenuObj4[m].id==subMenuObj[j].id && subMenuObj4[m].id2==subMenuObj2[k].id2 && subMenuObj4[m].id3==subMenuObj3[l].id3)
															{
																document.write('<tr valign=top><td nowrap>'+bulletPath5+'&nbsp;</td><td width=100% class="text"><a href="'+subMenuObj4[m].url+'"'+subMenuObj4[m].popup+'>'+getCaption('subMenuObj4', m)+'</a></td></tr>');
															}
														}
														document.writeln('</table></td></tr>');
													}

												}
											}
											document.writeln('	</table></td></tr>');
										}
									}
								}
								document.writeln('	</table></td></tr>');
							}
						}
					}
					document.writeln('	</table></td></tr>');
				}
			}
		}
	}
	document.writeln('</table>');
}

function getLinkPath(){
	var bulletPath1;
	var bulletPath2;
	var bulletPath3;
	var bulletPath4;
	var bulletPath5;
	
	bulletPath1='<img src="'+locationPath+'/images/bullet.gif" border=0 alt="*">';
	bulletPath2='<img src="'+locationPath+'/images/subNav_bullet_01.gif" border=0 alt="*">';
	bulletPath3='<img src="'+locationPath+'/images/subNav_bullet_02.gif" border=0 alt="*">';
	bulletPath4='<img src="'+locationPath+'/images/subNav_bullet_03.gif" border=0 alt="*">';
	bulletPath5='<img src="'+locationPath+'/images/subNav_bullet_04.gif" border=0 alt="*">';
	
	for(var i=1;i<a;i++)
	{
		if(menuObj[i])
		{
			if(menuObj[i].sitemap=="Y")
			{
				document.write('<a href="'+menuObj[i].url+'"'+menuObj[i].popup+'></a>\n');
				if(menuObj[i].hasChild=="Y" || menuObj[i].hasChild=="L")
				{
					for(var j=1;j<b;j++)
					{
						if (subMenuObj[j].menuID==i)
						{
							document.write('<a href="'+subMenuObj[j].url+'"'+subMenuObj[j].popup+'></a>\n');		
							if(subMenuObj[j].hasChild=="Y" || subMenuObj[j].hasChild=="L")
							{
								for(var k=1;k<c;k++)
								{
									if (subMenuObj2[k].menuID==i && subMenuObj2[k].id==subMenuObj[j].id)
									{
										document.write('<a href="'+subMenuObj2[k].url+'"'+subMenuObj2[k].popup+'></a>\n');
										if(subMenuObj2[k].hasChild=="Y" || subMenuObj2[k].hasChild=="L")
										{
											for(var l=1;l<d;l++)
											{
												
												if (subMenuObj3[l].menuID==i && subMenuObj3[l].id==subMenuObj[j].id && subMenuObj3[l].id2==subMenuObj2[k].id2)
												{
													
													document.write('<a href="'+subMenuObj3[l].url+'"'+subMenuObj3[l].popup+'></a>\n');
													if(subMenuObj3[l].hasChild=="Y" || subMenuObj3[l].hasChild=="L")
													{
														for(var m=1;m<e;m++)
														{
															if (subMenuObj4[m].menuID==i && subMenuObj4[m].id==subMenuObj[j].id && subMenuObj4[m].id2==subMenuObj2[k].id2 && subMenuObj4[m].id3==subMenuObj3[l].id3)
															{
																document.write('<a href="'+subMenuObj4[m].url+'"'+subMenuObj4[m].popup+'></a>\n');
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

function getSectionList(){
	var bulletPath1;

	bulletPath1='<img src="'+locationPath+'/images/bullet_1.gif" border=0 alt="*">';

	document.writeln('<table border=0 cellspacing=0 cellpadding=3 width=100%>');
	for(var j=1;j<b;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='format.css';
	
	if(langID==2)styleType=styleType.replace('.css', '_tc.css');
	if(langID==3)styleType=styleType.replace('.css', '_sc.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">');
		document.writeln('<!--[if IE]><link id="iecss" type="text/css" rel="stylesheet" href="'+locationPath.replace("/text", "")+'/css/ie'+styleType+'" /><![endif]-->');
//	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function 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){
	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 moveNewScroll(){
	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;
	if (!document.layers) {   // all others
		if (isNS6) {
			moveTopDivs(document.getElementById('divNewsCont').style, getDim(document.images.leftspacer).y+5, getDim(document.images.leftspacer).x+12);
		}else {
			moveTopDivs(document.all["divNewsCont"].style, getDim(document.images.leftspacer).y+5, getDim(document.images.leftspacer).x+12);
		}
	}else {  //NN4
		moveTopDivs(document.layers["divNewsCont"], document.images["leftspacer"].y+5, document.images["leftspacer"].x +12);
	}								
}

function getTopBtn(){
	document.writeln('<a href="'+topButtonLink+'"><img src="'+imagePath+'images/btn_top.gif" border="0" alt="'+arClfTopMenu[langID][10]+'" onmouseout="javascript:this.src=this.src.replace(\'top_over.gif\', \'top.gif\')" onmouseover="javascript:this.src=this.src.replace(\'top.gif\', \'top_over.gif\')"></a>');
}
var windowObject;
function MM_openBrWindow(theURL,winName,features) { //v2.0

 windowObject = window.open(theURL,winName,features);
 

}

function changeFooter(str){
alert(str);
var ele = document.getElementById("bottom");
ele.innerHTML = "<a class='text'>Shun Tak Holdings Limited reserves the rights of all images in the gallery.</a>" + ele.innerHTML;
}

