﻿// -------------------------------------------------------------    Link Variable Setting -----------------------------------------
var LastReviewDate = '01/08/2010';   //Date Format: MM/DD/YYYY
var LastReviewText = '最 近 覆 檢 日 期';
//Done by Alvin
var vLink = '';
var selectedSubSubSection;
var subLevelSection
var MainLink = new Array();
display_order = new Array();
display_order2 = new Array();

MainLink[0] = '/tc/about_us/welcome_message/t_welcome.htm';
MainLink[1] = '/tc/whats_new/t_whatsnew.htm';
MainLink[2] = '/tc/about_us/t_index.htm';
MainLink[3] = '/tc/publications/t_index.htm';
MainLink[4] = '/tc/access_to_information/t_index.htm';
MainLink[5] = '/tc/public_services/t_index.htm';
MainLink[6] = '/tc/public_forms/t_forms.htm';
MainLink[14] = '/tc/photoscorner/index.htm';
MainLink[7] = '/tc/tender_notices/t_tender.htm';
MainLink[8] = '/tc/job_vacancies/t_index.htm';
MainLink[9] = '/tc/links/t_index.htm';
MainLink[10] = '/tc/contact_us/t_index.htm';

var SubLink = new Array();
//Home 主頁
//What's New 最新消息
SubLink[1] = new Array();
SubLink[1][1]='/tc/whats_new/prevention/t_prevention.htm';
SubLink[1][2]='/tc/whats_new/translation/t_translation.htm';
SubLink[1][3]='/tc/whats_new/relocation/t_relocation.htm';
//About Us 關於我們
SubLink[2] = new Array();
SubLink[2][1]='/tc/about_us/welcome_message/t_welcome.htm';
SubLink[2][2]='/tc/about_us/organization/t_index.htm';
SubLink[2][3]='/tc/about_us/mission/t_mission.htm';
SubLink[2][4]='/tc/about_us/performance_pledges/t_pledge.htm';
SubLink[2][5]='/tc/about_us/statement_of_privacy_policy_and_practices/t_index.htm';
//Pulications 刊物
display_order[3] = new Array();
display_order[3][0] = 1;
display_order[3][1] = 3;
display_order[3][2] = 2;

SubLink[3] = new Array();
SubLink[3][1] = '/tc/publications/publications/t_publications.htm';
SubLink[3][2] = '/tc/publications/consultation_papers/t_consultation_papers.htm';
SubLink[3][3] = '/tc/publications/press_releases/t_press_releases.htm';

// Access to Information 公開資料
SubLink[4] = new Array();
//SubLink[4][1] = '/tc/access_to_information/t_ref.htm';
SubLink[4][1] = '/tc/access_to_information/t_code.htm';
SubLink[4][2] = '/tc/access_to_information/t_pub_con.htm';
SubLink[4][3] = '/tc/access_to_information/t_publish.htm';
SubLink[4][4] = '/tc/access_to_information/t_ref.htm';

//Public Service 公共服務
display_order[5] = new Array();
display_order[5][0] = 1;
display_order[5][1] = 2;
display_order[5][2] = 3;
display_order[5][3] = 17;
display_order[5][4] = 4;
display_order[5][5] = 15;
display_order[5][6] = 6;
display_order[5][7] = 8;
display_order[5][8] = 9;
display_order[5][9] = 16;
display_order[5][10] = 10;
display_order[5][11] = 11;
display_order[5][12] = 12;
display_order[5][13] = 13;
display_order[5][14] = 14;
//display_order[5][14] = 14;
//display_order[5][15] = 14;

SubLink[5] = new Array();
SubLink[5][1] = '/tc/public_services/building_management/t_index.htm';
SubLink[5][2] = '/tc/public_services/minor_works_programmes/t_rpis_main.htm';
SubLink[5][3] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_index.htm';
SubLink[5][4] = '/tc/public_services/local_community_economy/t_lce.htm';
//SubLink[5][5] = null;
//SubLink[5][5] = '/tc/public_services/sha_incorporated_tsunamis_relief_fund_2004/t_index.htm';
//SubLink[5][6] = '/tc/public_services/team_clean_corner/t_team_index.htm';
//SubLink[5][7] = null;
//SubLink[5][7] = '/tc/public_services/t_computer_facilities.htm';
SubLink[5][8] = '/tc/public_services/district_administration/t_admin_main.htm';
SubLink[5][9] = '/tc/public_services/community_halls_centres/t_index.htm';
SubLink[5][10] = '/tc/public_services/overseas_domestic_helpers_centres/t_helper.htm';
SubLink[5][11] = '/tc/public_services/licensing/t_lic_main.htm';
SubLink[5][12] = '/tc/public_services/emergency_services/t_index.htm';
SubLink[5][13] = '/tc/public_services/public_enquiry_services/t_enquiry_main.htm';
SubLink[5][14] = '/tc/public_services/estates/t_index.htm';
SubLink[5][15] = '/tc/public_services/en_self_reli/t_index.htm';
SubLink[5][16] = '/tc/public_services/com_clo_rec_ban_sch/t_index.htm';
//SubLink[5][17] = '/tc/public_services/tswp/t_index.htm';

//Public Forms 公用表格

//Tender Notices 招標公告
SubLink[7] = new Array();
SubLink[7][1] = '/tc/tender_notices/general/t_general.htm';
SubLink[7][2] = '/tc/tender_notices/works/t_works.htm';

//Links
SubLink[9] = new Array();
SubLink[9][1] = '/tc/links/t_links.htm';
SubLink[9][2] = '/tc/links/t_other.htm';

//Contact Us
SubLink[10] = new Array();
SubLink[10][1] = '/tc/contact_us/t_comments.htm';
SubLink[10][2] = '/file_manager/tc/documents/contact_us/comment_c.pdf'; //tc/contact_us/t_comment_c.htm';
SubLink[10][3] = '/tc/public_services/public_enquiry_services/t_ctec.htm';

var SubLink2 = new Array();
//Home 主頁
SubLink2[0] = new Array();

