var x = 1;	 //menuObj.length
var y = 1;	 //subMenuObj.length
var z = 1;	 //HomeIconObj.length
var q = 1;	 //HomeIconObj2.length

var menuObj = new Array();
var subMenuObj = new Array();
var HomeIconObj = new Array();
var HomeIconObj2 = new Array();

var Selected_ID;
var Selected_Sub;
var revisionDate;
var reviewDate;

var imagePath;
var locationPath;
var langPath;
var langID;
var isText;

var topButton;
var printPage;

var exLink;

var prodURL='';
var HomePath='';

getLocationPath();			// Checking hosting location

if(document.URL.toString().search('TextOnly.pl')!=-1)
	isText=1;

if(location.href.toString().search('westcomzivo')!=-1){			//Setting kanhan Server
	gb_urlPath='common.westcomzivo.com/gb/';
}else{
	gb_urlPath='sc.info.gov.hk/gb/';
}

if(document.URL.toString().search('/tc/')!=-1 || document.URL.toString().search('mode=288')!=-1){
	langID=2;
	langPath='/tc/';
}else{
	langID=1;
	langPath='/en/';
}

if(document.URL.toString().search('/gb/')!=-1){
	imagePath = locationPath+'/gb/';
//	locationPath='ht'+'tp://'+gb_urlPath+locationPath.substring(7, locationPath.length);
}else{
	imagePath = locationPath+langPath;
}

if(window.name=='PrintPage'){
	printPage=1;
}

