﻿var g_address = "http://www.ofta.gov.hk";
var g_address_https = "https://www.ofta.gov.hk";

var g_docPath;
var g_idxPath;

/****************************************
 * Added by Ryan, Nov 2006 
 * make the following variable change 
 	document.docPath 		g_docPath
	document.parentDoc 		g_parentDoc
	document.if_selected 		g_if_selected 
	document.cf_selected 		g_cf_selected
	document.if_menuName		g_if_menuName
	document.cf_menuName		g_cf_menuName
	document.headerImg		g_headerImg
	idxPath				g_idxPath
 */
var g_if_selected;
var g_cf_selected;
var g_if_menuName;
var g_cf_menuName;
var g_headerImg;
var g_pL1;
var g_parentDoc;

var currURL = String(window.location).toLowerCase();

var addrMatch = document.domain;
if(addrMatch != null){
  if(addrMatch != "www.ofta.gov.hk" &&
      addrMatch != "search.gov.hk" &&
      addrMatch != "gbcode.ofta.gov.hk" &&
      addrMatch != "sc.info.gov.hk" &&
      addrMatch != "gp.search.gov.hk" &&
      addrMatch != "gd.search.gov.hk" &&
      addrMatch != "y.search.gov.hk"){
    g_address_https = "ht" + "tps://" + addrMatch;
    g_address = "ht" + "tp://" + addrMatch;
  }
}
if (currURL.indexOf("https://") == 0) {
	g_address_s = g_address_https;
} else {
	g_address_s = g_address;
}	

//<!-- menu_array_start -->
var m1TopLvl=new Array
(
"Home", g_address + "/en/index.html","_self",0, "/en/common/images/snHd_home.jpg"
,"What's New", g_address + "/en/whats_new/main.html","_self",0, "/en/common/images/snHd_whatsnew.jpg"
,"About Us", g_address + "/en/aboutOFTA/main.html","_self",1, "/en/common/images/snHd_aboutus.jpg"
,"Newsroom", g_address + "/en/newsroom/main.html","_self",1, "/en/common/images/snHd_newsroom.jpg"
,"Industry Focus", g_address + "/en/industry/main.html","_self",1, "/en/common/images/snHd_industryfocus.jpg"
,"Consumer Focus", g_address + "/en/consumer_interest/main.html","_self",1,"/en/common/images/snHd_consumerfocus.jpg"
,"Telecom Legislation", g_address + "/en/legislation/main.html","_self",1,"/en/common/images/snHd_telecomlegislation.jpg"
,"Facts & Statistics", g_address + "/en/facts/main.html","_self",1,"/en/common/images/snHd_factsandstatistics.jpg"
,"Publications", g_address + "/en/publications/main.html","_self",1,"/en/common/images/snHd_publications.jpg"
,"Access to Information", g_address + "/en/access/main.html","_self",1,"/en/common/images/snHd_accesstoinformation.jpg"
,"Electronic Services", g_address + "/en/eto/main.html","_self",1,"/en/common/images/snHd_electronicservices.jpg"
,"Tender Notices", g_address + "/en/tender/main.html","_self",1,"/en/common/images/snHd_tendernotices.jpg"
,"Registration of Consultants", g_address + "/en/regform/consultancy.html","_self",0,"/en/common/images/snHd_registrationofconsultants.jpg"
,"Contact Us", g_address + "/en/enq_help/main.html","_self",1,"/en/common/images/snHd_contactus.jpg"
,"Tools", g_address + "/en/tools/main.html","_self",1,"/en/common/images/snHd_tools.jpg"
,"Links", g_address + "/en/links.html","_self",1,"/en/common/images/snHd_relatedlinks.jpg"
)

var m1mn3=new Array
(
"Organisation Profile", g_address + "/en/aboutofta/wiofta.html",0
,"Organisation Structure", g_address + "/en/aboutofta/organ.html",0
,"Vision, Mission & Values", g_address + "/en/vmv/vmv98.html",0
,"Major Tasks & Projects", g_address + "/en/aboutOFTA/majortasks.html",0
,"Internal Programmes", g_address + "/en/aboutofta/env-policy.html",0
,"Performance Pledge", g_address + "/en/aboutofta/pp-select.html",0
,"Trading Fund Reports", g_address + "/en/aboutofta/trf-select.html",0
,"Advisory Committees", g_address + "/en/ad-comm/main.html",1
,"Job Openings", g_address + "/en/vacancy/main.html",0
)

var m1mn4=new Array
(
"Press Releases", g_address + "/en/press_rel/main.html",0
,"Media Enquiries", g_address + "/en/enq_help/press.html",0
,"Articles", g_address + "/en/dg_article/main.html",0
,"Speeches & Presentations", g_address + "/en/speech-presentation/main.html",0
,"Corporate Events", g_address + "/en/event/main.html",1
)