//What's New 最新消息
SubLink2[1] = new Array();

//About Us - Organization 關於我們 - 組織結構
SubLink2[2] = new Array();
SubLink2[2][2] = new Array();
SubLink2[2][2][1] = '/tc/about_us/organization/orgainzation_chart/t_chart.htm';
SubLink2[2][2][2] = '/tc/about_us/organization/responsibilities/t_major.htm';
//About Us - Statement of Privacy 關於我們 - 私隱政策及聲明
SubLink2[2][5] = new Array();
SubLink2[2][5][1] = '/tc/about_us/statement_of_privacy_policy_and_practices/t_gpd.htm';
//SubLink2[2][5][2] = '/file_manager/tc/documents/about_us/statement_of_privacy_policy_and_practices/privacy_c.doc';
SubLink2[2][5][2] = '/tc/about_us/statement_of_privacy_policy_and_practices/t_privacy.htm';

//Publications 刊物
SubLink2[3] = new Array();

//Access to Information 公開資料
SubLink2[4] = new Array();

//Public Services - Building Management 公共服務 - 大廈管理
display_order2[5] = new Array();
display_order2[5][1] = new Array();
display_order2[5][1][0] = 1;
display_order2[5][1][1] = 2;
display_order2[5][1][2] = 3;
display_order2[5][1][3] = 4;
display_order2[5][1][4] = 5;
display_order2[5][1][5] = 6;
display_order2[5][1][6] = 7;
display_order2[5][1][7] = 8;
display_order2[5][1][8] = 9;
display_order2[5][1][9] = 10;
display_order2[5][1][10] = 11;
display_order2[5][1][11] = 12;


SubLink2[5] = new Array();
SubLink2[5][1] = new Array();
SubLink2[5][1][1] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/policy/t_1.htm\')';
SubLink2[5][1][2] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/whats_new/t_2.htm\')';
SubLink2[5][1][3] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/legislation/t_3.htm\')';
SubLink2[5][1][4] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/formation_of_owners_corporation/t_4.htm\')';
SubLink2[5][1][5] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/financial_management_procurement_and_insurance/t_5.htm\')';
SubLink2[5][1][6] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/daily_operation_of_building_management/t_6.htm\')';
SubLink2[5][1][7] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/district_building_management_liaison_teams/t_7.htm\')';
SubLink2[5][1][8] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/publicity_and_educational_activities/t_8.htm\')';
SubLink2[5][1][9] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/publications_and_useful_links/t_9.htm\')';
SubLink2[5][1][10] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/reference_materials/t_10.htm\')';
SubLink2[5][1][11] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/comments_and_enquiry/t_11.htm\')';
SubLink2[5][1][12] = 'javascript:externalLink(\'http://www.buildingmgt.gov.hk/tc/database_of_private_buildings_in_hong_kong/t_12.htm\')';

//Public Services - Minor Work Programmes 公共服務 - 小型工程計劃
SubLink2[5][2] = new Array();
SubLink2[5][2][1] = '/tc/public_services/minor_works_programmes/t_minor_work.htm';//
SubLink2[5][2][2] = '/tc/public_services/minor_works_programmes/t_contractor.htm';//

//Public Services - Services for New Arrivals 公共服務 - 內地新來港定居人仕服務
SubLink2[5][3] = new Array();
SubLink2[5][3][1] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_arrival.htm';
SubLink2[5][3][2] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_role.htm';
SubLink2[5][3][3] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_handbook.htm';
SubLink2[5][3][4] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_surveys.htm';
SubLink2[5][3][5] = '/tc/public_services/services_for_new_arrivals_from_the_mainland/t_activity.htm';

//Public Services - Local Community Economy 公共服務 - 本土經濟
SubLink2[5][4] = new Array();

//Public Services - SHA Incorporated Tsunamis Relief Fund 2004 公共服務 - 2004民政事務局局長法團海嘯救援基金
SubLink2[5][5] = new Array();

//Public Services - Team Clean Corner 公共服務 - 全城清潔策劃小組
SubLink2[5][6] = new Array();
//Public Services - Promote Wider 公共服務 - 向市民推廣資訊科技

SubLink2[5][7] = new Array();
//SubLink2[5][7][1] = '/tc/public_services/promote_wider_use_of_it_in_the_community/t_points.htm';
//SubLink2[5][7][2] = '/tc/public_services/promote_wider_use_of_it_in_the_community/t_tor.htm';
//SubLink2[5][7][3] = 'javascript:externalLink(\'http://www.scc.gov.hk/\')';

//Public Services - District Administration 公共服務 - 地方行政
display_order2[5][8] = new Array();
display_order2[5][8][0] = 4;
display_order2[5][8][1] = 1;
display_order2[5][8][2] = 2;
display_order2[5][8][3] = 3;
display_order2[5][8][4] = 5;

SubLink2[5][8] = new Array();
SubLink2[5][8][1] = '/tc/public_services/district_administration/t_dbmain.htm';
SubLink2[5][8][2] = '/tc/public_services/district_administration/t_area.htm';
SubLink2[5][8][3] = '/tc/public_services/district_administration/t_mutual.htm';
SubLink2[5][8][4] = '/tc/public_services/district_administration/t_dis_officers.htm';
SubLink2[5][8][5] = '/tc/public_services/district_administration/t_liaison.htm';
//SubLink2[5][8][6] = 'javascript:externalLink(\'http://www.summeryouth.org.hk/\')';

//Public Services - Community Halls / Center Overseas 公共服務 - 社區會堂/中心
SubLink2[5][9] = new Array();
SubLink2[5][9][1] = '/tc/public_services/community_halls_centres/t_community.htm';
SubLink2[5][9][2] = '/tc/public_services/community_halls_centres/t_ccch.htm';

//Public Services - Domestic Helpers Centres 公共服務 - 海外家庭傭工中心
SubLink2[5][10] = new Array();

