/********************* Variable defined for switch language *********************/
var langNo = 1;
if (lang=="eng"){langNo=1}else{langNo=2}	// 1= Eng, 2 = TC or SC
/********************* End of Variable defined for switch language *********************/

var errorMsg="The search function is under maintenance.  We are sorry for the inconvenience caused.";
if (langNo==2){errorMsg="現 正 維 修 搜 尋 功 能。 不 便 之 處 , 敬 請 原 諒。";}

/********************* Variable defined for generate the page title *********************/
var arPageTitle = new Array()
	arPageTitle[1] = new Array()
	arPageTitle[1][1] = "Travel Agents Registry"	//Main page title for ENG version

	arPageTitle[2] = new Array()
	arPageTitle[2][1] = "旅 行 代 理 商 註 冊 處"	//Main page title for TC and SC version
/********************* End of Variable defined for generate the page title *********************/

/********************* Variable defined for generate the CLF top menu *********************/
var arClfTopMenu = new Array()
	arClfTopMenu[1] = new Array()
	arClfTopMenu[1][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[1][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[1][21] = "en";
	arClfTopMenu[1][22] = "iso-8859-1";
	arClfTopMenu[1][3] = "Travel Agents Registry, The Government of the Hong Kong  Special Administrative Region";
	arClfTopMenu[1][4] = "7";
	arClfTopMenu[1][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/eindex.htm";
	arClfTopMenu[1][6] = "Brand Hong Kong";
	arClfTopMenu[1][7] = "GovHK";
	arClfTopMenu[1][8] = "/eng/";
	arClfTopMenu[1][9] = "/text/eng/";
	arClfTopMenu[1][10] = "Text Only";
	arClfTopMenu[1][11] = "/eng/";
	arClfTopMenu[1][12] = "/chi/";
	arClfTopMenu[1][13] = "Traditional Chinese";
	arClfTopMenu[1][14] = "/eng/";
	arClfTopMenu[1][15] = "/sc/";
	arClfTopMenu[1][16] = "Simplified Chinese";
	arClfTopMenu[1][17] = "Search";
	arClfTopMenu[1][18] = "Site Map";
	arClfTopMenu[1][19] = "Contact Us";
	arClfTopMenu[1][20] = "ht"+"tp://www.gov.hk/en/residents/";

	arClfTopMenu[2] = new Array()
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[2][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[2][21] = "zh-hk";
	arClfTopMenu[2][22] = "big5";
	arClfTopMenu[2][3] = "香 港 特 別 行 政 區 - 旅 行 代 理 商 註 冊 處";
	arClfTopMenu[2][4] = "12";
	arClfTopMenu[2][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/index.htm";
	arClfTopMenu[2][6] = "香 港 品 牌 形 象";
	arClfTopMenu[2][7] = "香 港 政 府 一 站 通";
	arClfTopMenu[2][8] = "/chi/";
	arClfTopMenu[2][9] = "/text/chi/";
	arClfTopMenu[2][10] = "繁 體 純 文 字";
	arClfTopMenu[2][11] = "/chi/";
	arClfTopMenu[2][12] = "/sc/";
	arClfTopMenu[2][13] = "簡 體 版";
	arClfTopMenu[2][14] = "/chi/";
	arClfTopMenu[2][15] = "/eng/";
	arClfTopMenu[2][16] = "English";
	arClfTopMenu[2][17] = "搜 尋";
	arClfTopMenu[2][18] = "網 站 指 南";
	arClfTopMenu[2][19] = "聯 絡 我 們";
	arClfTopMenu[2][20] = "ht"+"tp://www.gov.hk/tc/residents/";

if(document.URL.toString().search('/sc/') != -1)
{
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[2][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[2][21] = "zh-cn";
	arClfTopMenu[2][22] = "gb2312";
	//arClfTopMenu[2][3] = "香 港 特 別 行 政 區 - 旅 行 代 理 商 註 冊 處";
	arClfTopMenu[2][4] = "6";
	arClfTopMenu[2][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/index.htm";
	//arClfTopMenu[2][6] = "香 港 品 牌 形 象";
	//arClfTopMenu[2][7] = "政 府 資 訊 中 心";
	//arClfTopMenu[2][8] = "/chi/";
	//arClfTopMenu[2][9] = "/text/chi/";
	arClfTopMenu[2][10] = "簡 體 純 文 字";
	arClfTopMenu[2][11] = "/sc/";
	arClfTopMenu[2][12] = "/chi/";
	arClfTopMenu[2][13] = "繁 體 版";
	arClfTopMenu[2][14] = "/sc/";
	arClfTopMenu[2][15] = "/eng/";
	arClfTopMenu[2][16] = "English";
	//arClfTopMenu[2][17] = "搜 尋";
	//arClfTopMenu[2][18] = "網 站 地 圖";
	//arClfTopMenu[2][19] = "聯 絡 我 們";
}
/********************* End of Variable defined for generate the CLF top menu *********************/

/********************* Variable defined for generate left menu, sitemap and page title*********************/
var arMainTopicLink = new Array()	//folder name for first level sections
	arMainTopicLink[1] = upTwoLevelLink;
	arMainTopicLink[2] = upOneLevelLink+"whats/";
	arMainTopicLink[3] = upOneLevelLink+"about/";
	arMainTopicLink[4] = upOneLevelLink+"travel/";
	arMainTopicLink[5] = upOneLevelLink+"directory/";
	arMainTopicLink[6] = upOneLevelLink+"public/";
	arMainTopicLink[7] = upOneLevelLink+"electronic/";
	arMainTopicLink[8] = upOneLevelLink+"frequently/";
	arMainTopicLink[9] = upOneLevelLink+"tips/";
	arMainTopicLink[10] = upOneLevelLink+"board/";
	arMainTopicLink[11] = upOneLevelLink+"statistics/";
	arMainTopicLink[12] = upOneLevelLink+"enquiry/";
	arMainTopicLink[13] = upOneLevelLink+"links/";

var arMainTopicImage = new Array()	//image name for first level sections
	arMainTopicImage[1] = "home";
	arMainTopicImage[2] = "whats";
	arMainTopicImage[3] = "about";
	arMainTopicImage[4] = "travel";
	arMainTopicImage[5] = "directory";
	arMainTopicImage[6] = "public";
	arMainTopicImage[7] = "electronic";
	arMainTopicImage[8] = "frequently";
	arMainTopicImage[9] = "tips";
	arMainTopicImage[10] = "board";
	arMainTopicImage[11] = "statistics";
	arMainTopicImage[12] = "enquiry";
	arMainTopicImage[13] = "links";

var arMainTopicAlt = new Array()
	arMainTopicAlt[1] = new Array()
	arMainTopicAlt[1][1] = "Home";
	arMainTopicAlt[1][2] = "What's New";
	arMainTopicAlt[1][3] = "About Us";
	arMainTopicAlt[1][4] = "Travel Agents Ordinance";
	arMainTopicAlt[1][5] = "Directory of licensed travel agents";
	arMainTopicAlt[1][6] = "Public Forms";
	arMainTopicAlt[1][7] = "Electronic Services";
	arMainTopicAlt[1][8] = "Frequently Asked Questions";
	arMainTopicAlt[1][9] = "Tips for travellers";
	arMainTopicAlt[1][10] = "Board and Committee";
	arMainTopicAlt[1][11] = "Statistics";
	arMainTopicAlt[1][12] = "Enquiry";
	arMainTopicAlt[1][13] = "Links";

	arMainTopicAlt[2] = new Array()
	arMainTopicAlt[2][1] = "主 頁";
	arMainTopicAlt[2][2] = "最 新 消 息";
	arMainTopicAlt[2][3] = "關 於 我 們";
	arMainTopicAlt[2][4] = "旅 行 代 理 商 條 例";
	arMainTopicAlt[2][5] = "持 牌 旅 行 代 理 商 名 冊";
	arMainTopicAlt[2][6] = "公 用 表 格";
	arMainTopicAlt[2][7] = "電 子 服 務";
	arMainTopicAlt[2][8] = "常 見 問 題";
	arMainTopicAlt[2][9] = "旅 客 錦 囊";
	arMainTopicAlt[2][10] = "委 員 會";
	arMainTopicAlt[2][11] = "統 計 數 字";
	arMainTopicAlt[2][12] = "查 詢";
	arMainTopicAlt[2][13] = "相 關 網 址";

var arOtherTopicLink = new Array()	//folder name for first level sections but not include in the left menu
	arOtherTopicLink[1] = upOneLevelLink+"site/";
	arOtherTopicLink[2] = upOneLevelLink+"important/";
	arOtherTopicLink[3] = upOneLevelLink+"search/";

var arOtherTopicImage = new Array()	//image name for first level sections but not include in the left menu
	arOtherTopicImage[1] = "site";
	arOtherTopicImage[2] = "important";
	arOtherTopicImage[3] = "search";

var arOtherTopicAlt = new Array()	//Alt text for first level sections but not include in the left menu
	arOtherTopicAlt[1] = new Array()
	arOtherTopicAlt[1][1] = "Site Map";
	arOtherTopicAlt[1][2] = "Important Notices";
	arOtherTopicAlt[1][3] = "Search";

	arOtherTopicAlt[2] = new Array()
	arOtherTopicAlt[2][1] = "網 站 地 圖";
	arOtherTopicAlt[2][2] = "重 要 啟 示";
	arOtherTopicAlt[2][3] = "搜 尋";

if (mainTopicNo != 0){mainTopic = leftMenuCommonImageName+arMainTopicImage[mainTopicNo];}

/********************* End of Variable defined for generate left menu, sitemap and page title*********************/

/********************* Variable defined for generate Second level left menu, sitemap and page sub-title*********************/
var arSubTopicLink = new Array()	//html file name for second level sections
	arSubTopicLink[3] = new Array()
	arSubTopicLink[3][1] = "index.html";
	arSubTopicLink[3][2] = "organisation.html";
	arSubTopicLink[3][3] = "vision.html";
	arSubTopicLink[3][4] = "major.html";
	arSubTopicLink[3][5] = "performance.html";

	arSubTopicLink[4] = new Array()
	arSubTopicLink[4][1] = "index.html";
	arSubTopicLink[4][2] = "highlights.html";

	arSubTopicLink[8] = new Array()
	arSubTopicLink[8][1] = "index.html";
	arSubTopicLink[8][2] = "after.html";
	arSubTopicLink[8][3] = "fee.html";

	arSubTopicLink[9] = new Array()
	arSubTopicLink[9][1] = "index.html";
	arSubTopicLink[9][2] = "inbound.html";

	arSubTopicLink[10] = new Array()
	arSubTopicLink[10][1] = "index.html";
	arSubTopicLink[10][2] = "fund.html";

	arSubTopicLink[13] = new Array()
	arSubTopicLink[13][1] = "index.html";
	arSubTopicLink[13][2] = "relateds.html";

var arSubTopicImage = new Array()	//image name for second level sections
	arSubTopicImage[3] = new Array()
	arSubTopicImage[3][1] = "welcome";
	arSubTopicImage[3][2] = "organisation";
	arSubTopicImage[3][3] = "vision";
	arSubTopicImage[3][4] = "major";
	arSubTopicImage[3][5] = "performance";

	arSubTopicImage[4] = new Array()
	arSubTopicImage[4][1] = "introduction";
	arSubTopicImage[4][2] = "highlights";

	arSubTopicImage[8] = new Array()
	arSubTopicImage[8][1] = "new";
	arSubTopicImage[8][2] = "after";
	arSubTopicImage[8][3] = "fee";

	arSubTopicImage[9] = new Array()
	arSubTopicImage[9][1] = "outbound";
	arSubTopicImage[9][2] = "inbound";

	arSubTopicImage[10] = new Array()
	arSubTopicImage[10][1] = "advisory";
	arSubTopicImage[10][2] = "fund";

	arSubTopicImage[13] = new Array()
	arSubTopicImage[13][1] = "relatedg";
	arSubTopicImage[13][2] = "relateds";

var arSubTopicAlt = new Array()	//Alt text for second level sections
	arSubTopicAlt[1] = new Array()
	arSubTopicAlt[1][3] = new Array()
	arSubTopicAlt[1][3][1] = "Welcome Message";
	arSubTopicAlt[1][3][2] = "Organisation";
	arSubTopicAlt[1][3][3] = "Vision, Mission and Values";
	arSubTopicAlt[1][3][4] = "Major Functions";
	arSubTopicAlt[1][3][5] = "Performance Pledges";

	arSubTopicAlt[1][4] = new Array()
	arSubTopicAlt[1][4][1] = "Introduction";
	arSubTopicAlt[1][4][2] = "Highlights of the TAO";

	arSubTopicAlt[1][8] = new Array()
	arSubTopicAlt[1][8][1] = "New Application for a Travel Agents Licence";
	arSubTopicAlt[1][8][2] = "After granting a travel agents licence";
	arSubTopicAlt[1][8][3] = "Fee Schedule";

	arSubTopicAlt[1][9] = new Array()
	arSubTopicAlt[1][9][1] = "Travel Protection when Travelling Outside Hong Kong";
	arSubTopicAlt[1][9][2] = "Protection for Inbound Visitors";

	arSubTopicAlt[1][10] = new Array()
	arSubTopicAlt[1][10][1] = "Advisory Committee on Travel Agents";
	arSubTopicAlt[1][10][2] = "Travel Industry Compensation Fund Management Board";

	arSubTopicAlt[1][13] = new Array()
	arSubTopicAlt[1][13][1] = "Related Govt Depts / Bureaux / Organisations";
	arSubTopicAlt[1][13][2] = "Related Sites";

	arSubTopicAlt[2] = new Array()
	arSubTopicAlt[2][3] = new Array()
	arSubTopicAlt[2][3][1] = "歡 迎 辭";
	arSubTopicAlt[2][3][2] = "組 織 結 構";
	arSubTopicAlt[2][3][3] = "宗 旨 、 工 作 目 標 及 信 念";
	arSubTopicAlt[2][3][4] = "主 要 職 能";
	arSubTopicAlt[2][3][5] = "服 務 承 諾";

	arSubTopicAlt[2][4] = new Array()
	arSubTopicAlt[2][4][1] = "引 言";
	arSubTopicAlt[2][4][2] = "旅 行 代 理 商 條 例 要 點";

	arSubTopicAlt[2][8] = new Array()
	arSubTopicAlt[2][8][1] = "新 申 請 旅 行 代 理 商 牌 照";
	arSubTopicAlt[2][8][2] = "成 為 旅 行 代 理 商 持 牌 人 後 的 事 宜";
	arSubTopicAlt[2][8][3] = "收 費 表";

	arSubTopicAlt[2][9] = new Array()
	arSubTopicAlt[2][9][1] = "外 遊 旅 客 的 保 障";
	arSubTopicAlt[2][9][2] = "到 港 旅 客 可 得 的 保 障";

	arSubTopicAlt[2][10] = new Array()
	arSubTopicAlt[2][10][1] = "旅 行 代 理 商 諮 詢 委 員 會";
	arSubTopicAlt[2][10][2] = "旅 遊 業 賠 償 基 金 管 理 委 員 會";

	arSubTopicAlt[2][13] = new Array()
	arSubTopicAlt[2][13][1] = "相 關 政 府 部 門 / 機 構";
	arSubTopicAlt[2][13][2] = "相 關 網 站";
/********************* End of Variable defined for generate Second level left menu, sitemap and page sub-title*********************/

/********************* Variable defined for generate footer menu*********************/
var arFooter = new Array()
	arFooter[1] = new Array()
	arFooter[1][1] = "Important Notices";
	arFooter[1][2] = "Last revision date:";
	arFooter[1][3] = "12 February 2010";	//last modified date for whole site in English version except Directory of licensed travel agents
	arFooter[1][4] = "Back To Top";

	arFooter[2] = new Array()
	arFooter[2][1] = "重 要 告 示";
	arFooter[2][2] = "最 新 修 訂 日 期 : ";
	arFooter[2][3] = "2010 年 2 月 12 日";	//last modified date for whole site in TC and SC version except Directory of licensed travel agents
	arFooter[2][4] = "返 回 頁 首";
/********************* End of Variable defined for generate footer menu*********************/

/********************* Variable defined for store the name of layer*********************/
var arLayer = new Array()
/********************* End if Variable defined for store the name of layer*********************/

/********************* Function for generate the CLF top menu*********************/
function clfTopMenu()
{

document.writeln('<form name="form1" method="get" action="'+arClfTopMenu[langNo][1]+'">');
document.writeln('<input type="hidden" name="ui_lang" value="'+arClfTopMenu[langNo][21]+'">');
document.writeln('<input type="hidden" name="ui_charset" value="'+arClfTopMenu[langNo][22]+'">');
document.writeln('<input type="hidden" name="gp0" value="tar_home">');
document.writeln('<input type="hidden" name="gp1" value="tar_home">');
document.writeln('<input type="hidden" name="web" value="this">');
document.writeln('<input type="hidden" name="tpl_id" value="stdsearch">');
document.writeln('<table width="760" border="0" height="87" cellpadding="0" cellspacing="0" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif">');
document.writeln('    <tr align="left" valign="top">');
document.writeln('      <td height="66" colspan="6" class="sidebar" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="'+upTwoLevelLink+'index.html">');
document.writeln('		<img src="'+upOneLevelLink+imagePath+'/logo.gif" alt="'+arClfTopMenu[langNo][3]+'"  border="0" ></a></td>');
document.writeln('      <td height="19" colspan="4" align="right" valign="top" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="http://www.brandhk.gov.hk/brandhk/eindex.htm" target="_top"><img src="'+upOneLevelLink+imagePath+'/brandhk.gif" alt="'+arClfTopMenu[langNo][6]+'" name="BrandHK" border="0" align="top"></a></td>');
document.writeln('    </tr>');
document.writeln('    <tr align="left" valign="bottom">');
document.writeln('      <td width="170" height="20" align="left" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#BB3333">');
if (arClfTopMenu[langNo][14]=="/gb/"){
	document.writeln('		<a href="ht'+'tp://sc.info.gov.hk/TuniS/www.gov.hk/tc/residents/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')" target="_blank"><img name="mainbar1" src="'+upOneLevelLink+imagePath+'/mainbar1.gif"  border="0" alt="'+arClfTopMenu[langNo][7]+'""></a></td>');
}else{
	document.writeln('		<a href="'+arClfTopMenu[langNo][20]+'" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')" target="_blank"><img name="mainbar1" src="'+upOneLevelLink+imagePath+'/mainbar1.gif"  border="0" alt="'+arClfTopMenu[langNo][7]+'""></a></td>');
}
document.writeln('      <td width="67" height="19" align="left"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][8]+'\',\''+arClfTopMenu[langNo][9]+'\')" onMouseOut="outTopMenu(\'mainbar2\')" onMouseOver="overTopMenu(\'mainbar2\')"><img name="mainbar2" src="'+upOneLevelLink+imagePath+'/mainbar2.gif"  border="0" alt="'+arClfTopMenu[langNo][10]+'"></a></td>');
document.writeln('      <td width="40" height="19" align="left"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][11]+'\',\''+arClfTopMenu[langNo][12]+'\')" onMouseOut="outTopMenu(\'mainbar3\')" onMouseOver="overTopMenu(\'mainbar3\')"><img name="mainbar3" src="'+upOneLevelLink+imagePath+'/mainbar3.gif"  border="0" alt="'+arClfTopMenu[langNo][13]+'"></a></td>');
document.writeln('      <td width="50" height="19" align="left"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][14]+'\',\''+arClfTopMenu[langNo][15]+'\')" onMouseOut="outTopMenu(\'mainbar4\')" onMouseOver="overTopMenu(\'mainbar4\')"><img name="mainbar4" src="'+upOneLevelLink+imagePath+'/mainbar4.gif"  border="0" alt="'+arClfTopMenu[langNo][16]+'"></a></td>');
document.writeln('      <td width="141" height="20" align="left"><img name="mainbar5" src="'+upOneLevelLink+imagePath+'/mainbar5.gif"  border="0"></td>');
document.writeln('      <td width="54" height="19" align="left" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="javascript:form1.submit()" onMouseOut="outTopMenu(\'mainbar6\')" onMouseOver="overTopMenu(\'mainbar6\')"><img name="mainbar6" src="'+upOneLevelLink+imagePath+'/mainbar6.gif" border="0" alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
document.writeln('      <td align="right" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif">');
document.writeln('      <input type="text" name="query" size="'+arClfTopMenu[langNo][4]+'" class="search_box">');
document.writeln('     </td>');
document.writeln('      <td align="right" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="javascript:form1.submit()" onMouseOut="outTopMenu(\'mainbar8\')" onMouseOver="overTopMenu(\'mainbar8\')"><img name="mainbar8" src="'+upOneLevelLink+imagePath+'/mainbar8.gif"  border="0"  alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
document.writeln('      <td align="right" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="'+upOneLevelLink+'site/index.html" onMouseOut="outTopMenu(\'mainbar9\')" onMouseOver="overTopMenu(\'mainbar9\')"><img name="mainbar9" src="'+upOneLevelLink+imagePath+'/mainbar9.gif"  border="0"  alt="'+arClfTopMenu[langNo][18]+'"></a></td>');
document.writeln('      <td align="right" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif"><a href="mailto:targr@cedb.gov.hk" onMouseOut="outTopMenu(\'mainbar10\')" onMouseOver="overTopMenu(\'mainbar10\')"><img src="'+upOneLevelLink+imagePath+'/mainbar10.gif"  alt="'+arClfTopMenu[langNo][19]+'" name="mainbar10"  border="0" align="bottom"></a></td>');
document.writeln('    </tr>');
document.writeln('    <tr align="left" valign="top" bgcolor="#BB3333">');
document.writeln('      <td height="2" colspan="10" bgcolor="#BB3333"><img src="'+upOneLevelLink+imagePath+'/reddot.gif" width="1" height="1"></td>');
document.writeln('    </tr>');
document.writeln('</form>');
document.writeln('</table>');



/*
	document.writeln('<table width="100%" border="1" cellpadding="0" cellspacing="0">');
	document.writeln('<form name="form1" method="get" action="'+arClfTopMenu[langNo][1]+'">');
	document.writeln('	<INPUT name=mode type=hidden value='+arClfTopMenu[langNo][2]+'>');
	document.writeln('  <INPUT name=la type=hidden value=1>');
	document.writeln('  <INPUT name=gr_1 type=hidden value="tar">');
	document.writeln('	<INPUT name=ma type=hidden value=100>');
	document.writeln('	<INPUT name=ft_1 type=hidden value="alltype">');
	document.writeln('	<INPUT name=so type=hidden value=0>');
	document.writeln('	<INPUT name=nu type=hidden value=10>');
	document.writeln('	<INPUT name=ca type=hidden value=0>');
	document.writeln('	<INPUT name=ta type=hidden value="all">');
	document.writeln('	<INPUT name=fu type=hidden value="">');
	document.writeln('	<INPUT name=fd type=hidden value="">');
	document.writeln('	<INPUT name=demo type=hidden value="'+demo+'">');
	document.writeln('    <tr align="left" valign="top"> ');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="'+upTwoLevelLink+'index.html"><img src="'+upOneLevelLink+imagePath+'/logo.gif" border=0 alt="'+arClfTopMenu[langNo][3]+'"></a></td>');
	document.writeln('      <td rowspan="2" valign="bottom" background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" align=center bgcolor="#FAFAEB" width="99"><input type="text" name="query" size="'+arClfTopMenu[langNo][4]+'" class="search_box"></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#FAFAEB" width="22">&nbsp;</td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" colspan="2" valign="bottom" align=right bgcolor="#FAFAEB" width="97"><a href="'+arClfTopMenu[langNo][5]+'" target="_top"><img name="BrandHK" src="'+upOneLevelLink+imagePath+'/brandhk.gif" border="0" alt="'+arClfTopMenu[langNo][6]+'"></a></td>');
	document.writeln('    </tr>');
	document.writeln('	<tr align="left" valign="top"> ');
	document.writeln('	  <td><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="236"><a href="ht'+'tp://www.info.gov.hk/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')"><img name="mainbar1" src="'+upOneLevelLink+imagePath+'/mainbar1.gif" border="0" alt="'+arClfTopMenu[langNo][7]+'"></a></td>');
	document.writeln('      <td align="left" valign="top"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][8]+'\',\''+arClfTopMenu[langNo][9]+'\')" onMouseOut="outTopMenu(\'mainbar2\')" onMouseOver="overTopMenu(\'mainbar2\')"><img name="mainbar2" src="'+upOneLevelLink+imagePath+'/mainbar2.gif" border="0" alt="'+arClfTopMenu[langNo][10]+'"></a></td>');
	document.writeln('	  <td align="left" valign="top" width="56"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][11]+'\',\''+arClfTopMenu[langNo][12]+'\')" onMouseOut="outTopMenu(\'mainbar3\')" onMouseOver="overTopMenu(\'mainbar3\')"><img name="mainbar3" src="'+upOneLevelLink+imagePath+'/mainbar3.gif" border="0" alt="'+arClfTopMenu[langNo][13]+'"></a></td>');
	document.writeln('      <td align="left" valign="top" width="51"><a href="javascript:switchLang(\''+arClfTopMenu[langNo][14]+'\',\''+arClfTopMenu[langNo][15]+'\')" onMouseOut="outTopMenu(\'mainbar4\')" onMouseOver="overTopMenu(\'mainbar4\')"><img name="mainbar4" src="'+upOneLevelLink+imagePath+'/mainbar4.gif" border="0" alt="'+arClfTopMenu[langNo][16]+'"></a></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#FAFAEB" width="50"><img name="mainbar5" src="'+upOneLevelLink+imagePath+'/mainbar5.gif" border="0" alt=""></td>');
	document.writeln('	  <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#FAFAEB" width="100%"><img src="'+upOneLevelLink+imagePath+'/spacer.gif" border="0" height=1 width=10 alt=""></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="54"><a href="javascript:form1.submit()" onMouseOut="outTopMenu(\'mainbar6\')" onMouseOver="overTopMenu(\'mainbar6\')"><img name="mainbar6" src="'+upOneLevelLink+imagePath+'/mainbar6.gif" border="0" alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
	//document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="54"><a href="javascript:alert(errorMsg)" onMouseOut="outTopMenu(\'mainbar6\')" onMouseOver="overTopMenu(\'mainbar6\')"><img name="mainbar6" src="'+upOneLevelLink+imagePath+'/mainbar6.gif" border="0" alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
	document.writeln('	  </tr></table></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="22"><a href="javascript:form1.submit()" onMouseOut="outTopMenu(\'mainbar8\')" onMouseOver="overTopMenu(\'mainbar8\')"><img name="mainbar8" src="'+upOneLevelLink+imagePath+'/mainbar8.gif" border="0" alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
	//document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="22"><a href="javascript:alert(errorMsg)" onMouseOut="outTopMenu(\'mainbar8\')" onMouseOver="overTopMenu(\'mainbar8\')"><img name="mainbar8" src="'+upOneLevelLink+imagePath+'/mainbar8.gif" border="0" alt="'+arClfTopMenu[langNo][17]+'"></a></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" width="65"><a href="'+upOneLevelLink+'site/index.html" onMouseOut="outTopMenu(\'mainbar9\')" onMouseOver="overTopMenu(\'mainbar9\')"><img name="mainbar9" src="'+upOneLevelLink+imagePath+'/mainbar9.gif" border="0" alt="'+arClfTopMenu[langNo][18]+'"></a></td>');
	document.writeln('      <td background="'+upOneLevelLink+imagePath+'/bkgdtexture.gif" bgcolor="#FAFAEB" width="36"><a href="mailto:targr@edlb.gov.hk" onMouseOut="outTopMenu(\'mainbar10\')" onMouseOver="overTopMenu(\'mainbar10\')"><img name="mainbar10" src="'+upOneLevelLink+imagePath+'/mainbar10.gif" border="0" alt="'+arClfTopMenu[langNo][19]+'"></a></td>');
	document.writeln('    </tr>');
	document.writeln('    <tr align="left" valign="top" bgcolor="#BB3333"> ');
	document.writeln('      <td height=2 colspan="5"><img src="'+upOneLevelLink+imagePath+'/reddot.gif" width="1" height="1" alt="" border=0></td>');
	document.writeln('    </tr>');
	document.writeln('	</form>');
	document.writeln('</table>');*/
}
/********************* End of Function for generate the CLF top menu*********************/


/********************* Function for generate the first level left menu*********************/
function leftMenu()
{
	document.writeln('<table border="0" cellspacing="0" cellpadding="0">');
	document.writeln('<FORM ACTION=whatsnew.pl METHOD=POST name=whatsNewFormContent>');
	document.writeln('<INPUT TYPE=HIDDEN NAME=fileID VALUE="">');
	if (document.URL.toString().search('westcomzivo')!=-1){
		document.writeln('<INPUT TYPE=HIDDEN NAME=govTestSite VALUE="false">');
	}else if (document.URL.toString().search('www0')!=-1){
		document.writeln('<INPUT TYPE=HIDDEN NAME=govTestSite VALUE="true">');
	} else {
		document.writeln('<INPUT TYPE=HIDDEN NAME=govTestSite VALUE="">');
	}
	if (langNo == 1){
		document.writeln('<INPUT TYPE=HIDDEN NAME=lang VALUE="eng">');
	} else {
		document.writeln('<INPUT TYPE=HIDDEN NAME=lang VALUE="chi">');
	}
	if (document.URL.toString().search('www0')!=-1){
		document.writeln('<INPUT TYPE=HIDDEN NAME=demo VALUE="true">');
	} else {
		document.writeln('<INPUT TYPE=HIDDEN NAME=demo VALUE="">');
	}
	document.writeln('</form>');

		var govPath='<a href="ht'+'tp://www.gov.hk/tc/residents/" target="_blank">';

		if(location.href.toString().search('/gb/') != -1){
			govPath='<a href="ht'+'tp://sc.info.gov.hk/TuniS/www.gov.hk/tc/residents/" target="_blank">';
		}

		var contestPath='<a href="ht'+'tp://www.gov.hk/tc/theme/10/index.htm" target="_blank">';

		if(location.href.toString().search('/gb/') != -1){
			contestPath='<a href="ht'+'tp://sc.info.gov.hk/TuniS/www.gov.hk/tc/theme/10/index.htm" target="_blank">';
		}

		for (var i in arMainTopicImage)
		{
			document.writeln('<tr>');
			document.writeln('<td><a href="'+arMainTopicLink[i]+'index.html" onMouseOver="leftMenuMouseOver(\''+leftMenuCommonImageName+arMainTopicImage[i]+'\')" onMouseOut="leftMenuMouseOut(\''+leftMenuCommonImageName+arMainTopicImage[i]+'\')"><img src="'+upOneLevelLink+imagePath+'/'+leftMenuCommonImageName+arMainTopicImage[i]+leftMenuSectionImageOut+'" border="0" name="'+leftMenuCommonImageName+arMainTopicImage[i]+'" alt="'+arMainTopicAlt[langNo][i]+'"></a></td>');
			document.writeln('</tr>');
		}

		if (mainTopicNo == 2 && subTopic == 0 && otherTopicNo == 0 ) {
			if (langNo == 1){

				document.writeln('<tr><td align="center"><br><a href="http://www.policyaddress.gov.hk/09-10/eng/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/pre_pa0910_e_84x50.gif" alt="2009-10 Policy Address" title="2009-10 Policy Address" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.hkexpo2010.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/s_expo_e1.jpg" alt="Hong Kong at World Expo 2010" title="Hong Kong at World Expo 2010" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.budget.gov.hk/eindex.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget1011_e.gif" alt="The 2010-11 Budget" title="The 2010-11 Budget" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.gov.hk/en/residents/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/govhk.gif" alt="Linking to GovHK" title="Linking to GovHK" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="'+arMainTopicLink[2]+'5day.htm"><img src="'+upOneLevelLink+imagePath+'/5day_icon.jpg" alt="5 days week" title="5 days week" border="0"></a></td></tr>');

			} else {

				document.writeln('<tr><td align="center"><br><a href="http://www.policyaddress.gov.hk/09-10/chi/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/pre_pa0910_c_84x50.gif" alt="2009-10施政報告" title="2009-10施政報告" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.hkexpo2010.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/s_expo_c1.jpg" alt="香港在2010世傅" title="香港在2010世傅" border="0"></a></td></tr>');

				if(document.URL.toString().search('/gb/')!=-1){
				    document.writeln('<tr><td align="center"><br><a href="http://sc.info.gov.hk/TuniS/www.budget.gov.hk/2009/chi/speech.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget09-10_sc.jpg" alt="2009-10財政預算案" title="2009-10財政預算案" border="0"></a></td></tr>');
				}
				else
				{
				    document.writeln('<tr><td align="center"><br><a href="http://www.budget.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget1011_c.gif" alt="2010-11財政預算案" title="2010-11財政預算案" border="0"></a></td></tr>');
				}

				if(document.URL.toString().search('/gb/')!=-1){
					document.writeln('<tr><td align="center"><br><a href="ht'+'tp://shopsmart.consumer.org.hk/shopsmart/cn/home.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/banner_130x63_sc.gif" alt="精明消費香港游" title="精明消費香港游" border="0"></a></td></tr>');
				}
				else
				{
					document.writeln('<tr><td align="center"><br><a href="http://shopsmart.consumer.org.hk/shopsmart/tr/home.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/banner_130x63_sc.gif" alt="精明消費香港游" title="精明消費香港游" border="0"></a></td></tr>');
				}

				document.writeln('<tr><td align="center"><br>'+govPath+'<img src="'+upOneLevelLink+imagePath+'/govhk.gif" alt="連結到「香港政府一站通」" title="連結到「香港政府一站通」" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="'+arMainTopicLink[2]+'5day.htm"><img src="'+upOneLevelLink+imagePath+'/5day_icon.jpg" alt="5日工作周" title="5日工作周" border="0"></a></td></tr>');
			}

		}else{

			if (langNo == 1){

				document.writeln('<tr><td align="center"><br><a href="http://www.policyaddress.gov.hk/09-10/eng/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/pre_pa0910_e_84x50.gif" alt="2009-10 Policy Address" title="2009-10 Policy Address" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.hkexpo2010.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/s_expo_e1.jpg" alt="Hong Kong at World Expo 2010" title="Hong Kong at World Expo 2010" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.budget.gov.hk/eindex.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget1011_e.gif" alt="The 2010-11 Budget" title="The 2010-11 Budget" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.gov.hk/en/residents/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/govhk.gif" alt="Linking to GovHK" title="Linking to GovHK" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="'+arMainTopicLink[2]+'5day.htm"><img src="'+upOneLevelLink+imagePath+'/5day_icon.jpg" alt="5 days week" title="5 days week" border="0"></a></td></tr>');

			} else {

				document.writeln('<tr><td align="center"><br><a href="http://www.policyaddress.gov.hk/09-10/chi/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/pre_pa0910_c_84x50.gif" alt="2009-10施政報告" title="2009-10施政報告" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="http://www.hkexpo2010.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/s_expo_c1.jpg" alt="香港在2010世傅" title="香港在2010世傅" border="0"></a></td></tr>');

				if(document.URL.toString().search('/gb/')!=-1){
				    document.writeln('<tr><td align="center"><br><a href="http://sc.info.gov.hk/TuniS/www.budget.gov.hk/2009/chi/speech.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget09-10_sc.jpg" alt="2009-10財政預算案" title="2009-10財政預算案" border="0"></a></td></tr>');
				}
				else
				{
				    document.writeln('<tr><td align="center"><br><a href="http://www.budget.gov.hk/" target="_blank"><img src="'+upOneLevelLink+imagePath+'/budget1011_c.gif" alt="2010-11財政預算案" title="2010-11財政預算案" border="0"></a></td></tr>');
				}

				if(document.URL.toString().search('/gb/')!=-1){
					document.writeln('<tr><td align="center"><br><a href="ht'+'tp://shopsmart.consumer.org.hk/shopsmart/cn/home.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/banner_130x63_sc.gif" alt="精明消費香港游" title="精明消費香港游" border="0"></a></td></tr>');
				}
				else
				{
				document.writeln('<tr><td align="center"><br><a href="http://shopsmart.consumer.org.hk/shopsmart/tr/home.html" target="_blank"><img src="'+upOneLevelLink+imagePath+'/banner_130x63_sc.gif" alt="精明消費香港游" title="精明消費香港游" border="0"></a></td></tr>');
				}
				document.writeln('<tr><td align="center"><br>'+govPath+'<img src="'+upOneLevelLink+imagePath+'/govhk.gif" alt="連結到「香港政府一站通」" title="連結到「香港政府一站通」" border="0"></a></td></tr>');
				document.writeln('<tr><td align="center"><br><a href="'+arMainTopicLink[2]+'5day.htm"><img src="'+upOneLevelLink+imagePath+'/5day_icon.jpg" alt="5日工作周" title="5日工作周" border="0"></a></td></tr>');
			}
		}
      document.writeln('</table>');
}
/********************* End of Function for generate the first level left menu*********************/

/********************* Function for generate the heading image for first level title*********************/
function heading()
{
	document.writeln('	  <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('		<tr align="left" valign="top"> ');
	if (mainTopicNo != 0){	document.writeln('		  <td width="100%"><img src="'+upOneLevelLink+imagePath+'/'+headingCommonImageName+arMainTopicImage[mainTopicNo]+'.gif" alt="'+arMainTopicAlt[langNo][mainTopicNo]+'"></td>');}
	else{	document.writeln('		  <td width="100%"><img src="'+upOneLevelLink+imagePath+'/'+headingCommonImageName+arOtherTopicImage[otherTopicNo]+'.gif" alt="'+arOtherTopicAlt[langNo][otherTopicNo]+'"></td>');}
	document.writeln('        </tr>');
	document.writeln('	  </table>');
}
/********************* End of Function for generate the heading image for first level title*********************/

/********************* Function for generate the second level title*********************/
function subSectionTitle()
{
	if (subTopic!="" && subTopic!=0){document.writeln('<p class="page_title">'+arSubTopicAlt[langNo][mainTopicNo][subTopic]+'</p>');}
}
/********************* End of Function for generate the second level title*********************/

/********************* Function for generate the footer*********************/
function footer()
{
	document.writeln('	  <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('        <tr align="left" valign="top"> ');
	document.writeln('          <td><img src="'+upOneLevelLink+imagePath+'/spacer.gif" width="20" height="20" alt=""></td>');
	document.writeln('          <td width="100%">');
	document.writeln('		  <table border=0 cellpadding=0 celspacing=0 width="100%">');
	document.writeln('			<tr>');
	document.writeln('				<td colspan=2><img src="'+upOneLevelLink+imagePath+'/spacer.gif" width="20" height="20" alt=""></td>');
	document.writeln('			</tr>');
	document.writeln('			<tr>');
	document.writeln('				<td colspan=2><p align="right"><img src="'+upOneLevelLink+imagePath+'/spacer.gif" alt="'+arFooter[langNo][4]+'" border="0" name="backtotopspacer" height="26" width="26"></p></td>');
	document.writeln('			</tr>');
	document.writeln('			<tr>');
	document.writeln('				<td colspan=2><img src="'+upOneLevelLink+imagePath+'/spacer.gif" width="20" height="20" alt=""></td>');
	document.writeln('			</tr>');
	document.writeln('			<tr>');
	document.writeln('				<td colspan=2 background="'+upOneLevelLink+imagePath+'/botdot3.jpg"><img src="'+upOneLevelLink+imagePath+'/botdot3.jpg" alt="" border=0></td>');
	document.writeln('			</tr>');
	document.writeln('			<tr>');
	document.writeln('				<td class="footer">2004<img src="'+upOneLevelLink+imagePath+'/copy.gif" alt="" border=0> | <a href="'+upOneLevelLink+'important/index.html" class="notices">'+arFooter[langNo][1]+'</a></td>');
	document.writeln('				<td align=right class="reDate">'+arFooter[langNo][2]+arFooter[langNo][3]+'</td>');
	document.writeln('			</tr>');
	document.writeln('			</table>');
	document.writeln('		  </td>');
	document.writeln('		  <td><img src="'+upOneLevelLink+imagePath+'/spacer.gif" width="10" height="1" alt=""></td>');
	document.writeln('        </tr>');
	document.writeln('      </table>');
}
/********************* End of Function for generate the footer*********************/

/********************* Function for generate the second level layer*********************/
function genLayer()
{

	for (var j in arMainTopicImage)
	{
		if (arSubTopicImage[j]!=null)
		{
			arLayer[arLayer.length] = leftMenuCommonImageName+arMainTopicImage[j]
			//Start Layer
			if (document.layers)
			{document.writeln('<layer name='+leftMenuCommonImageName+arMainTopicImage[j]+'_layer top=0 left=0 width=150 height=58 visibility="hide" onMouseOver="leftMenuMouseOver(\''+leftMenuCommonImageName+arMainTopicImage[j]+'\')" onMouseOut="leftMenuMouseOut(\''+leftMenuCommonImageName+arMainTopicImage[j]+'\')">');}
			else
			{document.writeln('<div id="'+leftMenuCommonImageName+arMainTopicImage[j]+'_layer" style="position:absolute; left:0; top:0; width:150; height:58; z-index:2; visibility: hidden"> ');}

			//content for Layers
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" onMouseOver="leftMenuMouseOver(\''+leftMenuCommonImageName+arMainTopicImage[j]+'\')" onMouseOut="leftMenuMouseOut(\''+leftMenuCommonImageName+arMainTopicImage[j]+'\')">');

			for (var k in arSubTopicImage[j])
			{
				document.writeln('<tr valign=top>');
				document.writeln('	<td><a href="'+arMainTopicLink[j]+arSubTopicLink[j][k]+'" onMouseOver="layerMouseOver(\''+leftMenuCommonImageName+arSubTopicImage[j][k]+'\', \''+leftMenuCommonImageName+arMainTopicImage[j]+'_layer\')" onMouseOut="layerMouseOut(\''+leftMenuCommonImageName+arSubTopicImage[j][k]+'\', \''+leftMenuCommonImageName+arMainTopicImage[j]+'_layer\')"><img src="'+upOneLevelLink+imagePath+'/layer/'+leftMenuCommonImageName+arSubTopicImage[j][k]+leftMenuSectionImageOut+'" alt="'+arSubTopicAlt[langNo][j][k]+'" border="0" name="'+leftMenuCommonImageName+arSubTopicImage[j][k]+'"></a></td>');
				document.writeln('</tr>');
			}
			document.writeln('</table>');

			//Close Layer
			if (document.layers)
			{document.writeln('</layer>');}
			else
			{document.writeln('</div>');}
		}
	}
	//Back to top layer
	var footerY, footerVisibility;
	if (document.all){footerY=getDim(document.images.backtotopspacer).y; if (footerY > 630) footerVisibility = "visible"; else footerVisibility="hidden"}
	if (document.layers){footerY=document.images.backtotopspacer.y; if (footerY > 630) footerVisibility = "true"; else footerVisibility="hide"}
	if (!document.all && document.getElementById) {footerY=document.images.backtotopspacer.y; if (footerY > 630) footerVisibility = "visible"; else footerVisibility="hidden"}
	if (document.layers)
		{document.writeln('<layer name=footer_layer top=' + footerY + ' left=734 width=26 height=26 visibility="' + footerVisibility + '">');}
	else
		{document.writeln('<div id="footer_layer" style="position:absolute; left:734; top:' + footerY + '; width:26; height:26; z-index:1; visibility: ' + footerVisibility + '"> ');}
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0"  onmouseover="MM_swapImage(\'backtotopfoot\',\'\',\''+upOneLevelLink+imagePath+'/btn_top_h.gif\',1)" onMouseOut="MM_swapImgRestore();">');
	document.writeln('<tr valign=top>');
	document.writeln('	<td><a href="#top" onmouseover="MM_swapImage(\'backtotopfoot\',\'\',\''+upOneLevelLink+imagePath+'/btn_top_h.gif\',1)" onMouseOut="MM_swapImgRestore();"><img src="'+upOneLevelLink+imagePath+'/btn_top_n.gif" alt="'+arFooter[langNo][4]+'" border="0" name="backtotopfoot" width="26" height="26"></a></p></td>');
	document.writeln('</tr>');
	document.writeln('</table>');
	if (document.layers)
		{document.writeln('</layer>');}
	else
		{document.writeln('</div>');}

	setLayerPosition()
}
/********************* Function for generate the second level layer*********************/

/********************* Function for generate the sitemap*********************/
function genSiteMap()
{
	for (var j in arMainTopicImage)
		{
			document.writeln('<p><a href="'+arMainTopicLink[j]+'index.html">'+arMainTopicAlt[langNo][j]+'</a></p>');
			if (arSubTopicImage[j]!=null)
			{
				document.writeln('<ul>');
				for (var k in arSubTopicImage[j])
				{
					document.writeln('<li><a href="'+arMainTopicLink[j]+arSubTopicLink[j][k]+'">'+arSubTopicAlt[langNo][j][k]+'</a></li>');
				}
				document.writeln('</ul>');
			}
		}
}
/********************* End of Function for generate the sitemap*********************/

/********************* Function for generate the page title*********************/
var tempTitle2 = ""

function genTitle()
{
	var tempTitle = arPageTitle[langNo][1] + " - ";
	if (mainTopicNo != 0){tempTitle += arMainTopicAlt[langNo][mainTopicNo];}
	else{tempTitle += arOtherTopicAlt[langNo][otherTopicNo];}

	if (subTopic!="" && subTopic!=0){tempTitle += " - " + arSubTopicAlt[langNo][mainTopicNo][subTopic]}
	//document.title = tempTitle;
	tempTitle2 = tempTitle

}
/********************* End of Function for generate the page title*********************/

function genLicenceRedirectForm()
{
	var tempGovKanHan = ""
	if(document.URL.toString().search('/gb/') != -1){tempGovKanHan = "sc.info.gov.hk/gb/";}

	if (demo)
	{
		if(document.URL.toString().search('test.tar.gov.hk') != -1)
		{
			document.writeln('<form name="licenseRedirectForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'test.tar.gov.hk/cgi-bin/tar/licence.pl">');
		}
		else
		{
			document.writeln('<form name="licenseRedirectForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/licence.pl">');
		}
	}
	else
	{document.writeln('<form name="licenseRedirectForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/licence.pl">');}
	document.writeln('<input type="hidden" name="lang" value="'+lang+'">');
	document.writeln('<input type="hidden" name="demo" value="'+demo+'">');
	document.writeln('<input type="hidden" name="govTestSite" value="'+govTestSite+'">');
	document.writeln('</form>');
}

function genLicenceForm()
{
	var tempGovKanHan = ""
	if(document.URL.toString().search('/gb/') != -1){tempGovKanHan = "sc.info.gov.hk/gb/";}
	if (demo)
	{
		if(document.URL.toString().search('test.tar.gov.hk') != -1)
		{
			document.writeln('<form name="licenceForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'test.tar.gov.hk/cgi-bin/tar/licencesearch.pl">');
		}
		else
		{
			document.writeln('<form name="licenceForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/licencesearch.pl">');
		}
	}
	else
	{
		document.writeln('<form name="licenceForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/licencesearch.pl">');
	}
	document.writeln('<input type="hidden" name="lang" value="'+lang+'">');
	document.writeln('<input type="hidden" name="demo" value="'+demo+'">');
	document.writeln('<input type="hidden" name="govTestSite" value="'+govTestSite+'">');
	document.writeln('<input type="hidden" name="licenceNameOrder" value="">');
}

function genSearchForm()
{
	document.writeln('<form name="searchForm" method="get" action="'+arClfTopMenu[langNo][1]+'">');
	document.writeln('	<INPUT name=mode type=hidden value='+arClfTopMenu[langNo][2]+'>');
	document.writeln('  <INPUT name=la type=hidden value=1>');
	document.writeln('  <INPUT name=gr_1 type=hidden value="tar">');
	document.writeln('	<INPUT name=ma type=hidden value=100>');
	document.writeln('	<INPUT name=ft_1 type=hidden value="alltype">');
	document.writeln('	<INPUT name=so type=hidden value=0>');
	document.writeln('	<INPUT name=nu type=hidden value=10>');
	document.writeln('	<INPUT name=ca type=hidden value=0>');
	document.writeln('	<INPUT name=ta type=hidden value="all">');
	document.writeln('	<INPUT name=fu type=hidden value="">');
	document.writeln('	<INPUT name=fd type=hidden value="">');
	document.writeln('	<INPUT name=demo type=hidden value="'+demo+'">');
}

function genWhatsNewForm()
{
	var tempGovKanHan = ""
	if(document.URL.toString().search('/gb/') != -1){tempGovKanHan = "sc.info.gov.hk/gb/";}

	if (demo)
	{
		if(document.URL.toString().search('test.tar.gov.hk') != -1)
		{
			document.writeln('<form name="whatsNewForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'test.tar.gov.hk/cgi-bin/tar/whatsnew.pl">');
		}
		else
		{
			document.writeln('<form name="whatsNewForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/whatsnew.pl">');
		}
	}
	else
	{document.writeln('<form name="whatsNewForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/whatsnew.pl">');}
	document.writeln('<input type="hidden" name="lang" value="'+lang+'">');
	document.writeln('<input type="hidden" name="demo" value="'+demo+'">');
	document.writeln('<input type="hidden" name="govTestSite" value="'+govTestSite+'">');
	document.writeln('</form>');
}

/********************* Function for set the layer position*********************/
function setLayerPosition()
{
	for (var i in arLayer)
	{
			 if (document.all){moveDivs(document.all[arLayer[i]+"_layer"].style, getDim(document.images[arLayer[i]]).y);}
			 if (document.layers){moveDivs(document.layers[arLayer[i]+"_layer"], document.images[arLayer[i]].y);}
			 if (!document.all && document.getElementById) {moveDivs(document.getElementById(arLayer[i]+"_layer").style, document.images[arLayer[i]].y);}
	}
}
/********************* End of Function for set the l;ayer position*********************/

function preload_image() {

	if ( document.images ){
		var preload = new Array()
		preload[0] = upOneLevelLink+imagePath+"/mainbar1_f2.gif";
		preload[1] = upOneLevelLink+imagePath+"/mainbar2_f2.gif";
		preload[2] = upOneLevelLink+imagePath+"/mainbar3_f2.gif";
		preload[3] = upOneLevelLink+imagePath+"/mainbar4_f2.gif";
		preload[4] = upOneLevelLink+imagePath+"/mainbar5_f2.gif";
		preload[5] = upOneLevelLink+imagePath+"/mainbar6_f2.gif";
		preload[6] = upOneLevelLink+imagePath+"/mainbar8_f2.gif";
		preload[7] = upOneLevelLink+imagePath+"/mainbar9_f2.gif";
		preload[8] = upOneLevelLink+imagePath+"/mainbar10_f2.gif";
		preload[9] = upOneLevelLink+imagePath+"/btn_top_h.gif";
		preload[10] = upOneLevelLink+imagePath+"/btn_back_h.gif";
		preload[11] = upOneLevelLink+imagePath+"/btn_next_h.gif";
		preload[12] = upOneLevelLink+imagePath+"/btn_backtosearch_h.gif";
		preload[13] = upOneLevelLink+imagePath+"/btn_submit_n.gif";

		var jCounter = preload.length
		for (var j in arMainTopicImage)
		{
			preload[jCounter] = upOneLevelLink+imagePath+"/"+leftMenuCommonImageName+arMainTopicImage[j]+leftMenuSectionImageOver
			jCounter = jCounter + 1
			if (arSubTopicImage[j]!=null)
			{
				for (var k in arSubTopicImage[j])
				{
					preload[jCounter] = upOneLevelLink+imagePath+"/"+leftMenuCommonImageName+arSubTopicImage[j][k]+leftMenuSectionImageOver
					jCounter = jCounter + 1
				}
			}
		}

		for ( var i in preload ){
			var I = new Image();
			I.src = preload[i];
			preload[i] = I
		}

		if (!document.all&&document.getElementById){setLayerPosition();genTitle();}
		if (document.all){setLayerPosition();genTitle();}
		if (document.layers){setLayerPosition();genTitle();}
	}
}