var m1mn5=new Array
(
"Licensing", g_address + "/en/tele-lic/main.html",1
,"TA Statements", g_address + "/en/tas/main.html",1
,"TA Decisions", g_address + "/en/ta-decisions/main.html",1
,"Consultations", g_address + "/en/consultations/main.html",1
,"Proceedings in Progress", g_address + "/en/proceedings/main.html",0
//,"Facility-based Operations", g_address + "/en/industry/fbo/main.html",1
,"Facility-based Fixed Services", g_address + "/en/industry/ftns/main.html",1
,"Facility-based Mobile Services", g_address + "/en/industry/mobile/main.html",1
,"Service-based Telecommunications Services", g_address + "/en/industry/sbo/main.html",1
,"CEPA: Selling of Calling Cards in Guangdong Province", g_address + "/en/cepa/industry.html",0
,"WiFi Access Points", g_address + "/en/industry/wifi/main.html",1
,"Broadcasting", g_address + "/en/broadcast/main.html",1
,"Competition Affairs", g_address + "/en/c_bd/main.html",1
,"Frequency Spectrum", g_address + "/en/freq-spec/main.html",1
,"Unsolicited Electronic Messages Ordinance", g_address + "/en/uem/main.html",0
,"Interconnection", g_address + "/en/industry/interconnection/main.html",1
,"Numbering & Portability", g_address + "/en/number_portability/main.html",1
,"In-building Access", g_address + "/en/industry/inbuilding/main.html",1
,"Universal Service Obligation", g_address + "/en/uso/main.html",1
,"Codes of Practice/Guidelines", g_address + "/en/industry/code/main.html",1
,"Papers & Reports", g_address + "/en/industry/paper/main.html",1
,"Standards", g_address + "/en/standards/main.html",1
,"Billing & Metering Integrity Scheme", g_address + "/en/b_m_issues/main.html",0
,"Landing of Submarine Cables in Hong Kong", g_address + "/en/submarine/main.html",0
,"Mobile Content Services", g_address + "/en/industry/MCS/main.html",0
,"Registration Scheme for Buildings with Optical Fibre Access Networks", g_address + "/en/industry/fibre/main.html",0
,"Others", g_address + "/en/industry/others.html",1
)

var m1mn6=new Array
(
"Consumer and User Alert", g_address + "/en/c_alert/alert.html",1
,"Consumer Complaint Statistics",g_address + "/en/consumer_interest/com_stat.html",0
,"General Guide to Consumers", g_address + "/en/c_alert/main.html",1
,"<!--_blank-->Search for Registered WiFi Access Points", g_address + "/apps/clr/content/public_search.asp?language=english",0
,"Stay in Touch in Country Parks", g_address + "/en/ca_bd/country_park.html",0
,"Complaint Cases with Investigation Started or Completed", g_address + "/en/ca_bd/main.html",1
,"Radio Programmes", g_address + "/en/radio_ep/radio_index.html",0
,"The Smart Consumer's Corner", g_address + "/en/consumer_interest/smart_consumer.html",1
,"Facility-based Fixed Services", g_address + "/en/consumer_interest/ftns.html",1
,"Facility-based Mobile Services", g_address + "/en/consumer_interest/mobile.html",1
,"CEPA: Selling of Calling Cards in Guangdong Province", g_address + "/en/cepa/consumer.html",0
,"Internet Services", g_address + "/en/consumer_interest/internet.html",1
,"Unsolicited Electronic Messages Ordinance", g_address + "/en/uem/main.html",0
,"Broadcasting Services", g_address + "/en/consumer_interest/broadcasting/main.html",1
,"Certification & Labelling of Equipment", g_address + "/en/consumer_interest/learn.html",0
,"In-building Access", g_address + "/en/consumer_interest/inbuilding/main.html",1
,"Billing & Metering Integrity Scheme", g_address + "/en/b_m_issues/compliance.html",0
,"Registration Scheme for Buildings with Optical Fibre Access Networks", g_address + "/en/industry/fibre/main.html",0
,"Other Subjects", g_address + "/en/consumer_interest/other.html",1
)

var m1mn7=new Array
(
"Communications Authority Ordinance", g_address + "/en/legislation/ca.html",0
,"<!--_blank-->Telecommunications Ordinance","http://www.legislation.gov.hk/blis_ind.nsf/CurAllengDoc?OpenView&Start=106&Count=25&Expand=106#106",0
,"Legislative Amendments", g_address + "/en/legislation/amendments.html",0
,"Bills", g_address + "/en/legislation/telecom_legislation/bills.html",0
,"TA Orders", g_address + "/en/legislation/ta_order/main.html",0
,"TA Waivers", g_address + "/en/legislation/ta_waivers/main.html",0
,"Guidelines under 6D(1)", g_address + "/en/legislation/guideline_6d_1/main.html",0
,"Guidelines under 6D(2)(a)", g_address + "/en/legislation/guideline_6d_2a/main.html",0
,"Guidelines under 6D(2)(aa)", g_address + "/en/legislation/guideline_6d_2aa/main.html",0
,"Guidelines under 6D(2)(b)", g_address + "/en/legislation/guideline_6d_2b/main.html",0
,"Register under 7(9)", g_address + "/en/legislation/register_7-9/main.html",0
,"Register under 7D(2)", g_address + "/en/legislation/register_7d/main.html",0
)