//Public Services - Licensing 公共服務 - 發牌事宜
SubLink2[5][11] = new Array();
SubLink2[5][11][1] = '/tc/public_services/licensing/t_office.htm';//
SubLink2[5][11][2] = '/tc/public_services/licensing/t_bedspace.htm';//
SubLink2[5][11][3] = '/tc/public_services/licensing/t_clubs.htm';//
SubLink2[5][11][4] = '/tc/public_services/licensing/t_hotels.htm';
SubLink2[5][11][5] = '/tc/public_services/licensing/t_karaoke.htm';

//Public Services - Emergency Services 公共服務 - 緊急支援服務
SubLink2[5][12] = new Array();
SubLink2[5][12][1] = '/tc/public_services/emergency_services/t_emergency.htm';
SubLink2[5][12][2] = '/tc/public_services/emergency_services/t_emergency.htm#1';
SubLink2[5][12][3] = '/tc/public_services/emergency_services/t_emergency.htm#2';
SubLink2[5][12][4] = '/tc/public_services/emergency_services/t_emergency.htm#3';
//SubLink2[5][12][5] = '/tc/public_services/emergency_services/t_emergency.htm#4';

//Public Services - Public Enquiry Services 公共服務 - 諮詢服務
SubLink2[5][13] = new Array();
SubLink2[5][13][1] = '/tc/public_services/public_enquiry_services/t_provided.htm';
SubLink2[5][13][2] = '/tc/public_services/public_enquiry_services/t_ctec.htm';
SubLink2[5][13][3] = '/tc/public_services/public_enquiry_services/t_faq.htm';

//Public Services - Public Enquiry Services 公共服務 - 遺產受益人支援服務
SubLink2[5][14] = new Array();
SubLink2[5][14][1] = '/tc/public_services/estates/t_intro.htm';
SubLink2[5][14][2] = '/tc/public_services/estates/t_new_power.htm';
SubLink2[5][14][3] = '/tc/public_services/estates/t_intermeddling.htm';
SubLink2[5][14][4] = '/tc/public_services/estates/t_small_estates.htm';
SubLink2[5][14][5] = '/tc/public_services/estates/t_deposit_box.htm';
SubLink2[5][14][6] = '/tc/public_services/estates/t_funeral_expenses.htm';
SubLink2[5][14][7] = '/tc/public_services/estates/t_main.htm';
SubLink2[5][14][8] = '/tc/public_services/estates/t_forms_publications.htm';
SubLink2[5][14][9] = '/tc/public_services/estates/t_faq.htm';
SubLink2[5][14][10] = '/tc/public_services/estates/t_related_sites.htm';
SubLink2[5][14][11] = '/tc/public_services/estates/t_contact_us.htm';

//Public Forms 公用表格
SubLink2[6] = new Array();

//Tender Notices 招標公告
SubLink2[7] = new Array();

SubLink2[8] = new Array();

//Links 相關網址
SubLink2[9] = new Array();
SubLink2[9][1] = '/tc/links/t_links.htm';
SubLink2[9][2] = '/tc/links/t_other.htm';

//Contact Us 聯絡我們
SubLink2[10] = new Array();
SubLink2[10][1] = '/tc/contact_us/t_comments.htm';
SubLink2[10][2] = '/file_manager/en/documents/contact_us/comment_c.pdf';//tc/contact_us/t_comment_c.htm';
SubLink2[10][1] = '/tc/public_services/public_enquiry_services/t_ctec.htm';

// -------------------------------------------------------------   End of Link Variable Setting -----------------------------------------


var title=new Array();
title[0] = "主 頁";
title[1] = "最 新 消 息";
title[2] = "關 於 我 們";
title[3] = "刊 物 及 新 聞 公 佈";
title[4] = "公 開 資 料";
title[5] = "公 共 服 務";
title[6] = "公 用 表 格";
title[14]='相 片 廊';
title[7] = "招 標 公 告";
title[8] = "職 位 空 缺";
title[9] = "相 關 網 址";
title[10] = "聯 絡 我 們";
title[11]='網 頁 指 南';
title[12]='重 要 告 示';
title[15]='私 隱 政 策';

var subTitle = new Array();
subTitle[2] = new Array();
subTitle[2][1]='預 防 非 典 型 肺 炎';
subTitle[2][2]='行 政 科 翻 譯 組 榮 獲 傑 出 顧 客 服 務 獎 (31.5.2004)';
subTitle[2][3]='中 西 區 民 政 事 務 處 諮 詢 服 務 中 心 遷 址';

subTitle[3] = new Array();
subTitle[3][1]='歡 迎 辭';
subTitle[3][2]='組 織 結 構';
subTitle[3][3]='使 命';
subTitle[3][4]='服 務 承 諾';
subTitle[3][5]='私 隱 政 策 及 實 務 聲 明';

subTitle[4] = new Array();
subTitle[4][1]='刊 物';
subTitle[4][2]='諮 詢 文 件';
subTitle[4][3]='新 聞 公 佈';

subTitle[5] = new Array();
subTitle[5][1]='公 開 資 料 守 則';
subTitle[5][2]='可 提 供 的 資 料 一 覽 表';
subTitle[5][3]='按 類 別 劃 分 的 紀 錄 一 覽 表';
subTitle[5][4]='查 閱 非 按 慣 例 公 布 的 資 料 的 程 序 及 收 費';

subTitle[6] = new Array();
subTitle[6][1]='大 廈 管 理';
subTitle[6][2]='小 型 工 程 計 劃';
subTitle[6][3]='內 地 新 來 港 定 居 人 士 服 務';
subTitle[6][4]='本 土 經 濟';
//subTitle[6][5]=null;
//subTitle[6][5]='2004 民 政 事 務 局 局 長 法 團 海 嘯 救 援 基 金';
//subTitle[6][6]='全 城 清 潔 改 善 措 施';
//subTitle[6][7]=null;
//subTitle[6][7]='公 眾 電 腦 設 施';
subTitle[6][8]='地 方 行 政';
subTitle[6][9]='社 區 會 堂 / 社 區 中 心';
subTitle[6][10]='海 外 家 庭 傭 工 中 心';
subTitle[6][11]='發 牌 事 宜';
subTitle[6][12]='緊 急 支 援 服 務';
subTitle[6][13]='諮 詢 服 務';
subTitle[6][14]='遺 產 受 益 人 支 援 服 務';
subTitle[6][15]='&quot;伙 伴 倡 自 強&quot; 社 區 協 作 計 劃';
subTitle[6][16]='社 區 舊 衣 回 收 箱 計 劃';
//subTitle[6][17]='天 水 圍 鄰 里 互 助 資 助 計 劃';

