/*
var domain_pref ="pgdp";
var domain="hkdc.westcomzivo.com/"+domain_pref;
*/
if(location.href.toString().search('hkdc.westcomzivo.com')!=-1){
	var domain="hkdc.westcomzivo.com";
}
if(location.href.toString().search('hkdc.devprj.com')!=-1){
	var domain="hkdc.devprj.com";
}
if(location.href.toString().search('210.17.235.123')!=-1){
	var domain="210.17.235.123";
}
if(location.href.toString().search('218.103.69.41')!=-1){
	var domain="218.103.69.41";
}
if(location.href.toString().search('www.hkdesigncentre')!=-1){
	var domain="www.hkdesigncentre.org";
}
if(location.href.toString().search('www.uat.hkdesigncentre')!=-1){
	var domain="www.uat.hkdesigncentre.org";
}


if(document.URL.toString().search('/sc/')!=-1){
	langID=3;
	langFolder='/sc/';
	imgFolder=langFolder;
	docFolder='/doc/';
	mainsectionCaption=3;
	subsectionCaption=4;
	subsubsectionCaption=5;
	swflang='sc';
}else if(document.URL.toString().search('/tc/')!=-1 || document.URL.toString().search('mode=0')!=-1){
	langID=2;
	langFolder='/tc/';
	imgFolder=langFolder;
	docFolder='/doc/';
	mainsectionCaption=2;
	subsectionCaption=3;
	subsubsectionCaption=4;
	swflang='tc';
}else{
	langID=1;
	langFolder='/en/';
	imgFolder=langFolder;
	docFolder=langFolder+'pdf/';
	mainsectionCaption=1;
	subsectionCaption=2;
	subsubsectionCaption=3;
	swflang='en';
}

domain_url = "ht"+"tp://"+domain;

if(document.URL.toString().search('/text/')!=-1){					//TEXTONLY VERSION
	langPath = domain_url + '/text' + langFolder;
}else{													//GRAPHIC VERSION
	langPath = domain_url + langFolder;
	imgPath = domain_url + '/images' + imgFolder;
}
//alert('imgPath='+imgPath);
docPath=domain_url + docFolder;

if(location.href.toString().search('search.info.gov.hk') != -1){
	selectedSection=13;
	selectedSubSection=0;
	revisionDate='MM/DD/YYYY'; //Date Format: MM/DD/YYYY
}

// -------------------------------------------------------------    Variable for Common Function for Left Menu -----------------------------------------

//Browser Type var:
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
//If not NS4. It should be IE or NS6+
isIE5 =!isNS4;


var leftMenuSectionImageOut = ".jpg";
var leftMenuSectionImageOver = "_o.jpg";
var leftMenuName = "Menu";
var leftMenuImageName = "icon";
var layerCommonName = "Popup";
var leftMenuFlag = false;
var firstLayerFlag = false;
var firstLayerTimerID;
var activeLeftMenuID = "";
var mainTopic = "";

var arLayer = new Array()
var arLayer2 = new Array()

// -------------------------------------------------------------    End of Variable for Common Function for Left Menu -----------------------------------------

// -------------------------------------------------------------    Variable for Common Function for First Level Layers-----------------------------------------

var firstLayerImagesFlag = false;
var secondLayerFlag = false;
var activeFirstLayerImageID = "";
var activeSecondLayerID = "";
var secondLayerTimerID;
var subTopic = "";

var arSecondLayer = new Array()
var arSecondLayer2 = new Array()

// -------------------------------------------------------------    End of Variable for Common Function for First Level Layers -----------------------------------------

// -------------------------------------------------------------    Variable for Common Function for Second Level Layers-----------------------------------------

var secondLayerImagesFlag = false;
var thirdLayerFlag = false;
var activeSecondLayerImageID = "";
var activeThirdLayerID = "";
var thirdLayerTimerID;
var subSubTopic = "";

var arThirdLayer = new Array()
var arThirdLayer2 = new Array()

// -------------------------------------------------------------    End of Variable for Common Function for Second Level Layers -----------------------------------------

// -------------------------------------------------------------    Common Function for Left Menu -----------------------------------------
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 moveDivs(layerObj, inObjTop){
layerObj.top  = inObjTop - 1;
//	var objLeft = layerObj.left;
//	objLeft = objLeft.repalce("px");
//	objLeft = int(objLeft)+10;
//	alert(objLeft);
//layerObj.left  = leftMenuWidth;
}

var arLayerPos = new Array()
//arLayerPos[5] = 180;

function setLayerPosition()
{
//	alert (arLayer.length);
	for (var i in arLayer)
	{
			 if(arLayerPos[arLayer2[i]]!=null)
			 {
				 if (document.all){moveDivs(document.all[arLayer[i]].style, arLayerPos[arLayer2[i]]);}
				 if (document.layers){moveDivs(document.layers[arLayer[i]], arLayerPos[arLayer2[i]]);}
				 if (!document.all && document.getElementById) {moveDivs(document.getElementById(arLayer[i]).style, arLayerPos[arLayer2[i]]);}
			}
			else
			{
				 if (document.all){moveDivs(document.all[arLayer[i]].style, getDim(document.images[leftMenuName+arLayer2[i]]).y);}
				 if (document.layers){moveDivs(document.layers[arLayer[i]], document.images[leftMenuName+arLayer2[i]].y);}
				 if (!document.all && document.getElementById) {moveDivs(document.getElementById(arLayer[i]).style, document.images[leftMenuName+arLayer2[i]].y);}
			}
	}
} 