var m1mn8=new Array
(
"Data & Statistics", g_address + "/en/datastat/main.html",0
,"<!--_x_-->Frequency Spectrum", g_address + "/en/freq-spec/main.html",0
,"<!--_x_-->Numbering", g_address + "/en/numbering/main.html",0
,"Sector Overview", g_address + "/en/sector/main.html",0
,"<!--_x_-->Standards", g_address + "/en/standards/main.html",0
,"Telecom Milestones", g_address + "/en/telecom_fact/milestones/main.html",0
)

var m1mn9=new Array
(
"<!--_x_-->Trading Fund Reports", g_address + "/en/aboutofta/trf-select.html",0
,"Brochures/Leaflets", g_address + "/en/publications/leaflets.html",0
,"<!--_blank-->Fact Sheets","http://www.gov.hk/en/about/abouthk/factsheets/docs/telecommunications.pdf",0
,"Environmental Report", g_address + "/en/publications/environmental.html",0
)

var m1mn10=new Array
(
"Code on Access to Information","/en/access/intro.html",0
,"List of Available Information", g_address + "/en/access/avail_info.html",0
,"Procedures & Charges for Access to Information", g_address + "/en/access/pro_and_charges.html",0
)

var m1mn11=new Array
(
"Online Services", g_address + "/en/online_services/main.html",0,
"Report on Suspected Breach of the UEM Ordinance", g_address + "/en/uem/how_to_report.html",0,
"Consumer Complaints against Telecom Operators", g_address + "/en/enq_help/complaints.html",0,
"Public Complaints against OFTA", g_address + "/en/enq_help/complain_ofta.html",0,
"Electronic Submission", g_address + "/en/eto/acceptance.html",0
)

var m1mn12=new Array
(
"Tender Notices", g_address + "/en/tender/tender.html",0 
,"Invitation for Proposals", g_address + "/en/tender/invitation.html",0
)

var m1mn14=new Array
(
"Public Enquiries & Complaints on Telecommunication Matters", g_address + "/en/enq_help/pub_comp.html",0
,"Report on Suspected Breach of the UEM Ordinance", g_address + "/en/uem/how_to_report.html",0
,"Location Map", g_address + "/en/loc-map/main.html",0
,"Subscribe/Unsubscribe eNewsletters or Other Commercial Electronic Messages", g_address + "/en/enq_help/cem_main.html",0
,"Support Services for Ethnic Minorities",g_address + "/en/ethnic_minorities/ethnic_minorities.html",0
,"Access Co-ordinators and Access Officer",g_address + "/en/enq_help/access_co.html",0
)
var m1mn15=new Array
(
"Glossary", g_address + "/en/report-paper-guide/glossary.html",0
,"Downloadable Software", g_address + "/en/tools/download.html",0
)

var m1mn16=new Array
(
"Related Government Web Sites", g_address + "/en/links/gov.html",0
,"Local Industry Associations", g_address + "/en/links/local.html",0
,"Overseas Organisations", g_address + "/en/links/overseas.html",0
,"Miscellaneous", g_address + "/en/links/mis.html",0
)


var m1mn3_8=new Array
(
"Regulatory Affairs Advisory Committee (RAAC)", g_address + "/en/ad-comm/raac/main.html",0
,"Radio Spectrum Advisory Committee (RSAC)", g_address + "/en/ad-comm/rsac/main.html",0
,"Telecommunications Numbering Advisory Committee (NAC)", g_address + "/en/ad-comm/nac/main.html",0
,"Technical Standards Advisory Committee (TSAC)", g_address + "/en/ad-comm/tsac/main.html",0
,"Telecommunications Users & Consumers Advisory Committee (UCAC)", g_address + "/en/ad-comm/ucac/main.html",0
,"Information Infrastructure Advisory Committee (IIAC)", g_address + "/en/ad-comm/iiac/main.html",0
)

var m1mn4_5=new Array
(
"Industry Events", g_address + "/en/corporate-events.html",0
,"Public Education Activities", g_address + "/en/public_education/index.html",0
)

var m1mn5_1=new Array
(
"Telecom Licences", g_address + "/en/tele-lic/main_licences.html",0
,"Telecom Licensees", g_address + "/en/tele-lic/main_licensees.html",0
,"Operators' Customer Charters", g_address + "/en/tele-lic/cust-charter.html",0
,"Class Licences", g_address + "/en/legislation/class-licence/main.html",0
,"Outer Space Licences", g_address + "/en/tele-lic/osl.html",0
,"How to Apply", g_address + "/en/howto/main.html",0
,"Online Licensing", g_address + "/en/industry/online.html",0
,"<!--_blank-->Period of Validity & Fees of Licences", g_address + "/en/legislation/other_licence/fee.pdf",0
)

var m1mn5_2=new Array
(
"TA Statements by Subject", g_address + "/en/tas/main-bs.html",0
,"TA Statements by Date", g_address + "/en/tas/main-bd.html",0
)

var m1mn5_3=new Array
(
"TA Authorisations", g_address + "/en/ta-auth/main.html",0
,"TA Determinations", g_address + "/en/ta-determine/main.html",0
,"TA Directions", g_address + "/en/ta-directions/main.html",0
,"TA Notices", g_address + "/en/ta-notices/main.html",0
,"Others", g_address + "/en/ta-others/main.html",0
)