subTitle[8] = new Array();
subTitle[8][1]='一 般 招 標';
subTitle[8][2]='工 程 招 標';

subTitle[10] = new Array();
subTitle[10][1]='重 要 連 結 網 址';
subTitle[10][2]='其 他 連 結 網 址';

subTitle[11] = new Array();
subTitle[11][1]='總 署';
subTitle[11][2]='各 區 民 政 事 務 處';
subTitle[11][3]='諮 詢 服 務 中 心';

var subSubTitle = new Array();
subSubTitle[3] = new Array();
subSubTitle[3][2] = new Array();
subSubTitle[3][2][1]='組 織 結 構 圖';
subSubTitle[3][2][2]='職 責';

subSubTitle[3][5] = new Array();
subSubTitle[3][5][1]='一 般 個 人 資 料';
subSubTitle[3][5][2]='與 僱 傭 有 關 的 個 人 資 料';

subSubTitle[6] = new Array();
subSubTitle[6][1] = new Array();
subSubTitle[6][1][1]='政 策';
subSubTitle[6][1][2]='新 消 息';
subSubTitle[6][1][3]='法 例';
subSubTitle[6][1][4]='成 立 業 主 立 案 法 團';
subSubTitle[6][1][5]='財 務 管 理 、 採 購 及 保 險';
subSubTitle[6][1][6]='大 廈 管 理 日 常 運 作';
subSubTitle[6][1][7]='地 區 大 廈 管 理 聯 絡 小 組';
subSubTitle[6][1][8]='教 育 及 宣 傳 活 動';
subSubTitle[6][1][9]='刊 物 及 相 關 網 址';
subSubTitle[6][1][10]='參 考 資 料';
subSubTitle[6][1][11]='意 見 及 查 詢';
subSubTitle[6][1][12]='香 港 私 人 大 廈 電 腦 資 料 庫';

subSubTitle[6][2] = new Array();
subSubTitle[6][2][1]='小 型 工 程 計 劃';
subSubTitle[6][2][2]='民 政 事 務 總 署 認 可 承 造 商';

subSubTitle[6][3] = new Array();
subSubTitle[6][3][1]='新 來 港 人 士 服 務';
subSubTitle[6][3][2]='非 政 府 機 構';
subSubTitle[6][3][3]='服 務 指 南';
subSubTitle[6][3][4]='問 卷 調 查';
subSubTitle[6][3][5]='活 動 及 服 務 季 刊';

subSubTitle[6][5] = new Array();
subSubTitle[6][5][1]='簡 介';
subSubTitle[6][5][2]='申 請 表 格 及 申 請 須 知';
subSubTitle[6][5][3]='帳 目 報 表';

subSubTitle[6][7] = new Array();
//subSubTitle[6][7][1]='公 眾 電 腦 設 施';
//subSubTitle[6][7][2]='推 廣 婦 女 使 用 資 訊 科 技';
//subSubTitle[6][7][3]='超 級 數 碼 中 心';

subSubTitle[6][8] = new Array();
subSubTitle[6][8][1]='區 議 會';
subSubTitle[6][8][2]='分 區 委 員 會';
subSubTitle[6][8][3]='互 助 委 員 會';
subSubTitle[6][8][4]='民 政 事 務 專 員';
subSubTitle[6][8][5]='聯 絡 主 任';
//subSubTitle[6][8][6]='青 少 年 暑 期 活 動';

subSubTitle[6][9] = new Array();
subSubTitle[6][9][1]='設 施';
subSubTitle[6][9][2]='社 區 會 堂 及 社 區 中 心 一 覽 表 ( 包 括 租 用 申 請 表 格 及 指 南 )';

subSubTitle[6][11] = new Array();
subSubTitle[6][11][1]='牌 照 事 務 處';
subSubTitle[6][11][2]='床 位 寓 所';
subSubTitle[6][11][3]='會 社';
subSubTitle[6][11][4]='旅 館';
subSubTitle[6][11][5]='卡 拉 O K 場 所';

subSubTitle[6][12] = new Array();
subSubTitle[6][12][1]='服 務 範 圍';
subSubTitle[6][12][2]='臨 時 庇 護 中 心';
//subSubTitle[6][12][3]='臨 時 防 風 庇 護 站';
subSubTitle[6][12][3]='臨 時 避 寒 中 心';
subSubTitle[6][12][4]='臨 時 夜 間 避 暑 中 心';

subSubTitle[6][13] = new Array();
subSubTitle[6][13][1]='服 務 範 圍';
subSubTitle[6][13][2]='查 詢 電 話 及 地 址';
subSubTitle[6][13][3]='常 見 問 題';

subSubTitle[6][14] = new Array();
subSubTitle[6][14][1]='引 言';
subSubTitle[6][14][2]='民 政 事 務 局 局 長 的 權 力';
subSubTitle[6][14][3]='何 謂 擅 自 處 理 遺 產 ？';
subSubTitle[6][14][4]='小 額 遺 產';
subSubTitle[6][14][5]='檢 視 保 管 箱';
subSubTitle[6][14][6]='支 用 款 項 作 殯 殮 開 支';
subSubTitle[6][14][7]='支 用 款 項 作 生 活 費';
subSubTitle[6][14][8]='公 用 表 格 及 刊 物';
subSubTitle[6][14][9]='常 見 問 題';
subSubTitle[6][14][10]='相 關 網 站';
subSubTitle[6][14][11]='聯 絡 我 們';

//var for xml
var type="";


