PageSourceSearch

https://www.dh.gov.hk/tc_chi/images/js/tc_function.js

js dh.gov.hk collected 2026-10-01 08:29:47 UTC 18,901 bytes, 315 lines download raw bytes

1
2function externallinks() {
3if (!document.getElementsByTagName) return;
4var anchors = document.getElementsByTagName("a");
5for (var i=0; i<anchors.length; i++) {
6var anchor = anchors[i];
7if (anchor.getAttribute( "href") &&
8anchor.getAttribute( "rel") == "external")
9anchor.target = "_blank"; }
10}
11window.onload = externallinks;
12
13
14function chgText(){
15	var currentURL=document.location.href;
16	var nextURL='';
17	var langPath = '/tc_chi/';
18	var langPathTxt = '/textonly';
19	var langPathInd = '/cindex.html';
20	if(currentURL.indexOf(langPathTxt+"/")>=0)
21	{
22		if(currentURL.indexOf(langPathTxt + langPath)>=0){
23			nextURL=currentURL.ReplaceAll(langPathTxt + langPath , langPath);
24		}
25		else if(currentURL.indexOf(langPathTxt + langPathInd)>=0)
26		{
27			nextURL=currentURL.ReplaceAll(langPathTxt + langPathInd, langPathInd);
28		}
29		else{
30
31
32			var p1 = currentURL.indexOf("/textonly/");
33          	currentPath = currentURL.substring(p1);
34         	var urlElements = currentPath.split("/");
35
36	        nextURL=currentURL.ReplaceAll(langPathTxt+"/" + urlElements[2], "/"+urlElements[2]);
37
38		}
39	}
40	else
41	{
42		if(currentURL.indexOf(langPath)>=0){
43			nextURL=currentURL.ReplaceAll(langPath, langPathTxt + langPath);
44		}
45		else if(currentURL.indexOf(langPathInd)>=0)
46		{
47			nextURL=currentURL.ReplaceAll(langPathInd, langPathTxt + langPathInd);
48		}
49	}
50	document.location.href=nextURL;
51}
52
53function chglang(lang){
54	var currentURL=document.location.href;
55	var nextURL = '';
56	var lang1 = 'english';
57	var langInd1 = '/eindex.html';
58	var lang2 = 'chs';
59	var langInd2 = '/scindex.html';
60	var langDef = '/tc_chi/';
61	var langIndDef = '/cindex.html';
62	var langOther='_tc.html';
63	var langOther1='_eng.html';
64	var langOther2='_sc.html';
65	if(currentURL.indexOf(langDef)>=0){
66		nextURL=currentURL.ReplaceAll(langDef,"/"+lang+"/");
67	}
68	else if(currentURL.indexOf(langIndDef)>=0)
69	{
70		if(lang == lang1)
71		{
72			nextURL=currentURL.ReplaceAll(langIndDef,langInd1);
73		}
74		else if(lang == lang2)
75		{
76			nextURL=currentURL.ReplaceAll(langIndDef,langInd2);
77		}
78	}
79	else if(currentURL.indexOf(langOther)>=0){
80		if(lang == lang1)
81		{
82			nextURL=currentURL.ReplaceAll(langOther,langOther1);
83		}
84		else if(lang == lang2)
85		{
86			nextURL=currentURL.ReplaceAll(langOther,langOther2);
87		}
88	}
89	document.location.href=nextURL;
90}
91
92String.prototype.ReplaceAll = function(stringToFind, stringToReplace){
93    var temp = this;
94
95	var index = temp.indexOf(stringToFind);
96
97	var stringToChanging = '/thisWordIsUseForChangeTheLanguage/';
98
99
100
101        while(index != -1){
102            temp = temp.replace(stringToFind,stringToChanging);
103            index = temp.indexOf(stringToFind);
104        }
105
106	var index2 = temp.indexOf(stringToChanging);
107
108		while(index2 != -1){
109            temp = temp.replace(stringToChanging,stringToReplace);
110            index2 = temp.indexOf(stringToChanging);
111        }
112
113 	return temp;
114}
115
116
117function headerMenu()
118{
119	var path = findingPath();
120
121 // var txtHead = '<span style="font-size:14px"><form id="searchForm" method="GET" action="http://search.gov.hk/search.html">[<a href="javascript:chgText()">圖像版本</a>] [<a href="javascript:chglang(\'english\')">English</a>][<a href="javascript:chglang(\'sc_chi\')">簡體版本</a>] [搜尋 <input name="query" value="輸入查詢字段" size="25" style="font-size:10px;vertical-align:top" type="text" title="搜尋" onMouseOver="this.focus();" onMouseOut="if(this.value==\'\')this.value=\'\';" onBlur="if(this.value==\'\')this.value=\'\';" onFocus="this.select();" onClick="if(this.value==\'輸入查詢字段\')this.value=\'\'" onKeyPress="if(this.value==\'輸入查詢字段\')this.value=\'\'"><input type="submit" value="提交">] [<a href="'+path+'sitemap/sitemap.html">網頁指南</a>] [<a href="'+path+'about/about_cu.html">聯絡我們 </a>]</form></span>';
122   var txtHead = '<p class="hd">衞 生 署 </p><hr><span style="font-size:14px"><form id="searchForm" method="GET" action="https://www.search.gov.hk/search.html">[<a href="javascript:chgText()">圖像版本</a>] [<a href="javascript:chglang(\'english\')">English</a>] [<a href="javascript:chglang(\'chs\')">簡體版本</a>]<input type="hidden" name="tpl_id" value="stdsearch"><input type="hidden" name="ui_lang" value="zh-hk"><input type="hidden" name="ui_charset" value="utf-8"><input type="hidden" name="gp1" value="dh_home"><input type="hidden" name="gp0" value="dh_home"><input type="hidden" name="site" value="dh_home"><input type="hidden" name="web" value="this"> [搜尋 <input name="query" value="輸入查詢字段" size="25" style="font-size:10px;vertical-align:top" type="text" title="搜尋" onMouseOver="this.focus();" onMouseOut="if(this.value==\'\')this.value=\'\';" onBlur="if(this.value==\'\')this.value=\'\';" onFocus="this.select();" onClick="if(this.value==\'輸入查詢字段\')this.value=\'\'" onKeyPress="if(this.value==\'輸入查詢字段\')this.value=\'\'"><input type="submit" value="提交">] [<a href="'+path+'sitemap/sitemap.html">網頁指南</a>] [<a href="'+path+'contactus/contactus.html">聯絡我們</a>]</form></span>';
123
124  document.write(txtHead);
125
126}
127
128function footerMenu()
129{
130
131var path = findingPath();
132
133var txt = '<p style="font-size:14px">[<a href="'+path+'../tc_chi/index.html">主頁</a>] [<a href="'+path+'press/press.html">新聞公報</a>] [<a href="'+path+'aboutus/aboutus.html">關於我們</a>] [<a href="'+path+'main/main.html">主要服務範圍</a>] [<a href="'+path+'tele/tele.html">電話號碼及地址</a>] [<a href="'+path+'statistics/statistics.html">統計數字</a>] [<a href="'+path+'useful/useful.html">有用資料</a>] [<a href="'+path+'pub_rec/pub_rec.html">刊物及公開資料</a>] [<a href="'+path+'legislative/legislative.html">立法會事項</a>] [<a href="'+path+'budget/budget.html">財政預算</a>] [<a href="'+path+'vacancies/vacancies.html">職位空缺</a>] [<a href="'+path+'tender/tender_award.html">
133招標/合約/申請列入衞生署通知名單</a>] [<a href="'+path+'links/links.html">相關網址</a>] [<a href="'+path+'contactus/contactus.html">聯絡我們</a>]</p>';
134
135//var txt = '<p>[ <a href="http://www.gov.hk/tc/residents/" rel="external" onClick="javascript:externallinks()">香港政府一站通</a>] [ <a href="http://www.brandhk.gov.hk/brandhk/index.htm" rel="external" onClick="javascript:externallinks()">亞洲國際都會 - 香港</a>]</p><hr><p>2006 &copy; | <a href="'+path+'notices/notices.html">重要告示</a> | <a href="'+path+'privacy/privacy.html">隱私政策</a></p>';
136
137document.write(txt);
138
139}
140
141
142function footerMenu_2()
143{
144
145var path = findingPath();
146
147var txt = '<p style="font-size:14px">[ <a href="http://www.gov.hk/tc/residents/" rel="external" onClick="javascript:externallinks()">香港政府一站通</a>] [ <a href="http://www.brandhk.gov.hk/brandhk/index.htm" rel="external" onClick="javascript:externallinks()">亞洲國際都會 - 香港</a>] </p><hr><p style="font-size:14px">2006 版權 | <a href="'+path+'notices/notices.html">重要告示</a> | <a href="'+path+'privacy/privacy.html">私隱政策</a></p>';
148
149//var txt = '<p>[ <a href="http://www.gov.hk/tc/residents/" rel="external" onClick="javascript:externallinks()">香港政府一站通</a>] [ <a href="http://www.brandhk.gov.hk/brandhk/index.htm" rel="external" onClick="javascript:externallinks()">亞洲國際都會 - 香港</a>]</p><hr><p>2006 &copy; | <a href="'+path+'notices/notices.html">重要告示</a> | <a href="'+path+'privacy/privacy.html">隱私政策</a></p>';
150
151document.write(txt);
152
153}
154
155
156function subsection(){
157    var path = findingPath_sub();
158    var section=getSection();
159
160    var subsection="";
161if(section=="aboutus"){
162
163	subsection='<span><hr>[<a class="navlink" href="'+path+'aboutus_md/aboutus_md.html" >署長的話</a>] [<a   class="navlink" href="'+path+'aboutus_oc/aboutus_oc.html" >部門組織</a>] [<a class="navlink" href="'+path+'aboutus_mv/aboutus_mv.html" >使命與抱負</a>] [<a class="navlink" href="'+path+'aboutus_pp/aboutus_pp.html" >服務承諾</a>] [<a class="navlink" href="'+path+'aboutus_psi/aboutus_psi.html" >年度開放數據計劃</a>] [<a class="navlink" href="'+path+'aboutus_sd/aboutus_sd.html">年度空間數據計劃</a>]  [<a class="navlink" href="'+path+'aboutus_pps/aboutus_pps.html" >個人資料(私隱)政策</a>]</span>';
164
165}else if(section=="tender"){
166
167	subsection='<span><hr>[<a class="navlink" href="'+path+'tender.html" >招標公告/已批准訂立的合約公告</a>] [<a class="navlink" href="'+path+'inclusion_notification_lists.html" >申請列入衞生署通知名單</a>] </span>';
168
169}else if(section=="main"){
170
171	subsection='<span><hr>[<a class="navlink" href="'+path+'main.html">衞生防護中心</a>] [<a class="navlink" href="http://www.dhcas.gov.hk/" rel="external">兒童體能智力測驗服務</a>] [<a class="navlink" href="'+path+'main_cm/main_cm.html" >中醫藥</a>] [<a class="navlink" href="'+path+'main_cgs/main_cgs.html" >醫學遺傳服務</a>][<a class="navlink" href="'+path+'main_ds/main_ds.html" >牙科服務</a>] [<a class="navlink" href="'+path+'main_ps/main_ps.html" >藥物辦公室</a>] [<a class="navlink" href="'+path+'main_ehs/main_ehs.html" >長者健康服務部</a>] [<a class="navlink" href="'+path+'main_fhs/main_fhs.html" >家庭健康服務</a>] [<a class="navlink" href="'+path+'main_fps/main_fps.html" >法醫服務</a>] [<a class="navlink" href="'+path+'main_hcvu/main_hcvu.html" rel="external" >醫療券事務科</a>] [<a class="navlink" href="http://www.mdco.gov.hk/" rel="external" >醫療儀器科</a>] [<a class="navlink" href="'+path+'main_mc/main_mc.html" >美沙酮診所</a>] [<a class="navlink" href="http://www.orphf.gov.hk/tc" >私營醫療機構規管辦公室</a>] [<a class="navlink" href="main_pdqa/main_pdqa.html" rel="external" >專業發展及質素保證</a>][<a class="navlink" href="'+path+'main_rh/main_rh.html" >放射衞生科</a>] [<a class="navlink" href="'+path+'main_rhp/main_rhp.html" >醫護專業人員注冊</a>] [<a class="navlink" href="'+path+'main_shs/main_shs.html" >學生健康服務</a>][<a class="navlink" href="'+path+'main_taco/main_taco.html" >控煙酒辦公室</a>]</span>';
172
173}else if(section=="tele"){
174
175	subsection='<span><hr>[<a class="navlink" href="'+path+'tele_enq/tele_enq.html" >
175查詢</a>] [<a class="navlink" href="'+path+'tele_htis/tele_htis.html" >健康教育熱線及電話諮詢服務</a>] [<a class="navlink" href="'+path+'tele_chc/tele_chc.html" >診所及健康中心一覽表</a>] </span>';
176
177}else if(section=="statistics"){
178
179	subsection='<span><hr>[<a class="navlink" href="'+path+'statistics_hs/statistics_hs.html" >健康統計數字</a>] [<a class="navlink" href="'+path+'statistics_hms/statistics_hms.html" >醫療衞生服務人力統計調查</a>]  </span>';
180
181}else if(section=="useful"){
182
183	subsection='<span><hr>[<a class="navlink" href="'+path+'useful.html" >給公眾人士</a>] [<a class="navlink" href="'+path+'useful.html#ForHP" >給醫護專業人士</a>] [<a class="navlink" href="'+path+'useful_forms/useful_forms.html" >表格</a>] </span>';
184
185
186}else if(section=="pub_rec"){
187
188	subsection='<span><hr>[<a class="navlink" href="'+path+'pub_rec/pub_rec_arpis/pub_rec_arpis.html">年報,小冊子及資料單張</a>] [<a class="navlink" href="'+path+'pub_rec/pub_rec_lpoi/pub_rec_lpoi.html">刊物及其他資料目錄</a>] </span>';
189
190
191}else if(section=="links"){
192
193	subsection='<span><hr>[<a class="navlink" href="'+path+'links_dh.html">衞生署轄下服務網站</a>][<a class="navlink" href="'+path+'links_so.html">資助機構</a>][<a class="navlink" href="'+path+'links_gdro.html">政府部門及有關機構</a>][<a class="navlink" href="'+path+'links_cbc.html">專業機構</a>][<a class="navlink" href="'+path+'links_noha.html">國家及海外衞生機構</a>][<a class="navlink" href="'+path+'links_oo.html">其他</a>] </span>';
194
195}else if(section=="contactus"){
196
197	subsection='<span><hr>[<a class="navlink" href="'+path+'contactus_enq.html">查詢</a>][<a class="navlink" href="'+path+'contactus_cru.html">意見及投訴</a>] </span>';
198
199}else if(section=="budget"){
200
201	subsection='<span><hr>[<a class="navlink" href="'+path+'budget.html">衞生署</a>][<a class="navlink" href="http://www.budget.gov.hk/2013/index.html" rel="external">政府財政預算案</a>] </span>';
202
203}else if(section=="press"){
204
205	subsection=	document.getElementById('press_menu').innerHTML=' <form action=""><select name="year" title=""><option value="">請  選  擇  年  份  </option><option value="'+path+'2023/press_2023.html">2023</option><option value="'+path+'2022/press_2022.html">2022</option><option value="'+path+'2021/press_2021.html">2021</option><option value="'+path+'2020/press_2020.html">2020</option><option value="'+path+'2019/press_2019.html">2019</option><option value="'+path+'2018/press_2018.html">2018</option><option value="'+path+'2017/press_2017.html">2017</option><option value="'+path+'2016/press_2016.html">2016</option><option value="'+path+'2015/press_2015.html">2015</option><option value="'+path+'2014/press_2014.html">2014</option><option value="'+path+'2013/press_2013.html">2013</option><option value="'+path+'2012/press_2012.html">2012</option> <option value="'+path+'2011/press_2011.html">2011</option><option value="'+path+'2010/press_2010.html">2010</option><option value="'+path+'2009/press_2009.html">2009</option> <option value="'+path+'2008/press_2008.html">2008</option> <option value="'+path+'2007/press_2007.html">2007</option> <option value="'+path+'2006/press_2006.html">2006</option> <option value="'+path+'2005/press_2005.html">2005</option> <option value="'+path+'2004/press_2004.html">2004</option> <option value="'+path+'2003/press_2003.html">2003</option> <option value="'+path+'2002/press_2002.html">2002</option> <option value="'+path+'2001/press_2001.html">2001</option> <option value="'+path+'2000/press_2000.html">2000</option> <option value="'+path+'1999/press_1999.html">1999</option> <option value="'+path+'1998/press_1998.html">1998</option> <option value="'+path+'1997/press_1997.html">1997</option> </select> <input type="submit" value="查 看 " onClick="top.location.href = this.form.year.options[this.form.year.selectedIndex].value;return false;"></form>';
206
207}else{
208
209	subsection='';
210}
211
212
213document.write(subsection);
214}
215
216
217function useful_ld_menu(){
218
219    document.write('<form action=""><label for="select">&nbsp;</label> <select id="select" name="menu1"><option selected="selected" value="useful_ld.html">請選擇年份</option><option value="useful_ld_2025.html">2025</option><option value="useful_ld_2024.html">2024</option><option value="useful_ld_2023.html">2023</option><option value="useful_ld_2022.html">2022</option><option value="useful_ld_2021.html">2021</option><option value="useful_ld_2020.html">2020</option><option value="useful_ld_2019.html">2019</option><option value="useful_ld_2018.html">2018</option><option value="useful_ld_2017.html">2017</option><option value="useful_ld_2016.html">2016</option><option value="useful_ld_2015.html">2015</option><option value="useful_ld_2014.html">2014</option><option value="useful_ld_2013.html">2013</option><option value="useful_ld_2012.html">2012</option><option value="useful_ld_2011.html">2011</option><option value="useful_ld_2010.html">2010</option><option value="useful_ld_2009.html">2009</option><option value="useful_ld_2008.html">2008</option><option value="useful_ld_2007.html">2007</option><option value="useful_ld_2006.html">2006</option><option value="useful_ld_2005.html">2005</option><option value="useful_ld_2004.html">2004</option><option value="useful_ld_2003.html">2003</option><option value="useful_ld_2002.html">2002</option><option value="useful_ld_2001.html">2001</option><option value="useful_ld_2000.html">2000</option><option value="useful_ld_1999.html">1999</option></select> <input onclick="top.location.href = this.form.menu1.options[this.form.menu1.selectedIndex].value;&#13;&#10;return false;" type="submit" value="查 看 "></form>');
220}
221
222function getSection()
223{
224
225	var numPath = new Number;
226	if(!(document.location.href.indexOf("preview") > 0))
227	{
228		numPath = 5;
229	}
230	else
231	{
232		numPath = 6;
233	}
234
235	var currentURL = document.location.href;
236	if (currentURL.indexOf("index.html") > 0)
237		return "eindex";
238	var urlElements = currentURL.split("/");
239
240	return urlElements[numPath];
241}
242
243
244
245function findingPath()
246{
247	var Path= '';
248
249	var currentURL = document.location.href;
250	var p1 = currentURL.indexOf("/tc_chi/");
251	currentPath = currentURL.substring(p1);
252	var urlElements = currentPath.split("/");
253	var l = urlElements.length;
254
255  if(currentURL.indexOf("/tc_chi/")>0)
256	{
257     for(var i=3;i<l;i++)
258		{
259			Path += '../';
260		}
261	}else{
262
263		Path='tc_chi/';
264	}
265
266	return Path;
267}
268
269function findingPath_sub()
270{
271	var Path= '';
272
273	var currentURL = document.location.href;
274	var p1 = currentURL.indexOf("/tc_chi/");
275	currentPath = currentURL.substring(p1);
276	var urlElements = currentPath.split("/");
277	var l = urlElements.length;
278
279  if(currentURL.indexOf("/tc_chi/")>0)
280	{
281     for(var i=4;i<l;i++)
282		{
283			Path += '../';
284		}
285	}else{
286
287		Path='tc_chi/';
288	}
289
290	return Path;
291}
292
293function externallinks() {
294
295   if (!document.getElementsByTagName)
296	   return;
297   var anchors = document.getElementsByTagName("a");
298   for (var i=0; i<anchors.length; i++)
299   {
300        var anchor = anchors[i];
301        if (anchor.getAttribute( "href") && anchor.getAttribute( "rel") == "external")
302		{
303            anchor.target = "_blank";
304		}
305   }
306  window.onload = externallinks;
307
308}
309
310
311
312function showPopupStaticMap(d,c){var b=d.substring(0,1).toLowerCase();if(c=="tc"){c="tc"}var a="http://www.map.gov.hk/static/"+b+"/"+c+"/"+d+".html";openwin(a,"showstaticmap",565,650,-1,-1)}function showPopupAdvancedMap(e,c){var a=screen.width;var d=screen.height;var b=120;w=a-315;h=d-b-40;url="http://www.map.gov.hk/gih3/index.jsp?gih3ID="+e+"&lang="+c;openwin(url,"gih3a",a,d,1,1,"yes","yes")}function openwin(b,l,j,f,e,c,d,a,k,i){var g;d=d||"no";a=a||"no";k=k||"no";leftPos=(e==-1)?(screen.width-j)/2:e;topPos=(c==-1)?(screen.height-f)/2:c;j=j-12;f=f-90;setting="width="+j+",height="+f+",left="+leftPos+",top="+topPos+",resizable="+a+",scrollbars="+k+",status="+d;if(i==1){setting+=",menubar=yes"}g=window.open(b,l,setting);if(g.opener==null){g.opener=self}g.focus();return g};
313
314function showPopupStaticMap2(d,c){var b=d.substring(0,1).toLowerCase();if(c=="tc"){c="tc"}var a="https://www.map.gov.hk/mapviewer/map.do?gmid="+d+"&lg="+c;openwin(a,"showstaticmap",565,650,-1,-1)}
315function showPopupAdvancedMap2(e,c){var a=screen.width;var d=screen.height;var b=120;w=a-315;h=d-b-40;url="https://www.map.gov.hk/gm/gmid/"+e+"?lg="+c;openwin(url,"gih3a",a,d,1,1,"yes","yes")}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.