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

	if(location.href.toString().search('pandahotel.westcomzivo.com')!=-1){
		subPath="ht"+"tp://pandahotel.westcomzivo.com"
		HomePath="pandahotel.westcomzivo.com"
	}
	else if(location.href.toString().search('www.pandahotel.com.hk:8001')!=-1){
		subPath="ht"+"tp://www.pandahotel.com.hk:8001"
		HomePath="www.pandahotel.com.hk:8001"
	}
	else{
		subPath="ht"+"tp://www.pandahotel.com.hk"
		HomePath="www.pandahotel.com.hk"
	}

	if(subPath==''){
		var lastSlash=location.href.toString().lastIndexOf('/');
		subPath=location.href.toString().substring(0, lastSlash);
	}

	locationPath=subPath;
}

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

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

function getheaderHTML(){
	if(Selected_ID>=10){
		var bg=Selected_ID;
	}else{
		var bg="0"+Selected_ID;
	}
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('<tr>');
//	document.writeln('	<td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="265" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+locationPath+'/images/panda_inside_nav.swf?aspFile='+locationPath+'/images/inside_nav.asp" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="'+locationPath+'/images/panda_inside_nav.swf?aspFile='+locationPath+'/images/inside_nav.asp" quality="high" bgcolor="#000000" width="100%" height="265" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td>');
if(langID==2)
{
	document.writeln('	<td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="265" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+locationPath+'/images/panda_inside_nav_tc.swf?aspFile=inside_nav.asp" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="'+locationPath+'/images/panda_inside_nav_tc.swf?aspFile=inside_nav.asp" quality="high" bgcolor="#000000" width="100%" height="265" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td>');
}
else if(langID==3)
{
	document.writeln('	<td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="265" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+locationPath+'/images/panda_inside_nav_sc.swf?aspFile=inside_nav.asp" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="'+locationPath+'/images/panda_inside_nav_sc.swf?aspFile=inside_nav.asp" quality="high" bgcolor="#000000" width="100%" height="265" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td>');
}
else
{
	document.writeln('	<td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="265" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+locationPath+'/images/panda_inside_nav.swf?aspFile=inside_nav.asp" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="'+locationPath+'/images/panda_inside_nav.swf?aspFile=inside_nav.asp" quality="high" bgcolor="#000000" width="100%" height="265" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td>');
}
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td>');
	document.writeln('		<table width="930" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.writeln('		<tr>');
	document.writeln('			<td>');
	getSubSecMenu();
	document.writeln('			</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td>');
	document.writeln('		<table width="930" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.writeln('		<tr>');
// 1
	document.writeln('			<td><img src="'+imagePath+'images/sec'+Selected_ID+'_gra_color_top.gif" border="0"></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td>');
	document.writeln('				<table width="930" border="0" cellspacing="0" cellpadding="0">');
	if(Selected_ID!=4 && Selected_ID!=10 && Selected_ID!=11 && Selected_ID!=12){
	document.writeln('		    	<tr>');
// 2
	document.writeln('		            <td><img src="'+imagePath+'images/sec'+Selected_ID+'_gra_color_left.gif" border="0"></td>');
	getTopic();
// 3
	document.writeln('		            <td><img src="'+imagePath+'images/sec0_gra_color_right.gif" border="0"></td>');
	document.writeln('		    	</tr>');
	}
	document.writeln('		    	<tr>');
// 4
	document.writeln('		            <td valign="top" background="'+imagePath+'images/sec'+Selected_ID+'_gra_color_left.gif"><img src="'+imagePath+'images/sec'+Selected_ID+'_gra_color_left.gif" width="15" height="200"></td>');
	document.writeln('		            <td valign="top" bgcolor="#DCDCBD">');
}

function getfooterHTML(){
	document.writeln('					</td>');
// 5
	document.writeln('					<td valign="top" background="'+imagePath+'images/sec0_gra_color_right.gif"><img src="'+imagePath+'images/sec0_gra_color_right.gif" width="15" height="200"></td>');
	document.writeln('				</tr>');
	document.writeln('				</table>');
	document.writeln('			</td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
// 6
	document.writeln('			<td><img src="'+imagePath+'images/sec0_gra_color_buttom.gif" width="930" height="4"></td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td>');
	document.writeln('		<table width="930" border="0" cellspacing="0" cellpadding="5" align="center">');
	document.writeln('	    <tr>');
	document.writeln('	    	<td><div align="right"><a href="#top" onMouseOver="MM_swapImage(\'btn_top\',\'\',\''+imagePath+'images/btn_top_over.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="'+imagePath+'images/btn_top.gif" border="0" name="btn_top"></a><img src="'+imagePath+'images/spacer.gif" width="10" height="15"></div></td>');
	document.writeln('		</tr>');
	document.writeln('	    </table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('    <td background="'+imagePath+'images/footer_bg.gif">');
	getFooter();
	document.writeln('    </td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

//function for generating the top menu
function getTopMenu(){

}

function changeLanguage(switchLang){
	var tempVar="";
	var tempVar2="";
	var tempPos="";
	var currentPath=window.location.href.toLowerCase();
	var switchTc='/tc/';
	var switchSc='/sc/';
	var switchEn='/en/';

	if (currentPath.indexOf("?")!=-1)
	{
		tempPos = currentPath.indexOf("?")
		tempVar = currentPath.substring(tempPos,currentPath.length)
		tempVar2 = currentPath.substring(tempPos,currentPath.length-1)
		currentPath = currentPath.substring(0,tempPos)
	}
	switch (switchLang){
		case '/sc/':
			currentPath=currentPath.replace(switchEn, switchSc);
			currentPath=currentPath.replace(switchTc, switchSc);
			break;
		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;
		default:
	}

	
	

	if (Selected_ID == 6 && Selected_Sub==5){
		var subSecID=FORM_DATA['id'];
		if (subSecID==1 || subSecID==5|| subSecID==9){
			document.location=currentPath + tempVar2;
		}else if (subSecID == ''){
			document.location=currentPath + tempVar;
		}else{
			document.location=currentPath;
		}
	}else{
		document.location=currentPath;
	}
//	alert(currentPath);
}

function getCaption(menu, i){
	var showAlt;

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

function getSubSecMenu(){
	document.writeln('<table border="0" cellspacing="0" cellpadding="0" align="right">');
	document.writeln('<tr>');
	if (Selected_ID == 6 && Selected_Sub==5){
//		PopWin('/images/popup20070615.htm','popup20070615',760,590);
		var subSecID=FORM_DATA['id'];
/*		if (subSecID == 1 || subSecID == 5 || subSecID == 9 || subSecID == ''){
			PopWin('/images/popup20070615.htm','popup20070615',760,590);
		}*/
	}
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==Selected_ID){
				var outAction = " onMouseOut=\"simg(submenu_"+Selected_ID+"_"+subMenuObj[i].id+", '"+imagePath + "images/nav_2nd_sec"+Selected_ID+"_"+subMenuObj[i].id+".gif');\"";
				var overAction = " onMouseOver=\"simg(submenu_"+Selected_ID+"_"+subMenuObj[i].id+", '"+imagePath + "images/nav_2nd_sec"+Selected_ID+"_"+subMenuObj[i].id+"_over.gif');\"";
				
//				document.writeln('		<td><a href="'+subMenuObj[i].url+'"'+overAction+outAction+subMenuObj[i].popup+'><img src="'+imagePath+'images/nav_2nd_sec'+Selected_ID+'_'+subMenuObj[i].id+'.gif" name="submenu_'+Selected_ID+'_'+subMenuObj[i].id+'" alt="'+getSubMenuPath(Selected_ID, subMenuObj[i].id, false)+'" border="0"></a></td>');
				if (subMenuObj[i].id==Selected_Sub)
				{
//					if (Selected_ID == 6 && Selected_Sub==5){
//						PopWin('/images/popup20070615.htm','popup20070615',760,590);
//					}
					document.writeln('		<td><a href="'+subMenuObj[i].url+'"'+subMenuObj[i].popup+'><img src="'+imagePath+'images/nav_2nd_sec'+Selected_ID+'_'+subMenuObj[i].id+'_over.gif" name="submenu_'+Selected_ID+'_'+subMenuObj[i].id+'" border="0"></a></td>');
				}
				else
				{
//					if (Selected_ID == 6 && Selected_Sub==5){
//						PopWin('/images/popup20070615.htm','popup20070615',760,590);
//					}
					document.writeln('		<td><a href="'+subMenuObj[i].url+'"'+overAction+outAction+subMenuObj[i].popup+'><img src="'+imagePath+'images/nav_2nd_sec'+Selected_ID+'_'+subMenuObj[i].id+'.gif" name="submenu_'+Selected_ID+'_'+subMenuObj[i].id+'" border="0"></a></td>');
				}
			}
		}
	}
	document.writeln('	<td><img src="'+imagePath+'images/spacer.gif" width="18" height="26" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}

function getSubMenu(){
	var nextLine=0;
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==Selected_ID){
				if(nextLine==0){
					document.writeln('<tr>');
					document.writeln('	<td>');
				}
				nextLine++;
	
				if (subMenuObj[i].id != Selected_Sub){
					document.writeln("[ <a href='"+subMenuObj[i].url+"'>"+getCaption('subMenuObj', i)+"</a> ]&nbsp;&nbsp;");
				}else{
					document.writeln("[ <b>"+getCaption('subMenuObj', i)+"</b> ]&nbsp;&nbsp;");
				}
			}
		}
	}
	
	document.writeln('<tr valign=top>');
	document.writeln('	<td><hr width=100%></td>');
	document.writeln('</tr>');
}

function getMenuPath(ID, sub_ID, showlink){
	var strText;
	
	if(showlink)
		strText = "<a href='"+menuObj[Selected_ID].url+"' class='path_link'>"+getCaption('menuObj', ID)+"</a>"
	else
		strText = getCaption('menuObj', ID)
	
	return strText;
}

function getSubMenuPath(ID, sub_ID, showlink){
	var strText;
	var langText;
	
	if(langID==1)
		langText=".caption";
	else
		langText=".chiCaption";
	for(var i=1;i<y;i++){
		if (subMenuObj[i])
		{
			if (subMenuObj[i].menuID==ID){
				if (subMenuObj[i].id == sub_ID){
					if(showlink)
						strText = "<a href='"+subMenuObj[i].url+"'"+subMenuObj[i].popup+" class='path_link'>"+eval('subMenuObj[i]'+langText)+"</a>";
					else
						strText = eval('subMenuObj[i]'+langText);
				}
			}
		}
	}

	return strText;
}

function getTopic(){
	var showPath;
	if(exLink!=null)
		showPath = exLink;
	var checkList = new Array()
		checkList[0] = "Selected_Sub"
		checkList[1] = "Selected_ID"
	var functionList = new Array()
		functionList[0] ="getSubMenuPath" 
		functionList[1] ="getMenuPath" 
	
	for (var i in checkList){
		if(eval(checkList[i]) > 0){
			if(showPath==null){
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", false)");
			}else{
				showPath = eval(eval("functionList["+i+"]")+"("+Selected_ID+", "+Selected_Sub+", true)") + "<span class='path_arrow'> > </span>" + showPath;
			}
		}
	}

	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('<td><img src="'+imagePath+'images/heading_'+titleNum+'.gif" border="0" align=top alt="'+eval(eval("functionList["+functionNum+"]")+"("+Selected_ID+", "+Selected_Sub+", false)")+'"></td>');
	document.writeln('<td><img src="'+imagePath+'images/sec'+titleNum+'_hd.gif" border="0"></td>');
}

//function for generating the footer
function getFooter(){
document.writeln('<table width="930" border="0" cellspacing="0" cellpadding="5" align="center">');
document.writeln('<tr>');
document.writeln('	<td width="100%">');
if(langID==1)
{
	document.writeln('		<table width="600" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><img src="'+imagePath+'images/footer_panda_logo.gif" width="84" height="11" align="absmiddle" /><img src="'+imagePath+'images/spacer.gif" width="25" height="10" />3 Tsuen Wah Street, Tsuen Wan, Hong Kong</td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td class="footer">Tel: (852) 2409 1111</td><td width="20">&nbsp;</td><td class="footer">Fax: (852) 2409 1818</td><td width="20">&nbsp;</td><td class="footer">China Toll-free for reservations&nbsp;:&nbsp;</td><td class="footer">10-800-152-9022 (China Telecom User)<br>10-800-852-9022 (China Netcom User)</td></tr></table></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td><img src="'+imagePath+'images/spacer.gif" width="50" height="7" /></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer">Copyright &copy; 2007 Panda Hotel. All Rights Reserved.</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
}
if(langID==2)
{
	document.writeln('		<table width="600" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><img src="'+imagePath+'images/footer_panda_logo.gif" align="absmiddle" /><img src="'+imagePath+'images/spacer.gif" width="25" height="10" />翠芖地刁3腹</td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td class="footer">筿杠: (852) 2409 1111</td><td width="20">&nbsp;</td><td class="footer">肚痷: (852) 2409 1818</td><td width="20">&nbsp;</td><td class="footer">い瓣禣挤璹┬筿杠&nbsp;:&nbsp;</td><td class="footer">10-800-152-9022 (い瓣筿獺ノめ)<br>10-800-852-9022 (い瓣呼硄ノめ)</td></tr></table></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td><img src="'+imagePath+'images/spacer.gif" width="50" height="7" /></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer">舦┮Τ ぃ眔锣更 &copy; 2007 ㄓ皊┍</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
}
if(langID==3)
{
	document.writeln('		<table width="600" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><img src="'+imagePath+'images/footer_panda_logo.gif" align="absmiddle" /><img src="'+imagePath+'images/spacer.gif" width="25" height="10" />香港荃湾荃华街3号</td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer"><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td class="footer">电话: (852) 2409 1111</td><td width="20">&nbsp;</td><td class="footer">传真: (852) 2409 1818</td><td width="20">&nbsp;</td><td class="footer">中国免费直拨订房电话&nbsp;:&nbsp;</td><td class="footer">10-800-152-9022 (中国电信用户)<br>10-800-852-9022 (中国网通用户)</td></tr></table></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td><img src="'+imagePath+'images/spacer.gif" width="50" height="7" /></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td class="footer">版权所有 不得转载 &copy; 2007 悦来酒店</td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
}
document.writeln('	</td>');
document.writeln('	<td align="right"><img src="'+imagePath+'images/icon_cagp.gif" align="right"></td>');
document.writeln('	<td align="right"><img src="'+imagePath+'images/icon_caring.gif" align="right"></td>');
document.writeln('</tr>');
document.writeln('</table>');
}

function getSiteMap(){
	var bulletPath1;
	var bulletPath2;

	bulletPath1='<img src="'+locationPath+'/images/bullet_1.gif" border=0 alt="*">';
	bulletPath2='<img src="'+locationPath+'/images/bullet_2.gif" border=0 alt="*">';
	
	document.writeln('<table border=0 cellspacing=0 cellpadding=3 width=100%>');
	for(var i=1;i<x;i++){
		if(menuObj[i]){
			if(menuObj[i].sitemap=="Y"){
				document.write('<tr valign=top><td nowrap>'+bulletPath1+'&nbsp;</td><td width=100%><a href="'+menuObj[i].url+'"'+menuObj[i].popup+' class="Link">'+getCaption('menuObj', i)+'</a></td>');
//				document.write('	<li><a href="'+menuObj[i].url+'">'+getCaption('menuObj', i)+'</a>');
				if(menuObj[i].hasChild=="Y" || menuObj[i].hasChild=="L"){
					document.writeln('	<tr valign=top><td nowrap>&nbsp;</td><td width=100%><table border=0 cellspacing=0 cellpaddding=3 width=100%>');
					for(var j=1;j<y;j++){
						if (subMenuObj[j].menuID==i)
							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 styleSheet(){
	var styleType='common.css';
	
	if(langID!=1)
		styleType=styleType.replace('.css', '_c.css'); 

	document.writeln('<link href="'+locationPath.replace("/text", "")+'/css/'+styleType+'" rel="STYLESHEET" type="text/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_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 PopWin(url,page,x,y,resize){
	eval("nw = window.open(url, page,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable="+resize+",pageXOffset=0,pageYOffset=0,top=0,left=0,width=" + x + ",height=" + y + "')");
	if ( nw.focus != null)
	{nw.focus();}
}

function jumpSection(secNum,subSecNum)
{
	//alert(secNum+"/"+subSecNum);
	if(secNum==1)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"aboutus/profile.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"aboutus/philosophy.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"aboutus/management.asp";
		}
		else if(subSecNum==4)
		{
			location.href = locationPath+langPath+"aboutus/awards.asp";
		}
		else if(subSecNum==5)
		{
			location.href = locationPath+langPath+"aboutus/location.asp";
		}
		else if(subSecNum==6)
		{
			location.href = locationPath+langPath+"aboutus/newsletter.asp";
		}
		else if(subSecNum==7)
		{
			location.href = locationPath+langPath+"aboutus/career.asp";
		}
	}
	if(secNum==2)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"facilities/business.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"facilities/recreation.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"facilities/shopping.asp";
		}
	}
	if(secNum==3)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"rooms/rooms.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"rooms/suites.asp";
		}
	}
	if(secNum==4)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"restaurants/cafe.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"restaurants/balcony.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"restaurants/yinyue.asp";
		}
		else if(subSecNum==4)
		{
			location.href = locationPath+langPath+"restaurants/sports.asp";
		}
	}
	if(secNum==5)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"catering/banquet.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"catering/wedding.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"catering/occasions.asp";
		}
		else if(subSecNum==4)
		{
			location.href = locationPath+langPath+"catering/capacity.asp";
		}
		else if(subSecNum==5)
		{
			location.href = locationPath+langPath+"catering/request.asp";
		}
	}
	if(secNum==6)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"special/internet.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"special/local.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"special/weekly.asp";
		}
		else if(subSecNum==4)
		{
			location.href = locationPath+langPath+"special/long.asp";
		}
		else if(subSecNum==5)
		{
			//PopWin('/images/popup20070615.htm','popup20070615',760,590);
			location.href = locationPath+langPath+"special/promotions.asp?id=";
			var subSecID=FORM_DATA['id'];
/*			if (subSecID == 1 || subSecID == 5 || subSecID == 9 || subSecID == ''){
				PopWin('/images/popup20070615.htm','popup20070615',760,590);
			}*/
		}
	}
	if(secNum==7)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"information/download.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"information/tourist.asp";
		}
	}
	if(secNum==8)
	{
		if(subSecNum==1)
		{
			location.href = locationPath+langPath+"red/index.asp";
		}
		else if(subSecNum==2)
		{
			location.href = locationPath+langPath+"club/index.asp";
		}
		else if(subSecNum==3)
		{
			location.href = locationPath+langPath+"friends/index.asp";
		}
	}
	if(secNum==0)
	{
		if(subSecNum==1)
		{
			changeLanguage("/en/");
		}
		else if(subSecNum==2)
		{
			changeLanguage("/tc/");
		}
		else if(subSecNum==3)
		{
			changeLanguage("/sc/");
		}
		else if(subSecNum==4)
		{
			location.href = locationPath+langPath+"contactus/index.asp";
		}
		else if(subSecNum==5)
		{
			location.href = locationPath+langPath+"photo/index.asp";
		}
		else if(subSecNum==6)
		{
			location.href = locationPath+langPath+"sitemap/index.asp";
		}
		else if(subSecNum==7)
		{
			window.open("https://v3.reservation-system.net/BE/Index.aspx?hotelcd=HT04003021 ");
		}
		else if(subSecNum==8)
		{
			location.href = locationPath+langPath+"index.asp";
		}
		else if(subSecNum==9)
		{
			window.open("/popvideo.html","popvideo","width=350,height=320");
		}
		else if(subSecNum==10)
		{
			if(langID==1)
			window.open("/enews/index.asp?lang=en","popenews","width=800,height=600");
			if(langID==2)
			window.open("/enews/index.asp?lang=tc","popenews","width=800,height=600");
			if(langID==3)
			window.open("/enews/index.asp?lang=sc","popenews","width=800,height=600");
		}
	}
}

//Added by Hubert (Using Javascript to get queryString)
	function createRequestObject() {
	  FORM_DATA = new Object();
	    // The Object ("Array") where our data will be stored.
	  separator = ',';
	    // The token used to separate data from multi-select inputs
	  query = '' + this.location;
	  qu = query
	    // Get the current URL so we can parse out the data.
	    // Adding a null-string '' forces an implicit type cast
	    // from property to string, for NS2 compatibility.
	  query = query.substring((query.indexOf('?')) + 1);
	    // Keep everything after the question mark '?'.
	  if (query.length < 1) { return false; }  // Perhaps we got some bad data?
	  keypairs = new Object();
	  numKP = 1;
	    // Local vars used to store and keep track of name/value pairs
	    // as we parse them back into a usable form.
	  while (query.indexOf('&') > -1) {
	    keypairs[numKP] = query.substring(0,query.indexOf('&'));
	    query = query.substring((query.indexOf('&')) + 1);
	    numKP++;
	      // Split the query string at each '&', storing the left-hand side
	      // of the split in a new keypairs[] holder, and chopping the query
	      // so that it gets the value of the right-hand string.
	  }
	  keypairs[numKP] = query;
	    // Store what's left in the query string as the final keypairs[] data.<
	  for (i in keypairs) {
	    keyName = keypairs[i].substring(0,keypairs[i].indexOf('='));
	      // Left of '=' is name.
	    keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1);
	      // Right of '=' is value.
	    while (keyValue.indexOf('+') > -1) {
	      keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);
	        // Replace each '+' in data string with a space.
	    }
	    keyValue = unescape(keyValue);
	      // Unescape non-alphanumerics
	    if (FORM_DATA[keyName]) {
	      FORM_DATA[keyName] = FORM_DATA[keyName] + separator + keyValue;
	        // Object already exists, it is probably a multi-select input,
	        // and we need to generate a separator-delimited string
	        // by appending to what we already have stored.
	    } else {
	      FORM_DATA[keyName] = keyValue;
	        // Normal case: name gets value.
	    }
	  }
	  return FORM_DATA;
	}
	FORM_DATA = createRequestObject();