//switch language version
function langSwitch(lang) {
	var goPath;
	var pagePath=document.location.pathname;

	if(pagePath.search("photoscorner")!=-1){
		pagePath = document.location.toString().substring(document.location.toString().search(document.location.pathname),document.location.toString().length);
	}

	//var translationServer='http://sc.info.gov.hk/gb/';
	if(location.href.toString().search('westcom') != -1)
		var translationServer='ht'+'tp://common.westcomzivo.com/gb/';
	else
		var translationServer='ht'+'tp://sc.info.gov.hk/gb/';

	if (lang=='en') { //change to English version
		goPath='/en'+pagePath.substring(3,pagePath.length);
	}
	if (lang=='tc') { //change to traditional chinese version
		goPath='/tc'+pagePath.substring(3,pagePath.length);
	}
	if (lang=='sc') { //change to simplified chinese version
		goPath='/chs'+pagePath.substring(3,pagePath.length);
		//goPath=translationServer+location.host+goPath;
	}
	document.location=goPath;
}

//change to graphic only version
function graphicSwitch() {
	var arrayEle = new Array()
	arrayEle = document.location.toString().split('/t_')
	document.location = ''+arrayEle[arrayEle.length-1]
}

function getTitle() {
	var scriptBuffer='';
	scriptBuffer+='<title>';
	scriptBuffer+='民 政 事 務 總 署 - '+title[selectedSection];
	if(selectedSubSection!=0&&selectedSubSection!='') {
		scriptBuffer+= ' - ' + subTitle[selectedSection+1][selectedSubSection]
		if(subLevelSection>0&&subLevelSection!='') {
			scriptBuffer+= ' - ' + subSubTitle[selectedSection+1][selectedSubSection][subLevelSection]
		}
	}
	scriptBuffer+='</title>';
	return scriptBuffer;
}

function getTopic() {
	var retStr='';
	retStr = title[selectedSection];
	 if(selectedSubSection != 0){
		if (subLevelSection!=''&&subLevelSection > 0){
			retStr = subTitle[selectedSection+1][selectedSubSection] + ' - ' + subSubTitle[selectedSection+1][selectedSubSection][subLevelSection];
		}else{
			if(selectedSubSection!=0&&selectedSubSection!='') {
				retStr+= ' - ' + subTitle[selectedSection+1][selectedSubSection];
			}
		}
	 }
	return retStr;
}

function getHeader(){
	linkHome='/index.htm';
	linkGIC='javascript:externalLink(\'http://www.gov.hk/tc/residents/\')';
	linkSC='javascript:langSwitch(\'sc\')';
	linkEN='javascript:langSwitch(\'en\')';
	textLink='javascript:graphicSwitch()'; //Change to graphic only version
	linkSiteMap='/tc/t_sitemap.htm';
	linkContactUs='/tc/contact_us/t_index.htm';
	linkSearch='javascript:document.search.submit()';
//	linkSearch='javascript:PopWin(\'/popup2.html\', 0, 0, 300, 110)';
	
	var scriptBuffer='';
	scriptBuffer+='<table width="760" border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="3"><font size="4"><b>民 政 事 務 總 署</b></font><br><br>';
	scriptBuffer+='</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr valign="middle">';
	scriptBuffer+='<td><table border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td nowrap>[ <a href="'+linkGIC+'">GovHK 香 港 政 府 一 站 通</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+textLink+'">圖 像 版 本</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+linkSC+'">簡 體 版</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+linkEN+'">English</a> ]</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table>';
	scriptBuffer+='</td>';
	scriptBuffer+='<td align="right" width="100%"><table border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<form name="search" action="http://search.gov.hk/search.html" method="get">';
//	scriptBuffer+='<form name="search" action="javascript:PopWin(\'/popup2.html\', 0, 0, 300, 110)">';
	scriptBuffer+='<input type=hidden name=tpl_id value="stdsearch">';
	scriptBuffer+='<input type=hidden name=ui_lang value="zh-hk">';
	scriptBuffer+='<input type=hidden name=ui_charset value="utf-8">';
	scriptBuffer+='<input type=hidden name=gp0 value="had_home">';
	scriptBuffer+='<input type=hidden name=gp1 value="had_home">';
	scriptBuffer+='<input type=hidden name=web value="this">';
	scriptBuffer+='<input type=hidden name=txtonly value="1">';
	//form hidden field add here
	scriptBuffer+='<tr>';
	scriptBuffer+='<td valign="middle" nowrap>&nbsp;</td>';
	scriptBuffer+='<td valign="middle" nowrap><input type="text" name="query">';
	scriptBuffer+='</td>';
	scriptBuffer+='<td valign="middle" nowrap>&nbsp;[&nbsp;<a href="'+linkSearch+'">搜 尋</a>&nbsp;]</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</form>';
	scriptBuffer+='</table>';
	scriptBuffer+='</td>';
	scriptBuffer+='<td align="right"><table border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+linkSiteMap+'">網 頁 指 南</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap> [ <a href="'+linkContactUs+'">聯 絡 我 們</a> ] </td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table>';
	scriptBuffer+='</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td colspan="3"><hr></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table>';

	return scriptBuffer;
}