var m1mn5_4=new Array
(
"Consultation Papers and Submissions", g_address + "/en/report-paper-guide/paper/consultation.html",0
,"Circular Letters & Related Documents", g_address + "/en/consultations/circulardoc.html",0

)

var m1mn5_6=new Array
(
"<!--_blank-->Licences","http://app1.ofta.gov.hk/apps/telecom_lic/content/lic_list.asp?language=english&intservice=Y&extservice=Y&otherservice=Y",0
,"Fixed-Mobile Convergence / Unified Carrier Licence",g_address + "/en/fmc/main.html",0
,"Consultation Papers & Submissions",g_address + "/en/industry/ftns/consultation.html",0
,"TA Statements",g_address + "/en/tas/tas-bs-ftn.html",0
,"Codes of Practice issued by the TA",g_address + "/en/industry/ftns/cop.html",0
,"Guidance Notes",g_address + "/en/industry/ftns/guidance-notes.html",0
,"Operators' Customer Charters",g_address + "/en/tele-lic/ftn.html",0
,"Tariffs of Fixed Network Operators",g_address + "/en/operators-tariff/ftns-operators.html",0
,"Billing & Metering Integrity Scheme",g_address + "/en/b_m_issues/main.html",0
,"Landing of Submarine Cables in Hong Kong", g_address + "/en/submarine/main.html",0
,"Universal Service Obligation",g_address + "/en/uso/main.html",0
,"Fixed Number Portability",g_address + "/en/number_portability/fnp.html",0
,"In-building Access",g_address + "/en/industry/inbuilding/main.html",0
,"Type II Interconnection",g_address + "/en/interconnection.html",0
)

var m1mn5_7=new Array
(
"<!--_blank-->Licences","http://app1.ofta.gov.hk/apps/telecom_lic/content/lic_list.asp?language=english&mobservice=Y",0
,"Fixed-Mobile Convergence / Unified Carrier Licence",g_address + "/en/fmc/main.html",0
," 2.3 GHz Band Auction", g_address + "/en/industry/2.3GHz/main.html",0
,"850 MHz, 900 MHz and 2 GHz Bands Licensing", g_address + "/en/industry/850/main.html",0
,"Mobile TV Radio Spectrum Licensing", g_address + "/en/industry/mobiletv/main.html",0
,"1800 MHz Band Licensing",g_address + "/en/industry/1800/main.html",0
,"Broadband Wireless Access Licensing",g_address + "/en/industry/broadband/main.html",0
,"CDMA2000 Licensing",g_address + "/en/3g-licensing/licensing850mhz.html",0
,"3G Licensing",g_address + "/en/3g-licensing/main.html",0
,"2G Licensing",g_address + "/en/2g-licensing/main.html",0
,"Consultation Papers & Submissions",g_address + "/en/industry/mobile/consultation.html",0
,"TA Statements",g_address + "/en/tas/tas-bs-mobile.html",0
,"Codes of Practice issued by the TA",g_address + "/en/industry/mobile/cop.html",0
,"Guidance Notes",g_address + "/en/industry/mobile/guidance-notes.html",0
,"Operators' Customer Charters",g_address + "/en/industry/mobile/cust-charter.html",0
,"Tariffs of Mobile Network Operators",g_address + "/en/operators-tariff/mob-operators.html",0
,"Billing & Metering Integrity Scheme",g_address + "/en/b_m_issues/main.html",0
,"Universal Service Obligation",g_address + "/en/uso/main.html",0
,"Mobile Number Portability",g_address + "/en/mnp/main.html",0
,"Mobile Phone RF Radiation Safety",g_address + "/en/ca_bd/rf_safety.html",0
,"Country Parks",g_address + "/en/ca_bd/country_park.html",0
)

var m1mn5_8=new Array
(
"Licences", g_address + "/en/industry/sbo/lic.html",0
,"Consultation Papers & Submissions", g_address + "/en/industry/sbo/consultation.html",0
,"TA Statements", g_address + "/en/tas/tas-bs-sbo.html",0
,"Codes of Practice issued by the TA", g_address + "/en/industry/sbo/cop.html",0
,"Guidance Notes", g_address + "/en/industry/sbo/guidance-notes.html",0
,"Billing & Metering Integrity Scheme", g_address + "/en/b_m_issues/main.html",0
,"Universal Service Obligation", g_address + "/en/uso/main.html",0
,"Fixed Number Portability", g_address + "/en/number_portability/fnp.html",0
,"Mobile Number Portability", g_address + "/en/mnp/main.html",0
,"IP Telephony/Services-based Licence", g_address + "/en/ipphone.html",0
,"Tariffs of Services-Based Operators", g_address + "/en/operators-tariff/sbo.html",0
)

var m1mn5_10=new Array
(
"<!--_blank-->Online Updating Form", g_address + "/apps/clr/content/lic_login.asp?language=english",0
,"<!--_blank-->Search for Registered WiFi Access Points", g_address + "/apps/clr/content/public_search.asp?language=english",0
,"<!--_blank-->Help Menu", g_address + "/en/legislation/class-licence/clr-help.pdf",0
)