/********************* 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";
//	if(isText)
//		arClfTopMenu[1][2] = "289";					/****** Value of variable mode ******/
//	else
	arClfTopMenu[1][3] = "Rating and Valuation Department - The Government of the Hong Kong Special Administrative Region";	/****** Department Name ******/
	arClfTopMenu[1][4] = "9";
	arClfTopMenu[1][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/eindex.htm";
	arClfTopMenu[1][6] = "Brand Hong Kong - Asia's world city";
	arClfTopMenu[1][7] = "GovHK";
	arClfTopMenu[1][8] = "/eng/";
	arClfTopMenu[1][9] = "/text/";
	arClfTopMenu[1][10] = "Text Only";
	arClfTopMenu[1][11] = "/eng/";
	arClfTopMenu[1][12] = "/tc/";
	arClfTopMenu[1][13] = "繁體版";	
	arClfTopMenu[1][14] = "/eng/";	
	arClfTopMenu[1][15] = "/sc/";	
	arClfTopMenu[1][16] = "簡體版";	
	arClfTopMenu[1][17] = "Search";	
	arClfTopMenu[1][18] = "Site Map";	
	arClfTopMenu[1][19] = "Contact Us";	
	arClfTopMenu[1][20] = "rvd";			/****** Value of variable gr_1 ******/
	arClfTopMenu[1][21] = "Graphic Version";	
	arClfTopMenu[1][22] = "/graphics/";
	arClfTopMenu[1][23] = "ht"+"tp://www.gov.hk/en/residents/";
	arClfTopMenu[1][24] = "en";
	arClfTopMenu[1][25] = "utf-8";
	
	arClfTopMenu[2] = new Array()
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
//	if(isText)
//		arClfTopMenu[2][2] = "290";					/****** Value of variable mode ******/
//	else
	arClfTopMenu[2][3] = "香港特別行政區政府 - 差餉物業估價署";		/****** Department Name ******/
	arClfTopMenu[2][4] = "9";
	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/";
	arClfTopMenu[2][10] = "繁體純文字";
	arClfTopMenu[2][11] = "/tc/";
	arClfTopMenu[2][12] = "/sc/";
	arClfTopMenu[2][13] = "簡體版";
	arClfTopMenu[2][14] = "/chi/";
	arClfTopMenu[2][15] = "/en/";
	arClfTopMenu[2][16] = "English";
	arClfTopMenu[2][17] = "搜尋";
	arClfTopMenu[2][18] = "網頁指南";
	arClfTopMenu[2][19] = "聯絡我們";
	arClfTopMenu[2][20] = "rvd";				/****** Value of variable gr_1 ******/
	arClfTopMenu[2][21] = "繁體圖像版";
	arClfTopMenu[2][22] = "/graphics/";
	arClfTopMenu[2][23] = "ht"+"tp://www.gov.hk/tc/residents/";
	arClfTopMenu[2][24] = "zh-hk";
	arClfTopMenu[2][25] = "utf-8";
	
if(document.URL.toString().search('/sc/') != -1){
	arClfTopMenu[2][1] = "http://search.gov.hk/search.html";
	arClfTopMenu[2][4] = "10";
	arClfTopMenu[2][5] = "ht"+"tp://www.brandhk.gov.hk/brandhk/index.htm";
	arClfTopMenu[2][10] = "簡體純文字";
	arClfTopMenu[2][11] = "/sc/";
	arClfTopMenu[2][12] = "/tc/";
	arClfTopMenu[2][13] = "繁體版";
	arClfTopMenu[2][14] = "/sc/";
	arClfTopMenu[2][15] = "/en/";
	arClfTopMenu[2][16] = "English";
	arClfTopMenu[2][21] = "簡體圖像版";
	arClfTopMenu[2][22] = "/graphics/";
	arClfTopMenu[2][23] = "ht"+"tp://www.gov.hk/sc/residents/";
	arClfTopMenu[2][24] = "zh-cnhk";
	arClfTopMenu[2][25] = "utf-8";
}
/********************* End of Variable defined for generate the CLF top menu *********************/

/***** Add Section Start *****/
addMenu(1, "Home","主頁", "home/index.htm","nav_01.gif","nav_01-over.gif","N","Y","Y");
addMenu(2, "Topical Issues","專題事項", "issues/index.htm","nav_02.gif","nav_02-over.gif","Y","Y","Y");
addMenu(3, "What's New","最新消息", "news/index.htm","nav_03.gif","nav_03-over.gif","Y","Y","Y");
addMenu(4, "About Us","關於我們", "about/index.htm","nav_04.gif","nav_04-over.gif","Y","Y","Y");
addMenu(5, "Publications and Press Releases","刊物及新聞公報", "publications/index.htm","nav_05.gif","nav_05-over.gif","Y","Y","Y");
addMenu(6, "Access to Information","公開資料", "access/index.htm","nav_06.gif","nav_06-over.gif","N","Y","Y");
addMenu(7, "Public Services","公共服務", "public/index.htm","nav_07.gif","nav_07-over.gif","Y","Y","Y");
addMenu(8, "Property Market Statistics","物業市場統計資料", "publications/pro-review.htm","nav_08.gif","nav_08-over.gif","N","Y","Y");
addMenu(9, "Frequently Asked Questions","常見問題", "faqs/index.htm","nav_09.gif","nav_09-over.gif","N","Y","Y");
addMenu(10, "Public Forms","公用表格", "forms/index.htm","nav_10.gif","nav_10-over.gif","Y","Y","Y");
addMenu(11, "Electronic Services","電子化服務", "eservices/index.htm","nav_11.gif","nav_11-over.gif","N","Y","Y");
addMenu(12, "Public Inspection of Valuation List & Government Rent Roll","公眾查閱估價冊及地租登記冊", "valuation/index.htm","nav_12.gif","nav_12-over.gif","N","Y","Y");
addMenu(13, "Tender Notices","招標公告", "tender/index.htm","nav_13.gif","nav_13-over.gif","N","Y","Y");
addMenu(14, "Enquiries and Contacts","查詢和聯絡", "contact/index.htm","nav_14.gif","nav_14-over.gif","N","Y","Y");
addMenu(15, "Links","相關網址", "links/index.htm","nav_15.gif","nav_15-over.gif","N","Y","Y");

addMenu(16, "Site Map","網頁指南", "","","","N","N","N");
addMenu(17, "Important notices","重要告示", "","","","N","N","N");
addMenu(18, "Privacy Policy","私隱政策", "","","","N","N","N");
addMenu(19, "Display Building Numbers","門牌裝妥 方便你我", "building/index.htm","","","N","N","N");
addMenu(20, "Rates Concession","差餉寬減", "concession/index.htm","","","N","N","N");
addMenu(99, "Search","搜尋", "","","","N","N","N");

/***** Add Section End *****/

/***** Add Sub Section Start *****/
//Topical Issues
//addSubMenu(2, 1, "Feature article on building numbering \"A number exercise of a different kind\"","專題文章 「清楚展示門牌  利人利己」", "../doc/BNC_Feature_Article.pdf","N","N");
addSubMenu(2, 1, "Press Release on \"Building Numbering Campaign\"","新聞公報 - 「門牌號數展示運動」", "../doc/Proper_display_of_building_numbers_urged.pdf","N","N");
addSubMenu(2, 2, "\"Building Numbering Campaign\" video","「門牌號數展示運動」短片", "../images/Building_Numbering_2009_3.mpg","N","N");
addSubMenu(2, 3, "Controlling Officer's Environmental Report 2008-09","2008至09年度管制人員環保報告", "../doc/ereport08-09.pdf","N","N");
addSubMenu(2, 4, "Electronic Issue of Rates/Government Rent Demands","徵收差餉及／或地租電子通知書", "issues/news_03.htm","N","N");
addSubMenu(2, 5, "Controlling Officer's Replies to Initial Written Questions Raised by Finance Committee Members in Examining the Estimates of Expenditure 2009-10","管制人員答覆財務委員會審核2009-10年度開支預算提問", "news/news_01.htm","N","N");
addSubMenu(2, 6, "Advice to New Property Owner on Rates/Government Rent Liability","新業主就繳納差餉/地租須注意的事項", "issues/advice.htm","N","N");
addSubMenu(2, 7, "Practice Note on Building Numbering","有關樓宇門牌號數的執行守則", "building/practice_note.htm","N","N");
addSubMenu(2, 8, "Electronic Submission of Forms","遞交表格電子化", "forms/electronic.htm","N","N");
addSubMenu(2, 9, "Option to receive Chinese Demand Note","選擇中文季度通知書", "../doc/forms/rvd1047a.pdf","N","N");
if (langID==1)
{
	addSubMenu(2, 10, "Change of Rates and Government Rent Payer's Particulars","更改差餉及地租繳納人的資料", "http://www.gov.hk/en/residents/housing/private/rate/changepayers.htm","N","N");
	addSubMenu(2, 11, "Payment of Rates and/or Government Rent via Internet","網上繳交差餉及/或地租", "http://www.try.gov.hk/internet/ehcoll_paym_ebank.html","N","N");
}
else
{
	addSubMenu(2, 10, "Change of Rates and Government Rent Payer's Particulars","更改差餉及地租繳納人的資料", "http://www.gov.hk/tc/residents/housing/private/rate/changepayers.htm","N","N");
	addSubMenu(2, 11, "Payment of Rates and/or Government Rent via Internet","網上繳交差餉及/或地租", "http://www.try.gov.hk/cinternet/chcoll_paym_ebank.html","N","N");
}
addSubMenu(2, 12, "Enforcement on Non-return of Requisition Forms (R1A)","檢控不交回物業詳情申報表(R1A)人士", "issues/news_02.htm","N","N");
addSubMenu(2, 13, "Service Changes under the Landlord and Tenant (Consolidation) Ordinance","有關《業主與租客(綜合)條例》的服務變更", "issues/news_01.htm","N","N");

//What's New
addSubMenu(3, 1, "Rates Concession for the Financial Year 2009-2010","2009至2010財政年度差餉寬減", "news/news_03.htm","N","N");
addSubMenu(3, 2, "Hong Kong Property Review 2009","《香港物業報告》2009年版", "news/news_02.htm","N","N");
addSubMenu(3, 3, "Controlling Officer's Replies to Initial Written Questions Raised by Finance Committee Members in Examining the Estimates of Expenditure 2009-10","管制人員答覆財務委員會審核2009-10年度開支預算提問", "news/news_01.htm","N","N");
addSubMenu(3, 4, "Guidelines for Providing Information to Rating & Valuatioin Department (RVD) Upon Completion of a Sale or Lease Transaction","完成物業買賣或租賃交易後向差餉物業估價署提供資料的指引", "news/toolkit.htm","N","N");
//addSubMenu(3, 13, "Change of website address","更新網址", "javascript:PopWin('popup.htm','popup',370,200)","N","N");

//About Us
addSubMenu(4, 1, "Vision, Mission and Values","理想、使命及信念", "about/mission.htm","Y","Y");
addSubMenu(4, 2, "Organization","組織架構", "about/organ.htm","Y","Y");
addSubMenu(4, 3, "Responsibilities","職務", "about/respon.htm","Y","Y");
//addSubMenu(4, 4, "Performance Pledge","服務承諾", "../doc/2009-10_Pledge.pdf","Y","Y");
addSubMenu(4, 4, "Performance Pledge","服務承諾", "about/perform.htm","Y","Y");
//addSubMenu(4, 5, "Enquiries and Contacts","查詢和聯絡", "contact/index.htm","Y","Y");

//Publications and Press Releases
addSubMenu(5, 1, "Press Releases","新聞公報", "publications/press.htm","Y","Y");
addSubMenu(5, 2, "Publications","刊物", "publications/publications.htm","Y","Y");

//Public Services
addSubMenu(7, 1, "Rates","差餉", "public/rates.htm","Y","Y");
addSubMenu(7, 2, "Government Rent","地租", "public/rent.htm","Y","Y");
addSubMenu(7, 3, "Billing and Payment","發單與繳款", "public/billing.htm","Y","Y");
addSubMenu(7, 4, "Property Valuation Services","物業估價服務", "public/pvs.htm","Y","Y");
addSubMenu(7, 5, "Landlord and Tenant","業主與租客", "public/landlord.htm","Y","Y");
addSubMenu(7, 6, "Property Information","物業資訊", "public/pi.htm","Y","Y");

//Frequently Asked Questions
addSubMenu(9, 1, "Rates","差餉", "faqs/rates_q.htm","Y","Y");
addSubMenu(9, 2, "Government Rent","地租", "faqs/rent_q.htm","Y","Y");
addSubMenu(9, 3, "Billing and Payment","發單及繳款", "faqs/billing_q.htm","Y","Y");
addSubMenu(9, 4, "Advice to New Property Owner on Rates/Government Rent Liability","新業主就繳納差餉/地租須注意的事項", "faqs/advice_q.htm","Y","Y");
addSubMenu(9, 5, "Consolidated Demand and Payment for Rates and/or Government Rent","綜合徵收及繳付差餉及/或地租通知書", "faqs/faq_q.htm","Y","Y");
addSubMenu(9, 6, "Tenancy Matters","租賃事宜", "faqs/tenancy_q.htm","Y","Y");
addSubMenu(9, 7, "Electronic Submission of Forms","遞交表格電子化", "faqs/eform_q.htm","Y","Y");

//Public Forms
addSubMenu(10, 1, "Downloadable Forms","可供下載表格", "forms/downloadable.htm","Y","Y");
addSubMenu(10, 2, "Electronic Submission of Forms","遞交表格電子化", "forms/electronic.htm","Y","Y");

/***** Add Sub Section End *****/

addHomeIcon(1, "Pay Rates and Government Rent Online","網上繳交差餉及地租", "http://www.try.gov.hk/internet/ehcoll_paym_ebank.html","http://www.try.gov.hk/cinternet/chcoll_paym_ebank.html","payment.gif");
if(document.URL.toString().search('TextOnly.pl')!=-1)
{
	if(document.URL.toString().search('/tc/')!=-1)
	{
	//	addHomeIcon(2, "選擇中文季度通知書","選擇中文季度通知書", "../../tc/doc/forms/rvd1047a.pdf","../../tc/doc/forms/rvd1047a.pdf","rbsi.gif");
	}
	addHomeIcon(2, "Consolidated Demand","綜合徵收通知書", "TextOnly.pl?search=/en/faqs/faq_index.htm","TextOnly.pl?search=/tc/faqs/faq_index.htm","consol.gif");
	addHomeIcon(3, "Account Enquiries","帳目查詢", "TextOnly.pl?search=/en/home/acenquiries.htm","TextOnly.pl?search=/tc/home/acenquiries.htm","account_enquiries.gif");
}
else
{
	if(document.URL.toString().search('/tc/')!=-1)
	{
	//	addHomeIcon(2, "選擇中文季度通知書","選擇中文季度通知書", "../doc/forms/rvd1047a.pdf","../doc/forms/rvd1047a.pdf","rbsi.gif");
	}
	addHomeIcon(2, "Consolidated Demand","綜合徵收通知書", "../faqs/faq_index.htm","../faqs/faq_index.htm","consol.gif");
	addHomeIcon(3, "Account Enquiries","帳目查詢", "javascript:PopWin('../home/acenquiries.htm','popup',650,580,'yes')","javascript:PopWin('../home/acenquiries.htm','popup',650,500,'yes')","account_enquiries.gif");
}
addHomeIcon(4, "Change of Payer's Particulars","更改繳納人資料", "http://www.gov.hk/en/residents/housing/private/rate/changepayers.htm","http://www.gov.hk/tc/residents/housing/private/rate/changepayers.htm","change.jpg");
addHomeIcon(5, "Electronic Submission of Forms","遞交表格電子化", "http://eforms.rvd.gov.hk/eform/apps/RVD-eform.jsp","http://eforms.rvd.gov.hk/eform/apps/RVD-eform-c.jsp","esub.gif");
if(document.URL.toString().search('TextOnly.pl')!=-1)
{
	if(document.URL.toString().search('/tc/')!=-1)
	{
	addHomeIcon(6, "選擇中文季度通知書","選擇中文季度通知書", "../../tc/doc/forms/rvd1047a.pdf","../../tc/doc/forms/rvd1047a.pdf","rbsi.gif");
	}
}
else
{
	if(document.URL.toString().search('/tc/')!=-1)
	{
	addHomeIcon(6, "選擇中文季度通知書","選擇中文季度通知書", "../doc/forms/rvd1047a.pdf","../doc/forms/rvd1047a.pdf","rbsi.gif");
	}
}

addHomeIcon2(1, "Linking to GovHK","連結到「香港政府一站通」", "http://www.gov.hk/en/residents/","http://www.gov.hk/tc/residents/","govhk.gif");
addHomeIcon2(2, "Lands Department Payment of Government Rent","地政總署繳納地稅事宜", "http://www.landsd.gov.hk/en/gov_rent/index.htm","http://www.landsd.gov.hk/tc/gov_rent/index.htm","ld.gif");
addHomeIcon2(3, "Property e-Stamping","物業電子印花", "http://www.gov.hk/en/residents/taxes/etax/services/stamping_of_property_document.htm","http://www.gov.hk/tc/residents/taxes/etax/services/stamping_of_property_document.htm","estamping.gif");
addHomeIcon2(4, "GovWiFi Programme","「香港政府WiFi通」計劃", "http://www.gov.hk/en/theme/wifi/program/index.htm","http://www.gov.hk/tc/theme/wifi/program/index.htm","GovWiFi.gif");
addHomeIcon2(5, "Quality Seawater Assurance Scheme","優質海水認可計劃", "http://www.hkpc.org/qsas/eng/index.htm","http://www.hkpc.org/qsas/chi/index.htm","quality_seawater.jpg");
addHomeIcon2(6, "Hong Kong at World Expo 2010","香港在2010世博", "http://www.hkexpo2010.gov.hk","http://www.hkexpo2010.gov.hk","s_expo.jpg");
//addHomeIcon2(7, "2009-10 Policy Address","2009-10施政報告", "http://www.policyaddress.gov.hk/09-10/eng/index.html","http://www.policyaddress.gov.hk/09-10/chi/index.html","pa0910.gif");
addHomeIcon2(7, "Organ Donation","器官捐贈", "http://www.organdonation.gov.hk/eng/home.html","http://www.organdonation.gov.hk/tc/home.html","Organ_Donation.jpg");
addHomeIcon2(8, "2010-11 Budget","2010-11財政預算案", "http://www.budget.gov.hk/eindex.html","http://www.budget.gov.hk/","pre-budget.gif");

styleSheet();