function getNavMenu(){
	var sectionlink = new Array();
	sectionlink[1]='/tc/t_index.htm';
	sectionlink[2]='/tc/whats_new/t_whatsnew.htm';
	sectionlink[3]='/tc/about_us/t_index.htm';
	sectionlink[4]='/tc/publications/t_index.htm';
	sectionlink[5]='/tc/access_to_information/t_index.htm';
	sectionlink[6]='/tc/public_services/t_index.htm';
	sectionlink[15]='/tc/photoscorner/t_index.htm';
	sectionlink[7]='/tc/public_forms/t_forms.htm';
	sectionlink[8]='/tc/tender_notices/t_tender.htm';
	sectionlink[9]='/tc/job_vacancies/t_index.htm';
	sectionlink[10]='/tc/links/t_index.htm';
	sectionlink[11]='/tc/contact_us/t_index.htm';


	var subSectionlink = new Array();
	subSectionlink[1] = new Array();
	subSectionlink[1][1]='/tc/whats_new/prevention/t_prevention.htm';
	subSectionlink[1][2]='/tc/whats_new/translation/t_translation.htm';
	subSectionlink[1][3]='/tc/whats_new/relocation/t_relocation.htm';

	subSectionlink[2] = new Array();
	subSectionlink[2][1]='/tc/about_us/welcome_message/t_welcome.htm';
	subSectionlink[2][2]='/tc/about_us/organization/orgainzation_chart/t_chart.htm';
	subSectionlink[2][3]='/tc/about_us/mission/t_mission.htm';
	subSectionlink[2][4]='/tc/about_us/performance_pledges/t_pledge.htm';
	subSectionlink[2][5]='/tc/about_us/statement_of_privacy_policy_and_practices/t_gpd.htm';

	subSectionlink[3] = new Array();
	subSectionlink[3][1]='/tc/publications/publications/t_publications.htm';
	subSectionlink[3][2]='/tc/publications/consultation_papers/t_consultation_papers.htm';
	subSectionlink[3][3]='/tc/publications/press_releases/t_press_releases.htm';

	subSectionlink[4] = new Array();
	subSectionlink[4][1]='javascript:externalLink(\'http://www.access.gov.hk/tc/index.htm\')';
	subSectionlink[4][2]='/tc/access_to_information/t_pub_con.htm';
	subSectionlink[4][3]='/tc/access_to_information/t_publish.htm';
	subSectionlink[4][4]='/tc/access_to_information/t_ref.htm';

	subSectionlink[5] = new Array();
	subSectionlink[5][1]='/tc/public_services/building_management/t_index.htm';
	subSectionlink[5][2]='/tc/public_services/minor_works_programmes/t_rpis_main.htm';
	subSectionlink[5][3]='/tc/public_services/services_for_new_arrivals_from_the_mainland/t_arrival.htm';
	subSectionlink[5][4]='/tc/public_services/local_community_economy/t_lce.htm';
//	subSectionlink[5][5]='/tc/public_services/sha_incorporated_tsunamis_relief_fund_2004/t_index.htm';
//	subSectionlink[5][6]='/tc/public_services/team_clean_corner/t_team_index.htm';
//	subSectionlink[5][7]='/tc/public_services/t_computer_facilities.htm';
	subSectionlink[5][8]='/tc/public_services/district_administration/t_admin_main.htm';
	subSectionlink[5][9]='/tc/public_services/community_halls_centres/t_index.htm';
	subSectionlink[5][10]='/tc/public_services/overseas_domestic_helpers_centres/t_helper.htm';
	subSectionlink[5][11]='/tc/public_services/licensing/t_lic_main.htm';
	subSectionlink[5][12]='/tc/public_services/emergency_services/t_index.htm';
	subSectionlink[5][13]='/tc/public_services/public_enquiry_services/t_enquiry_main.htm';
	subSectionlink[5][14]='/tc/public_services/estates/t_index.htm';
	subSectionlink[5][15]='/tc/public_services/en_self_reli/t_index.htm';
	subSectionlink[5][16]='/tc/public_services/com_clo_rec_ban_sch/t_index.htm';
	//subSectionlink[5][17]='/tc/public_services/tswp/t_index.htm';

	subSectionlink[7] = new Array();
	subSectionlink[7][1] = '/tc/tender_notices/general/t_general.htm';
	subSectionlink[7][2] = '/tc/tender_notices/works/t_works.htm';

	subSectionlink[9] = new Array();
	subSectionlink[9][1]='/tc/links/t_links.htm';
	subSectionlink[9][2]='/tc/links/t_other.htm';

	subSectionlink[10] = new Array();
	subSectionlink[10][1]= '/tc/contact_us/t_comments.htm';
//	subSectionlink[10][2]='/tc/contact_us/t_districtoffices.htm';
	subSectionlink[10][2]='javascript:internalCheckLang();';

	subSectionlink[15] = new Array();

	//generate the topic image to the buffer variable
	var scriptBuffer='';
	scriptBuffer+='<table width="760" border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td><br>';
	scriptBuffer+='<br>';
	scriptBuffer+='<hr></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td><table width="100%"><tr><td>[ <a href="#">頁 首</a> ]</td>';
	if (selectedSubSection != 0) {
		var thisLink;
		thisLink = '';
		if (selectedSubSubSection > 0 ) {
			thisLink = 'javascript: history.go(-1);';
		}else if (isArrayContain(document.location.pathname)){
			thisLink = MainLink[selectedSection];
		}else {
			thisLink = SubLink[selectedSection][selectedSubSection];
		}
		 //alert( isArrayContain(document.location.pathname));

		if((selectedSection==2)&&(selectedSubSection==2)&&(subLevelSection==2))
			thisLink = '/tc/about_us/organization/responsibilities/t_major.htm';

		if((selectedSection==2)&&(selectedSubSection==2)&&(subLevelSection==1)&&(selectedSubSubSection==1))
				thisLink = '/tc/about_us/organization/orgainzation_chart/t_chart.htm';
		if((selectedSection==5)&&(selectedSubSection==9)&&(subLevelSection==2)&&(selectedSubSubSection==1))
				thisLink = '/tc/public_services/community_halls_centres/t_ccch.htm';

		//if((selectedSection==5)&&(selectedSubSection==12))
		//	thisLink = MainLink[selectedSection];

		if (vLink != '') {
			thisLink = vLink;
		}

		scriptBuffer+='<td align="right">[ <a href="'+thisLink+'">回 上 頁</a> ]</td></tr></table></td>';
	}
	if((selectedSection==1)&&(selectedSubSection==0)){
		thisLink = MainLink[selectedSection];
		scriptBuffer+='<td align="right">[ <a href="'+thisLink+'">回 上 頁</a> ]</td></tr></table></td>';
	}
	if((selectedSection==20)&&(selectedSubSection==0)){
		scriptBuffer+='<td align="right">[ <a href="javascript: history.go(-1);">回 上 頁</a> ]</td></tr></table></td>';
	}
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td><hr></td>';
	scriptBuffer+='</tr>';
	if(selectedSubSection!=0&&selectedSubSection!='') {
		scriptBuffer+='<tr>';
		scriptBuffer+='<td><table border="0" cellspacing="0" cellpadding="0">';
		switch(selectedSection) {
			case 1:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][3]+'">'+subTitle[selectedSection+1][3]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 2:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][3]+'">'+subTitle[selectedSection+1][3]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][4]+'">'+subTitle[selectedSection+1][4]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][5]+'">'+subTitle[selectedSection+1][5]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 3:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][3]+'">'+subTitle[selectedSection+1][3]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 4:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][3]+'">'+subTitle[selectedSection+1][3]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][4]+'">'+subTitle[selectedSection+1][4]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 5:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][3]+'">'+subTitle[selectedSection+1][3]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				//scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][17]+'">'+subTitle[selectedSection+1][17]+'</a> ]</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][4]+'">'+subTitle[selectedSection+1][4]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				scriptBuffer+='<tr>';			
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][15]+'">'+subTitle[selectedSection+1][15]+'</a> ]</td>';
				//scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				//scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][6]+'">'+subTitle[selectedSection+1][6]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][8]+'">'+subTitle[selectedSection+1][8]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][9]+'">'+subTitle[selectedSection+1][9]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';			
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][16]+'">'+subTitle[selectedSection+1][16]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				scriptBuffer+='<tr>';			
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][10]+'">'+subTitle[selectedSection+1][10]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][11]+'">'+subTitle[selectedSection+1][11]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][12]+'">'+subTitle[selectedSection+1][12]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';				
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][13]+'">'+subTitle[selectedSection+1][13]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				scriptBuffer+='<tr>';							
				scriptBuffer+='<td  nowrap>[ <a href="'+subSectionlink[selectedSection][14]+'">'+subTitle[selectedSection+1][14]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 7:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 9:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			case 10:
				scriptBuffer+='<tr>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][1]+'">'+subTitle[selectedSection+1][1]+'</a> ]</td>';
				scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
				scriptBuffer+='<td nowrap>[ <a href="'+subSectionlink[selectedSection][2]+'">'+subTitle[selectedSection+1][2]+'</a> ]</td>';
				scriptBuffer+='</tr>';
				break;
			default:
				scriptBuffer+='<td><h3><font color="red">Error Occured</font></h3></td>';
		}
		scriptBuffer+='</table></td>';
		scriptBuffer+='</tr>';
		scriptBuffer+='<tr>';
		scriptBuffer+='<td><hr></td>';
		scriptBuffer+='</tr>';
	}
	scriptBuffer+='<tr>';
	scriptBuffer+='<td><table border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[1]+'">'+title[0]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[2]+'">'+title[1]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[3]+'">'+title[2]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[4]+'">'+title[3]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[5]+'">'+title[4]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[6]+'">'+title[5]+'</a> ] </td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[15]+'">'+title[14]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[7]+'">'+title[6]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[8]+'">'+title[7]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[9]+'">'+title[8]+'</a> ]</td>';