var m1mn5_11=new Array
(
"Sound Broadcasting", g_address + "/en/broadcast/sound-main.html",0
,"Television Broadcasting", g_address + "/en/broadcast/tv-main.html",0
,"Related Issues", g_address + "/en/broadcast/related-issues.html",0
,"FAQs", g_address + "/en/broadcast/faq.html",0
,"Useful Links", g_address + "/en/broadcast/links.html",0
)


var m1mn5_12=new Array
(
"Introduction", g_address + "/en/c_bd/general/introduction.html",0
,"Complaints & Investigations", g_address + "/en/c_bd/competition-complaints.html",0
,"Competition Decisions", g_address + "/en/c_bd/competition-decisions.html",0
,"Competition-related Materials & Links", g_address + "/en/c_bd/competition-links.html",0
,"Current Notices", g_address + "/en/c_bd/current-notices.html",0
)

var m1mn5_13=new Array
(
 "Spectrum Management", g_address + "/en/freq-spec/spectrum.html",0
,"Spectrum Policy Framework", g_address + "/en/freq-spec/spr.html",0
,"Spectrum Utilization Fee", g_address + "/en/freq-spec/suf.html",0
)

var m1mn5_15=new Array
(
"Type II Interconnection", g_address + "/en/interconnection.html",0
,"Local Access Charge", g_address + "/en/tas/interconnect/lac.html",0
,"TA Statements", g_address + "/en/tas/tas-bs-interconnection.html",0
,"Interconnection Agreements", g_address + "/en/interconnection/main.html",0
)

var m1mn5_16=new Array
(
"Numbering", g_address + "/en/numbering/main.html",0
,"Fixed Number Portability", g_address + "/en/number_portability/fnp.html",0
,"Mobile Number Portability", g_address + "/en/mnp/main.html",0
)

var m1mn5_17=new Array
(
"List of Operators/Licensees", g_address + "/en/industry/inbuilding/licensees.html",0
,"Telecommunications Licences", g_address + "/en/industry/inbuilding/tele-lic.html",0
,"Guidelines/Information Notes", g_address + "/en/industry/inbuilding/info-notes.html",0
,"Codes of Practice", g_address + "/en/industry/inbuilding/cop.html",0
,"TA Statements", g_address + "/en/industry/inbuilding/tas.html",0
,"TA Determinations", g_address + "/en/industry/inbuilding/ta-determine.html",0
,"CAN Coordination Working Group", g_address + "/en/inbuilding/can/workgroup.html",0
,"FAQs", g_address + "/en/industry/inbuilding/faq.html",0
)

var m1mn5_18=new Array
(
"Consultation Papers & Submissions", g_address + "/en/uso/consub.html",0
,"Regulatory Framework", g_address + "/en/uso/framework.html",0
,"Implementation", g_address + "/en/uso/implementation.html",0
,"Level of Universal Service Charge", g_address + "/en/uso/usc.html",0
,"<!--_blank-->Virtual Training Module","http://itu-coe.ofta.gov.hk/vtm/main_universal.htm",0
,"Related Information", g_address + "/en/uso/related-info.html",0
)

var m1mn5_19=new Array
(
"Codes of Practice issued by the TA", g_address + "/en/code/main.html",0
,"Industry Codes of Practice", g_address + "/en/ca_bd/cop_industry.html",0
,"Guidelines/Guidance Notes", g_address + "/en/report-paper-guide/guidance-notes.html",0
,"Health Advice", g_address + "/en/industry/health_advice.html",0
)

var m1mn5_20=new Array
(
"Discussion Papers", g_address + "/en/report-paper-guide/paper/discussion.html",0
,"Information Papers", g_address + "/en/report-paper-guide/paper/information/main.html",0
,"LegCo Papers", g_address + "/en/report-paper-guide/paper/legco.html",0
,"Consultancy Reports", g_address + "/en/report-paper-guide/report/consultancy.html",0
,"Investigation Reports", g_address + "/en/report-paper-guide/report/investigation.html",0
,"Technical Reports", g_address + "/en/report-paper-guide/report/technical.html",0
,"Other Reports", g_address + "/en/report-paper-guide/report/other.html",0
)

var m1mn5_21=new Array
(
"Telecom Equipment Certification", g_address + "/en/tec/main.html",0
,"HKTA Specifications", g_address + "/en/standards/HKTASpec/hkta-spec.html",0
,"<!--_blank-->Standards Adopted/Under Preparation", g_address + "/en/standards/standards-hk_china.html",0
,"Technical Regulations under Consultation", g_address + "/en/standards/tech-regulations.html",0
,"Related Information", g_address + "/en/standards/standard-issue.html",0
)

//var m1mn5_24=new Array
var m1mn5_26=new Array
(
"Telecom Events", g_address + "/en/industry/events/main.html",0
,"OFTA CoE Site", g_address + "/en/CoE_Site/main.html",0
,"Announcements", g_address + "/en/industry/announcements/main.html",0
)

