//gen menu ver. 4.0



level_1 = new Array('aboutus', 'services', 'enews', 'activities', 'edc', 'library', 'subscribe', 'links', 'search', 'sitemap', 'contactus', 'copyright','plug');
level_1_alt = new Array('中 心 簡 介', '服 務', '電 子 通 訊', '活 動', '中 心 資 訊', '參 考 資 料', '訂 閱 通 訊', '相 關 網 站', '搜 尋', '網 站 指 南', '聯 絡 我 們', '版 權','軟 件 下 載');
level_1_img_no = new Array('01', '02', '03', '04', '05', '06', '07', '08');
level_1_img_no_main = new Array('07', '11', '12', '13', '14', '15', '18', '23');
level_1_link = new Array(http+menu_path+'about_1.htm', http+menu_path+'services_1.htm', http+menu_path+'enews.htm', http+menu_path+'activities.asp', http+menu_path+'edcalert1.asp', http+menu_path+'library2.asp', https+menu_path_https+'subenews.asp', http+menu_path+'links.asp');



//level_1 1

//level_1 2

function genmenu(){	
	//gentable('link','alt', 'target');	
	if(level_1[fol] == 'aboutus'){ //About us
		tablehd();
		gentable(http+menu_path+'about_1.htm', '使 命','');
		bar();
		gentable(http+menu_path+'about_2.htm', '組 織','');
		bar();
		gentable(http+menu_path+'about_3.htm', '諮 詢 委 員 會','');
		bar();
		gentable(http+menu_path+'about_4.htm', '主 席 獻 辭','');
		//bar();
		//gentable(http+menu_path+'about_5.htm', '里 程 碑','');
		bar();
		gentable(http+menu_path+'contact.asp', '職 員','');
		tablefoot();

	}else if(level_1[fol] == 'services'){ //services
		tablehd();
		gentable(http+menu_path+'services_1.htm', '資 源 中 心','');
		bar();
		gentable(http+menu_path+'services_2.htm', '顧 問 服 務','');
		bar();
		gentable(http+menu_path+'services_3.htm', '培 訓 設 施','');
		tablefoot();

	/*}else if(level_1[fol] == 'edc'){ //edc
		tablehd();
		gentable('edc_whatsnew.html', 'What\'s New','');
		tablefoot();*/

	}else if(level_1[fol] == 'library'){ //library
		tablehd();
		gentable(http+menu_path+'library2.asp', '實 務 指 引','');
		bar();
		gentable(http+menu_path+'library3.asp', '培 訓 視 聽 資 料 / 教 材','');
		bar();
		gentable(http+menu_path+'library4.asp', '個 案 研 究','');
		bar();
		gentable(http+menu_path+'library1.asp', '會 議 及 研 討 會 資 料','');
		tablefoot();

	}else if(level_1[fol] == 'subscribe'){ //subscribe
		tablehd();
		gentable(https+menu_path_https+'subenews.asp', '訂 閱 通 訊','');
		bar();
		gentable(https+menu_path_https+'unsubscribe.asp', '取 消 訂 閱 通 訊','');
		bar();
		gentable(https+menu_path_https+'update_part.asp', '更 新 個 人 資 料','');
		tablefoot();

	}
}

//end level_1 2