function doShowMenu(imgName)
{
	var iconNo = parseInt(imgName)+1;
	(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
	if(mainTopic != imgName && !leftMenuFlag)

	{
		document.images[leftMenuName+imgName].src=document.images[leftMenuName+imgName].src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
		leftMenuFlag = true;
	}
	if (!firstLayerFlag)
	{
		MM_showHideLayers(layerCommonName+iconNo,'','show');
		firstLayerFlag=true;
	}
	activeLeftMenuID = imgName
}

function leftMenuMouseOver(imgName) 
{
	if (activeLeftMenuID == imgName)
	{
		if (firstLayerTimerID) clearTimeout(firstLayerTimerID);
		firstLayerTimerID = null;
	}
	else
	{
		if (firstLayerTimerID) clearTimeout(firstLayerTimerID);
		firstLayerTimerID = null;
		if (activeLeftMenuID!=""){doHideMenu(activeLeftMenuID);}
		doShowMenu(imgName)	
	}
}

function doHideMenu(imgName)
{
	var iconNo = parseInt(imgName)+1;
	(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;

	if(mainTopic != imgName)
	{
		document.images[leftMenuName+imgName].src=document.images[leftMenuName+imgName].src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
		leftMenuFlag = false;
	}
	if (firstLayerFlag)
	{
		MM_showHideLayers(layerCommonName+iconNo,'','hide')
		firstLayerFlag=false;
	}
	activeLeftMenuID = "";
}

function leftMenuMouseOut(imgName) {
	
	if (activeLeftMenuID == imgName)
	{
		firstLayerTimerID = setTimeout("doHideMenu('"+imgName+"')", 500);
	}
	else
	{
		doHideMenu(imgName);
	}
}

// -------------------------------------------------------------   End of Common Function for Left Menu -----------------------------------------

// -------------------------------------------------------------    Common Function for First Level Layers -----------------------------------------
function findHeightForLayer(layerObj, obj)
{
	var height = 0;
	var flag = true;
	for (i=0;i<layerObj.images.length;i++)
	{
		if (obj==layerObj.images[i].name)
		{flag = false;}
		if (flag)
		{height+=parseInt(layerObj.images[i].height);}
	}
	return height;
}

var arSecondLayerPos = new Array();
arSecondLayerPos[6] = new Array();
arSecondLayerPos[6][11] = 300;

function setSecondLayerPosition()
{
	for (var i in arSecondLayer)
	{
			 var tempLayer = arSecondLayer[i].substring(0, arSecondLayer[i].length-2)
			 var tempImage = leftMenuName+arSecondLayer2[i];
			 var tempImagePos = tempImage.indexOf("_")

			 tempImage = tempImage.substring(0, tempImagePos)
		 
			 var tempFirstNo = parseFloat(arSecondLayer[i].substring(arSecondLayer[i].length-4, arSecondLayer[i].length-2));
			 var tempSecondNo = parseFloat(arSecondLayer[i].substring(arSecondLayer[i].length-2, arSecondLayer[i].length));
			 
			 if (arLayerPos[parseInt(tempFirstNo-1)] != null)
			 {
				if (arSecondLayerPos[parseInt(tempFirstNo)][parseInt(tempSecondNo)] != null)
				{
					if (document.all){moveDivs(document.all[arSecondLayer[i]].style, arSecondLayerPos[parseInt(tempFirstNo)][parseInt(tempSecondNo)]);}
				 	if (document.layers){moveDivs(document.layers[arSecondLayer[i]], arSecondLayerPos[parseInt(tempFirstNo)][parseInt(tempSecondNo)]);}
				 	if (!document.all && document.getElementById) {moveDivs(document.getElementById(arSecondLayer[i]).style, arSecondLayerPos[parseInt(tempFirstNo)][parseInt(tempSecondNo)]);}	
				}
				else
				{
					if (document.all){moveDivs(document.all[arSecondLayer[i]].style, getDim(document.images[leftMenuName+arSecondLayer2[i]]).y);}
				 	if (document.layers){moveDivs(document.layers[arSecondLayer[i]], arLayerPos[parseInt(tempFirstNo-1)] + findHeightForLayer(document.layers[tempLayer].document, leftMenuName+arSecondLayer2[i]) - 1);}
				 	if (!document.all && document.getElementById) {moveDivs(document.getElementById(arSecondLayer[i]).style, document.images[leftMenuName+arSecondLayer2[i]].y);}	
				}
			 }
			 else
			 {
			 	if (document.all){moveDivs(document.all[arSecondLayer[i]].style, getDim(document.images[leftMenuName+arSecondLayer2[i]]).y);}
			 	if (document.layers){moveDivs(document.layers[arSecondLayer[i]], document.images[tempImage].y + findHeightForLayer(document.layers[tempLayer].document, leftMenuName+arSecondLayer2[i]) - 1);}
			 	if (!document.all && document.getElementById) {moveDivs(document.getElementById(arSecondLayer[i]).style, document.images[leftMenuName+arSecondLayer2[i]].y);}	
			 }
	}
} 

function doShowLayer(imgName, layerName)
{
	var tempLayerName = layerName.substring(0, (layerName.length-2))
	var tempLayer = "";
	var tempImage = "";
	var tempPath = "";
	if(subTopic != imgName && !firstLayerImagesFlag)
	{
		if(document.layers) //netscape 4.x version
		{
			tempLayer = document.layers[tempLayerName].document;
			tempImage = tempLayer.images[imgName];
//			tempImage.src=tempImage.src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
		}
		else
		{
//			document.images[imgName].src=document.images[imgName].src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
		}
		
		firstLayerImagesFlag = true;
	}
	if (!secondLayerFlag )
	{
		MM_showHideLayers(layerName,'','show');
		secondLayerFlag =true;
	}
	activeFirstLayerImageID = imgName
	activeSecondLayerID = layerName
}

function firstLayerMouseOver(imgName, layerName) 
{
	if (activeFirstLayerImageID == imgName && activeSecondLayerID == layerName)
	{
		if (secondLayerTimerID) clearTimeout(secondLayerTimerID);
		secondLayerTimerID = null;
	}
	else
	{
		if (secondLayerTimerID) clearTimeout(secondLayerTimerID);
		secondLayerTimerID = null;
		if (activeFirstLayerImageID!=""){doHideLayer(activeFirstLayerImageID, activeSecondLayerID);}
		doShowLayer(imgName, layerName)	
	}
}

function doHideLayer(imgName, layerName)
{
	var tempLayerName = layerName.substring(0, layerName.length-2)
	var tempLayer = "";
	var tempImage = "";

	if(subTopic != imgName)
	{
		if(document.layers) //netscape 4.x version
		{
			tempLayer = document.layers[tempLayerName].document;
			tempImage = tempLayer.images[imgName];
//			tempImage.src=tempImage.src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
		}
		else
		{
//			document.images[imgName].src=document.images[imgName].src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
		}
		
		firstLayerImagesFlag = false;
	}
	if (secondLayerFlag )
	{
		MM_showHideLayers(layerName,'','hide')
		secondLayerFlag =false;
	}
	activeFirstLayerImageID = "";
	activeSecondLayerID = "";
}

function firstLayerMouseOut(imgName, layerName) {
	
	if (activeFirstLayerImageID == imgName && activeSecondLayerID == layerName)
	{
		secondLayerTimerID = setTimeout("doHideLayer('"+imgName+"', '"+layerName+"')", 500);
	}
	else
	{
		doHideLayer(imgName, layerName);
	}
}

// -------------------------------------------------------------   End of Common Function for First Level Layers -----------------------------------------

// -------------------------------------------------------------    Common Function for Second Level Layers -----------------------------------------
function doShowSecondLayer(imgName, layerName)
{
	var tempLayerName = layerName.substring(0, (layerName.length-2))
	var tempLayer = "";
	var tempImage = "";
	var tempPath = "";
	if(subSubTopic != imgName && !secondLayerImagesFlag)
	{
		if(document.layers) //netscape 4.x version
		{
			tempLayer = document.layers[tempLayerName].document;
			tempImage = tempLayer.images[imgName];
//			tempImage.src=tempImage.src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
		}
		else
		{
//			document.images[imgName].src=document.images[imgName].src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
		}
		
		secondLayerImagesFlag = true;
	}
	if (!thirdLayerFlag )
	{
		MM_showHideLayers(layerName,'','show');
		thirdLayerFlag =true;
	}
	activeSecondLayerImageID = imgName
	activeThirdLayerID = layerName
}

function secondLayerMouseOver(imgName, layerName) 
{
	if (activeSecondLayerImageID == imgName && activeThirdLayerID == layerName)
	{
		if (thirdLayerTimerID) clearTimeout(thirdLayerTimerID);
		thirdLayerTimerID = null;
	}
	else
	{
		if (thirdLayerTimerID) clearTimeout(thirdLayerTimerID);
		thirdLayerTimerID = null;
		if (activeSecondLayerImageID!=""){doHideSecondLayer(activeSecondLayerImageID, activeThirdLayerID);}
		doShowSecondLayer(imgName, layerName)	
	}
}

function doHideSecondLayer(imgName, layerName)
{
	var tempLayerName = layerName.substring(0, layerName.length-2)
	var tempLayer = "";
	var tempImage = "";

	if(subSubTopic != imgName)
	{
		if(document.layers) //netscape 4.x version
		{
			tempLayer = document.layers[tempLayerName].document;
			tempImage = tempLayer.images[imgName];
//			tempImage.src=tempImage.src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
		}
		else
		{
//			document.images[imgName].src=document.images[imgName].src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
		}
		
		secondLayerImagesFlag = false;
	}
	if (thirdLayerFlag )
	{
		MM_showHideLayers(layerName,'','hide')
		thirdLayerFlag =false;
	}
	activeSecondLayerImageID = "";
	activeThirdLayerID = "";
}

function secondLayerMouseOut(imgName, layerName) {
	
	if (activeSecondLayerImageID == imgName && activeThirdLayerID == layerName)
	{
		thirdLayerTimerID = setTimeout("doHideSecondLayer('"+imgName+"', '"+layerName+"')", 500);
	}
	else
	{
		doHideSecondLayer(imgName, layerName);
	}
}

// -------------------------------------------------------------   End of Common Function for Second Level Layers -----------------------------------------


//print this page
function printPage(){
	if(location.href.toString().search('search.info.gov.hk')!=-1){
		window.open(document.URL+'?p=1','PrintPage','top=10,left=10,height=500,width=650,scrollbars=1');
	}else{
		window.open(document.location.pathname+'?p=1','PrintPage','top=10,left=10,height=500,width=650,scrollbars=1');
	}
}

function getTitle() {
	var scriptBuffer='';
	var scriptBuffer2='';
	
	
	for (var i in mainsection)
	{
		iconNo = parseInt(mainsection[i][0]);
		(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
		if(selectedID==mainsection[i][0]){
			scriptBuffer2+=sitetitle+' - '+mainsection[i][mainsectionCaption];
			//alert(sitetitle+' - '+mainsection[i][1]);
		}
	}
	/*
	if(selectedSection!=0&&selectedSection!='') {
		scriptBuffer2+= ' - ' + subTitle[selectedID][selectedSection]
		if(selectedSubSection>0&&selectedSubSection!='') {
			scriptBuffer2+= ' - ' + subSubTitle[selectedID][selectedSection][selectedSubSection]
		}
	}
	*/
//	scriptBuffer+='<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n';	
	scriptBuffer+='<meta name="Keywords" content="'+scriptBuffer2+'">\n';
	scriptBuffer+='<title>'+scriptBuffer2+'</title>\n';

	//alert(scriptBuffer);
	return scriptBuffer;	
}


//change to text only version
function textSwitch() {
	document.location = domain_url+ "/index.htm";
	if(location.href.toString().search('search.info.gov.hk') != -1){
		if (location.href.toString().search('mode=0') != -1) { //change to English version
			goPath=location.href.replace("mode=0", "mode=1");
		}
		if (location.href.toString().search('mode=0') != -1) { //change to traditional chinese version
			goPath=location.href.replace("mode=0", "mode=1");
		}
		document.location=goPath;
	}else{
	var arrayEle = new Array()
	arrayEle = document.location.pathname.split('/')
	document.location = 't_'+arrayEle[arrayEle.length-1]
	}
}

//switch language version
var chi_str = document.URL.toString(); 

if(chi_str.search('/gb/') != -1){ 
	chi_str = chi_str.substring( chi_str.indexOf('/gb/')+4, chi_str.length ); 
} 
else {
	chi_str = chi_str.substring( 7, chi_str.length ); 
}

function langSwitch(lang) {
var currentPath=location.href.toString();
var switchTc='/tc/';
var switchEn='/en/';
var switchSc='/sc/';

	if(lang=="graphic"){
		currentPath=currentPath.replace('/text', "");
	}else if(lang=="textonly"){
		currentPath=currentPath.replace(switchEn, '/text'+switchEn);
		currentPath=currentPath.replace(switchTc, '/text'+switchTc);
		currentPath=currentPath.replace(switchSc, '/text'+switchSc);
	}else if(lang=="tc"){
		currentPath=currentPath.replace(switchEn, switchTc);
		currentPath=currentPath.replace(switchSc, switchTc);
		currentPath=currentPath.replace("hkdc_en.xsl", "hkdc_tc.xsl");
		currentPath=currentPath.replace("hkdc_sc.xsl", "hkdc_tc.xsl");
		currentPath=currentPath.replace("col=1", "col=2");
		currentPath=currentPath.replace("col=3", "col=2");
	}else if(lang=="sc"){
		currentPath=currentPath.replace(switchTc, switchSc);
		currentPath=currentPath.replace(switchEn, switchSc);
		currentPath=currentPath.replace("hkdc_en.xsl", "hkdc_sc.xsl");
		currentPath=currentPath.replace("hkdc_tc.xsl", "hkdc_sc.xsl");
		currentPath=currentPath.replace("col=1", "col=3");
		currentPath=currentPath.replace("col=2", "col=3");
	}else if(lang=="en"){
		currentPath=currentPath.replace(switchTc, switchEn);
		currentPath=currentPath.replace(switchSc, switchEn);
		currentPath=currentPath.replace("hkdc_tc.xsl", "hkdc_en.xsl");
		currentPath=currentPath.replace("hkdc_sc.xsl", "hkdc_en.xsl");
		currentPath=currentPath.replace("col=2", "col=1");
		currentPath=currentPath.replace("col=3", "col=1");
	}
	location.href=currentPath;
}

function getheaderHTML()
{
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){

		document.writeln('<table width="100%" border="0" height="100%" cellpadding="0" cellspacing="0">');
		document.writeln('  <tr>');
		document.writeln('    <td height="123" bgcolor="#ffffff">');


		document.writeln('<div id="flashTop" style="z-index:1">Top menu flash</div>');
		//var so = new SWFObject(domain_url+langFolder+"swf/hkdc_top.swf?path="+domain_url+"/&lang="+swflang+"&curSection="+selectedID, "topFlash", "100%", "100%", "8","#FFFFFF");
		var so = new SWFObject(domain_url+"/swf/hkdc_top.swf?path="+domain_url+"/&lang="+swflang+"&curSection="+selectedID, "topFlash", "100%", "100%", "8","#FFFFFF");
		so.addParam("allowScriptAccess", "always");
		so.addParam("allowFullScreen", "true");
		so.addParam("menu", "false");
		so.addParam("wmode", "transparent");
		so.write("flashTop");
		
		if (whichBrs()!='Safari'){
			setFlashHeight('flashTop', 140);
			//alert('change'+whichBrs());
		}
		
		document.writeln('    </td>');
		document.writeln('  </tr>');
		/*flash header start
		document.writeln('  <tr>');
		document.writeln('    <td height="140" bgcolor="#FFFFFF"><table width="100%" height="140" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('      <tr>');
		document.writeln('        <td width="200"><a href="'+langFolder+'"><img src="'+domain_url+'/images/common/logo_hkdc.gif" width="200" border="0" height="140" title="'+sitetitle+'" alt="'+sitetitle+'"></a></td>');
		document.writeln('        <td>');
		getHeader();
		document.writeln('        </td>');
		document.writeln('        <td width="19">&nbsp;</td>');
		document.writeln('      </tr>');
		document.writeln('    </table></td>');
		document.writeln('  </tr>');
		flash header end*/
		
		/*netvigation path start*/
		document.writeln('  <tr>');
		if (selectedID==0){
			document.writeln('    <td valign="top" background="'+domain_url+'/images/common/index_bg.gif" bgcolor="#FFFFFF">');
		}else{
			document.writeln('    <td height="21" background="'+domain_url+'/images/common/bg_path.gif" style="background-position:top">');
			//document.writeln('	<div id="location"  style="z-index:0; position:relative;">');
			document.writeln('        <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">');
			document.writeln('          <tr>');
			document.writeln('            <td width="25"><img src="'+domain_url+'/images/common/spacer.gif" alt="" width="25" height="21"></td>');
			document.writeln('            <td class="path">'+getLocation()+'</td>');
			document.writeln('          </tr>');
			document.writeln('        </table>');
			//document.writeln('	</div>');
			document.writeln('    </td>');
			document.writeln('  </tr>');
		/*netvigation path end*/
		
			document.writeln('<tr>');
			document.writeln('  <td height="29">');
			document.writeln('  	<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">');
			document.writeln('  	<tr>');
			document.writeln('  		<td width="207">'+getSectionImg()+'</td>');
			document.writeln('  	    <td bgcolor="#f5f5f5">&nbsp;</td>');
			document.writeln('  	</tr>');
			document.writeln('  	</table>');
			document.writeln('  </td>');
			document.writeln('</tr>');

			document.writeln('<tr>');
			document.writeln('	<td height="100%">');
			document.writeln('		<table width="1000" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">');
			document.writeln('		<tr height="1">');
			document.writeln('			<td><img src="'+domain_url+'/images/common/spacer.gif" alt="" width="207" height="1"></td>');
			document.writeln('			<td><img src="'+domain_url+'/images/common/spacer.gif" alt="" width="550" height="1"></td>');
			document.writeln('			<td><img src="'+domain_url+'/images/common/spacer.gif" alt="" width="243" height="1"></td>');
			document.writeln('		</tr>');
			if(selectedID>7)
			{
				document.writeln('		<tr height="210" class="sectionColor8">');
			}
			else
			{
				document.writeln('		<tr height="210" class="sectionColor'+selectedID+'">');
			}
			document.writeln('			<td valign="top">');
			document.writeln(''+getLeftMenu());
			document.writeln('			</td>');
			document.writeln('			<td valign="top" class="leftBorder">'+getHeadImg()+'</td>');
			document.writeln('			<td valign="top" class="leftBorder">');
			document.writeln('				<table border="0" cellspacing="0" cellpadding="0" class="rpTable">');
			document.writeln('				<tr>');
			document.writeln('					<td>');
//			getRightBox();
			//document.writeln('            <td width="550" valign="top">');
		}
		/*
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('  <tr>');
		document.writeln('    <td align="center"><table width="978" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('      <tr>');
		document.writeln('        <td height="117" valign="top"><table width="978" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('          <tr>');
		document.writeln('            <td colspan="2"><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /></td>');
		document.writeln('          </tr>');
		document.writeln('          <tr>');
		document.writeln('            <td width="587" height="97"><img src="'+domain_url+'/images/Logo01.jpg" border="0" title="'+sitetitle+'" alt="'+sitetitle+'"/><a href="'+linkpolyu+'" target="_blank"><img src="'+domain_url+'/images/Logo02.jpg" border="0" title="'+altpolyu+'" alt="'+altpolyu+'"/></a><a href="http://www.polyu.edu.hk/sao/content" target="_blank"><img src="'+domain_url+'/images/Logo03.jpg" width="95" height="97" border="0"/></a><img src="'+domain_url+'/images/spacer.gif" width="13" height="97" /></td>');
		document.writeln('            <td width="391" valign="top">'+getHeader()+'</td>');
		document.writeln('          </tr>');
		document.writeln('        </table></td>');
		document.writeln('      </tr>');
		document.writeln('      <tr>');
		document.writeln('        <td><table width="978" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('          <tr>');
		document.writeln('            <td width="223" colspan="2"><img src="'+domain_url+'/images/Top1.jpg" width="222" height="44" /></td>');
		document.writeln('            <td colspan="3" align="left" background="'+domain_url+'/images/Top2.jpg"><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /><span class="content14_bold">PGDP </span><span class="navpath">');
		//<span class="content11">&gt; </span><span class="content11_line">Introduction of PGDP</span><span class="content11_path"> &gt; Introduction</span>
		if (selectedSection==0) {
			document.writeln('&gt; '+title[selectedID]);
		}else{
			document.writeln('&gt; <a href="'+MainLink[selectedID]+'" class="navpath">'+title[selectedID]+'</a>');
			if (selectedSubSection==0) {
				document.writeln('&gt; '+subTitle[selectedID][selectedSection]);
			}else{
				document.writeln('&gt; <a href="'+SubLink[selectedID][selectedSection]+'" class="navpath">'+subTitle[selectedID][selectedSection]+'</a>');
				document.writeln('&gt; '+subSubTitle[selectedID][selectedSection][selectedSubSection]);
			}
		}
		document.writeln('</span></td>');
		document.writeln('          </tr>');
		document.writeln('          <tr>');
		document.writeln('            <td valign="top" bgcolor="#770F0E"><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /></td>');
		document.writeln('            <td valign="top" bgcolor="#FFB93F">'+getLeftMenu()+'</td>');
		
		var headingNo = parseInt(selectedID-1);
		var visualNo=headingNo;
		(headingNo<10)?headingNo='0'+headingNo:headingNo=headingNo;

		if ((selectedID>1) && (selectedID<8) && (selectedID!=3)) {
			var commonTableWidth = 504;
			document.write('            <td width="230" rowspan="2" valign="top" background="'+domain_url+'/images/Visual_bg.jpg" bgcolor="fffce7" align="right">');
			document.write('<img src="'+imgPath+'Sec'+selectedID+'.jpg" alt="'+title[selectedID]+'" title="'+title[selectedID]+'"><br>');
			document.write('<img src="'+domain_url+'/images/Visual_'+visualNo+'.jpg" height="393" width="231">');		//Left Visual Image
			document.write('</td>');
			document.writeln('            <td width="'+commonTableWidth+'" rowspan="2" valign="top" bgcolor="fffce7"><table width="'+commonTableWidth+'" border="0" cellspacing="0" cellpadding="0">');
			document.writeln('                <tr>');
			document.writeln('                  <td background="'+domain_url+'/images/H_dot2.jpg"><img src="'+domain_url+'/images/H_dot.jpg" width="8" height="35" /><img src="'+domain_url+'/images/H_dot2.jpg" width="10" height="35" /><img src="'+domain_url+'/images/H_slogan.jpg" width="486" height="35" /></td>');
			document.writeln('                </tr>');
			document.writeln('              </table>              ');
		}else{
			var commonTableWidth = 714;
			document.write('            <td width="20" rowspan="2" valign="top" background="'+domain_url+'/images/Visual_bg.jpg" bgcolor="fffce7" align="right"><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /></td>');
			document.writeln('            <td width="'+commonTableWidth+'" rowspan="2" valign="top" bgcolor="fffce7"><table width="'+commonTableWidth+'" border="0" cellspacing="0" cellpadding="0">');
			document.writeln('                <tr>');
			document.writeln('                  <td background="'+domain_url+'/images/H_dot2.jpg"><img src="'+imgPath+'Sec'+selectedID+'.jpg" alt="'+title[selectedID]+'" title="'+title[selectedID]+'"><img src="'+domain_url+'/images/H_dot.jpg" width="8" height="35" /><img src="'+domain_url+'/images/H_dot2.jpg" width="10" height="35" /><img src="'+domain_url+'/images/H_slogan.jpg" width="486" height="35" /></td>');
			document.writeln('                </tr>');
			document.writeln('              </table>              ');
		}
		

		if (selectedSection!=0){//Sub heading Image
			document.writeln('              <table width="'+commonTableWidth+'" border="0" cellspacing="0" cellpadding="0">');
			document.writeln('                <tr>');
			document.writeln('                  <td><img src="'+imgPath+'H'+headingNo+'_'+selectedSection+'.jpg" border="0" title="'+subTitle[selectedID][selectedSection]+'" alt="'+subTitle[selectedID][selectedSection]+'"></td>');
			document.writeln('                </tr>');
			document.writeln('              </table>              ');
		}
		
		document.writeln('              <table width="'+commonTableWidth+'" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('                <tr valign="top">');
		document.writeln('                  <td width="20"><img src="'+domain_url+'/images/spacer.gif" width="20" height="450" /></td>');
		document.writeln('                  <td width="'+parseInt(commonTableWidth-20)+'" align="left"><p>&nbsp;</p>');
		if (selectedSubSection!=0){
			SubpageMenu();
			if ((!(selectedID==6 && selectedSection==3 && selectedSubSection==2))){
				document.writeln('                  <span class="heading1">'+subSubTitle[selectedID][selectedSection][selectedSubSection]+':</span>');
				if (typeof(selectedThirdLevelSection)!='undefined'){
					if (selectedThirdLevelSection!=0){
						document.writeln('<p><span class="heading2">'+subSubTitle2[selectedID][selectedSection][selectedSubSection][selectedThirdLevelSection]+'</span></p>');
					}
				}
			}
		}
		*/
	}else{//istextonly version
		document.writeln('<table width="100%" border="0" cellspacing="2" cellpadding="2">');
		document.writeln('<tr><td>');
		//document.writeln('<p><a href="'+linkpolyu+'" target="_blank">'+altpolyu+'</a></p>');
		document.writeln(getHeader());
		document.writeln('<hr>');
		document.writeln(getLeftMenu());
		document.writeln('<hr>');
		getTopic();
	}//check not textonly version
	//SiteMap();
}

function getheaderHTML2()
{
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		document.writeln('					</td>');
		document.writeln('				</tr>');
		document.writeln('				<tr>');
		document.writeln('					<td></td>');
		document.writeln('				</tr>');
		document.writeln('				</table>');
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('		<tr height="100%">');
		document.writeln('			<td valign="top" bgcolor="#f2f2f2">');
		document.writeln('				<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('				<tr>');
		document.writeln('					<td height="17" align="right"><a href="javascript:history.go(-1);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'back\',\'\',\''+imgPath+'btn_back_over.gif\',1)"><br><img src="'+imgPath+'btn_back.gif" name="back" title="'+altBack+'" alt="'+altBack+'" border="0"></a></td>');
		document.writeln('				</tr>');
		document.writeln('				<tr>');
		document.writeln('					<td height="100%">&nbsp;</td>');
		document.writeln('				</tr>');
		document.writeln('				<tr>');
		document.writeln('					<td height="17" align="right"><a href="#top" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'top\',\'\',\''+imgPath+'btn_top_over.gif\',1)" onClick="jumpToPageTop();return false;" onKeyPress="jumpToPageTop();return false;"><img src="'+imgPath+'btn_top.gif" name="top" title="'+altTop+'" alt="'+altTop+'" border="0"></a></td>');
		document.writeln('				</tr>');
		document.writeln('				</table>');
		document.writeln('			</td>');
		document.writeln('			<td valign="top">');
		document.writeln('				<table width="100%" border="0" cellspacing="0" cellpadding="30" class="contentArea">');
		document.writeln('				<tr>');
		document.writeln('					<td>');
	}
}

//generate Section heading Image
function getSectionImg(){
	var scriptBuffer='';
	
	iconNo = parseInt(selectedID);
	//(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
	(iconNo<10)?iconNo=iconNo:iconNo=iconNo;
	subiconNo = parseInt(selectedSection);
	//(subiconNo<10)?subiconNo='0'+subiconNo:subiconNo=subiconNo;
	(subiconNo<10)?subiconNo=subiconNo:subiconNo=subiconNo;
	sub2iconNo = parseInt(selectedSubSection);
	//(sub2iconNo<10)?sub2iconNo='0'+sub2iconNo:sub2iconNo=sub2iconNo;
	(sub2iconNo<10)?sub2iconNo=sub2iconNo:sub2iconNo=sub2iconNo;
	/*if (selectedSubSection!=0){
	alert("1")
		for (var i in subsubsection)
		{
			(
			selectedID==subsubsection[i][0]&&
			selectedSection==subsubsection[i][1]&&
			selectedSubSection==subsubsection[i][2])?scriptBuffer+='<img src="'+imgPath+'heading_'+iconNo+'_'+subiconNo+'_'+sub2iconNo+'.gif" title="'+subsubsection[i][3]+'" alt="'+subsubsection[i][3]+'">':isOver='';
		}
	}else if (selectedSection==0){
	alert("2")
		for (var i in mainsection)
		{
			(selectedID==mainsection[i][0])?scriptBuffer+='<img src="'+imgPath+'heading_'+iconNo+'_'+subiconNo+'.gif" title="'+mainsection[i][1]+'" alt="'+mainsection[i][1]+'">':isOver='';
		}
	}else{
	alert("3")
		for (var i in subsection)
		{
			(selectedID==subsection[i][0]&&selectedSection==subsection[i][1])?scriptBuffer+='<img src="'+imgPath+'heading_'+iconNo+'_'+subiconNo+'.gif" title="'+subsection[i][2]+'" alt="'+subsection[i][2]+'">':isOver='';
		}
	}*/
		for (var i in mainsection)
		{
			(selectedID==mainsection[i][0])?scriptBuffer+='<a href="'+langPath+mainsection[i][4]+'"><img src="'+imgPath+'heading_'+iconNo+'.gif" border="0" title="'+mainsection[i][mainsectionCaption]+'" alt="'+mainsection[i][mainsectionCaption]+'"></a>':isOver='';
		}
	return scriptBuffer;
}
//generate Section heading Image
function getHeadImg(){
	var scriptBuffer='';
	iconNo = parseInt(selectedID);
	//(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
	(iconNo<10)?iconNo=iconNo:iconNo=iconNo;
	subiconNo = parseInt(selectedSection);
	//(subiconNo<10)?subiconNo='0'+subiconNo:subiconNo=subiconNo;
	(subiconNo<10)?subiconNo=subiconNo:subiconNo=subiconNo;
	sub2iconNo = parseInt(selectedSubSection);
	//(sub2iconNo<10)?sub2iconNo='0'+sub2iconNo:sub2iconNo=sub2iconNo;
	(sub2iconNo<10)?sub2iconNo=sub2iconNo:sub2iconNo=sub2iconNo;
	if (selectedSubSection!=0){
		for (var i in subsubsection)
		{
			(
			selectedID==subsubsection[i][0]&&
			selectedSection==subsubsection[i][1]&&
			selectedSubSection==subsubsection[i][2])?scriptBuffer+='<img src="'+imgPath+'visual_'+iconNo+'_'+subiconNo+'_'+sub2iconNo+'.jpg" title="'+subsubsection[i][subsubsectionCaption]+'" alt="'+subsubsection[i][subsubsectionCaption]+'" border="0">':isOver='';
		}
	}else if (selectedSection==0){
		for (var i in mainsection)
		{
			(selectedID==mainsection[i][0])?scriptBuffer+='<img src="'+imgPath+'visual_'+iconNo+'_'+subiconNo+'.jpg" title="'+mainsection[i][mainsectionCaption]+'" alt="'+mainsection[i][mainsectionCaption]+'" border="0">':isOver='';
		}
	}else{
		for (var i in subsection)
		{
			(selectedID==subsection[i][0]&&selectedSection==subsection[i][1])?scriptBuffer+='<img src="'+imgPath+'visual_'+iconNo+'_'+subiconNo+'.jpg" title="'+subsection[i][subsectionCaption]+'" alt="'+subsection[i][subsectionCaption]+'" border="0" width="550" height="210">':isOver='';
		}
	}
	return scriptBuffer;
}

function getheaderTable(){
		document.writeln('              <table width="550" border="0" cellspacing="0" cellpadding="0" style="padding-top:25px; padding-bottom:35px;">');
		document.writeln('              <tr>');
		document.writeln('                <td width="33">&nbsp;</td>');
		document.writeln('                <td width="484">');
}

//generate common look & feel header
function getHeader(){
	//define the common background image path
	var bkImgPath=domain_url+'/images/bkgdtexture.gif';
	//define the language icon image path
	var textPath=domain_url+'/images/textonly.gif';
	var textOverPath=domain_url+'/images/textonly_over.gif';
	var lang1Path=domain_url+'/images/en.gif';
	var lang1OverPath=domain_url+'/images/en_over.gif';
	var lang2Path=domain_url+'/images/tc.gif';
	var lang2OverPath=domain_url+'/images/tc_over.gif';
	var lang3Path=domain_url+'/images/sc.gif';
	var lang3OverPath=domain_url+'/images/sc_over.gif';
	//set hyperlink for items
	var brandingLink=domain_url+'/index.html';
	var brandhkLink='javascript:externalLink(\'http://www.brandhk.gov.hk/brandhk/eindex.htm\')';
	var gicLink='javascript:externalLink(\'http://www.gov.hk/\')';
	var textLink='javascript:langSwitch(\'textonly\')';//domain_url+"/index.htm"; //Change to text only version //	var textLink='javascript:textSwitch()'; //Change to text only version
	var graphicLink='javascript:langSwitch(\'graphic\')'; //Graphic
	
	var lang1Link='javascript:langSwitch(\'en\')'; //English
	var lang2Link='javascript:langSwitch(\'tc\')'; //Traditional Chinese
	var lang3Link='javascript:langSwitch(\'sc\')'; //Simplified Chinese
	//set alternate text for the items
	//var brandingAlt='Economic Analysis and Business Facilitation Unit';
	var brandhkAlt='Brand Hong Kong';
	var gicAlt='GovHK 香港政府一站通';
	var textAlt='Text Mode';
	var lang1Alt='English';
	var lang2Alt='繁體版';
	var lang3Alt='簡體版';
	var searchAlt='Search';
	if(langID==1)
	{
		var sitemapAlt='Site Map';
		var contactusAlt='Contact Us';
		var graphicAlt='Graphic Version';
		var quicklinkAlt='Quick Link';
	}
	if(langID==2)
	{
		var sitemapAlt='網頁指南';
		var contactusAlt='聯絡我們';
		var graphicAlt='繁體圖像版';
		var quicklinkAlt='Quick Link';
	}
	if(langID==3)
	{
		var sitemapAlt='网页指南';
		var contactusAlt='联络我们';
		var graphicAlt='简体图像版';
		var quicklinkAlt='Quick Link';
	}

	/*
	if(document.URL.toString().search('/sc/')!=-1){
		var lang1Link='javascript:langSwitch(\'tc\')'; //Traditional Chinese
		var lang2Link='javascript:langSwitch(\'en\')'; //English
		//set alternate text for the items
		//var brandingAlt='冪撳煦昴摯源晞茠妀揭';
		var brandhkAlt='Brand Hong Kong';
		var gicAlt='GovHK 眅誠淉葬珨桴籵';
		var textAlt='曾恅趼';
		var lang1Alt='楛极唳';
		var lang2Alt='English';
		var searchAlt='刲扆';
		var sitemapAlt='厙珜硌鰍';	
		var contactusAlt='薊釐扂蠅';
		var graphicAlt='芞砉唳';
	}else if(document.URL.toString().search('/tc/')!=-1 || document.URL.toString().search('mode=0')!=-1){
		var lang1Link='javascript:langSwitch(\'sc\')'; //Simplified Chinese
		var lang2Link='javascript:langSwitch(\'en\')'; //English
		//set alternate text for the items
		//var brandingAlt='經濟分析及方便營商處';
		var brandhkAlt='Brand Hong Kong';
		var gicAlt='GovHK 香港政府一站通';
		var textAlt='純文字';
		var lang1Alt='簡體版';
		var lang2Alt='English';
		var searchAlt='搜尋';
		var sitemapAlt='網頁指南';	
		var contactusAlt='聯絡我們';
		var graphicAlt='圖像版';
	}else{
		var lang1Link='javascript:langSwitch(\'tc\')'; //Traditional Chinese
		var lang2Link='javascript:langSwitch(\'en\')'; //English
		//set alternate text for the items
		//var brandingAlt='Economic Analysis and Business Facilitation Unit';
		var brandhkAlt='Brand Hong Kong';
		var gicAlt='GovHK 香港政府一站通';
		var textAlt='Text Mode';
		var lang1Alt='Traditional Chinese';
		var lang2Alt='English';
		var searchAlt='Search';
		var sitemapAlt='Site Map';	
		var contactusAlt='Contact Us';
		var graphicAlt='Graphic Version';
		var quicklinkAlt='Quick Link';
	}	
	*/
	//var brandingAlt=sitetitle
	//var searchLink='javascript:document.forms.search.submit()';
	var sitemapLink=langPath+'sitemap/index.htm';	
	var contactusLink=langPath+'contact/index.htm';
	//generate the menu to the buffer variable
	var scriptBuffer='';
	var scriptQlinkBuffer='';
	
	//section option
	/*
	scriptQlinkBuffer+='                <select class="quicklink" name="qlinks" onchange="externalLink(this.value)">';
	scriptQlinkBuffer+='                    <option value="" selected>Please Select</option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk">PolyU </option>';
	//scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/pgdp">\'Preferred Graduate\' Development Programme </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/sao">Student Affairs Office </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/recruit">Graduate Recruitment </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/fast/ ">Faculty of Applied Science & Textiles  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/fb/wie ">Faculty of Business  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/~fcom/">Faculty of Communication  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/~fclu/ ">Faculty of Construction & Land Use   </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/feng/ ">Faculty of Engineering  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/fhss/ ">Faculty of Health & Social Sciences  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.polyu.edu.hk/~htm/ ">School of Hotel & Tourism Management  </option>';
	scriptQlinkBuffer+='                    <option value="http://www.sd.polyu.edu.hk/welcome/index.html ">School of Design  </option>';
	scriptQlinkBuffer+='                </select>';
	*/
	//section option

	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		document.writeln('        <table width="781" height="140" border="0" cellpadding="0" cellspacing="0">');
		document.writeln('          <tr>');
		document.writeln('            <td width="781" height="90" align="right"><a href="'+lang2Link+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image2\',\'\',\''+domain_url+'/images/common/btn_eng_over.gif\',1)"><img src="'+domain_url+'/images/common/btn_eng_over.gif" name="Image2" width="51" height="20" border="0" title="'+lang2Alt+'" alt="'+lang2Alt+'"></a><a href="'+lang1Link+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image3\',\'\',\''+domain_url+'/images/common/btn_tc_over.gif\',1)"><img src="'+domain_url+'/images/common/btn_tc.gif" name="Image3" width="40" height="20" border="0" title="'+lang1Alt+'" alt="'+lang1Alt+'"></a><a href="'+lang3Link+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image4\',\'\',\''+domain_url+'/images/common/btn_sc_over.gif\',1)"><img src="'+domain_url+'/images/common/btn_sc.gif" name="Image4" width="38" height="20" border="0"  title="'+lang3Alt+'" alt="'+lang3Alt+'"></a><a href="'+textLink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image5\',\'\',\'../../images/en/btn_textonly_over.gif\',1)"><img src="../../images/en/btn_textonly.gif" name="Image5" width="66" height="20" border="0"  title="'+textAlt+'" alt="'+textAlt+'"></a></td>');
		document.writeln('          </tr>');
		document.writeln('          <tr>');
		document.writeln('            <td height="28">'+getTopMenu()+'</td>');
		document.writeln('          </tr>');
		document.writeln('          <tr>');
		document.writeln('            <td height="22">&nbsp;</td>');
		document.writeln('          </tr>');
		document.writeln('        </table>');
		/*scriptBuffer+='<table width="385" border="0" cellspacing="0" cellpadding="0">';
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /></td>';
		scriptBuffer+='              </tr>';
		
		//pls delete if show lang bar
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td><img src="'+domain_url+'/images/spacer.gif" width="20" height="20" /></td>';
		scriptBuffer+='              </tr>';
		//pls delete if show lang bar
		*/
		/*lang bar
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td align="left"><a href="'+textLink+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image49\',\'\',\''+domain_url+'/images/TBtn_TM_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_TM.jpg" name="Image49" width="69" height="26" border="0" id="Image49" title="'+textAlt+'" alt="'+textAlt+'"/></a><img src="'+domain_url+'/images/TBtn_dot.jpg" width="15" height="26" /><a href="'+lang2Link+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image50\',\'\',\''+domain_url+'/images/TBtn_EN_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_EN.jpg" name="Image50" width="52" height="26" border="0" id="Image50" title="'+lang2Alt+'" alt="'+lang2Alt+'"/></a><img src="'+domain_url+'/images/TBtn_dot.jpg" width="15" height="26" /><a href="'+lang1Link+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image11\',\'\',\''+domain_url+'/images/TBtn_CH_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_CH.jpg" name="Image11" width="29" height="26" border="0" id="Image11" title="'+lang1Alt+'" alt="'+lang1Alt+'"/></a></td>';
		scriptBuffer+='              </tr>';
		lang bar*/
		
		/*
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td align="left"><a href="'+contactusLink+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'TBtn_Con\',\'\',\''+domain_url+'/images/TBtn_Con_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_Con.jpg" border="0" id="TBtn_Con" title="'+title[10]+'" alt="'+title[10]+'"/></a><img src="'+domain_url+'/images/TBtn_dot.jpg" width="15" height="26" /><a href="'+sitemapLink+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'TBtn_SM\',\'\',\''+domain_url+'/images/TBtn_SM_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_SM.jpg" border="0" id="TBtn_SM" title="'+title[0]+'" alt="'+title[0]+'"/></a><img src="'+domain_url+'/images/TBtn_dot.jpg" width="15" height="26" /><a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'TBtn_QL\',\'\',\''+domain_url+'/images/TBtn_QL_over.jpg\',1)"><img src="'+domain_url+'/images/TBtn_QL.jpg" border="0" id="TBtn_QL" title="'+quicklinkAlt+'" alt="'+quicklinkAlt+'"/></a>'+scriptQlinkBuffer+'<!-- <img src="'+domain_url+'/images/List.jpg" width="153" height="24" /> --></td>';
		scriptBuffer+='              </tr>';
		scriptBuffer+='            </table>';
		*/

	}else{//textonly version
		//scriptBuffer+='<p><b><a href="'+domain_url+'">'+brandingAlt+'</a></b></p>';
		scriptBuffer+='<table width="100%" border="0" cellpadding="0" cellspacing="0">';
		//scriptBuffer+=scriptFormBuffer;
		scriptBuffer+='<tr><td>';
		//scriptBuffer+='[<a href="'+gicLink+'">'+gicAlt+'</a>] ';
		scriptBuffer+='[<a href="'+graphicLink+'">'+graphicAlt+'</a>] ';
		if(langID==1)
		{
			scriptBuffer+='[<a href="'+lang2Link+'">'+lang2Alt+'</a>] ';
			scriptBuffer+='[<a href="'+lang3Link+'">'+lang3Alt+'</a>] ';
		}
		if(langID==2)
		{
			scriptBuffer+='[<a href="'+lang1Link+'">'+lang1Alt+'</a>] ';
			scriptBuffer+='[<a href="'+lang3Link+'">'+lang3Alt+'</a>] ';

		}
		if(langID==3)
		{
			scriptBuffer+='[<a href="'+lang1Link+'">'+lang1Alt+'</a>] ';
			scriptBuffer+='[<a href="'+lang2Link+'">'+lang2Alt+'</a>] ';

		}
		//scriptBuffer+='[<a href="'+searchLink+'">'+searchAlt+'</a>] <input name="qu" type="text" id="qu" size="12" class="search"> ';
		//scriptBuffer+='[<a href="'+sitemapLink+'">'+sitemapAlt+'</a>] ';
		//scriptBuffer+='[<a href="'+contactusLink+'">'+contactusAlt+'</a>] ';
		//scriptBuffer+=quicklinkAlt+scriptQlinkBuffer;
		scriptBuffer+='</td></tr>';
		//scriptBuffer+='</form>';
		scriptBuffer+='</table>';
	
	}//check not textonly version
	
	return scriptBuffer;
}

function indexpage(){//print a bulletin sub section link

	if (selectedSection==0){
		document.writeln('<p><table width="100%" border="0" cellspacing="0" cellpadding="5">\n');
		for (var i in SubLink[selectedID])		
			document.writeln('<tr><td width="26" valign="top"><img src="../../images/Bullet.jpg" alt="*" title="*" /></td><td width="100%" valign="top"><a href="'+SubLink[selectedID][i]+'">'+subTitle[parseInt(selectedID)][i]+'</a></td></tr>\n');
		document.writeln('</table></p>\n');
		
	}
}

function indexSubpage(){//print a bulletin sub section link

	if (selectedSubSection==0){
		document.writeln('<p><table width="100%" border="0" cellspacing="0" cellpadding="5">\n');
		for (var i in SubLink2[selectedID][selectedSection])		
			document.writeln('<tr><td width="26" valign="top"><img src="../../images/Bullet.jpg" alt="*" title="*" /></td><td width="100%" valign="top"><a href="'+SubLink2[selectedID][selectedSection][i]+'">'+subSubTitle[parseInt(selectedID)][selectedSection][i]+'</a></td></tr>\n');
		document.writeln('</table></p>\n');
		
	}
}

function SubpageMenu(){//print a sub section menu

	if (selectedSubSection!=0){
		//alert(SubLink2[selectedID][selectedSection].length);
		if ((SubLink2[selectedID][selectedSection].length-1)>1){
			document.writeln('<p><table width="100%" border="0" cellspacing="0" cellpadding="5">\n');
			document.writeln('<tr><td width="100%" valign="top">');
			for (var i in SubLink2[selectedID][selectedSection]){
				if (selectedSubSection!=i){
					document.writeln('<a href="'+SubLink2[selectedID][selectedSection][i]+'">'+subSubTitle[parseInt(selectedID)][selectedSection][i]+'</a> | ');
				}else{
					document.writeln('<a href="'+SubLink2[selectedID][selectedSection][i]+'"><span style="font-weight: bold; color: #4A2D03">'+subSubTitle[parseInt(selectedID)][selectedSection][i]+'</span></a> | ');
				}
			}
			document.writeln('</td></tr>\n');
			document.writeln('</table></p>\n');
		}
	}
}
function indexSubsubpage(){//print a bulletin sub section link
	if (typeof(selectedThirdLevelSection)!='undefined'){
		if (selectedThirdLevelSection==0){
			document.writeln('<p><table width="100%" border="0" cellspacing="0" cellpadding="5">\n');
			for (var i in SubLink3[selectedID][selectedSection][selectedSubSection])		
				document.writeln('<tr><td width="26" valign="top"><img src="../../images/Bullet.jpg" alt="*" title="*" /></td><td width="100%" valign="top"><a href="'+SubLink3[selectedID][selectedSection][selectedSubSection][i]+'">'+subSubTitle2[parseInt(selectedID)][selectedSection][selectedSubSection][i]+'</a></td></tr>\n');
			document.writeln('</table></p>\n');
			
		}
	}
}
function ThirdLevelMenu(){//print a 3rd level section menu
	//alert (typeof(selectedThirdLevelSection));
	if (typeof(selectedThirdLevelSection)!='undefined'){
		if (selectedSubSection!=0){
			document.writeln('<p><table width="100%" border="0" cellspacing="0" cellpadding="5">\n');
			document.writeln('<tr><td width="100%" valign="top">');
			for (var i in SubLink3[selectedID][selectedSection][selectedSubSection])		
				if (selectedThirdLevelSection!=i){
					document.writeln('<a href="'+SubLink3[selectedID][selectedSection][selectedSubSection][i]+'">'+subSubTitle2[parseInt(selectedID)][selectedSection][selectedSubSection][i]+'</a> | ');
				}else{
					document.writeln('<a href="'+SubLink3[selectedID][selectedSection][selectedSubSection][i]+'"><span style="font-weight: bold; color: #4A2D03">'+subSubTitle2[parseInt(selectedID)][selectedSection][selectedSubSection][i]+'</span></a> | ');
				}
			document.writeln('</td></tr>\n');
			document.writeln('</table></p>\n');
		}
	}
}


function SiteMap(){
	//if(document.URL.toString().search('/sitemap/')!=-1){
		var bulletPath1;
		var bulletPath2;
		var bulletPath3;

		if(document.URL.toString().search('/text/')==-1){
			bulletPath1='<img src="'+domain_url+'/images/common/arrow_dark.gif" border=0 alt="*">';
			bulletPath2='<img src="'+domain_url+'/images/common/arrow_dark.gif" border=0 alt="*">';
			bulletPath3='<img src="'+domain_url+'/images/common/arrow_dark.gif" border=0 alt="*">';
		}else{
			bulletPath1='*';
			bulletPath2='*';
			bulletPath3='*';
		}
	
		document.writeln('<table border=0 cellpadding=2 cellspacing=0>');
		for (var i in mainsection)
		{
			if (mainsection[i][6]=="Y"){
				if(mainsection[i][4].search('http://')!=-1){
					var linkurl_main = mainsection[i][4];
					var linkpopup_main = ' target="_blank"'
				}else{
					var linkurl_main = langPath+mainsection[i][4];
					var linkpopup_main = ''
				}
				document.writeln('<tr valign=top><td nowrap>'+bulletPath1+'&nbsp;</td><td width=100%><a href="'+linkurl_main+'"'+linkpopup_main+'>'+mainsection[i][mainsectionCaption]+'</a></td></tr>');
				if (mainsection[i][5]=="Y"){
					document.writeln('<tr valign=top><td nowrap>&nbsp;</td><td width=100%><table border=0 cellspacing=0 cellpaddding=2 width=100%>');
					for (var j in subsection){
						if (subsection[j][0]==mainsection[i][0] && subsection[j][7]=="Y"){
							if(subsection[j][5].search('http://')!=-1){
								var linkurl_sub = subsection[j][5];
								var linkpopup_sub = ' target="_blank"'
							}else{
								var linkurl_sub = langPath+subsection[j][5];
								var linkpopup_sub = ''
							}
							document.writeln('<tr valign=top><td nowrap>'+bulletPath2+'&nbsp;</td><td width=100%><a href="'+linkurl_sub+'"'+linkpopup_sub+'>'+subsection[j][subsectionCaption]+'</a></td></tr>');
							if(subsection[j][6]=="Y"){
								document.writeln('<tr valign=top><td nowrap>&nbsp;</td><td width=100%><table border=0 cellspacing=0 cellpaddding=2 width=100%>');
								for (var k in subsubsection){
									if (subsubsection[k][0]==mainsection[i][0] && subsubsection[k][1]==subsection[j][1] && subsubsection[k][8]=="Y"){
										if(subsubsection[k][6].search('http://')!=-1){
											var linkurl_subsub = subsubsection[k][6];
											var linkpopup_subsub = ' target="_blank"'
										}else{
											var linkurl_subsub = langPath+subsubsection[k][6];
											var linkpopup_subsub = ''
										}
										document.writeln('<tr valign=top><td nowrap>'+bulletPath3+'&nbsp;</td><td width=100%><a href="'+linkurl_subsub+'"'+linkpopup_subsub+'>'+subsubsection[k][subsubsectionCaption]+'</a></td></tr>');
									}
								}
								document.writeln('</table></td></tr>');
							}
						}
					}
					document.writeln('</table></td></tr>');
				}
			}
		}
		/*
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="5">');
		for (var i in MainLink){
			document.writeln('<tr valign="top"><td><img src="../../images/Bullet.jpg" alt="*" title="*" /></td><td width="100%" class="content"><a href="'+MainLink[i]+'">'+title[i]+'</a>');
			document.writeln('</td></tr>');
		}
		document.writeln('</table>');
		*/
		document.writeln('</table>');
			
	//}
}

//generate the top side menu
function getTopMenu(){
	var scriptBuffer='';
	var isOver='';
	var iconNo = '';
	var title_image_alt = sitetitle;
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		//scriptBuffer+='<table width="202" border="0" cellspacing="0" cellpadding="0">\n';
		scriptBuffer+='            <table width="100%" border="0" cellspacing="0" cellpadding="0">';
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td>';
		for (var i in mainsection)
		{
			if (mainsection[i][7]=="Y"){
				iconNo = parseInt(mainsection[i][0]);
				//iconNo = parseInt(i) + 1;
				(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
				(selectedID==mainsection[i][0])?isOver='_over':isOver='';
				if (selectedID==i){mainTopic=i;}
				/*
				scriptBuffer+='<tr><td><a href="'+MainLink[i]+'" onmouseout="leftMenuMouseOut(\''+i+'\')" onmouseover="leftMenuMouseOver(\''+i+'\')">';
				scriptBuffer+='<img src="'+imgPath+'images/btn_'+iconNo+isOver+'.jpg" name="'+leftMenuName+i+'" border="0" alt="'+title[i]+'" title="'+title[i]+'"></a></td></tr>\n';
				*/
				//scriptBuffer+='            <tr><td><a href="'+MainLink[i]+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'nav'+i+'\',\'\',\''+imgPath+'menu'+i+'_o.gif\',0)"><img src="'+imgPath+'menu'+i+isOver+'.gif" alt="'+title[i]+'" title="'+title[i]+'" border="0" id="nav'+i+'" /></a></td></tr>\n';
				//scriptBuffer+='<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image7\',\'\',\'../../images/en/nav_01_over.gif\',1)"><img src="../../images/en/nav_01_over.gif" name="Image7" width="77" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image8\',\'\',\'../../images/en/nav_02_over.gif\',1)"><img src="../../images/en/nav_02.gif" name="Image8" width="63" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image9\',\'\',\'../../images/en/nav_03_over.gif\',1)"><img src="../../images/en/nav_03.gif" name="Image9" width="58" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image10\',\'\',\'../../images/en/nav_04_over.gif\',1)"><img src="../../images/en/nav_04.gif" name="Image10" width="114" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image11\',\'\',\'../../images/en/nav_05_over.gif\',1)"><img src="../../images/en/nav_05.gif" name="Image11" width="80" height="17" border="0"></a>';
				scriptBuffer+='<a href="'+langPath+mainsection[i][4]+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ImageNav'+i+'\',\'\',\''+imgPath+'nav_'+iconNo+'_over.gif\',1)"><img src="'+imgPath+'nav_'+iconNo+isOver+'.gif" name="ImageNav'+i+'" id="ImageNav'+i+'" title="'+mainsection[i][mainsectionCaption]+'" alt="'+mainsection[i][mainsectionCaption]+'" border="0"></a>';
				/*
				scriptBuffer+='              <tr><td><a href="'+MainLink[i]+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'nav'+i+'\',\'\',\''+imgPath+'Btn'+iconNo+'_over.jpg\',1)"><img src="'+imgPath+'Btn'+iconNo+isOver+'.jpg" border="0" id="nav'+i+'" alt="'+title[i]+'" title="'+title[i]+'"  /></a>';
				if (selectedID==i){
					for (var j in SubLink[i]){
					
						(selectedSection==j)?isOverS='ON':isOverS='OFF';
						(selectedSection==j)?isOverR='':isOverR='_red';
						scriptBuffer+='                  <table width="202" border="0" cellspacing="0" cellpadding="0">\n';
						scriptBuffer+='                    <tr bgcolor="ffd399" align="left" valign="top">\n';
						scriptBuffer+='                      <td><img src="'+domain_url+'/images/Btn2nd_'+isOverS+'_over.jpg" width="31" height="24" align="absmiddle" /></td><td width="178"><a href="'+SubLink[i][j]+'"><span class="submenu'+isOverR+'">'+subTitle[i][j]+'</span></a></td>\n';
						scriptBuffer+='                    </tr>\n';
						scriptBuffer+='                  </table>';
					}
				}
				scriptBuffer+='</td></tr>\n';
				*/
			}
		}
		scriptBuffer+='                </td>';
		if (selectedID==0){
			scriptBuffer+='                <td align="right" width="325"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Imagebtn_subscription\',\'\',\''+imgPath+'btn_subscription_over.gif\',1)"><img src="'+imgPath+'btn_subscription.gif" name="Imagebtn_subscription" border="0" height="28" width="319" title="Subscription" alt="Subscription"></a></td>';
		}
		scriptBuffer+='              </tr>';
		scriptBuffer+='            </table>';	
		//scriptBuffer+='            </table>\n';	
	}else{//istextonly version
	
		//mainmenu
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		for (var i in MainLink){
			iconNo = parseInt(i) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			(selectedSection==i)?isOver='_o':isOver='';
			if(i!=selectedID){
				scriptBuffer+='[<a href="'+MainLink[i]+'">'+title[i]+'</a>]\n';
			}else{
				scriptBuffer+='['+title[i]+']\n';
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		//mainmenu
	

		//submenu
		
		
		var TempSelectedID=selectedID+1;
		if (SubLink[selectedID]!=null){
			
			scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
			scriptBuffer+='<tr><td>';
		
		  	for (var k in SubLink[selectedID]){
		  		if(k!=selectedSection){
					scriptBuffer+='[<a href="'+SubLink[selectedID][k]+'">'+subTitle[TempSelectedID][k]+'</a>] ';
				}else{
					scriptBuffer+='['+subTitle[TempSelectedID][k]+'] ';
				}//end if
		  	}//end for
			
			scriptBuffer+='</td></tr>';
			scriptBuffer+='</table>\n';
		}
			
		
		//submenu
		
		//Sub Submenu
		if (SubLink[selectedID]!=null){
		
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		if (SubLink2[selectedID]!=null){
			for (var l in SubLink2[selectedID][selectedSection]){
				if(l!=selectedSubSection){
					scriptBuffer+='[<a href="'+SubLink2[selectedID][selectedSection][l]+'">'+subSubTitle[TempSelectedID][selectedSection][l]+'</a>] ';
				}else{
					scriptBuffer+='['+subSubTitle[TempSelectedID][selectedSection][l]+'] ';
				}
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		
		}//Sub Submenu

		
	}//check not textonly version

	return scriptBuffer;
}
//generate the top side menu
function getFootMenu(){
	var scriptBuffer='';
	var isOver='';
	var iconNo = '';
	var title_image_alt = sitetitle;
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		//scriptBuffer+='<table width="202" border="0" cellspacing="0" cellpadding="0">\n';
		/*
		scriptBuffer+='            <table width="100%" border="0" cellspacing="0" cellpadding="0">';
		scriptBuffer+='              <tr>';
		scriptBuffer+='                <td>';
		*/
		for (var i in mainsection)
		{
	//	alert(leftMenuName+i)
			iconNo = parseInt(mainsection[i][0]);
			//iconNo = parseInt(i) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			(selectedID==mainsection[i][0])?isOver='_over':isOver='';
			if (selectedID==i){mainTopic=i;}
			/*
			scriptBuffer+='<tr><td><a href="'+MainLink[i]+'" onmouseout="leftMenuMouseOut(\''+i+'\')" onmouseover="leftMenuMouseOver(\''+i+'\')">';
			scriptBuffer+='<img src="'+imgPath+'images/btn_'+iconNo+isOver+'.jpg" name="'+leftMenuName+i+'" border="0" alt="'+title[i]+'" title="'+title[i]+'"></a></td></tr>\n';
			*/
			//scriptBuffer+='            <tr><td><a href="'+MainLink[i]+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'nav'+i+'\',\'\',\''+imgPath+'menu'+i+'_o.gif\',0)"><img src="'+imgPath+'menu'+i+isOver+'.gif" alt="'+title[i]+'" title="'+title[i]+'" border="0" id="nav'+i+'" /></a></td></tr>\n';
			//scriptBuffer+='<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image7\',\'\',\'../../images/en/nav_01_over.gif\',1)"><img src="../../images/en/nav_01_over.gif" name="Image7" width="77" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image8\',\'\',\'../../images/en/nav_02_over.gif\',1)"><img src="../../images/en/nav_02.gif" name="Image8" width="63" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image9\',\'\',\'../../images/en/nav_03_over.gif\',1)"><img src="../../images/en/nav_03.gif" name="Image9" width="58" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image10\',\'\',\'../../images/en/nav_04_over.gif\',1)"><img src="../../images/en/nav_04.gif" name="Image10" width="114" height="17" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image11\',\'\',\'../../images/en/nav_05_over.gif\',1)"><img src="../../images/en/nav_05.gif" name="Image11" width="80" height="17" border="0"></a>';
			//scriptBuffer+='<a href="'+langPath+mainsection[i][3]+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ImageNav'+i+'\',\'\',\''+imgPath+'nav_'+iconNo+'_over.gif\',1)"><img src="'+imgPath+'nav_'+iconNo+isOver+'.gif" name="ImageNav'+i+'" id="ImageNav'+i+'" title="'+mainsection[i][1]+'" alt="'+langPath+mainsection[i][1]+'" border="0"></a>';
			if(mainsection[i][4].search('contactus')!=-1) scriptBuffer+='<br>';
			scriptBuffer+='<a href="'+langPath+mainsection[i][4]+'">'+mainsection[i][mainsectionCaption]+'</a> . ';
			/*
			scriptBuffer+='              <tr><td><a href="'+MainLink[i]+'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'nav'+i+'\',\'\',\''+imgPath+'Btn'+iconNo+'_over.jpg\',1)"><img src="'+imgPath+'Btn'+iconNo+isOver+'.jpg" border="0" id="nav'+i+'" alt="'+title[i]+'" title="'+title[i]+'"  /></a>';
			if (selectedID==i){
				for (var j in SubLink[i]){
				
					(selectedSection==j)?isOverS='ON':isOverS='OFF';
					(selectedSection==j)?isOverR='':isOverR='_red';
					scriptBuffer+='                  <table width="202" border="0" cellspacing="0" cellpadding="0">\n';
					scriptBuffer+='                    <tr bgcolor="ffd399" align="left" valign="top">\n';
					scriptBuffer+='                      <td><img src="'+domain_url+'/images/Btn2nd_'+isOverS+'_over.jpg" width="31" height="24" align="absmiddle" /></td><td width="178"><a href="'+SubLink[i][j]+'"><span class="submenu'+isOverR+'">'+subTitle[i][j]+'</span></a></td>\n';
					scriptBuffer+='                    </tr>\n';
					scriptBuffer+='                  </table>';
				}
			}
			scriptBuffer+='</td></tr>\n';
			*/
		}
		//scriptBuffer+='<br><a href="#">Contact Us</a> . <a href="#">Site Map</a> . <a href="#">Privacy Policy</a>';
		/*
		scriptBuffer+='                </td>';
		scriptBuffer+='                <td width="325" align="right"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image6\',\'\',\'../../images/en/btn_subscription_over.gif\',1)"></a></td>';
		scriptBuffer+='              </tr>';
		scriptBuffer+='            </table>';	
		*/
		//scriptBuffer+='            </table>\n';	
	}else{//istextonly version
	
		//mainmenu
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		for (var i in MainLink){
			iconNo = parseInt(i) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			(selectedSection==i)?isOver='_o':isOver='';
			if(i!=selectedID){
				scriptBuffer+='[<a href="'+MainLink[i]+'">'+title[i]+'</a>]\n';
			}else{
				scriptBuffer+='['+title[i]+']\n';
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		//mainmenu
	

		//submenu
		
		
		var TempSelectedID=selectedID+1;
		if (SubLink[selectedID]!=null){
			
			scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
			scriptBuffer+='<tr><td>';
		
		  	for (var k in SubLink[selectedID]){
		  		if(k!=selectedSection){
					scriptBuffer+='[<a href="'+SubLink[selectedID][k]+'">'+subTitle[TempSelectedID][k]+'</a>] ';
				}else{
					scriptBuffer+='['+subTitle[TempSelectedID][k]+'] ';
				}//end if
		  	}//end for
			
			scriptBuffer+='</td></tr>';
			scriptBuffer+='</table>\n';
		}
			
		
		//submenu
		
		//Sub Submenu
		if (SubLink[selectedID]!=null){
		
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		if (SubLink2[selectedID]!=null){
			for (var l in SubLink2[selectedID][selectedSection]){
				if(l!=selectedSubSection){
					scriptBuffer+='[<a href="'+SubLink2[selectedID][selectedSection][l]+'">'+subSubTitle[TempSelectedID][selectedSection][l]+'</a>] ';
				}else{
					scriptBuffer+='['+subSubTitle[TempSelectedID][selectedSection][l]+'] ';
				}
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		
		}//Sub Submenu

		
	}//check not textonly version

	return scriptBuffer;
}

//generate the left side menu
function getLeftMenu(){
	var scriptBuffer='';
	var isOver='';
	var iconNo = '';
	var title_image_alt = sitetitle;
	var styleCount = 0;
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		iconNo = parseInt(selectedID);
		(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;

		scriptBuffer+='<table border="0" align="center" cellpadding="0" cellspacing="0">';
		scriptBuffer+='<tr>';
		scriptBuffer+='	<td><img src="'+domain_url+'/images/common/spacer.gif" alt="" width="167" height="10"></td>';
		scriptBuffer+='</tr>';

		for (var i in subsection)
		{
	//	alert(leftMenuName+i)
			if (selectedID==subsection[i][0]){
				if(styleCount<1){
					var tdclass = "";
				}else{
					var tdclass = " class=\"navBtn"+selectedID+"\"";
				}
				iconNo = parseInt(selectedID);
				//(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
				(iconNo<10)?iconNo=iconNo:iconNo=iconNo;
				subiconNo = parseInt(subsection[i][1]);
				//(subiconNo<10)?subiconNo='0'+subiconNo:subiconNo=subiconNo;
				(subiconNo<10)?subiconNo=subiconNo:subiconNo=subiconNo;
				(selectedSection==subsection[i][1])?isOver='_h':isOver='';
				if(subsection[i][5].search('http://')!=-1){
					var linkurl = subsection[i][5];
					var linkpopup = ' target="_blank"'
				}else{
					var linkurl = langPath+subsection[i][5];
					var linkpopup = ''
				}
				scriptBuffer+='<tr><td'+tdclass+'><a href="'+linkurl+'"'+linkpopup+' onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Imagesnav'+i+'\',\'\',\''+imgPath+'nav'+iconNo+'_'+subiconNo+'_o.gif\',1)"><img src="'+imgPath+'nav'+iconNo+'_'+subiconNo+isOver+'.gif" name="Imagesnav'+i+'" id="Imagesnav'+i+'" border="0" title="'+subsection[i][subsectionCaption]+'" alt="'+subsection[i][subsectionCaption]+'"></a></td></tr>';
				if (subsection[i][6]=="Y"){
					for (var j in subsubsection){
						if (selectedID==subsubsection[j][0]){
							iconNo = parseInt(selectedID);
							//(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
							(iconNo<10)?iconNo=iconNo:iconNo=iconNo;
							subiconNo = parseInt(subsubsection[j][1]);
							//(subiconNo<10)?subiconNo='0'+subiconNo:subiconNo=subiconNo;
							(subiconNo<10)?subiconNo=subiconNo:subiconNo=subiconNo;
							sub2iconNo = parseInt(subsubsection[j][2]);
							//(sub2iconNo<10)?sub2iconNo='0'+sub2iconNo:sub2iconNo=sub2iconNo;
							(sub2iconNo<10)?sub2iconNo=sub2iconNo:sub2iconNo=sub2iconNo;
							
							(selectedSubSection==subsubsection[j][2])?isOver='_h':isOver='';
							if(subsubsection[j][6].search('http://')!=-1){
								var linkurl = subsubsection[j][6];
								var linkpopup = ' target="_blank"'
							}else{
								var linkurl = langPath+subsubsection[j][6];
								var linkpopup = ''
							}
							scriptBuffer+='<tr><td><a href="'+linkurl+'"'+linkpopup+' onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ImagesSubNav'+j+'\',\'\',\''+imgPath+'nav'+iconNo+'_'+subiconNo+'_'+sub2iconNo+'_o.gif\',1)">';
							scriptBuffer+='<img src="'+imgPath+'nav'+iconNo+'_'+subiconNo+'_'+sub2iconNo+isOver+'.gif" name="ImagesSubNav'+j+'" id="ImagesSubNav'+j+'" border="0" title="'+subsubsection[j][subsubsectionCaption]+'" alt="'+subsubsection[j][subsubsectionCaption]+'"></a></td></tr>';
						}
					}
				}
				styleCount = styleCount + 1;
			}
		}
		scriptBuffer+='</table>';
	}else{//istextonly version
if(selectedID==12||selectedID==13||selectedID==14)
{
	selectedID = selectedID-2;
}
		//mainmenu
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		/*for (var i in MainLink){
			iconNo = parseInt(i) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			(selectedSection==i)?isOver='_o':isOver='';
			if(i!=selectedID){
				scriptBuffer+='[<a href="'+MainLink[i]+'">'+title[i]+'</a>]\n';
			}else{
				scriptBuffer+='['+title[i]+']\n';
			}
		}*/
		for (var i in mainsection)
		{
			if(mainsection[i][7]=="Y"){
				if(mainsection[i][4].search('http://')!=-1){
					var linkurl = mainsection[i][4];
					var linkpopup = ' target="_blank"'
				}else{
					var linkurl = langPath+mainsection[i][4];
					var linkpopup = ''
				}
				(selectedID==mainsection[i][0])?scriptBuffer+='[<strong><a href="'+linkurl+'"'+linkpopup+'>'+mainsection[i][mainsectionCaption]+'</a></strong>]\n':scriptBuffer+='[<a href="'+linkurl+'"'+linkpopup+'>'+mainsection[i][mainsectionCaption]+'</a>]\n';
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		//mainmenu
	
/*
		//submenu
		var TempSelectedID=selectedID+1;
		if (SubLink[selectedID]!=null){
			
			scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
			scriptBuffer+='<tr><td>';
		
		  	for (var k in SubLink[selectedID]){
		  		if(k!=selectedSection){
					scriptBuffer+='[<a href="'+SubLink[selectedID][k]+'">'+subTitle[TempSelectedID][k]+'</a>] ';
				}else{
					scriptBuffer+='['+subTitle[TempSelectedID][k]+'] ';
				}//end if
		  	}//end for
			
			scriptBuffer+='</td></tr>';
			scriptBuffer+='</table>\n';
		}*/
		if(mainsection[selectedID-1][5]=="Y")
		{
			scriptBuffer+='<hr>\n';
			scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
			scriptBuffer+='<tr><td>';
			for (var i in subsection)
			{
				if (selectedID==subsection[i][0]){
					if(subsection[i][5].search('http://')!=-1){
						var linkurl = subsection[i][5];
						var linkpopup = ' target="_blank"'
					}else{
						var linkurl = langPath+subsection[i][5];
						var linkpopup = ''
					}
					(selectedSection==subsection[i][1])?scriptBuffer+='[<strong><a href="'+linkurl+'"'+linkpopup+'>'+subsection[i][subsectionCaption]+'</a></strong>]\n':scriptBuffer+='[<a href="'+linkurl+'"'+linkpopup+'>'+subsection[i][subsectionCaption]+'</a>]\n';
					
				}
			}
			scriptBuffer+='</td></tr>';
			scriptBuffer+='</table>\n';		
		}
		//submenu
/*
		//Sub Submenu
		if (SubLink[selectedID]!=null){
		
		scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
		scriptBuffer+='<tr><td>';
		if (SubLink2[selectedID]!=null){
			for (var l in SubLink2[selectedID][selectedSection]){
				if(l!=selectedSubSection){
					scriptBuffer+='[<a href="'+SubLink2[selectedID][selectedSection][l]+'">'+subSubTitle[TempSelectedID][selectedSection][l]+'</a>] ';
				}else{
					scriptBuffer+='['+subSubTitle[TempSelectedID][selectedSection][l]+'] ';
				}
			}
		}
		scriptBuffer+='</td></tr>';
		scriptBuffer+='</table>\n';
		*/
		if(mainsection[selectedID-1][5]=="Y")
		{
			for (var i in subsection)
			{
				if (selectedID==subsection[i][0]){
					if (selectedID==subsection[i][0] && selectedSection==subsection[i][1] && subsection[i][6]=="Y"){
						scriptBuffer+='<hr>\n';
						scriptBuffer+='<table border="0" cellspacing="0" cellpadding="2">\n';
						scriptBuffer+='<tr><td>';					
						for(var i in subsubsection)
						(selectedSubSection==subsubsection[i][2])?scriptBuffer+='[<strong><a href="'+langPath+subsubsection[i][6]+'">'+subsubsection[i][subsubsectionCaption]+'</a></strong>]\n':scriptBuffer+='[<a href="'+langPath+subsubsection[i][6]+'">'+subsubsection[i][subsubsectionCaption]+'</a>]\n';					
						scriptBuffer+='</td></tr>';
						scriptBuffer+='</table>\n';		
					}
				}
			}

		}
		//Sub Submenu
	}//check not textonly version

	return scriptBuffer;
}

function getLayer()
{
	var scriptBuffer='';
	var isOver='';
	var iconNo = '';
	var subIconNo = '';
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
	
	for (var j in MainLink)
	{
		if (SubLink[j]!=null)
		{
			
			//Start Layer
			iconNo = parseInt(j) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			arLayer[arLayer.length] = layerCommonName+iconNo;
			arLayer2[arLayer2.length] = j;
			
			if (document.layers)
			{document.writeln('<layer name="'+layerCommonName+iconNo+'" top=0 left='+(leftOffSet+147)+' width=180 height=58 visibility="hide" onMouseOver="leftMenuMouseOver(\''+j+'\')" onMouseOut="leftMenuMouseOut(\''+j+'\')">');}
			else
			{document.writeln('<div id="'+layerCommonName+iconNo+'" style="position:absolute; left:'+(leftOffSet+147)+'; top:0; width:180; height:58; z-index:2; visibility: hidden"> ');}
			
			//content for Layers
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" onMouseOver="leftMenuMouseOver(\''+j+'\')" onMouseOut="leftMenuMouseOut(\''+j+'\')">');
			document.writeln('<tr valign=top>');
			document.writeln('	<td><img src="'+imgPath+'images/btn_lv1_top.jpg" border="0"></td>');
			document.writeln('</tr>');
			
			for (var k in SubLink[j])
			{
				(selectedSection==j && selectedSubSection==k)?isOver='_over':isOver='';
				subIconNo = parseInt(k);
				(subIconNo<10)?subIconNo='0'+subIconNo:subIconNo=subIconNo;
				if (selectedSection==j && selectedSubSection==k){subTopic=leftMenuName+j+'_'+k;}

				document.writeln('<tr valign=top>');
				document.writeln('	<td><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="left" width="100%" class="menu"><a href="'+SubLink[j][k]+'" onMouseOver="MM_swapImage(\''+leftMenuName+j+'_'+k+'\',\'\',\''+imgPath+'images/btn_lv1_'+iconNo+subIconNo+'_o.jpg\',1); firstLayerMouseOver(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');" onMouseOut="MM_swapImgRestore(); firstLayerMouseOut(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');"><img name="'+leftMenuName+j+'_'+k+'" src="'+imgPath+'images/btn_lv1_'+iconNo+subIconNo+'.jpg" alt="'+subTitle[parseInt(j)+1][k]+'" title="'+subTitle[parseInt(j)+1][k]+'" border="0"></a></td></tr></table></td>');
//				document.writeln('	<td bgcolor="#2365C3" onMouseover="this.style.backgroundColor=\'348FEA\',this.style.color=\'FFFFFF\';"  onMouseout="this.style.backgroundColor=\'2365C3\',this.style.color=\'B9CBE7\';"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td colspan="2"><img src="images/nav_sub_Line.gif" alt="'+subTitle[parseInt(j)+1][k]+'" height="1" border="0" name="'+leftMenuName+j+'_'+k+'"></td></tr><tr><td><img src="images/spacer.gif" width="5"	></td><td align="left" width="100%" ><a href="'+SubLink[j][k]+'" onMouseOver="firstLayerMouseOver(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');"  onMouseOut="firstLayerMouseOut(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');"><span style="color:#B9CBE7;text-decoration:none" onMouseover="this.style.color=\'FFFFFF\';" onMouseout="this.style.color=\'B9CBE7\';">'+subTitle[parseInt(j)+1][k]+'</span></a></td></tr></table></td>');

				document.writeln('</tr>');
			}
			document.writeln('<tr valign=top>');
			document.writeln('	<td><img src="'+imgPath+'images/btn_lv1_bottom.jpg" border="0"></td>');
			document.writeln('</tr>');
			document.writeln('</table>');
			
			//Close Layer
			if (document.layers)
			{document.writeln('</layer>');}
			else
			{document.writeln('</div>');}
		}
	}
	
	}//check not textonly version
	
	return scriptBuffer;
}

function getSecondLayer()
{
	var scriptBuffer='';
	var isOver='';
	var iconNo = '';
	var subIconNo = '';
	var subSubIconNo = '';
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
	
	for (var j in MainLink)
	{
		if (SubLink[j]!=null)
		{
			
			//Start Layer
			iconNo = parseInt(j) + 1;
			(iconNo<10)?iconNo='0'+iconNo:iconNo=iconNo;
			
			for (var k in SubLink[j])
			{
				if (SubLink2[j][k]!=null)
				{
					subIconNo = parseInt(k);
					(subIconNo<10)?subIconNo='0'+subIconNo:subIconNo=subIconNo;
					arSecondLayer[arSecondLayer.length] = layerCommonName+iconNo+subIconNo;
					arSecondLayer2[arSecondLayer2.length] = j+'_'+k;
					
					if (document.layers)
					{document.writeln('<layer name='+layerCommonName+iconNo+subIconNo+' top=0 left='+(leftOffSet+350)+' width=120 height=58 visibility="hide" onMouseOver="leftMenuMouseOver(\''+j+'\');firstLayerMouseOver(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');" onMouseOut="leftMenuMouseOut(\''+j+'\');firstLayerMouseOut(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');">');}
					else
					{document.writeln('<div id="'+layerCommonName+iconNo+subIconNo+'" style="position:absolute; left:'+(leftOffSet+350)+'; top:0; width:120; height:58; z-index:2; visibility: hidden"> ');}
					
					//content for Layers
					document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" onMouseOver="leftMenuMouseOver(\''+j+'\');firstLayerMouseOver(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');" onMouseOut="leftMenuMouseOut(\''+j+'\');firstLayerMouseOut(\''+leftMenuName+j+'_'+k+'\', \''+layerCommonName+iconNo+subIconNo+'\');">');
					document.writeln('<tr valign=top>');
					document.writeln('	<td><img src="'+imgPath+'images/btn_lv2_top.jpg" border="0"></td>');
					document.writeln('</tr>');
					
					for (var l in SubLink2[j][k])
					{
						subSubIconNo = parseInt(l);
						(subSubIconNo<10)?subSubIconNo='0'+subSubIconNo:subSubIconNo=subSubIconNo;
						
						document.writeln('<tr valign=top>');
						document.writeln('	<td><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td width="100%" class="menu"><a href="'+SubLink2[j][k][l]+'" onMouseOver="MM_swapImage(\''+leftMenuName+j+'_'+k+'_'+l+'\',\'\',\''+imgPath+'images/btn_lv2_'+iconNo+subIconNo+subSubIconNo+'_o.jpg\',1); secondLayerMouseOver(\''+leftMenuName+j+'_'+k+'_'+l+'\', \''+layerCommonName+iconNo+subIconNo+subSubIconNo+'\');" onMouseOut="MM_swapImgRestore(); secondLayerMouseOut(\''+leftMenuName+j+'_'+k+'_'+l+'\', \''+layerCommonName+iconNo+subIconNo+subSubIconNo+'\');"><img name="'+leftMenuName+j+'_'+k+'_'+l+'" src="'+imgPath+'images/btn_lv2_'+iconNo+subIconNo+subSubIconNo+'.jpg" alt="'+subSubTitle[parseInt(j)+1][k][l]+'" border="0"></a></td></tr></table></td>');
//						document.writeln('	<td bgcolor="#2365C3" onMouseover="this.style.backgroundColor=\'348FEA\',this.style.color=\'FFFFFF\';smenuTitle'+parseInt(j)+"_"+k+l+'.style.color=\'ffffff\';"  onMouseout="this.style.backgroundColor=\'2365C3\',this.style.color=\'B9CBE7\';smenuTitle'+parseInt(j)+"_"+k+l+'.style.color=\'B9CBE7\';"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td colspan="3" width="100%" background="images/nav_sub_Line.gif"><img src="images/nav_sub_Line.gif" alt="'+subSubTitle[parseInt(j)+1][k][l]+'" border="0" name="'+leftMenuName+j+'_'+k+'_'+l+'" width="180"></td></tr><tr><td><img src="images/spacer.gif" width="5"></td><td width="100%" class="menu"><a href="'+SubLink2[j][k][l]+'" onMouseOver="secondLayerMouseOver(\''+leftMenuName+j+'_'+k+'_'+l+'\', \''+layerCommonName+iconNo+subIconNo+subSubIconNo+'\');"  onMouseOut="secondLayerMouseOut(\''+leftMenuName+j+'_'+k+'_'+l+'\', \''+layerCommonName+iconNo+subIconNo+subSubIconNo+'\');"><span style="color:#B9CBE7;font-family:Verdana; text-decoration:none"  onMouseover="this.style.color=\'FFFFFF\';" onMouseout="this.style.color=\'B9CBE7\';" name="smenuTitle'+parseInt(j)+"_"+k+l+'"  id="smenuTitle'+parseInt(j)+"_"+k+l+'">'+subSubTitle[parseInt(j)+1][k][l]+'</span></a></td></tr></table></td>');
						document.writeln('</tr>');
					}
					document.writeln('<tr valign=top>');
					document.writeln('	<td><img src="'+imgPath+'images/btn_lv2_bottom.jpg" border="0"></td>');
					document.writeln('</tr>');
					document.writeln('</table>');		
			
					//Close Layer
					if (document.layers)
					{document.writeln('</layer>');}
					else
					{document.writeln('</div>');}
				}
			}
		}
	}
	
	
	}//check not textonly version
	
	return scriptBuffer;
}

function getLocation(){
	var scriptBuffer='';
	if(langID==1)
	scriptBuffer+='<a href="'+langFolder+'index.asp">Home</a>';
	if(langID==2)
	scriptBuffer+='<a href="'+langFolder+'index.asp">主頁</a>';
	if(langID==3)
	scriptBuffer+='<a href="'+langFolder+'index.asp">主页</a>';
	
		for (var i in mainsection)
		{
			if(selectedID==mainsection[i][0]){
				if(selectedSection!=0){
					scriptBuffer+='&nbsp;&gt; <a href="'+langPath+mainsection[i][4]+'">'+mainsection[i][mainsectionCaption]+'</a>';
				}else{
					scriptBuffer+='&nbsp;&gt; <a href="'+langPath+mainsection[i][4]+'"><span class="path_on">'+mainsection[i][mainsectionCaption]+'</span></a>';
				}
			}
			//scriptBuffer+='<a href="'+langPath+mainsection[i][3]+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ImageNav'+i+'\',\'\',\''+imgPath+'nav_'+iconNo+'_over.gif\',1)"><img src="'+imgPath+'nav_'+iconNo+isOver+'.gif" name="ImageNav'+i+'" id="ImageNav'+i+'" title="'+mainsection[i][1]+'" alt="'+langPath+mainsection[i][1]+'" border="0"></a>';
		}
		for (var i in subsection)
		{
			if (selectedID==subsection[i][0]){
				if (selectedSection==subsection[i][1]){
					scriptBuffer+='&nbsp;&gt; <a href="'+langPath+subsection[i][5]+'"><span class="path_on">'+subsection[i][subsectionCaption]+'</span></a>';
				}
				//scriptBuffer+='<a href="'+subsection[i][4]+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Imagesnav'+i+'\',\'\',\'../../images/en/nav_'+iconNo+'_'+subiconNo+'_over.gif\',1)"><img src="../../images/en/nav_'+iconNo+'_'+subiconNo+isOver+'.gif" name="Imagesnav'+i+'" id="Imagesnav'+i+'" width="157" height="28" border="0" title="'+subsection[i][2]+'" alt="'+subsection[i][2]+'"></a>';
			}
		}
	return scriptBuffer;
	
}
function getTopic()
{
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
	
	document.writeln('<table width="607" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('<tr>');
	document.writeln('	<td width="21" height="31" rowspan="3" align="left" valign="top"><img src="'+imgPath+'images/spacer.gif" width="21" height="31" border="0"></td>');
	document.writeln('	<td height="14" align="left" valign="top" colspan="2">');
	document.writeln('</td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td height="3" align="left" valign="top" colspan="2"><IMG src="'+imgPath+'images/title_line.jpg" ALT="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td align="left" valign="top" colspan="2"><IMG src="'+imgPath+'images/title_line_left.jpg" ALT="" border="0">');
	
	if (typeof(subTitle[parseInt(selectedID)+1]) !='undefined'){
		if (typeof(subTitle[parseInt(selectedID)+1][selectedSection]) !='undefined'){
			if (subSubTitle[parseInt(selectedID)+1].length>1){
				if (subSubTitle[parseInt(selectedID)+1][selectedSection].length>1){
					//alert(subTitle[parseInt(selectedID)+1][selectedSection].length);
					if (typeof(subSubTitle[parseInt(selectedID)+1][selectedSection][selectedSubSection]) !='undefined'){
						document.write('<a href="'+SubLink[selectedID][selectedSection]+'"><IMG src="'+imgPath+'images/sub_title_0'+(parseInt(selectedID)+1)+'_0'+selectedSection+'.jpg" title="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" ALT="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" border="0"></a>');
						document.write('<img src="'+imgPath+'images/sub_title_arr.jpg" border="0" title="&gt;" alt="&gt;"><img src="'+imgPath+'images/sub_title_0'+(parseInt(selectedID)+1)+'_0'+selectedSection+'_0'+selectedSubSection+'.jpg" border="0" title="'+subSubTitle[parseInt(selectedID)+1][selectedSection][selectedSubSection]+'" alt="'+subSubTitle[parseInt(selectedID)+1][selectedSection][selectedSubSection]+'">');
					}else{
						document.write('<IMG src="'+imgPath+'images/sub_title_0'+(parseInt(selectedID)+1)+'_0'+selectedSection+'.jpg" title="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" ALT="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" border="0">');
					}
				}else{
					document.write('<IMG src="'+imgPath+'images/sub_title_0'+(parseInt(selectedID)+1)+'_0'+selectedSection+'.jpg" title="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" ALT="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" border="0">');
				}
			}else{
				document.write('<IMG src="'+imgPath+'images/sub_title_0'+(parseInt(selectedID)+1)+'_0'+selectedSection+'.jpg" title="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" ALT="'+subTitle[parseInt(selectedID)+1][selectedSection]+'" border="0">');
			}
		}else{
			document.write('&nbsp;');
		}
	}else{
		document.write('&nbsp;');
	}
	document.write('</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
	
	}else{//istextonly version
	/*
		var TempSelectedID=selectedID + 1;
		if(document.URL.toString().search('/sitemap/')!=-1){//check sitemap
			document.writeln('<b>'+title[selectedID]+'</b>');
		}else{
			if (SubLink[selectedID]!=null && selectedSection!=0) {//check main
				document.writeln('<p><a href="'+MainLink[selectedID]+'">'+title[selectedID]+'</a>');

				if (SubLink2[selectedID].length > 1){//check SubLink2
					if (SubLink2[selectedID][selectedSection]!=null && selectedSubSection!=0){
				
						document.writeln(' > <a href="'+SubLink[selectedID][selectedSection]+'">'+subTitle[TempSelectedID][selectedSection]+'</a>');
						if (SubLink2[selectedID][selectedSection][selectedSubSection]!=null) {
							document.writeln(' > '+subSubTitle[TempSelectedID][selectedSection][selectedSubSection]+'</p>');
						}else{
							document.writeln('</p>');
						}
				
					}else{
						document.writeln(' > <b>'+subTitle[TempSelectedID][selectedSection]+'</b></p>');
					}
			
				}else{
					document.writeln(' > <b>'+subTitle[TempSelectedID][selectedSection]+'</b></p>');
				}//end check SubLink2
			}else{
				document.writeln('<p><b>'+title[selectedID]+'</b></p>');
			}//end check main
		

		}//end check sitemap
		*/
		if(selectedID!=0 && selectedSection==0 && selectedSubSection==0)
		{
			document.writeln('<p><b>'+mainsection[selectedID-1][mainsectionCaption]+'</b></p>');		
		}
		if(selectedID!=0 && selectedSection!=0 && selectedSection==0)
		{
			for(i in subsection)
			{
				if(subsection[i][0]==selectedID && subsection[i][1]==selectedSection)
				{
					document.writeln('<p><b>'+subsection[i][subsectionCaption]+'</b></p>');
				}
				
			}
		}
		if(selectedID!=0 && selectedSection!=0 && selectedSubSection!=0)
		{
			for(i in subsubsection)
			{
				if(subsubsection[i][0]==selectedID && subsubsection[i][1]==selectedSection && subsubsection[i][2]==selectedSubSection)
				{
					document.writeln('<p><b>'+subsubsection[i][subsubsectionCaption]+'</b></p>');
				}
				
			}
		}
		
	}//check not textonly version
}

//generate the current topic
function getCurrentTopic(){
	//set image path for the topics
	var imagePath=domain_url+'/images/topic/'
	var topicPath = new Array();
	topicPath[1]='title02';
	topicPath[2]='title03';
	topicPath[3]='title04';
	topicPath[4]='title05';
	topicPath[5]='title06';
	topicPath[6]='title07';
	topicPath[7]='title08';
	topicPath[8]='title09';
	topicPath[9]='title10';
	topicPath[10]='title11';
	topicPath[11]='title12';
	topicPath[12]='title13';
	topicPath[13]='title14';
	//generate the topic image to the buffer variable
	var scriptBuffer='';
	var altTitle='';
	if(selectedSubSection != 0){
		if (selectedSubSection < 10){
			imagePath = imagePath+topicPath[selectedSection] + '_0' + selectedSubSection;
		}else{
			imagePath = imagePath+topicPath[selectedSection] + '_' + selectedSubSection;
		}

		if (subLevelSection > 0){
			if (subLevelSection < 10){
				imagePath = imagePath + '_0' + subLevelSection;
			}else{
				imagePath = imagePath + '_' + subLevelSection;	
			}

		altTitle = subTitle[selectedSection+1][selectedSubSection]+' > '+subSubTitle[selectedSection+1][selectedSubSection][subLevelSection];			

		}else{
			altTitle = title[selectedSection]+' > '+subTitle[selectedSection+1][selectedSubSection];
		}

	}else{
		imagePath = imagePath+topicPath[selectedSection];
		altTitle = title[selectedSection];
	}
	
	scriptBuffer+='<a name="top"></a>';
	scriptBuffer+='<img src="'+imagePath+'.gif" alt="'+altTitle+'">'
	return scriptBuffer;
}

function getPrintButton() {
	var scriptBuffer='';
//	scriptBuffer+='<a href="javascript:printPage();"><img src="'+domain_url+'/images/common/but_print.gif" alt="Print This Page" border="0"></a>';
	if(p==0)
	scriptBuffer+='<a href="javascript:printPage();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'btnprint\',\'\',\'images/btn_print_over.gif\',1)"><img src="images/btn_print.gif" name="btnprint" alt="Print This Page" border="0"></a>';
	return scriptBuffer;
}


//generate the page footer to show the notices and revision date
function getFooter() {
	var copyYear='2007';
	var noticesLink=langPath+'notice/index.htm';
	//alert(noticesLink);
	if (revisionDate==''||revisionDate=='MM/DD/YYYY') revisionDate='7/11/2007';
	var reDate=new Date(Date.parse(revisionDate))
	
	//set language format
	if(document.URL.toString().search('/en/')!=-1){
		var txtLastRevisionDate='Last revision date: ';
		var txtImportantNotices='Important notices';
		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 showDate=reDate.getDate()+' '+monthArray[reDate.getMonth()]+' '+reDate.getFullYear();
	}else if(document.URL.toString().search('/sc/')!=-1){
		var txtLastRevisionDate='党隆゜ヽ:';
		var txtImportantNotices='笭猁豢尨';
		var showMonth=reDate.getMonth()+1;
		var showDate=reDate.getFullYear()+'爛'+showMonth+'堎'+reDate.getDate()+'゜';
	}else{
		var txtLastRevisionDate='修訂日期:';
		var txtImportantNotices='重要告示';
		var showMonth=reDate.getMonth()+1;
		var showDate=reDate.getFullYear()+'年'+showMonth+'月'+reDate.getDate()+'日';
	}
	//generate the topic image to the buffer variable
	var scriptBuffer='';
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
	
	scriptBuffer+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	
	if(!p) {
		scriptBuffer+='<tr>';
		scriptBuffer+='<td colspan="2" align="right" class="footer">'; 

		if (selectedSubSection != 0) {
			var thisLink;
			thisLink = '';
			if (selectedSubSubSection > 0 ) {
				thisLink = 'javascript: history.go(-1);';
			}else if (isArrayContain(document.location.pathname)){
				thisLink = MainLink[selectedID];
			}else {
				thisLink = SubLink[selectedID][selectedSection];
			}
			
			if((selectedSection==2)&&(selectedSubSection==2)&&(subLevelSection==2))
				thisLink = '/about_us/organization/responsibilities/major.htm';
			
			if((selectedSection==2)&&(selectedSubSection==2)&&(subLevelSection==1)&&(selectedSubSubSection==1))
				thisLink = '/about_us/organization/orgainzation_chart/chart.htm';
				
			if((selectedSection==5)&&(selectedSubSection==2)&&(subLevelSection==2)&&(selectedSubSubSection==1))
				thisLink = '/public_services/community_halls_centres/ccch.htm';
	
			if (vLink != '') {
				thisLink = vLink;
			}
			
//			scriptBuffer+='<a href="'+thisLink+'"><img src="'+domain_url+'/images/common/but_back.gif" border=0 align=top alt="Back"></a>&nbsp;&nbsp;&nbsp;';
		}
		if((selectedSection==1)&&(selectedSubSection==0)){
			thisLink = MainLink[selectedSection];
//			scriptBuffer+='<a href="'+thisLink+'"><img src="'+domain_url+'/images/common/but_back.gif" border=0 align=top alt="Back"></a>&nbsp;&nbsp;&nbsp;';
		}
//		scriptBuffer+='<a href="#"><img src="'+domain_url+'/images/common/but_top.gif" border=0 align=top alt="Top"></a></td>';
		scriptBuffer+='</tr>';
	}
	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="2"><img src="'+imgPath+'images/spacer.gif" width="16" height="16"></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="2" background="'+imgPath+'images/botdot.jpg"><img src="'+imgPath+'images/botdot.jpg"></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="2"><img src="'+imgPath+'images/spacer.gif" width="1" height="4"></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td class="footer" align="left">&nbsp;'+copyYear+'<img src="'+imgPath+'images/copy.gif" align="absmiddle"> | <a href="'+noticesLink+'" class="notices">'+txtImportantNotices+'</a></td>';
	scriptBuffer+='<td align="right" class="reDate"><div align=right>'+txtLastRevisionDate+showDate+'&nbsp;</div></td>';
	scriptBuffer+='</tr>';
/*	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="2"><img src="'+imgPath+'images/spacer.gif" width="1" height="16"></td>';
	scriptBuffer+='</tr>';*/
	scriptBuffer+='</table>';
	
	}else{// istextonly version
	
		scriptBuffer+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
		scriptBuffer+='<tr>';
		scriptBuffer+='<td>'+copyYear+' | <a href="'+noticesLink+'" class="notices">'+txtImportantNotices+'</a></td><td align="right"><div align=right>'+txtLastRevisionDate+showDate+'</div></td>';
		scriptBuffer+='</tr>';
		scriptBuffer+='</table>';
	
	}//check not textonly version
	
	return scriptBuffer;
}

function PdfReader(){
	
	var scriptBuffer='';
	var PdfText='';
	var PdfLogoAlt='';
	var PdfLogo='';
	var checker=false;
	var CheckPdfSection = new Array();
	CheckPdfSection[3]  = new Array();
	CheckPdfSection[3][1]  = true;
	CheckPdfSection[3][5]  = new Array();
	CheckPdfSection[3][5][0] = false;
	CheckPdfSection[3][5][1] = true;
	CheckPdfSection[3][5][2] = true;
	CheckPdfSection[3][5][3] = true;
	CheckPdfSection[3][5][4] = true;
	
	CheckPdfSection[6]  = true;
	
	
	if (typeof(CheckPdfSection[selectedID]) !='undefined'){
		if (CheckPdfSection[selectedID].length>1){
			if (typeof(CheckPdfSection[selectedID][selectedSection]) !='undefined'){
				if (CheckPdfSection[selectedID][selectedSection]){
					checker=true;
				}
				if (CheckPdfSection[selectedID][selectedSection].length>1){
					if (typeof(CheckPdfSection[selectedID][selectedSection][selectedSubSection]) !='undefined'){
						
						//check isTrue add content here
						if (CheckPdfSection[selectedID][selectedSection][selectedSubSection]){
							checker=true;
						}else{
							checker=false;
						}
						//check isTrue add content
						
					}//check defind 3-lv
				}//check length 2-lv
			} //check defind 2-lv
		}else{
			if(CheckPdfSection[selectedID]){
				checker=true;
			}
		}//check length 1-lv
	}//check defind 1-lv
		
	
	if (checker){
	if(document.URL.toString().search('/en/')!=-1){
		PdfText='To view the above document, you need to use an Adobe Acrobat Reader. Please click <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">here</a> to download the latest version and install the <a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html" target="_blank">Asian Font Pack</a> if necessary.';
		PdfLogoAlt='Get Adobe Acrobat Reader';
	}else if(document.URL.toString().search('/sc/')!=-1){
		PdfText='以上文件以PDF 格式储存，你需要使用Adobe Acrobat Reader 来阅览。如需安装，可按<a href="http://www.chinese-t.adobe.com/products/acrobat/readstep2.html?c=hk" target="_blank">此处</a> 下载该软件及其<a href="http://www.chinese-t.adobe.com/products/acrobat/acrrasianfontpack.html?c=hk">亚洲字型套件</a> 。';
		PdfLogoAlt='安装 Acrobat Reader';
	}else{
		PdfText='以上文件以PDF 格式儲存，你需要使用Adobe Acrobat Reader 來閱覽。如需安裝，可按<a href="http://www.chinese-t.adobe.com/products/acrobat/readstep2.html?c=hk" target="_blank">此處</a> 下載該軟件及其<a href="http://www.chinese-t.adobe.com/products/acrobat/acrrasianfontpack.html?c=hk">亞洲字型套件</a> 。';
		PdfLogoAlt='安裝 Acrobat Reader';
	}
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		PdfLogo='<img src="'+domain_url+'/images/pdficon.gif" width="88" height="31" border="0" title="'+PdfLogoAlt+'" alt="'+PdfLogoAlt+'">';
	}else{//istextonly version
		PdfLogo=PdfLogoAlt;
	}
	scriptBuffer+='<table border="0" cellpadding="2" cellspacing="0" width="100%">';
	scriptBuffer+='<tr><td><a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">'+PdfLogo+'</a></td><td>';
	scriptBuffer+=PdfText;
	scriptBuffer+='</td></tr>';
	scriptBuffer+='</table>';
	}
	
	return scriptBuffer;
}
function PdfReader2(){
	
	var scriptBuffer='';
	var PdfText='';
	var PdfLogoAlt='';
	var PdfLogo='';

	if(document.URL.toString().search('/en/')!=-1){
		PdfText='To view the above document, you need to use an Adobe Acrobat Reader. Please click <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">here</a> to download the latest version and install the <a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html" target="_blank">Asian Font Pack</a> if necessary.';
		PdfLogoAlt='Get Adobe Acrobat Reader';
	}else if(document.URL.toString().search('/sc/')!=-1){
		PdfText='眕奻恅璃眕PDF 跡宒揣湔ㄛ斕剒猁妏蚚Adobe Acrobat Reader 懂堐擬﹝⺼剒假蚾ㄛ褫偌<a href="http://www.chinese-t.adobe.com/products/acrobat/readstep2.html?c=hk" target="_blank">森揭</a> 狟婥蜆⻏璃摯［<a href="http://www.chinese-t.adobe.com/products/acrobat/acrrasianfontpack.html?c=hk">捚粔趼倰杶璃</a> ﹝';
		PdfLogoAlt='假蚾 Acrobat Reader';
	}else{
		PdfText='以上文件以PDF 格式儲存，你需要使用Adobe Acrobat Reader 來閱覽。如需安裝，可按<a href="http://www.chinese-t.adobe.com/products/acrobat/readstep2.html?c=hk" target="_blank">此處</a> 下載該軟件及其<a href="http://www.chinese-t.adobe.com/products/acrobat/acrrasianfontpack.html?c=hk">亞洲字型套件</a> 。';
		PdfLogoAlt='安裝 Acrobat Reader';
	}
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		PdfLogo='<img src="'+domain_url+'/images/pdficon.gif" width="88" height="31" border="0" title="'+PdfLogoAlt+'" alt="'+PdfLogoAlt+'">';
	}else{//istextonly version
		PdfLogo=PdfLogoAlt;
	}
	scriptBuffer+='<table border="0" cellpadding="2" cellspacing="0" width="100%">';
	scriptBuffer+='<tr><td><a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">'+PdfLogo+'</a></td><td>';
	scriptBuffer+=PdfText;
	scriptBuffer+='</td></tr>';
	scriptBuffer+='</table>';
	
	//alert(scriptBuffer);
	document.writeln(scriptBuffer);
}
function GenTopid(){
	for (i=1; i<100; i++){
		if (document.getElementById('Image'+i)==null){
			//alert(i);
			return 'Image'+i
		}
	}
}
function Back_gotoTop(type)
{
	//type 2 = back + gotoTop, type 1 = gotoTop
	if(document.URL.toString().search('/sc/')!=-1){
		var backalt='上一页';
		var topalt='回页首';
	}else if(document.URL.toString().search('/tc/')!=-1){
		var backalt='上一頁';
		var topalt='回頁首';
	}else{
		var backalt='Back';
		var topalt='Top^';
	}
	
	GenTopidtxt=GenTopid();
	
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		document.writeln('	        <table border="0" cellpadding="0" cellspacing="0" width="100%">');
		document.writeln('	        	<tr valign="middle">');
		if (type == 2){
			document.writeln('	        		<td align="left"><!-- <div align="right"> --><a href="javascript:history.go(-1);" onMouseOver="MM_swapImage(\'back\',\'\',\''+imgPath+'images/btn_back_o.jpg\',1)" onMouseOut="MM_swapImgRestore()"><img src="'+imgPath+'images/btn_back.jpg" id="back" alt="'+backalt+'" title="'+backalt+'" border="0"></a><!-- </div> --></td>');
		}
		document.writeln('	        		<td align="right"><div align="right"><a href="#top" onMouseOver="MM_swapImage(\''+GenTopidtxt+'\',\'\',\''+imgPath+'images/btn_top_o.jpg\',1)" onMouseOut="MM_swapImgRestore()"><img src="'+imgPath+'images/btn_top.jpg" id="'+GenTopidtxt+'" alt="'+topalt+'" title="'+topalt+'" border="0"></a></div></td>');
		document.writeln('	        	</tr>');
		document.writeln('	        </table>');
	}else{//is textonly version
		document.writeln('	<table border="0" cellpadding="2" cellspacing="2" width="100%">');
		document.writeln('		<tr valign="middle">');
		if (type == 2){
			document.writeln('		<td><a href="javascript:history.go(-1);">'+backalt+'</a></td>');
		}
		document.writeln('		<td align="right"><div align="right"><a href="#top">'+topalt+'</a></td></div></tr>');
		document.writeln('	</table>');
	}
}

function getheaderTableEnd(){
			document.writeln('				</td>');
			document.writeln('                <td width="33">&nbsp;</td>');
			document.writeln('              </tr>');
			document.writeln('            </table>');
}

function getRightBox(){
	document.writeln('<table border="0" cellspacing="0" cellpadding="0" >');
	document.writeln('<tr>');
	document.writeln('	<td valign="top"><img src="'+domain_url+'/images/common/relPage_bullet.gif" alt=""  /></td>');
	document.writeln('	<td valign="top" class="rp_heading white"><b>RELATED PAGE</b></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td valign="top">&nbsp;</td>');
	document.writeln('	<td valign="top" class="rp_title white">Strategic Partner</td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td valign="top">&nbsp;</td>');
	document.writeln('	<td valign="top" ><img src="'+domain_url+'/images/common/img_innocentre.jpg" class="rp_Image"/></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td valign="top">&nbsp;</td>');
	document.writeln('	<td valign="top" class="rp_info white"><strong>INNOCENTRE</strong></td>');
	document.writeln('</tr>');
	document.writeln('<tr>');
	document.writeln('	<td valign="top">&nbsp;</td>');
	document.writeln('	<td valign="top" class="rp_info white">');
	document.writeln('		<table border="0" cellspacing="0" cellpadding="3" >');
	document.writeln('		<tr>');
	document.writeln('			<td valign="top"><img src="'+domain_url+'/images/common/arrow_light.gif" width="11" height="11" /></td>');
	document.writeln('			<td valign="top" class="rp_info"><a href="#" class="white">See Details</a></td>');
	document.writeln('		</tr>');
	document.writeln('		<tr>');
	document.writeln('			<td valign="top"><img src="'+domain_url+'/images/common/arrow_light.gif" width="11" height="11" /></td>');
	document.writeln('			<td valign="top" class="rp_info"><a href="#"  class="white">Visit Offical Website</a></td>');
	document.writeln('		</tr>');
	document.writeln('		</table>');
	document.writeln('	</td>');
	document.writeln('</tr>');
	document.writeln('</table>');
}


function getRightMenu(){
/*	document.writeln('				<table border="0" cellspacing="0" cellpadding="0" class="linksTable">');
	document.writeln('				<tr>');
	document.writeln('					<td class="links_heading">Founding Members</td>');
	document.writeln('				</tr>');
	document.writeln('				<tr>');
	document.writeln('					<td>');
	document.writeln('						<table border="0" cellspacing="0" cellpadding="3">');
	document.writeln('						<tr>');
	document.writeln('							<td valign="top"><img src="'+domain_url+'/images/common/arrow_dark.gif" /></td>');
	document.writeln('							<td valign="top"  class="link_info"><a href="#">Hong Kong Designers Association</a></td>');
	document.writeln('						</tr>');
	document.writeln('						<tr>');
	document.writeln('							<td valign="top"><img src="'+domain_url+'/images/common/arrow_dark.gif" /></td>');
	document.writeln('							<td valign="top" class="link_info"><a href="#">Chartered Society of Designers, Hong Kong</a></td>');
	document.writeln('						</tr>');
	document.writeln('						<tr>');
	document.writeln('							<td valign="top"><img src="'+domain_url+'/images/common/arrow_dark.gif" /></td>');
	document.writeln('							<td valign="top" class="link_info"><a href="#">Interior Design Association Hong Kong</a></td>');
	document.writeln('						</tr>');
	document.writeln('						<tr>');
	document.writeln('							<td valign="top"><img src="'+domain_url+'/images/common/arrow_dark.gif" /></td>');
	document.writeln('							<td valign="top" class="link_info"><a href="#">Hong Kong Fashion Designers Association</a></td>');
	document.writeln('						</tr>');
	document.writeln('						</table>');
	document.writeln('					</td>');
	document.writeln('				</tr>');
	document.writeln('				</table>');*/
}

function getfooterHTML()
{
	/*
	if(document.URL.toString().search('/sc/')!=-1){
		var copyright='&copy; 版权为香港设计中心所有 不得转载';
		var altBack='&lt;Back';
		var altTop='^Top';
	}else if(document.URL.toString().search('/tc/')!=-1){
		var copyright='&copy; 版權為香港設計中心所有 不得轉載';
		var altBack='&lt;Back';
		var altTop='^Top';
	}else{
		var copyright='&copy; Copyright 2008 Hong Kong Design Centre. All rights reserved.';
		var altBack='&lt;&nbsp;Back';
		var altTop='^Top';
	}
	*/
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		if (selectedID!=0){
		document.writeln('					</td>');
		document.writeln('				</tr>');
		document.writeln('				</table>');
		document.writeln('			</td>');
		document.writeln('			<td valign="top" bgcolor="#f2f2f2">');
		}
	}else{//istextonly version
		//document.writeln(PdfReader());
		Back_gotoTop(1);
		document.writeln('<hr>');
		//document.writeln(getFooter());
		document.writeln(copyright);
		document.writeln('</td></tr>');
		document.writeln('</table>');

	}//check not textonly version
}

function getfooterHTML2()
{
	//check not textonly version
	if(document.URL.toString().search('/text/')==-1){
		if (selectedID!=0){
		document.writeln('			</td>');
		document.writeln('		</tr>');
		document.writeln('		<tr height="20">');
		document.writeln('			<td align="right" valign="top" bgcolor="#f2f2f2">&nbsp;</td>');
		document.writeln('			<td valign="bottom"><img src="'+domain_url+'/images/common/bottom_line.gif" alt="" width="550" height="1" /></td>');
		document.writeln('			<td valign="top" bgcolor="#f2f2f2">&nbsp;</td>');
		document.writeln('		</tr>');
		document.writeln('		</table>');
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('<tr>');
		document.writeln('	<td height="116">');
		document.writeln('<div id="flashFooter" style="z-index:2">footer flash</div>');
		//var so = new SWFObject(domain_url+langFolder+"swf/hkdc_footer.swf?path="+domain_url+"/&lang="+swflang, "footer", "100%", "100%", "8","#FFFFFF");
		var so = new SWFObject(domain_url+"/swf/hkdc_footer.swf?path="+domain_url+"/&lang="+swflang, "footer", "100%", "100%", "8","#FFFFFF");
		so.addParam("allowScriptAccess", "always");
		so.addParam("allowFullScreen", "true");
		so.addParam("menu", "false");
		so.write("flashFooter");
		document.writeln('	</td>');
		document.writeln('</tr>');
		document.writeln('</table>');
		}
	}//check not textonly version
}

function isArrayContain(sLink) {
	for (var i in SubLink[selectedSection]){
		if (SubLink[selectedSection][i].indexOf(sLink)!=-1) {
			return true;
		}
	}
	return false;
}


function getSubSectionList() {
	var scriptBuffer;
	var bulletPath;
	bulletPath = 'images/bullet_1.gif';
	
	scriptBuffer = '';
	scriptBuffer+='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
	if (selectedSubSection==0){
		for (i=1; i<SubLink[selectedSection].length;i++ ) {
			scriptBuffer+='<tr>';
			scriptBuffer+='<td width="10%" align="right" valign="top"><img src="'+bulletPath+'" border=0 align=middle alt="*">&nbsp;&nbsp;&nbsp;</td>';
			scriptBuffer+='<td width="90%" align="left" valign="top"><a href="'+SubLink[selectedSection][i]+'">'+subTitle[selectedSection+1][i]+'</a><br><br></td>';
			scriptBuffer+='</tr>';
		}
	} else {
		for (i=1; i<SubLink2[selectedSection][selectedSubSection].length;i++ ) {
			scriptBuffer+='<tr>';
			scriptBuffer+='<td width="10%" align="right" valign="top"><img src="'+bulletPath+'" border=0 align=middle alt="*">&nbsp;&nbsp;&nbsp;</td>';
			scriptBuffer+='<td width="90%" align="left" valign="top"><a href="'+SubLink2[selectedSection][selectedSubSection][i]+'">'+subSubTitle[selectedSection+1][selectedSubSection][i]+'</a><br><Br></td>';
			scriptBuffer+='</tr>';
		}
	}
	scriptBuffer+='</table>';
	return scriptBuffer;
}


function externalLink(url)
{
	if (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=760,height=580')");
		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=800,height=300')");
	if ( nw.focus != null)
	{nw.focus();}
}

function setVistorTopPos(){
	if(!isNS4){
		document.getElementById('rightMenuTop').style.visibility = "visible";
		document.getElementById('rightMenuTop').style.left=getDim(document.images.ptest).x;
	}
}

function changeSubBg(obj){
}

function restoreSubBg(obj){
}


function changeSubSubBg(obj){
}

function restoreSubSubBg(obj){
}

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

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

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

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

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function PopWin(url, x, y, w, h){
	url = domain_url + url;
    eval("popup0 = window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,pageXOffset=300,pageYOffset=500,top=" + y + ",left=" + x +",width=" + w + ",height=" + h + "')");
        if ( popup0.focus != null){
        popup0.focus();
    }
}

function customPreload(pageType){
	if(pageType==0)
		MM_preloadImages('images/spacer.gif','images/spacer_over.gif','images/nav_sub_Line.gif','images/nav_sub_Line_over.gif','images/top_view.jpg','images/btn_01.gif' ,'images/btn_01_over.gif' ,'images/btn_02.gif' ,'images/btn_02_over.gif' ,'images/btn_03.gif' ,'images/btn_03_over.gif' ,'images/btn_04.gif' ,'images/btn_04_over.gif' ,'images/btn_05.gif' ,'images/btn_05_over.gif' ,'images/btn_06.gif' ,'images/btn_06_over.gif' ,'images/btn_07.gif' ,'images/btn_07_over.gif' ,'images/btn_08.gif' ,'images/btn_08_over.gif' ,'images/btn_09.gif' ,'images/btn_09_over.gif' ,'images/btn_10.gif' ,'images/btn_10_over.gif' ,'images/btn_11.gif' ,'images/btn_11_over.gif' ,'images/btn_12.gif' ,'images/btn_12_over.gif',"btn_gotoTop.gif","btn_gotoTop_over.gif","btn_logIn.gif","btn_logIn_over.gif","btn_next.gif","btn_next_over.gif","btn_previous.gif","btn_previous_over.gif","btn_signUp.gif","btn_signUp_over.gif","btn_visit.gif","btn_visit_over.gif","btn_visit_top.gif","key_pix_01.gif","key_pix_01.jpg","key_pix_01_over.gif","key_pix_01_over.jpg","title_pop_R_On.gif","title_pop_R.gif","title_key_R.gif","title_key_R_On.gif","title_highlight_bg.gif","sub_title_R.gif","subHead_bg_01.gif","subHead_bg_02.gif","subHead_pix_top.gif","sub_title_bg.gif","stat_low.gif","sub_R.gif","stat_bgR.gif","stat_bgL.gif","smal_low_L.gif","smal_low_R.gif","RSS.gif","reg_right.jpg","regist_bgL.gif","reg_left.jpg","regist_bgR.gif","new.gif")
	else	
		MM_preloadImages('images/spacer.gif','images/spacer_over.gif','images/nav_sub_Line.gif','images/nav_sub_Line_over.gif','images/top_view.jpg','images/btn_01.gif' ,'images/btn_01_over.gif' ,'images/btn_02.gif' ,'images/btn_02_over.gif' ,'images/btn_03.gif' ,'images/btn_03_over.gif' ,'images/btn_04.gif' ,'images/btn_04_over.gif' ,'images/btn_05.gif' ,'images/btn_05_over.gif' ,'images/btn_06.gif' ,'images/btn_06_over.gif' ,'images/btn_07.gif' ,'images/btn_07_over.gif' ,'images/btn_08.gif' ,'images/btn_08_over.gif' ,'images/btn_09.gif' ,'images/btn_09_over.gif' ,'images/btn_10.gif' ,'images/btn_10_over.gif' ,'images/btn_11.gif' ,'images/btn_11_over.gif' ,'images/btn_12.gif' ,'images/btn_12_over.gif');
}


function genRightSpacer(){
	document.write('<img src="images/spacer.gif" width="8">');
}

//print style sheet

if(document.URL.toString().search('/en/')!=-1)
	var css_file='format_en.css';
else if(document.URL.toString().search('/tc/')!=-1)
	var css_file='format_tc.css';
else if(document.URL.toString().search('/sc/')!=-1)
	var css_file='format_sc.css';
else 
	var css_file='format_en.css';

document.writeln('<link href="'+domain_url+'/css/'+css_file+'" rel="stylesheet" type="text/css">');
/*
if(document.URL.toString().search('/text/')!=-1){
	document.writeln('<link href="../../../css/'+css_file+'" rel="stylesheet" type="text/css">');
}else{
	document.writeln('<link href="../../css/'+css_file+'" rel="stylesheet" type="text/css">');
} 
*/
function newlink(abc){
	
	tlink=abc.replace("javascript:externalLink('", "")
	externalLink(tlink.replace("')", ""));
}

function newSize(width,height) {
	//alert(width+":"+height);
    if(document.all && !document.getElementById) {
      document.all['flashcontent'].style.pixelWidth = width;
      document.all['flashcontent'].style.pixelHeight = height;
    }else{
        document.getElementById('flashcontent').style.width = width;
        document.getElementById('flashcontent').style.height = height;
    }
}
function resizeHandle(dwidth,dheight) {
		var pageX = (document.all)?document.body.offsetWidth:window.innerWidth;
		var pageY = (document.all)?document.body.offsetHeight:window.innerHeight;
		if(pageX<dwidth && pageY>dheight){
			newSize(dwidth,"100%");
			document.body.scroll="yes";
		}else if(pageX>dwidth && pageY<dheight){
			newSize("100%",dheight);
			document.body.scroll="yes";
		}else if(pageX<dwidth && pageY<dheight){
			newSize(dwidth,dheight);
			document.body.scroll="yes";
		}else{
			newSize("100%","100%");
			document.body.scroll="no";
		}
}


function whichBrs() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("staroffice") != -1) return 'Star Office';
	if (agt.indexOf("webtv") != -1) return 'WebTV';
	if (agt.indexOf("beonex") != -1) return 'Beonex';
	if (agt.indexOf("chimera") != -1) return 'Chimera';
	if (agt.indexOf("netpositive") != -1) return 'NetPositive';
	if (agt.indexOf("phoenix") != -1) return 'Phoenix';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("skipstone") != -1) return 'SkipStone';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) {
	if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
	return navigator.userAgent.substr(0,agt.indexOf('\/'));}
	else return 'Netscape';} else if (agt.indexOf(' ') != -1)
	return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;
}

function callbackTopFlash(){
//alert('top')
	thisMovie("topFlash").updateTop();
}
function callbackFooterFlash(){
//	alert('footer')
	thisMovie("footer").updateFooter();
}
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}