var m1mn6_1=new Array
(
"Telecommunications Service Contracts", g_address + "/en/c_alert/alert-tsc.html",0
,"Mobile Data Services", g_address + "/en/c_alert/alert-mds.html",0
,"Mobile Phone Services (General)", g_address + "/en/c_alert/alert-mobile.html",0
,"Fixed Telecom Network Services", g_address + "/en/c_alert/alert-ftns.html",0
,"Internet Services", g_address + "/en/c_alert/alert-internet.html",0
,"International Direct Dialling (IDD) Service", g_address + "/en/c_alert/alert-idd.html",0
,"Broadcasting Services", g_address + "/en/c_alert/alert-broadcasting.html",0
,"Radiocommunications Equipment", g_address + "/en/c_alert/alert-rcs.html",0
,"Wi-Fi Services", g_address + "/en/c_alert/alert-wfs.html",0
,"Unsolicited Electronic Messages", g_address + "/en/c_alert/alert-uem.html",0
,"Person-to-Person Marketing Calls (Telecommunications Sector)", g_address + "/en/c_alert/alert-ptp_mc.html",0
,"All Services", g_address + "/en/c_alert/alert-all.html",0
)

var m1mn6_3=new Array
(
"General Guide", g_address + "/en/tips/main.html",0
,"<!--_blank-->Telecom Tips -  provided by Communications Association of Hong Kong", "http://www.cahk.hk/publication/TelecomTips/eng/",0
,"<!--_x_-->Operators' Customer Charters", g_address + "/en/tele-lic/cust-charter.html",0
//,"Presentations", g_address + "/en/ca_bd/presentation.html",0
//,"<!--_x_-->Information Security", g_address + "/en/ca_bd/info_security.html",0
)
/*
m1mn6_2=new Array
(
"Stay in Touch in Country Parks", g_address + "/en/ca_bd/stay-in-touch.html",0
,"Mobile Network Services in Country Parks", g_address + "/en/ca_bd/Coverage-in-country-park-main.html",0
,"Mobile Network Coverage Survey (Mobile Coverage of Hiking Trails in Country Parks)", g_address + "/en/ca_bd/country_map/main.html",0
,"<!--_blank-->Note Card - Emergency Communication in Country Parks by Mobile Phones", g_address + "/en/ca_bd/ec_notecard.pdf",0
)
*/
var m1mn6_6=new Array
(
"<!--_blank-->Investigation Procedures", g_address + "/en/c_bd/general/investigation.pdf",0
,"<!--_blank-->Reports", g_address + "/en/report-paper-guide/report/rp20050329.pdf",0
,"Current Cases", g_address + "/en/ca_bd/cases_new.html",0
,"Completed Cases", g_address + "/en/ca_bd/cases_closed.html",0
)

var m1mn6_8=new Array
(
"Public Education Activities", g_address + "/en/public_education/index.html",0
,"E-Games", g_address + "/en/essay_comp/eng_index_egames.html",0
)

var m1mn6_9=new Array
(
"Consumer Advice", g_address + "/en/tips/servicetype/local.html",0
,"<!--_x_-->Operators' Customer Charters", g_address + "/en/tele-lic/ftn.html",0
,"<!--_x_-->Tariffs of FTNS Operators", g_address + "/en/operators-tariff/ftns-operators.html",0
,"<!--_x_-->In-building Access", g_address + "/en/consumer_interest/inbuilding/main.html",0
,"RJ Plug & Socket System", g_address + "/en/consumer_interest/rj_system/index.html",0
)

var m1mn6_10=new Array
(
"Consumer Advice", g_address + "/en/tips/servicetype/mobile.html",0
,"<!--_x_-->Country Parks", g_address + "/en/ca_bd/country_park.html",0
,"<!--_x_-->Number Portability", g_address + "/en/mnp/main.html",0
,"<!--_x_-->Operators' Customer Charters", g_address + "/en/industry/mobile/cust-charter.html",0
,"<!--_x_-->Mobile Phone RF Radiation Safety", g_address + "/en/ca_bd/rf_safety.html",0
,"<!--_x_-->Safe Use of Mobile Phone", g_address + "/en/ca_bd/safe_use_mobile.html",0
,"Leaflet", g_address + "/en/publications/m_leaflets.html",0
)

var m1mn6_12=new Array
(
"Consumer Advice", g_address + "/en/tips/servicetype/internet.html",0
,"E-mail Spam", g_address + "/en/junk-email/main.html",0
,"Information Security", g_address + "/en/ca_bd/info_security.html",0
,"Performance Pledges of Fixed Broadband Services", g_address + "/en/consumer_interest/pp-broadband.html",0
,"Performance Pledges of Mobile Broadband Services", g_address + "/en/consumer_interest/pp-mobileBroadband.html",0
,"TA Statements - Consumer Information in relation to Broadband Internet Access Services", g_address + "/en/consumer_interest/bias.html",0
)

var m1mn6_14=new Array
(
"Sound Broadcasting", g_address + "/en/consumer_interest/broadcasting/sound-main.html",0
,"Television Broadcasting", g_address + "/en/consumer_interest/broadcasting/tv-main.html",0
)