function genTopMenu(){
	document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<tr>");
	if (fo!=''){
		document.writeln("	<td><a href=\""+http+menu_path+"main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn02','','"+http+image_path+"image/general/topbtn_over_02.gif',1)\"><img name=\"topbtn02\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_02.gif\" alt=\"主 頁\"></a></td>");
	}
	
		document.writeln("	<td><a href=\"javascript:chglang('entxt')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn03','','"+http+image_path+"image/general/topbtn_over_03.gif',1)\"><img name=\"topbtn03\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_03.gif\" alt=\"Text Only\"></a></td>");
		document.writeln("	<td><a href=\"javascript:chglang('tctxt')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn04','','"+http+image_path+"image/general/topbtn_over_04.gif',1)\"><img name=\"topbtn04\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_04.gif\" alt=\"繁 體 純 文 字 版\"></a></td>");
		document.writeln("	<td><a href=\"javascript:chglang('sctxt')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn05','','"+http+image_path+"image/general/topbtn_over_05.gif',1)\"><img name=\"topbtn05\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_05.gif\" alt=\"簡 体 純 文 字 版\"></a></td>");
		document.writeln("	<td><a href=\"javascript:chglang('en')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn06','','"+http+image_path+"image/general/topbtn_over_06.gif',1)\"><img name=\"topbtn06\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_06.gif\" alt=\"ENGLISH\"></a></td>");
	if (atgb){		
		document.writeln("	<td><a href=\"javascript:chglang('tc')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn07','','"+http+image_path+"image/general/topbtn_over_07.gif',1)\"><img name=\"topbtn07\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_07.gif\" alt=\"繁 體 版\"></a></td>");
	}else{
		document.writeln("	<td><a href=\"javascript:chglang('sc')\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn07','','"+http+image_path+"image/general/topbtn_over_07.gif',1)\"><img name=\"topbtn07\" border=\"0\" src=\""+http+image_path+"image/general/topbtn_07.gif\" alt=\"簡 体 版\"></a></td>");
	}
	
	document.writeln("</tr>");
	document.writeln("</table>");	
}

function genTopMenu_fullpath(fullpath){
	document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<tr>");
	if (fo!=''){
		document.writeln("	<td><a href=\""+fullpath+"chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn02','','"+fullpath+"chi/image/general/topbtn_over_02.gif',1)\"><img name=\"topbtn02\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_02.gif\" alt=\"主 頁\"></a></td>");
	}
	
		document.writeln("	<td><a href=\""+fullpath+"txt_eng/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn03','','"+fullpath+"chi/image/general/topbtn_over_03.gif',1)\"><img name=\"topbtn03\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_03.gif\" alt=\"Text Only\"></a></td>");
		document.writeln("	<td><a href=\""+fullpath+"txt_chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn04','','"+fullpath+"chi/image/general/topbtn_over_04.gif',1)\"><img name=\"topbtn04\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_04.gif\" alt=\"繁 體 純 文 字 版\"></a></td>");
		document.writeln("	<td><a href=\""+http+scserver+ fullpath.replace('http://','')+"txt_chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn05','','"+fullpath+"chi/image/general/topbtn_over_05.gif',1)\"><img name=\"topbtn05\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_05.gif\" alt=\"簡 体 純 文 字 版\"></a></td>");
		document.writeln("	<td><a href=\""+fullpath+"eng/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn06','','"+fullpath+"chi/image/general/topbtn_over_06.gif',1)\"><img name=\"topbtn06\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_06.gif\" alt=\"ENGLISH\"></a></td>");
	if (atgb){		
		document.writeln("	<td><a href=\""+fullpath+"chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn07','','"+fullpath+"chi/image/general/topbtn_over_07.gif',1)\"><img name=\"topbtn07\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_07.gif\" alt=\"繁 體 版\"></a></td>");
	}else{
		document.writeln("	<td><a href=\""+http+scserver+ fullpath.replace('http://','')+"chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn07','','"+fullpath+"chi/image/general/topbtn_over_07.gif',1)\"><img name=\"topbtn07\" border=\"0\" src=\""+fullpath+"chi/image/general/topbtn_07.gif\" alt=\"簡 体 版\"></a></td>");
	}
	
	document.writeln("</tr>");
	document.writeln("</table>");	
}

