var langNo = 1;
if (lang=="eng"){langNo=1}else{langNo=2}

var errorMsg="The search function is under maintenance.  We are sorry for the inconvenience caused.";
if (langNo==2){errorMsg="現 正 維 修 搜 尋 功 能。 不 便 之 處 , 敬 請 原 諒。";}

var arMainTopicLink = new Array()
	arMainTopicLink[1] = upThreeLevelLink;
	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()
	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 arOtherTopicLink = new Array()
	arOtherTopicLink[1] = upOneLevelLink+"site/";
	arOtherTopicLink[2] = upOneLevelLink+"important/";
	arOtherTopicLink[3] = upOneLevelLink+"search/";

var arOtherTopicImage = new Array()
	arOtherTopicImage[1] = "site";
	arOtherTopicImage[2] = "important";
	arOtherTopicImage[3] = "search";

var arOtherTopicAlt = new Array()
	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];}

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 arClfTopMenu = new Array()
	arClfTopMenu[1] = new Array()
	arClfTopMenu[1][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[1][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[1][20] = "en";
	arClfTopMenu[1][21] = "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] = "Government Information Centre";
	arClfTopMenu[1][8] = "/text/eng/";
	arClfTopMenu[1][9] = "/eng/";
	arClfTopMenu[1][10] = "Graphic Version";
	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[2] = new Array()
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[2][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[2][20] = "zh-hk";
	arClfTopMenu[2][21] = "big5";
	arClfTopMenu[2][3] = "香 港 特 別 行 政 區 - 旅 行 代 理 商 註 冊 處";
	arClfTopMenu[2][4] = "15";
	arClfTopMenu[2][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/index.htm";
	arClfTopMenu[2][6] = "香 港 品 牌 形 象";
	arClfTopMenu[2][7] = "政 府 資 訊 中 心";
	arClfTopMenu[2][8] = "/text/chi/";
	arClfTopMenu[2][9] = "/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] = "聯 絡 我 們";

if(document.URL.toString().search('/sc/') != -1)
{
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
	//arClfTopMenu[2][1] = "javascript:alert(errorMsg)";
	arClfTopMenu[2][20] = "zh-hk";
	arClfTopMenu[2][21] = "big5";
	//arClfTopMenu[2][3] = "香 港 特 別 行 政 區 - 旅 行 代 理 商 註 冊 處";
	arClfTopMenu[2][4] = "8";
	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] = "聯 絡 我 們";
}

function clfTopMenu()
{
	genTitle();

	document.writeln('<form name="form1" method="get" action="'+arClfTopMenu[langNo][1]+'">');
	document.writeln('<input type="hidden" name="ui_lang" value="'+arClfTopMenu[langNo][20]+'">');
	document.writeln('<input type="hidden" name="ui_charset" value="'+arClfTopMenu[langNo][21]+'">');
	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="txtonly" value="1">');
	document.writeln('<input type="hidden" name="tpl_id" value="stdsearch">');
	document.writeln('	<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('	<tr valign=bottom>');
	document.writeln('		<td class="lv1" width=99%>' + arClfTopMenu[langNo][3] + '</td>');
	document.writeln('		<td align=right><input type="text" name="query" size="' + arClfTopMenu[langNo][4] + '" class="search_box"></td>');
	document.writeln('		<td nowrap>&nbsp;[<a href="javascript:form1.submit()">' + arClfTopMenu[langNo][17] + '</a>]</td>');
	//document.writeln('		<td nowrap>&nbsp;[<a href="javascript:alert(errorMsg)">' + arClfTopMenu[langNo][17] + '</a>]</td>');
	document.writeln('	</tr>');
	document.writeln('	<tr>');
	document.writeln('		<td colspan=3><hr width=100%></td>');
	document.writeln('	</tr>');
	document.writeln('	<tr>');
	document.writeln('		<td colspan=3>[<a href="'+upThreeLevelLink+'index.html">' + arMainTopicAlt[langNo][1] + '</a>]&nbsp;[<a href="mailto:targr@cedb.gov.hk">' + arClfTopMenu[langNo][19] + '</a>]&nbsp;[<a href="'+upOneLevelLink+'site/index.html">' + arClfTopMenu[langNo][18] + '</a>]&nbsp;[<a href="javascript:switchLang(\''+arClfTopMenu[langNo][8]+'\',\''+arClfTopMenu[langNo][9]+'\')">'+arClfTopMenu[langNo][10]+'</a>]&nbsp;[<a href="javascript:switchLang(\''+arClfTopMenu[langNo][11]+'\',\''+arClfTopMenu[langNo][12]+'\')">'+arClfTopMenu[langNo][13]+'</a>]&nbsp;[<a href="javascript:switchLang(\''+arClfTopMenu[langNo][14]+'\',\''+arClfTopMenu[langNo][15]+'\')">' + arClfTopMenu[langNo][16] + '</a>]</td>');
	document.writeln('	</tr>');
	document.writeln('	<tr>');
	document.writeln('		<td colspan=3><hr width=100%></td>');
	document.writeln('	</tr>');
	document.writeln('</table>');
	document.writeln('</form>');

}

function heading()
{
	document.writeln('	<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td>');
	if (mainTopicNo != 0){	document.writeln('<p class="main_title">'+arMainTopicAlt[langNo][mainTopicNo]);}
	else{	document.writeln('<p class="main_title">'+arOtherTopicAlt[langNo][otherTopicNo]);}

}

function subSectionTitle()
{

	document.writeln('</td></tr>');
	document.writeln('</table>');
	document.writeln('<table border="0" cellpadding="6" cellspacing="10" width="100%">');
    document.writeln('<tr>');
    document.writeln('<td width="100%" align="left" valign="top">');
	if (subTopic!="" && subTopic!=0){document.writeln('<p class="page_title">'+arSubTopicAlt[langNo][mainTopicNo][subTopic]+'</p></td></tr><tr><td>');}
}

var arSubTopicAlt = new Array()
	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] = "相 關 網 站";

var arSubTopicLink = new Array()
	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()
	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";

function leftMenu()
{
	document.writeln('</td></tr>');
	document.writeln('</table>');

	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td><hr width="100%"></td></tr></table>');

	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td>');
	document.writeln('[<a href="#top">'+arFooter[langNo][4]+'</a>]');
	document.writeln('</td></tr></table>');

	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td><hr width="100%"></td></tr></table>');

	if (arSubTopicImage[mainTopicNo]!=null)
	{
		document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
		document.writeln('<tr><td>');
		for (var k in arSubTopicImage[mainTopicNo])
		{
			document.writeln('[<a href="'+arMainTopicLink[mainTopicNo]+arSubTopicLink[mainTopicNo][k]+'">'+arSubTopicAlt[langNo][mainTopicNo][k]+'</a>]&nbsp;');
		}
		document.writeln('</td></tr></table>');
		document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
		document.writeln('<tr><td><hr width="100%"></td></tr></table>');
	}

	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td>');
	for (var i in arMainTopicImage)
	{
		document.writeln('[<a href="'+arMainTopicLink[i]+'index.html">'+arMainTopicAlt[langNo][i]+'</a>]&nbsp;');
	}

	var govPath='ht'+'tp://www.gov.hk/tc/residents/';

	if(location.href.toString().search('/gb/') != -1){
		govPath='ht'+'tp://sc.info.gov.hk/TuniS/www.gov.hk/tc/residents/';
	}

	var contestPath='ht'+'tp://www.gov.hk/tc/theme/10/index.htm';

	if(location.href.toString().search('/gb/') != -1){
		contestPath='ht'+'tp://sc.info.gov.hk/TuniS/www.gov.hk/tc/theme/10/index.htm';
	}

	if (langNo == 1){
		document.writeln('[<a href="http://www.policyaddress.gov.hk/09-10/eng/" target="_blank">2009-10 Policy Address</a>]&nbsp;');
		document.writeln('[<a href="http://www.hkexpo2010.gov.hk/engText/index.html" target="_blank">Hong Kong Expo 2010 Shanghai</a>]&nbsp;');
		document.writeln('[<a href="http://www.budget.gov.hk/eindex.html" target="_blank">The 2010-11 Budget</a>]&nbsp;');
		document.writeln('[<a href="http://www.gov.hk/en/residents/" target="_blank">GovHK</a>]&nbsp;');
		document.writeln('[<a href="'+arMainTopicLink[2]+'5day.htm">5 day week</a>]&nbsp;');
	}else{

		document.writeln('[<a href="http://www.policyaddress.gov.hk/09-10/chi/" target="_blank">2009-10施政報告</a>]&nbsp;');

		if(document.URL.toString().search('/gb/')!=-1){
			document.writeln('[<a href="http://www.hkexpo2010.gov.hk/scText/index.html" target="_blank">香港在2010世博</a>]&nbsp;');
		}
		else
		{
			document.writeln('[<a href="http://www.hkexpo2010.gov.hk/tcText/index.html" target="_blank">香港在2010世博</a>]&nbsp;');
		}

		document.writeln('[<a href="http://www.budget.gov.hk/" target="_blank">2010-11財政預算案</a>]&nbsp;');

		if(document.URL.toString().search('/gb/')!=-1){
			document.writeln('[<a href="ht'+'tp://shopsmart.consumer.org.hk/shopsmart/cn/home.html" target="_blank">精明消費香港游</a>]&nbsp;');
		}
		else
		{
			document.writeln('[<a href="http://shopsmart.consumer.org.hk/shopsmart/tr/home.html" target="_blank">精明消費香港游</a>]&nbsp;');
		}

		document.writeln('[<a href="'+govPath+'" target="_blank">香港政府一站通</a>]&nbsp;');
		document.writeln('[<a href="'+arMainTopicLink[2]+'5day.htm">5天工作周</a>]&nbsp;');
	}
    document.writeln('</td></tr></table>');
	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td><hr width="100%"></td></tr></table>');
}


var arFooter = new Array()
	arFooter[1] = new Array()
	arFooter[1][1] = "Important Notices";
	arFooter[1][2] = "Last revision date:";
	arFooter[1][3] = "28 May 2010";
	arFooter[1][4] = "Back To Top";

	arFooter[2] = new Array()
	arFooter[2][1] = "重 要 告 示";
	arFooter[2][2] = "最 近 修 訂 日 期 : ";
	arFooter[2][3] = "2010 年 5 月 28 日";
	arFooter[2][4] = "返 回 頁 首";

function footer()
{
	document.writeln('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
	document.writeln('<tr><td>');
	document.writeln('[<a href="'+upOneLevelLink+'important/index.html">'+arFooter[langNo][1]+'</a>]&nbsp;');
	document.writeln('['+arFooter[langNo][2]+arFooter[langNo][3]+']');
	document.writeln('<br><br></td></tr></table>');
}

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>');
			}
		}
}

var arPageTitle = new Array()
	arPageTitle[1] = new Array()
	arPageTitle[1][1] = "Travel Agents Registry"

	arPageTitle[2] = new Array()
	arPageTitle[2][1] = "旅 行 代 理 商 註 冊 處"

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

}

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="tc">');
	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 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_t.pl">');
		}
		else
		{
			document.writeln('<form name="licenseRedirectForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/licence_t.pl">');
		}
	}
	else
	{document.writeln('<form name="licenseRedirectForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/licence_t.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_t.pl">');
		}
		else
		{
			document.writeln('<form name="licenceForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/licencesearch_t.pl">');
		}
	}
	else
	{
		document.writeln('<form name="licenceForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/licencesearch_t.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 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_t.pl">');
		}
		else
		{
			document.writeln('<form name="whatsNewForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www0.tar.gov.hk/cgi-bin/tar/whatsnew_t.pl">');
		}
	}
	else
	{document.writeln('<form name="whatsNewForm" method="POST" action="ht'+'tp://'+tempGovKanHan+'www.tar.gov.hk/cgi-bin/tar/whatsnew_t.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>');
}
