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/';
}
langID=2;
langPath='/sc/';

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] = "/sc/";
	arClfTopMenu[2][12] = "/tc/";
	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/sc/residents/";
	arClfTopMenu[2][24] = "zh-cnhk";
	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","N","Y","Y");
addMenu(3, "What's New","最新消息", "news/index.htm","nav_03.gif","nav_03-over.gif","N","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, "Basic Law Test Guidance Notes","基本法测试考生须知", "basiclaw/index.htm","nav_15.gif","nav_15-over.gif","N","N","N");
addMenu(16, "Links","相关网址", "links/index.htm","nav_16.gif","nav_16-over.gif","N","Y","Y");

addMenu(17, "Site Map","网页指南", "","","","N","N","N");
addMenu(18, "Important notices","重要告示", "","","","N","N","N");
addMenu(19, "Privacy Policy","私隐政策", "","","","N","N","N");
addMenu(20, "Display Building Numbers","门牌装妥 方便你我", "building/index.htm","","","N","N","N");
addMenu(21, "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, 3, "Property Information Online Service to be launched","差饷物业估价署推出新物业资讯网", "news/news_64.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","选择中文季度通知书", "/sc/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/sc/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");
//addSubMenu(7, 7, "Summary Statistics","估价册及地租登记册 - 摘要统计资料", "public/statistics.htm","N","N");

//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");
addSubMenu(9, 8, "Completion of the Requisition Forms for Particulars of Tenements (Form R1A)","填写物业详情申报表(表格R1A)", "../doc/CAQ_SBI_for_GR1213.pdf","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 *****/

if(document.URL.toString().search('TextOnly.pl')!=-1){
	addHomeIcon(1, "Mass Appraisal Valuation Symposium","批量评估技术研讨会", "TextOnly.pl?search=/en/news/news_12.htm","TextOnly.pl?search=/sc/news/news_12.htm","mass_appraisal_valuation_symposium.gif");
}else{
	addHomeIcon(1, "Mass Appraisal Valuation Symposium","批量评估技术研讨会", "../news/news_12.htm","../news/news_12.htm","mass_appraisal_valuation_symposium.gif");
}
addHomeIcon(2, "Pay Rates and Government Rent Online","网上缴交差饷及地租", "http://www.try.gov.hk/internet/ehcoll_paym_ebank.html","http://www.try.gov.hk/sc/chcoll_paym_ebank.html","payment.gif");
if(document.URL.toString().search('TextOnly.pl')!=-1){
	addHomeIcon(3, "Consolidated Demand","综合征收通知书", "TextOnly.pl?search=/en/faqs/faq_index.htm","TextOnly.pl?search=/sc/faqs/faq_index.htm","consol.gif");
	addHomeIcon(4, "Account Enquiries","帐目查询", "TextOnly.pl?search=/en/home/acenquiries.htm","TextOnly.pl?search=/sc/home/acenquiries.htm","account_enquiries.gif");
}else{
	addHomeIcon(3, "Consolidated Demand","综合征收通知书", "../faqs/faq_index.htm","../faqs/faq_index.htm","consol.gif");
	addHomeIcon(4, "Account Enquiries","帐目查询", "javascript:PopWin('../home/acenquiries.htm','popup',650,700,'yes')","javascript:PopWin('../home/acenquiries.htm','popup',650,610,'yes')","account_enquiries.gif");
}
addHomeIcon(5, "Change of Payer's Particulars","更改缴纳人资料", "http://www.gov.hk/en/residents/housing/private/rate/changepayers.htm","http://www.gov.hk/sc/residents/housing/private/rate/changepayers.htm","change.jpg");
addHomeIcon(6, "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(langID==2){
	addHomeIcon(7, "选择中文季度通知书","选择中文季度通知书", "/sc/doc/forms/rvd1047a.pdf","/sc/doc/forms/rvd1047a.pdf","rbsi.gif");
}

addHomeIcon2(1, "Scheme $6,000","$6,000计划", "http://www.scheme6000.gov.hk/eng/index.html","http://www.scheme6000.gov.hk/sim/index.html","6k.jpg");
//addHomeIcon2(2, "2011 Population Census","2011年人口普查", "http://www.census2011.gov.hk/en/index.html","http://www.census2011.gov.hk/sc/index.html","census.gif");
addHomeIcon2(2, "The Hong Kong Housing Society Free Building Number Plate","香港房屋协会免费提供门牌", "http://bmms.hkhs.com/chi/services_door_sign.html","http://bmms.hkhs.com/chi/services_door_sign.html","icon_service_door_sign.jpg");
addHomeIcon2(3, "Linking to GovHK","连结到「香港政府一站通」", "http://www.gov.hk/en/residents/","http://www.gov.hk/sc/residents/","govhk.gif");
addHomeIcon2(4, "Welcome to MyGovHK","欢迎使用我的政府一站通", "http://www.gov.hk/en/theme/mygovhk/","http://www.gov.hk/sc/theme/mygovhk/","MyGovHK.gif");
addHomeIcon2(5, "Lands Department Payment of Government Rent","地政总署缴纳地税事宜", "http://www.landsd.gov.hk/en/gov_rent/index.htm","http://www.landsd.gov.hk/sc/gov_rent/index.htm","ld.gif");
addHomeIcon2(6, "Property e-Stamping","物业电子印花", "http://www.gov.hk/en/residents/taxes/etax/services/stamping_of_property_document.htm","http://www.gov.hk/sc/residents/taxes/etax/services/stamping_of_property_document.htm","estamping.gif");
addHomeIcon2(7, "1823 Online","1823 Online", "http://www.1823.gov.hk/eng/index.htm","http://sc.1823.gov.hk/TuniS/www.1823.gov.hk/big5/index.htm","1823.jpg");
addHomeIcon2(8, "news.gov.hk","香港政府新闻网", "http://www.news.gov.hk/en/index.shtml","http://sc.news.gov.hk/TuniS/www.news.gov.hk/tc/index.shtml","newsgovhk-grey.jpg");
addHomeIcon2(9, "2012-13 Budget","2012-13财政预算案", "http://www.budget.gov.hk/2012/eng/speech.html","http://www.budget.gov.hk/2012/sim/speech.html","budget_2012-13.gif");
//addHomeIcon2(9, "2011-12 Policy Address","2011-12 施政报告", "http://www.policyaddress.gov.hk/11-12/eng/index.html","http://www.policyaddress.gov.hk/11-12/sim/index.html","pa1112.gif");
//addHomeIcon2(7, "2011 Voter Registration","2011 选民登记", "http://www.voterregistration.gov.hk/eng/home.htm","http://www.voterregistration.gov.hk/sim/home.htm","voter2011.jpg");

styleSheet();