//gen menu ver. 4.0

level_1 = new Array('slaughterhouse','rapid_alert','consumer_zone','events','eindex.html','whatsnew','aboutus','press','food_leg','import','programme','committee','nutrient','public','multimedia','links','faq','contactus','sitemap','search','notices','trade_zone');
//level 1

function genmenu(){
	//gentable(lev_div+'link','alt','target','layer');
	gentable(lev_div+'../eindex.html', 'Home', '', '');
	gentable(lev_div+'whatsnew/whatsnew.html', 'What\'s New', '', 'y');	
	gentable(lev_div+'aboutus/aboutus.html', 'About Us', '', 'y');
	gentable(lev_div+'press/press_e.html', 'Press Release', '', '');
	gentable(lev_div+'programme/programme.html', 'Programme Areas', '', 'y');
	gentable(lev_div+'committee/committee.html', 'Committee and Forum', '', '');
	gentable(lev_div+'import/import.html', 'Import Control / <br>Export Certification', '', 'y');	
	gentable(lev_div+'slaughterhouse/slaughterhouse.html', 'Slaughterhouses and Food Animal Monitoring', '', 'y');	
	gentable(lev_div+'food_leg/food_leg.html', 'Food Legislation / Guidelines', '', '');
	gentable(lev_div+'multimedia/multimedia.html', 'Multimedia Library', '', 'y');	
	gentable(lev_div+'nutrient/index.shtml', 'Nutrient Information Inquiry','', '');		
	gentable(lev_div+'public/public.html', 'Public Forms', '', '');
	gentable(lev_div+'faq/faq.html', 'Frequently Asked Questions', '', '');
	gentable(lev_div+'links/links.html', 'Links', '', 'y');	
	gentable(lev_div+'contactus/contactus.html', 'Contact Us', '', 'y');
	gentable('', 'Site Map', '', '', '');
	gentable('', 'Search', '', '', '');
	gentable('', 'Important notices', '', '', '');
}


//end level 1