function genMainMenu(){
	if (fo!=''){
		document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		for (i in level_1_img_no){
			document.writeln("<tr>");
			document.writeln("    <td><a href=\""+level_1_link[i]+"\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('side"+level_1_img_no[i]+"','','"+http+image_path+"image/general/side_over_"+level_1_img_no[i]+".gif',1)\"><img name=\"side"+level_1_img_no[i]+"\" border=\"0\" src=\""+http+image_path+"image/general/side_"+level_1_img_no[i]+".gif\" alt=\""+level_1_alt[i]+"\"></a></td>");
			document.writeln("</tr>");
		}
		document.writeln("<tr>");
		document.writeln("  <td><img border=\"0\" src=\""+http+image_path+"image/general/side_09.gif\"></td>");
		document.writeln("</tr>");
		document.writeln("<tr>");
		document.writeln("    <td>");
		genmenu();
		document.writeln("    </td>");
		document.writeln("</tr>");
		document.writeln("</table>");
	}else{
		document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		for (i in level_1_img_no_main){
			document.writeln("<tr>");
			document.writeln("    <td><a href=\""+level_1_link[i]+"\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('btnfrtop"+level_1_img_no_main[i]+"','','"+http+image_path+"image/front/frtop_over_"+level_1_img_no_main[i]+".gif',1)\"><img name=\"btnfrtop"+level_1_img_no_main[i]+"\" border=\"0\" src=\""+http+image_path+"image/front/frtop_"+level_1_img_no_main[i]+".gif\" alt=\""+level_1_alt[i]+"\"></a></td>");
			document.writeln("</tr>");
		}
		document.writeln("</table>");
	}
}	

function genMainMenu_fullpath(fullpath){
	var level_1_link_fullpath = new Array(fullpath+'chi/about_1.htm', fullpath+'chi/services_1.htm', fullpath+'chi/enews.htm', fullpath+'chi/activities.asp', fullpath+'chi/edcalert1.asp', fullpath+'chi/library2.asp', fullpath.replace("http", "https").replace(dept, "/https"+dept)+'chi/subenews.asp', fullpath+'chi/links.asp');
	if (fo!=''){
		document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		for (i in level_1_img_no){
			document.writeln("<tr>");
			document.writeln("    <td><a href=\""+level_1_link_fullpath[i]+"\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('side"+level_1_img_no[i]+"','','"+fullpath+"chi/image/general/side_over_"+level_1_img_no[i]+".gif',1)\"><img name=\"side"+level_1_img_no[i]+"\" border=\"0\" src=\""+fullpath+"chi/image/general/side_"+level_1_img_no[i]+".gif\" alt=\""+level_1_alt[i]+"\"></a></td>");
			document.writeln("</tr>");
		}
		document.writeln("<tr>");
		document.writeln("  <td><img border=\"0\" src=\""+fullpath+"chi/image/general/side_09.gif\"></td>");
		document.writeln("</tr>");
		document.writeln("<tr>");
		document.writeln("    <td>");
		genmenu();
		document.writeln("    </td>");
		document.writeln("</tr>");
		document.writeln("</table>");
	}else{
		document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		for (i in level_1_img_no_main){
			document.writeln("<tr>");
			document.writeln("    <td><a href=\""+level_1_link_fullpath[i]+"\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('btnfrtop"+level_1_img_no_main[i]+"','','"+fullpath+"chi/image/front/frtop_over_"+level_1_img_no_main[i]+".gif',1)\"><img name=\"btnfrtop"+level_1_img_no_main[i]+"\" border=\"0\" src=\""+fullpath+"chi/image/front/frtop_"+level_1_img_no_main[i]+".gif\" alt=\""+level_1_alt[i]+"\"></a></td>");
			document.writeln("</tr>");
		}
		document.writeln("</table>");
	}
}

