//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('About Us', 'Services', 'E-Newsletter', 'Activities', 'EDC News', 'Library', 'Subscribe E-news', 'Links', 'Search', 'Sitemap', 'Contact Us', 'Copyright','Plug in Downloads');
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', 'Mission','');
		bar();
		gentable(http+menu_path+'about_2.htm', 'Organisation','');
		bar();
		gentable(http+menu_path+'about_3.htm', 'Advisory Committee','');
		bar();
		gentable(http+menu_path+'about_4.htm', 'Chairman\'s Message','');
		//bar();
		//gentable(http+menu_path+'about_5.htm', 'Milestones','');
		bar();
		gentable(http+menu_path+'contact.asp', 'Staff','');
		tablefoot();

	}else if(level_1[fol] == 'services'){ //services
		tablehd();
		gentable(http+menu_path+'services_1.htm', 'Resource Centre','');
		bar();
		gentable(http+menu_path+'services_2.htm', 'Consultancy Service','');
		bar();
		gentable(http+menu_path+'services_3.htm', 'Training Facilities','');
		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', 'Practical Guide','');
		bar();
		gentable(http+menu_path+'library3.asp', 'Training Package / Video','');
		bar();
		gentable(http+menu_path+'library4.asp', 'Case Studies','');
		bar();
		gentable(http+menu_path+'library1.asp', 'Conference &amp; Seminar Papers','');
		tablefoot();

	}else if(level_1[fol] == 'subscribe'){ //subscribe
		tablehd();
		gentable(https+menu_path_https+'subenews.asp', 'Subscribe E-news','');
		bar();
		gentable(https+menu_path_https+'unsubscribe.asp', 'Un-subscribe E-news','');
		bar();
		gentable(https+menu_path_https+'update_part.asp', 'Update Personal Particulars','');
		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=\"Home\"></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('tc')\" 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=\"繁體版\"></a></td>");
	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+"eng/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn02','','"+fullpath+"eng/image/general/topbtn_over_02.gif',1)\"><img name=\"topbtn02\" border=\"0\" src=\""+fullpath+"eng/image/general/topbtn_02.gif\" alt=\"Home\"></a></td>");
	}
	document.writeln("	<td><a href=\""+fullpath+"txt_eng/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn03','','"+fullpath+"eng/image/general/topbtn_over_03.gif',1)\"><img name=\"topbtn03\" border=\"0\" src=\""+fullpath+"eng/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+"eng/image/general/topbtn_over_04.gif',1)\"><img name=\"topbtn04\" border=\"0\" src=\""+fullpath+"eng/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+"eng/image/general/topbtn_over_05.gif',1)\"><img name=\"topbtn05\" border=\"0\" src=\""+fullpath+"eng/image/general/topbtn_05.gif\" alt=\"簡体純文字版\"></a></td>");
	document.writeln("	<td><a href=\""+fullpath+"chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn06','','"+fullpath+"eng/image/general/topbtn_over_06.gif',1)\"><img name=\"topbtn06\" border=\"0\" src=\""+fullpath+"eng/image/general/topbtn_06.gif\" alt=\"繁體版\"></a></td>");
	
	document.writeln("	<td><a href=\""+http+scserver+ fullpath.replace('http://','') +"chi/main2.asp\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('topbtn07','','"+fullpath+"eng/image/general/topbtn_over_07.gif',1)\"><img name=\"topbtn07\" border=\"0\" src=\""+fullpath+"eng/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+'eng/about_1.htm', fullpath+'eng/services_1.htm', fullpath+'eng/enews.htm', fullpath+'eng/activities.asp', fullpath+'eng/edcalert1.asp', fullpath+'eng/library2.asp', fullpath.replace("http", "https").replace(dept, "/https"+dept)+'eng/subenews.asp', fullpath+'eng/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+"eng/image/general/side_over_"+level_1_img_no[i]+".gif',1)\"><img name=\"side"+level_1_img_no[i]+"\" border=\"0\" src=\""+fullpath+"eng/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+"eng/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+"eng/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+"eng/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=12>");
	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+"eng/image/general/intop_09.jpg\"></td>");
		document.writeln("  <td><img src=\""+fullpath+"eng/image/general/search_bar_01.gif\" alt=\"Keyword Search\"></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+"eng/image/general/search_bar_over_03.gif',1)\"><img name=\"search_bar03\" border=\"0\" src=\""+fullpath+"eng/image/general/search_bar_03.gif\" alt=\"Search\"></a></td>");
		document.writeln("  <td><a href=\""+fullpath+"eng/sitemap.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar04','','"+fullpath+"eng/image/general/search_bar_over_04.gif',1)\"><img name=\"search_bar04\" border=\"0\" src=\""+fullpath+"eng/image/general/search_bar_04.gif\" alt=\"Sitemap\"></a></td>");
		document.writeln("  <td><a href=\""+fullpath+"eng/contactus.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('search_bar05','','"+fullpath+"eng/image/general/search_bar_over_05.gif',1)\"><img name=\"search_bar05\" border=\"0\" src=\""+fullpath+"eng/image/general/search_bar_05.gif\" alt=\"Contact us\"></a></td>");
	}else{
		document.writeln("<td><img src=\""+fullpath+"eng/image/front/frt_search_01.gif\" alt=\"Keyword Search\"></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+"eng/image/front/frt_search_over_03.gif',1)\"><img name=\"frtsearch03\" border=\"0\" src=\""+fullpath+"eng/image/front/frt_search_03.gif\" alt=\"Search\"></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\">Sitemap</a> | <a href=\""+http+menu_path+"contactus.htm\" class=\"btm_txtlink\">Contact us</a> | <a href=\"http://www.icac.org.hk/en/disclaimer/index.html\" class=\"btm_txtlink\">Disclaimer Notice</a></td>");
	document.writeln("    <td width=\"50%\" align=\"right\" class=\"btm_txt\"><a href=\""+http+menu_path+"plugin.htm\" class=\"btm_txtlink\">Plug in Download</a> | <a href=\""+http+menu_path+"copyright.htm\" class=\"btm_txtlink\">Copyright</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+"eng/image/general/spacer.gif\" width=\"15\" height=\"41\"></td>");
	document.writeln("    <td width=\"50%\" class=\"btm_txt\"><a href=\""+fullpath+"eng/sitemap.htm\" class=\"btm_txtlink\">Sitemap</a> | <a href=\""+http+menu_path+"contactus.htm\" class=\"btm_txtlink\">Contact us</a> | <a href=\"http://www.icac.org.hk/en/disclaimer/index.html\" class=\"btm_txtlink\">Disclaimer</a></td>");
	document.writeln("    <td width=\"50%\" align=\"right\" class=\"btm_txt\"><a href=\""+fullpath+"eng/plugin.htm\" class=\"btm_txtlink\">Plug in Download</a> | <a href=\""+http+menu_path+"copyright.htm\" class=\"btm_txtlink\">Copyright</a></td>");
	document.writeln("    <td><img src=\""+fullpath+"eng/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("Last review date: " + siteReviewDate); 
	}else{
		document.writeln("Last review date: " + pageReviewDate); 
	}
}