var m1mn6_16=new Array
(
"List of Operators/Licensees", g_address + "/en/consumer_interest/inbuilding/licensees.html",0
,"Telecommunications Licences", g_address + "/en/consumer_interest/inbuilding/tele-lic.html",0
,"Guidelines/Information Notes", g_address + "/en/consumer_interest/inbuilding/info-notes.html",0
,"Codes of Practice", g_address + "/en/consumer_interest/inbuilding/cop.html",0
,"TA Statements", g_address + "/en/consumer_interest/inbuilding/tas.html",0
,"TA Determinations", g_address + "/en/consumer_interest/inbuilding/ta-determine.html",0
,"FAQs", g_address + "/en/consumer_interest/inbuilding/faq.html",0
)

var m1mn6_19=new Array
(
"Amateur Radio Services", g_address + "/en/amateur/main.html",0
,"Calling Number Display", g_address + "/en/ca_bd/cnd-main.html",0
,"<!--_x_-->Class Licences", g_address + "/en/legislation/class-licence/main.html",0
,"Codes of Practice/Guidelines related to Consumer Interest", g_address + "/en/consumer_interest/cop.html",0
,"Lodging a Complaint against a Telecom Operator on Possible Breach of the Telecommunications Ordinance or Licence Conditions", g_address + "/en/enq_help/complaints.html",0
,"Report on Suspected Breach of the UEM Ordinance", g_address + "/en/uem/how_to_report.html",0
,"<!--_x_-->RF Radiation Safety", g_address + "/en/ca_bd/rf_safety.html",0
,"Tariffs of Telecom Operators", g_address + "/en/operators-tariff/main.html",0
,"<!--_x_-->UCAC", g_address + "/en/ad-comm/ucac/main.html",0
,"<!--_x_-->Information Security", g_address + "/en/ca_bd/info_security.html",0
)

//<!-- menu_array_end -->



var callLocally = false;
if (String(document.location).indexOf("search.gov.hk") < 0)
	callLocally = true;


function isMobile(){
	a = navigator.userAgent||navigator.vendor||window.opera;
	if(/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))
    	return true;
	else
		return false;
}

function generateDocPath(callLocally){
	var aL1 = -1, aL2=-1, aL3 = -1;
	var L1, L2, L3;
	var matched = false;
	var docPath, i;
	
	
	var thisPath="";
	var thisURL = String(document.location).split("/en/");
	
	//added by ryan, " || thisURL[1] == undefined" for netscape7
	if ((thisURL[1] == "") || (thisURL[1]== null) || thisURL[1] == undefined){
		if(callLocally)	//by Ryan
			thisURL[1] = "index.html"; //default document
		else 
			thisURL[1] = "sdlfjlsdj"; //any string other than index.html is OK, by Ryan
	}
		
	//strip parameters
	var qpos = thisURL[1].indexOf("?");
	if ((qpos != -1) )  {
		thisPath = "/en/" + thisURL[1].substring(0, qpos);
	} else {
		thisPath = "/en/" + thisURL[1];
	}
	
	thisPath = g_address_s + thisPath;	//added by Ryan, as the path in menu array  changed, we need to change it too so that it can match the array below
	thisPath = thisPath.toLowerCase();
	
	var hpos = thisPath.indexOf("#");
	if (hpos != -1) thisPath=thisPath.substring(0,hpos);

	g_idxPath = thisPath.toLowerCase(); // idxPath variable used to generate index page
	
	if  (g_docPath == null && g_parentDoc == null && (document.docPath == null) && (document.parentDoc == null) ) {
		// if document path and header properties not defined then search it using menu array 	
		var i=0,j=0,k=0, matched=false;
				
		//find equivalent path from menu array
		L1 = m1TopLvl;
		for (i=0;i<L1.length;i+=5) {
			if ( ( L1[i].indexOf("<!--_x_-->") == -1 ) && (L1[i+1].toLowerCase()==thisPath) ) {aL1=i; matched=true; break;}
			
			if (L1[i+3]==1) { // has child - Level2
				L2 = eval("m1mn"+ (parseInt(i/5)+1));
				for (j=0;j<L2.length;j+=3) {
					
					if ( ( L2[j].indexOf("<!--_x_-->") == -1 ) && (L2[j+1].toLowerCase()==thisPath) ) {aL1=i; aL2=j; matched=true; break;}

					if (L2[j+2]==1) { // has child - Level3
						L3 = eval("m1mn"+(parseInt(i/5)+1)+"_"+ (parseInt(j/3)+1) );
						for (k=0;k<L3.length;k+=3){
							if ( ( L3[k].indexOf("<!--_x_-->") == -1 ) && (L3[k+1].toLowerCase()==thisPath) ){aL1=i; aL2=j; aL3=k; matched=true; break;}
							
						} //loop k
					}
					if (matched) break;
				} //loop j								
			}
			if (matched) break;
		} // loop i
		// construct docPath HTML and Links
		if (matched) {
		// commented out code - so to hide self reference path
			var re = new RegExp('\<br\>', 'gi');
			docPath = "<IMG alt='' SRC='" + g_address_s + "/images/spacer.gif' WIDTH='10' HEIGHT='10' /><BR>";
			if ((aL1!=-1)&&(aL2==-1)) {	/* docPath += "<STRONG>" + L1[aL1] + "</STRONG>" */} else 
			if ((aL1!=-1)) {	docPath += "<A href=" + L1[aL1+1] + " class='docPath'>" + L1[aL1].replace(re," ") + "</A>"	}
			if ((aL2!=-1)&&(aL3==-1)) {	/* docPath += "&nbsp;>&nbsp;<STRONG>" + L2[aL2] + "</STRONG>" */} else
			if (aL2!=-1) {	docPath += "&nbsp;>&nbsp;<A href=" + L2[aL2+1] + " class='docPath'>" + L2[aL2].replace(re," ") + "</A>"}
			if (aL3!=-1) {	/* docPath += "&nbsp;>&nbsp;<STRONG>" + L3[aL3] + "</STRONG>" */ }
			docPath += "<BR><IMG alt='' SRC='" + g_address_s + "/images/spacer.gif'  WIDTH=15 HEIGHT=15 />";
		}
	} else { // with parentDoc & docPath defined
		// only look for page in L1 menu array for a match
		//find equivalent path from menu array
		//by Ryan, added "g_addres +"
		thisPath = g_address_s + String(g_parentDoc);
		thisPath = thisPath.toLowerCase();
		L1 = m1TopLvl;
		for (i=0;i<L1.length;i+=5) {
			if ( ( L1[i].indexOf("<!--_x_-->") == -1 ) && (L1[i+1].toLowerCase()==thisPath) ) {aL1=i; matched=true; break;}
		} // loop i
	}
	
	
	/*******************************
	 * Change by ryan, Nov 2006 
	 ******************************/
	//for WinMobile
	if(docPath != null)	g_docPath = docPath;
	g_headerImg = L1[aL1+4];
	g_pL1 = aL1;
	if ( docPath != null && document.docPath == null ) document.docPath = docPath;
	document.headerImg = L1[aL1+4];
	document.parentL1 = aL1;
}