// level 2
function genlayer(){	
	//genlaytab(lev_div+'link', 'alt', 'orgcolor', 'overcol','target');

	for(l=0; l<layer.length; l++){
		if(layer[l] == "What\'s New"){			
			genlayerheader(l);
			genlaytab(lev_div+'whatsnew/whatsnew_fa/whatsnew_fa.html', 'Food Alerts', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'whatsnew/whatsnew_act/whatsnew_act.html', 'Activities', '#FF8213', '#FFC28B','');			
			bar2();
			genlaytab(lev_div+'whatsnew/whatsnew_fstr/whatsnew_fstr.html', 'New Information and Risk In Brief', '#FF8213', '#FFC28B','');
			genlayerfooter();

		}else if(layer[l] == "About Us"){			
			genlayerheader(l);
			//genlaytab(lev_div+'aboutus/aboutus_mc/aboutus_mc.html', 'Message from the Controller', '#FF8213', '#FFC28B','');
			//bar2();
			genlaytab(lev_div+'aboutus/aboutus_org/aboutus_org.html', 'Organisation', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'aboutus/aboutus_vm/aboutus_vm.html', 'Vision and Mission', '#FF8213', '#FFC28B','');
                        bar2();
                        genlaytab(lev_div+'aboutus/aboutus_iv/aboutus_iv.html', 'Introduction Video', '#FF8213', '#FFC28B','');
			bar2();
			genlayerfooter();

		}else if(layer[l] == "Programme Areas"){
			genlayerheader(l);
			genlaytab(lev_div+'programme/programme_fs/programme_fs.html', 'Food Surveillance Programme', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'programme/programme_haccp/programme_haccp.html', 'HACCP System', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'programme/programme_gmf/programme_gmf.html', 'Genetically Modified Food', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'whatsnew/whatsnew_act/whatsnew_act_19_Nutrition_Labelling_Scheme.html', 'Nutrition Information on Food Labels', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'programme/programme_rafs/programme_rafs.html', 'Risk Assessment in Food Safety', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'programme/programme_firm/programme_firm.html', 'Food Incidents Response and Management', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'programme/programme_firm/programme_fcs.html', 'Food Consumption Survey', '#FF8213', '#FFC28B','');
			genlayerfooter();

		}else if(layer[l] == "Import Control / <br>Export Certification"){
			genlayerheader(l);
			genlaytab(lev_div+'import/import_imf.html', 'The Mainland Farm Inspection and Liaison with the Relevant Mainland Authorities', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_ifc.html', 'Imported Food Control', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_ifa.html', 'Imported Inspection of Live Food Animals', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_efp.html', 'Exported Food Products', '#FF8213', '#FFC28B','');
			genlayerfooter();
		
		}else if(layer[l] == "Slaughterhouses and Food Animal Monitoring"){
			genlayerheader(l);
			genlaytab(lev_div+'import/import_caf.html', 'Control on Admission of Food Animals to Slaughterhouses and Sampling and Testing on Agricultural Chemical and Veterinary Drug Residues', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_sds.html', 'Slaughterhouses and Disease Surveillance', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_ami.html', 'Ante-mortem Inspection', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'import/import_smi.html', 'Slaughterhouses and Meat Inspection', '#FF8213', '#FFC28B','');
			bar2();
			genlayerfooter();

		}else if(layer[l] == "Multimedia Library"){
			genlayerheader(l);
			genlaytab(lev_div+'multimedia/multimedia_pub/multimedia_pub.html', 'Publications', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'multimedia/multimedia_avr/multimedia_avr.html', 'Audio-visual Resources', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'multimedia/multimedia_og/multimedia_og.html', 'Online Games', '#FF8213', '#FFC28B','');
			genlayerfooter();

		}else if(layer[l] == "Links"){
			genlayerheader(l);
			genlaytab(lev_div+'links/links_rgd/links_rgd.html', 'Related Government Departments / Organisations', '#FF8213', '#FFC28B','');
			bar2();
			genlaytab(lev_div+'links/links_rs/links_rs.html', 'Related Sites', '#FF8213', '#FFC28B','');
			genlayerfooter();

		}else if(layer[l] == "Contact Us"){
			genlayerheader(l);
			genlaytab(lev_div+'contactus/contactus_atn/contactus_atn.html', 'Address and Telephone Number', '#FF8213', '#FFC28B','');
			bar2();
			

		}
	}
}

//end level 2

function gen_footer(lang) {
	s = new Date();	
	document.write(s.getFullYear());
	
	if (lang == 'e') {
		document.write("<img src=\"/english/images/clf/copy.gif\" alt=\"copyright logo\" align=\"absmiddle\"> | ");
		//document.write("<a href=\"/english/notices/notices.html\"><b>Important notices</b></a>");
		document.write("<a href=\"/english/notices/notices.html\"><b>Important notices</b></a> | ");
		document.write("<a href=\"/english/notices/privacy.html\"><b>Privacy Policy</b></a>");
	} else if (lang == 'c') {
		document.write("<img src=\"/tc_chi/images/clf/copy.gif\" alt=\"版權\" align=\"absmiddle\"> | ");
		//document.write("<a href=\"/tc_chi/notices/notices.html\"><b>重要告示</b></a>");
		document.write("<a href=\"/tc_chi/notices/notices.html\"><b>重要告示</b></a> | ");
		document.write("<a href=\"/tc_chi/notices/privacy.html\"><b>私隱政策</b></a>");
	}
}

function gen_czList() {
	document.write("<select name=\"cz_quickURL\" class=\"cfs_list\" onChange=\"quickURL(this);\">");
	document.write("<option selected>------------------ Please select ------------------</option>");
	document.write("<option>==== Food Safety =====</option>");
	document.write("<option value=\"foodsafety_additives.html\">Food Additives</option>");
	document.write("<option value=\"foodsafety_borneillness.html\">Foodborne Illness</option>");
	document.write("<option value=\"foodsafety_contaminants.html\">Food Contaminants</option>");
	document.write("<option value=\"foodsafety_labelling.html\">Food Labelling</option>");
	document.write("<option value=\"foodsafety_surveillance.html\">Food Surveillance Results</option>");
	document.write("<option value=\"foodsafety_genfood.html\">Genetically Modified Food</option>");
	document.write("<option value=\"foodsafety_nutirition.html\">Nutrition Information</option>");
	document.write("<option>===== Food Product =====</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#frozen\">Beverages and Frozen Confections</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#fruits\">Fruits and Vegetables</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#meat\">Meat, Poultry and Eggs</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#other\">Other Foods</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#seafood\">Seafood</option>");
	document.write("<option value=\"consumer_zone_foodprod.html#seasonal\">Seasonal Food</option>");
	document.write("<option>===== Education Resources =====</option>");
	document.write("<option value=\"consumer_zone_eduresource.html#booklets\">Booklet</option>");
	document.write("<option value=\"/english/multimedia/multimedia_pub/multimedia_pub_fsb.html\">Food Safety Bulletin (For Consumers)</option>");
	document.write("<option value=\"/english/multimedia/multimedia_pub/multimedia_pub_fsf.html\">Food Safety Focus</option>");
    document.write("<option value=\"/english/programme/programme_gmf/programme_gmf_er_res1.html\">GM Food Newsletter and Pamphlets</option>");
	document.write("<option value=\"/english/multimedia/multimedia_pub/multimedia_pub_pm.html\">Leaflet / Pamphlet Library</option>");
	document.write("<option value=\"/english/multimedia/multimedia_og/multimedia_og.html\">Online Games</option>");
	document.write("<option value=\"/english/multimedia/multimedia_pub/multimedia_pub_pm_pol.html\">Poster Library</option>");
	document.write("<option value=\"/english/programme/programme_rafs/programme_rafs.html\">Risk Assessment Studies and Risk in Brief</option>");
	document.write("</select>");
}