//	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[10]+'">'+title[9]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td nowrap>[ <a href="'+sectionlink[11]+'">'+title[10]+'</a> ]</td>';
	scriptBuffer+='<td width="10" nowrap>&nbsp;</td>';
	scriptBuffer+='<td colspan="13">&nbsp;</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td><hr></td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table>';

	return scriptBuffer;
}

//Done by Alvin
function isArrayContain(sLink) {
	for (var i in SubLink[selectedSection]){
		if( SubLink[selectedSection][i] != null)
			if (SubLink[selectedSection][i].indexOf(sLink)!=-1) {
				return true;
			}
	}
	return false;
}

function getFooter() {
	var copyYear='2004';
	var noticesLink='/tc/t_notice.htm';
	var privateLink='/tc/t_private.htm';
	if (revisionDate==''||revisionDate=='MM/DD/YYYY') revisionDate='03/04/2004';
	var monthArray=new Array();
	monthArray[0]='1';
	monthArray[1]='2';
	monthArray[2]='3';
	monthArray[3]='4';
	monthArray[4]='5';
	monthArray[5]='6';
	monthArray[6]='7';
	monthArray[7]='8';
	monthArray[8]='9';
	monthArray[9]='10';
	monthArray[10]='11';
	monthArray[11]='12';
	var reDate=new Date(Date.parse(revisionDate))
	var showDate=reDate.getFullYear()+'年 '+monthArray[reDate.getMonth()]+'月 '+reDate.getDate()+'日';

	var ReviewDate = new Date (Date.parse(LastReviewDate));
	var showReviewDate = ReviewDate.getFullYear() + '年 ' + monthArray[ReviewDate.getMonth()] + '月 ' + ReviewDate.getDate() + '日';

	//generate the topic image to the buffer variable
	var scriptBuffer='';
	scriptBuffer+='<table width="760" border="0" cellspacing="0" cellpadding="0">';
	scriptBuffer+='<tr>';
	scriptBuffer+='<td>版 權 所 有 2004 | <a href="'+noticesLink+'">重 要 告 示</a> | <a href="'+privateLink+'">私 隱 政 策</a><br>';
	scriptBuffer+='</td>';
	if(ReviewDate >= reDate)
		scriptBuffer+='<td align="right">'+ LastReviewText +': '+showReviewDate+'</td>';
	else
		scriptBuffer+='<td align="right">最 近 修 訂 日 期 : '+showDate+'</td>';
	scriptBuffer+='</tr>';
	scriptBuffer+='</table>';

	return scriptBuffer;
}