function genSearchBar(){
	document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<form name=\"frmSearch\" method=\"get\" action=\"http://search.gov.hk/search.html\" target=_blank >");

	document.writeln("<input name=a_submit type=hidden value=true>");
	document.writeln("<input name=ui_lang type=hidden value=en>");
	document.writeln("<input name=ui_charset type=hidden value=utf-8>");
	document.writeln("<input name=tpl_id type=hidden value=OSP>");
	document.writeln("<input name=r_lang type=hidden value=all>");
	document.writeln("<input name=gp0 type=hidden value=0>");
	document.writeln("<input name=gp1 type=hidden value=icac_home>");
	document.writeln("<input name=doc_type type=hidden value=html>");
	document.writeln("<input name=p_size type=hidden value=30>");
	<!-- -->

	document.writeln("<tr>");
	if(fo!=''){
		document.writeln("  <td><img src=\""+http+image_path+"image/general/intop_09.jpg\"></td>");
		document.writeln("  <td><img src=\""+http+image_path+"image/general/search_bar_01.gif\" alt=\"關 鍵 詞 搜 尋\"></td>");
		document.writeln("  <td width=\"100%\" align=\"center\"><input type=\"text\" name=\"query\" style=\"width:110px;height:20px;font-size:12px;border:1 solid #942300;background-color: #FFFFFF;color:#000000\"></td>");
		document.writeln("  <td><a href=\"javascript:document.frmSearch.submit();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar03','','"+http+image_path+"image/general/search_bar_over_03.gif',1)\"><img name=\"search_bar03\" border=\"0\" src=\""+http+image_path+"image/general/search_bar_03.gif\" alt=\"搜 尋\"></a></td>");
		document.writeln("  <td><a href=\""+http+menu_path+"sitemap.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar04','','"+http+image_path+"image/general/search_bar_over_04.gif',1)\"><img name=\"search_bar04\" border=\"0\" src=\""+http+image_path+"image/general/search_bar_04.gif\" alt=\"網 站 指 南\"></a></td>");
		document.writeln("  <td><a href=\""+http+menu_path+"contactus.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar05','','"+http+image_path+"image/general/search_bar_over_05.gif',1)\"><img name=\"search_bar05\" border=\"0\" src=\""+http+image_path+"image/general/search_bar_05.gif\" alt=\"聯 絡 我 們\"></a></td>");
	}else{
		document.writeln("<td><img src=\""+http+image_path+"image/front/frt_search_01.gif\" alt=\"關 鍵 詞 搜 尋\"></td>");
		document.writeln("<td width=\"100%\" align=\"center\"><input type=\"text\" name=\"query\" style=\"width:110px;height:20px;font-size:12px;border:1 solid #942300;background-color: #FFFFFF;color:#000000\"></td>");
		document.writeln("<td><a href=\"javascript:document.frmSearch.submit();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('frtsearch03','','"+http+image_path+"image/front/frt_search_over_03.gif',1)\"><img name=\"frtsearch03\" border=\"0\" src=\""+http+image_path+"image/front/frt_search_03.gif\" alt=\"搜 尋\"></a></td>");
	}
	document.writeln("</tr>");

	document.writeln("</form>");
	document.writeln("</table>");
}

function genSearchBar_fullpath(fullpath){
	document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<form name=\"frmSearch\" method=\"get\" action=\"http://www.icac.org.hk/cgi-bin/pse.pl\">");
	document.writeln("<input name=mode type=hidden value=11>");
	document.writeln("<input name=lmode type=hidden value=1>");
	document.writeln("<input name=la type=hidden value=1>");
	document.writeln("<input name=gr_1 type=hidden value=\"hkedc\">");
	document.writeln("<tr>");
	if(fo!=''){
		document.writeln("  <td><img src=\""+fullpath+"chi/image/general/intop_09.jpg\"></td>");
		document.writeln("  <td><img src=\""+fullpath+"chi/image/general/search_bar_01.gif\" alt=\"關 鍵 詞 搜 尋\"></td>");
		document.writeln("  <td width=\"100%\" align=\"center\"><input type=\"text\" name=\"qu\" style=\"width:110px;height:20px;font-size:12px;border:1 solid #942300;background-color: #FFFFFF;color:#000000\"></td>");
		document.writeln("  <td><a href=\"javascript:document.frmSearch.submit();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar03','','"+fullpath+"chi/image/general/search_bar_over_03.gif',1)\"><img name=\"search_bar03\" border=\"0\" src=\""+fullpath+"chi/image/general/search_bar_03.gif\" alt=\"搜 尋\"></a></td>");
		document.writeln("  <td><a href=\""+fullpath+"chi/sitemap.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar04','','"+fullpath+"chi/image/general/search_bar_over_04.gif',1)\"><img name=\"search_bar04\" border=\"0\" src=\""+fullpath+"chi/image/general/search_bar_04.gif\" alt=\"網 站 指 南\"></a></td>");
		document.writeln("  <td><a href=\""+fullpath+"chi/contactus.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar05','','"+fullpath+"chi/image/general/search_bar_over_05.gif',1)\"><img name=\"search_bar05\" border=\"0\" src=\""+fullpath+"chi/image/general/search_bar_05.gif\" alt=\"聯 絡 我 們\"></a></td>");
	}else{
		document.writeln("<td><img src=\""+fullpath+"chi/image/front/frt_search_01.gif\" alt=\"關 鍵 詞 搜 尋\"></td>");
		document.writeln("<td width=\"100%\" align=\"center\"><input type=\"text\" name=\"qu\" style=\"width:110px;height:20px;font-size:12px;border:1 solid #942300;background-color: #FFFFFF;color:#000000\"></td>");
		document.writeln("<td><a href=\"javascript:document.frmSearch.submit();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('frtsearch03','','"+fullpath+"chi/image/front/frt_search_over_03.gif',1)\"><img name=\"frtsearch03\" border=\"0\" src=\""+fullpath+"chi/image/front/frt_search_03.gif\" alt=\"搜 尋\"></a></td>");
	}
	document.writeln("</tr>");
	document.writeln("</form>");
	document.writeln("</table>");
}