function writePathWith(path) {
	if(path.length > 0)
	{
		if ( history.length > 1 ) {
			document.write ("<TABLE cellpadding='0' cellspacing='0'><TR><TH></TH></TR><TR><TD WIDTH='100%' valign='top'>");
			document.write(path);
			document.write ("</TD><TD WIDTH='0%' valign='bottom'><A href='javascript:history.go(-1)' title='Back to previously visited page' class='docPath'>&lt;&lt;&nbsp;Back</A><BR><IMG alt='' SRC='" + g_address_s + "/images/spacer.gif' width='15' height='15'></TD></TR></TABLE>\n");
		} else {
			document.write(path);
		}
	}
}
function writePathNew(bIsMobile) {
	var sPath;
	if (document.docPath ) {
		sPath = document.docPath;
	}
	else if(g_docPath) {
		sPath = g_docPath
	}
	
	if(bIsMobile){
		sPath = addMobileHome(sPath);
	}
	
	writePathWith(sPath);
}

//hide the left navigation bar
function hideNavBar(){
	var oBar = document.getElementById("navMenuBar");
	if(oBar != null){
		oBar.parentNode.width= "1px";
		oBar.parentNode.style.width= "1px";
	}
}

//added the static sitemap link to the home
function addMobileHome(sPath){
	var indicator = "<br>";
	var i = 0;
	var sChiLink = currURL.replace("/en/", "/zh/");
	var sSChiLink;
	if(currURL.indexOf(".ofta.gov.hk") > 0)
		sSChiLink = "<a href='ht" + "tp://gbcode.ofta.gov.hk"
	else
		sSChiLink = "<a href='ht" + "tp://gbcode.internal"
	sSChiLink +=  "/TuniS/" + sChiLink.substring(sChiLink.indexOf(document.domain), sChiLink.length) + "'>简体版</a>";
	
	var sTChiLink = "<a href='" + sChiLink + "'>繁體版</a>";
	
	var sHomeLink = sTChiLink + " | " + sSChiLink + " | <a href='/en/tools/sitemap_mobile.html'>Home</a>";
	
	if(sPath){
		i = sPath.toLowerCase().indexOf(indicator)
	
		if(i < 0) 
			i = 0;
		else
			i += indicator.length;
			
		if(sPath.toLowerCase().substring(i).indexOf("<br>") == 0)		
			sPath =  sHomeLink + "<br>";	
		else
			sPath = sPath.substring(0, i) + sHomeLink + " &gt; " + sPath.substring(i);
	}
	else{
		sPath =  sHomeLink + "<br>";
	}
	
	return sPath
}

/**
 * Start main code
 * Edit for mobile, by Ryan LEUNG, Jan 2010
 */
var g_isMobile = false;
if(isMobile(navigator.userAgent||navigator.vendor||window.opera)){
	document.jsMenu_Loaded = true;
	document.jsCommon_Loaded = true;
	
	writeMenu = function(){
		//create something on the nav bar so that we can get the navigation bar DOM object
		document.write('<div id="navMenuBar"></div>'); 
	};
	writeHeader = function(){};
	useCSS = function() {};
	writePath = function(){
		generateDocPath(true);
		writePathNew(true); 
		hideNavBar()
	};
	g_isMobile  = true;
}
else{
	writePath = function(){
		writePathNew(false);
	};
	document.write('<' + 'SCRIPT LANGUAGE="javascript" TYPE="text/javascript" ' + 'SRC="' + g_address_s + '/nav/enMenuFunc.js"></SCRIPT>');
}