//Done by Alvin
function getSubSectionList() {
	var scriptBuffer;
	var bulletPath;

	scriptBuffer = '';
	//scriptBuffer+='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
	scriptBuffer+='<ul>';
	if (selectedSubSection==0){
		if (typeof(display_order[selectedSection])!='undefined')
		{
			for (var p=0; p<display_order[selectedSection].length;p++ ) {
				i = display_order[selectedSection][p]
				if(SubLink[selectedSection][i] != null)
				 	scriptBuffer+='<li><a href="'+SubLink[selectedSection][i]+'">'+subTitle[selectedSection+1][i]+'</a></li>';
			 }
		}
		else
		{
			for (i=1; i<SubLink[selectedSection].length;i++ ) {
				if(SubLink[selectedSection][i] != null)
				 	scriptBuffer+='<li><a href="'+SubLink[selectedSection][i]+'">'+subTitle[selectedSection+1][i]+'</a></li>';
			 }
		}
	} else {
		//alert(SubLink2[selectedSection][selectedSubSection].length);
		if(typeof(display_order2[selectedSection]) != 'undefined' && typeof(display_order2[selectedSection][selectedSubSection]) != 'undefined')
		{
			for(q in display_order2[selectedSection][selectedSubSection])
			{
				i = display_order2[selectedSection][selectedSubSection][q];
				if(SubLink2[selectedSection][selectedSubSection][i] != null)
		 			scriptBuffer+='<li><a href="'+SubLink2[selectedSection][selectedSubSection][i]+'">'+subSubTitle[selectedSection+1][selectedSubSection][i]+'</a></li>';
			}
		}else
		{
			for (i=1; i<SubLink2[selectedSection][selectedSubSection].length;i++ ) {
		 		if(SubLink2[selectedSection][selectedSubSection][i] != null)
		 			scriptBuffer+='<li><a href="'+SubLink2[selectedSection][selectedSubSection][i]+'">'+subSubTitle[selectedSection+1][selectedSubSection][i]+'</a></li>';
		 	}
		}
	}
	//scriptBuffer+='</table>';
	scriptBuffer+='</ul>';
	return scriptBuffer;
}

function externalLink(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=800,height=300')");
	if ( nw.focus != null)
	{nw.focus();}
}

function documentPopUp(url)
{
if(location.href.toString().search('/gb/') != -1){
	var pathName = document.location.pathname;
	var PathAdd = pathName.indexOf("/tc/");
	var Main_url = pathName.substr(0, PathAdd);
	url = Main_url + url;
	if(url.toString().search('.pdf') != -1){
		url = url.replace('/tc/', '/sc/');
	}
//	alert(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 documentPopUp2(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 documentStaticPopUp(url){
if(location.href.toString().search('/gb/') != -1){
	var pathName = document.location.pathname;
	var PathAdd = pathName.indexOf("/tc/");
	var Main_url = pathName.substr(0, PathAdd);
	url = Main_url + 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 PopWin(url, x, y, w, h){
    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();
    }
}

//Listing XML objects
function ListDataText(num, type){
		//num , sequence of the subjects
		//type, language type
		document.write("<script type=\"text/javascript\" src=\"http://www.map.gov.hk/static/gihs_interface.js\"><\/script>");
		var type="tc";


//branch for native XMLHttpRequest Object and modern browser firefox, safari
if (window.XMLHttpRequest && !(window.ActiveXObject)){
   	//alert("not using IE");
  	xhttp=new XMLHttpRequest();
	xhttp.open("GET", "http://www0.had.gov.hk/file_manager/xml/xml_091120.xml", false);
	xhttp.send("");
	xmlDoc=xhttp.responseXML;
	x=xmlDoc.getElementsByTagName("gihs");


  }
//branch for IE/Windows ActiveX version
else if(window.ActiveXObject){
	//alert(" using IE");
  	xhttp=new ActiveXObject("Microsoft.XMLDOM");
		if (xhttp!=null) {
			xhttp.async=false;
		if((xhttp.load("http://www0.had.gov.hk/file_manager/xml/xml_091120.xml"))||(xhttp.load("http://www.had.gov.hk/file_manager/xml/xml_091120.xml"))){
			x=xhttp.getElementsByTagName("gihs");
			//y=xhttp.load("xml_091120.xml");
			//x=xhttp.getElementsByTagName("gihs");
			//document.write(x[94].childNodes[5].childNodes[0].nodeValue+"<br>");
		}else { 
		document.write("No file found");}
		}

}else{
		alert('Your browser cannot handle this script');
	}
	//var type=type;

	if(type=="sc"){
		if(window.ActiveXObject){var addr=5;var static_path=8;var adv_path=11;}else if (window.XMLHttpRequest){var addr=11;var static_path=17;var adv_path=23;}
		var listdata="";
			listdata+=x[num].childNodes[addr].childNodes[0].nodeValue +"<br>";
			listdata+= x[num].childNodes[static_path].childNodes[0].nodeValue +"位 置 图</a>&nbsp;&nbsp;";
			listdata+= x[num].childNodes[adv_path].childNodes[0].nodeValue +"连 结 地 理 资 讯 地 图</a><br>";
	}
	else if(type=="en"){
		if(window.ActiveXObject){var addr=3;var static_path=6;var adv_path=9;}else if (window.XMLHttpRequest){var addr=7;var static_path=13;var adv_path=19;}
		var listdata="";
			listdata+= x[num].childNodes[addr].childNodes[0].nodeValue +"<br>";
			listdata+= x[num].childNodes[static_path].childNodes[0].nodeValue +"Location Map</a>&nbsp;&nbsp;";
			listdata+= x[num].childNodes[adv_path].childNodes[0].nodeValue +"Link to GeoInfo Map</a><br>";}
	else if(type=="tc"){
		if(window.ActiveXObject){var addr=5;var static_path=7;var adv_path=10;}else if (window.XMLHttpRequest){var addr=11;var static_path=15;var adv_path=21;}
		var listdata="";
			listdata+= x[num].childNodes[addr].childNodes[0].nodeValue +"<br>";
			listdata+= x[num].childNodes[static_path].childNodes[0].nodeValue +"位 置 圖</a>&nbsp;&nbsp;";
			listdata+= x[num].childNodes[adv_path].childNodes[0].nodeValue +"連 結 地 理 資 訊 地 圖</a><br>";
	}
	document.write(listdata);
}