function genBottomMenu(){
	document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("  <tr> ");
	document.writeln("    <td><img src=\""+http+image_path+"image/general/spacer.gif\" width=\"15\" height=\"41\"></td>");
	document.writeln("    <td width=\"50%\" class=\"btm_txt\"><a href=\""+http+menu_path+"sitemap.htm\" class=\"btm_txtlink\">網 站 指 南</a> | <a href=\""+http+menu_path+"contactus.htm\" class=\"btm_txtlink\">聯 絡 我 們</a> | <a href=\"http://www.icac.org.hk/tc/disclaimer/index.html\" class=\"btm_txtlink\">聲明</a></td>");
	document.writeln("    <td width=\"50%\" align=\"right\" class=\"btm_txt\"><a href=\""+http+menu_path+"plugin.htm\" class=\"btm_txtlink\">軟 件 下 載</a> | <a href=\""+http+menu_path+"copyright.htm\" class=\"btm_txtlink\">版 權</a></td>");
	document.writeln("    <td><img src=\""+http+image_path+"image/general/spacer.gif\" width=\"15\" height=\"41\"></td>");
	document.writeln("  </tr>");
	document.writeln("</table>");
}

function genBottomMenu_fullpath(fullpath){
	document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("  <tr> ");
	document.writeln("    <td><img src=\""+fullpath+"chi/image/general/spacer.gif\" width=\"15\" height=\"41\"></td>");
	document.writeln("    <td width=\"50%\" class=\"btm_txt\"><a href=\""+http+menu_path+"sitemap.htm\" class=\"btm_txtlink\">網 站 指 南</a> | <a href=\""+http+menu_path+"contactus.htm\" class=\"btm_txtlink\">聯 絡 我 們</a> | <a href=\"http://www.icac.org.hk/tc/disclaimer/index.html\" class=\"btm_txtlink\">聲明</a></td>");
	document.writeln("    <td width=\"50%\" align=\"right\" class=\"btm_txt\"><a href=\""+fullpath+"chi/plugin.htm\" class=\"btm_txtlink\">軟 件 下 載</a> | <a href=\""+fullpath+"chi/copyright.htm\" class=\"btm_txtlink\">版 權</a></td>");
	document.writeln("    <td><img src=\""+fullpath+"chi/image/general/spacer.gif\" width=\"15\" height=\"41\"></td>");
	document.writeln("  </tr>");
	document.writeln("</table>");
}

function genLastReviewDate(pageReviewDate){
	var siteReviewDate = "2010/01/28";
	if (pageReviewDate==""){
		document.writeln("最 近 檢 視 日 期: " + siteReviewDate); 
	}else{
		document.writeln("最 近 檢 視 日 期: " + pageReviewDate); 
	}
}