var lev_div = "";
var lev_div2 = "";
var path = parent.location.pathname;

if(path.indexOf('\\') != -1){
	div = "\\";
}else{
	div = "/";	
}

//level_1 = new Array("about","whatsnew","psr","reform","psi","ccsp", "mr", "or","icc", "youth", "osc", "rmc", "case","tms","grade","photo", "publication", "links", "contactus", "sitemap", "search", "notice","privacy");
//level_1_alt = new Array("關於效率促進組", "最新消息", "公營部門改革通訊", "公營部門改革", "私營機構參與公共服務","以民為本服務計劃", "服務模式重整 / 變革", "業務檢討 / 架構重組", "1823電話中心","Youth.gov.hk", "一站式貨倉建築牌照中心", "管理顧問公司登記", "個案研究","投標/市場意向調查", "職系管理","照片廊", "刊物", "有用連結", "聯絡我們", "網頁指南", "搜尋", "重要告示","私隱政策");

level_1 = new Array("about","whatsnew","psr","reform","psi","ccsp", "mr", "or","icc", "youth", "osc", "rmc", "case","tms","grade","cmps","photo", "publication", "accessibility", "links", "contactus", "sitemap", "search", "notice","privacy");
level_1_alt = new Array("關於效率促進組", "最新消息", "公營部門改革通訊", "公營部門改革", "私營機構參與公共服務","以民為本服務計劃", "服務模式重整 / 變革", "業務檢討 / 架構重組", "1823電話中心","Youth.gov.hk", "一站式貨倉建築牌照中心", "管理顧問公司登記", "個案研究","投標/市場意向調查", "職系管理","昔日研討會講義","照片廊", "刊物","无障碍统筹经理及无障碍主任", "有用連結", "聯絡我們", "網頁指南", "搜尋", "重要告示","私隱政策");

lev = path.split(div);

for(i=0; i<level_1.length; i++){	
	if(path.indexOf(div + level_1[i] + div) != -1){				
		fol = i;
		for (j=0; j<lev.length; j++){			
			if(lev[j] == level_1[i]){
				lev_no = j;
				break;				
			}
		}		
	}
}

for (i=0 ;i<(lev.length - lev_no)-1 ;i++){
	lev_div += "../";
}

//alert(lev_div);

function genhead(){	
	document.write('<img src="'+lev_div+'images/'+level_1[fol]+'/pic_'+level_1[fol]+'.jpg" alt="'+level_1_alt[fol]+'">');
}

function genmenu(sel){	

	if(fol == 0 && sel == 0){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
//		gentable('歡迎辭', lev_div2+'about_wel/about_wel.html');
		gentable('願景及使命', lev_div2+'about_vm/about_vm.html');
		gentable('服務範圍', lev_div2+'about_ser/about_ser.html');
		gentable("效率促進組的職能", lev_div2+'about_role/about_role.html');
		gentable("服務承諾", lev_div2+'about_pp/about_pp.html');
		gentable('架構及管理', lev_div2+'about_org/about_org.html');
	}

//	if(fol == 2 && sel == 2){
//		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
//			lev_div2 += "../";
//		}
//		gentable('最新通訊特寫', lev_div2+'psr_current/psr_current.html');
//		gentable('昔日通訊特寫', lev_div2+'psr_past/psr_past.html');		
//	}

	if(fol == 3 && sel == 3){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('改革歷程概要', lev_div2+'reform_over/reform_over.html');
		gentable('公營部門改革未來路向', lev_div2+'reform_agenda/reform_agenda.html');
		gentable('公營部門改革目前和日後的挑戰', lev_div2+'reform_cha/reform_cha.html');
//		gentable('參考資料', lev_div2+'reform_ref/reform_ref_glo/reform_ref_glo.html');	
	
	}

//	if(fol == 3 && sel == 3){
//		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
//			lev_div2 += "../";
//		}
//		gentable('改革歷程概述', lev_div2+'history_over/history_over.html');
//		gentable('管理研討會2002', lev_div2+'history_mf/history_mf.html');
//		gentable('資源增值計劃', lev_div2+'history_epp/history_epp.html');
//		gentable('成效為本管理工作', lev_div2+'history_man/history_man.html');
//		gentable('服務市民', lev_div2+'history_ser/history_ser.html');
//		gentable('七十、八十年代的改革', lev_div2+'history_ref/history_ref.html');
//	}

	if(fol == 4 && sel == 4){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('私營機構參與公共服務', lev_div2+'psi_psi/psi_psi_over/psi_psi_over.html');
		gentable('公營部門與私營機構合作', lev_div2+'psi_ppp/psi_ppp_over/psi_ppp_over.html');
		gentable('外判', lev_div2+'psi_out/psi_out_over/psi_out_over.html');
		gentable('個案研究', lev_div2+'psi_case/psi_case.html');
		gentable('參考資料及有用連結', lev_div2+'psi_guides/psi_guides_ppgpop/psi_guides_ppgpop.html');
//		gentable('昔日研討會講義', lev_div2+'psi_course/psi_course.html', '#F0C1C1', '#FFFFFF');
		gentable('效率促進組如何提供協助', lev_div2+'psi_how/psi_how.html');
	}

	if(fol == 5 && sel == 5){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('以民為本服務計劃', lev_div2+'ccsp_over/ccsp_over.html');
		gentable('顧客管理評估機制', lev_div2+'ccsp_cmaf/ccsp_cmaf.html');
		gentable('處理公眾投訴及查詢', lev_div2+'ccsp_chm/ccsp_chm.html');
	}

	if(fol == 6 && sel == 6){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('業務流程重整資源中心', lev_div2+'mr_resource/mr_resource.html');
//		gentable('Self-Assessment', lev_div2+'mr_self/mr_self_out/mr_self_out.html');
		gentable('成功故事', lev_div2+'mr_success/mr_success_lcs/mr_success_lcs.html');
		gentable('有用連結', lev_div2+'mr_useful/mr_useful.html');
		gentable('效率促進組如何提供協助', lev_div2+'mr_how/mr_how.html');
	}

	if(fol == 7 && sel == 7){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('概述及好處', lev_div2+'or_over/or_over.html');
		gentable('業務檢討 / 重組架構的機會', lev_div2+'or_oor/or_oor.html');
		gentable("效率促進組的往績", lev_div2+'or_eu/or_eu.html');
//		gentable('Case Study', lev_div2+'or_case/or_case.html');
		gentable('效率促進組如何提供協助', lev_div2+'or_how/or_how.html');
	}

//	if(fol == 8 && sel == 8){
//		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
//			lev_div2 += "../";
//		}
//		gentable('概述', lev_div2+'icc_over/icc_over.html');
//		gentable('1823電話中心如何提供協助', lev_div2+'icc_howicc/icc_howicc.html');
//		gentable('參與部門', lev_div2+'icc_part/icc_part.html');
//		gentable('統計資料', lev_div2+'icc_some/icc_some.html');
//		gentable('ISO 10002', lev_div2+'icc_iso/icc_iso.html');
//		//gentable('效率促進組如何提供協助', lev_div2+'icc_howeu/icc_howeu.html');
//	}

	if(fol == 9 && sel == 9){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('Youth.gov.hk', lev_div2+'youth.html');
		gentable('職位空缺', lev_div2+'youth_job.html');
	}

	if(fol == 11 && sel == 11){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('概述', lev_div2+'rmc_over/rmc_over.html');
		gentable('管理顧問公司登記名單', lev_div2+'rmc_reg/rmc_reg.html');
		gentable('一般管理顧問服務網站', lev_div2+'rmc_cpr/rmc_cpr.html');
//		gentable('登記條件及登記程序', lev_div2+'rmc_cpr/rmc_cpr.html');
//		gentable('更新登記資料', lev_div2+'rmc_up/rmc_up.html');
	}

	if(fol == 13 && sel == 13){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('投標', lev_div2+'tender.html');
		gentable('市場意向調查', lev_div2+'market.html');
	}

	if(fol == 14 && sel == 14){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('管理參議主任職系', lev_div2+'grade_mso/grade_mso_over/grade_mso_over.html');
	}
	if(fol == 16 && sel == 16){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('照片廊', lev_div2+'photo.html');
		gentable('昔日照片', lev_div2+'photo_arc.html');
	}

	if(fol == 17 && sel == 17){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('最佳做法刊物', lev_div2+'pub_bp/pub_bp.html');
		gentable('其他刊物', lev_div2+'pub_oth/pub_oth.html');
	}

	if(fol == 19 && sel == 19){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
//		gentable('1823政府熱線 / 相關部門 / 組織機構', lev_div2+'links_gov/links_gov.html');
		gentable('相關網站', lev_div2+'links_related/links_related.html');		
	}
	
}


function gentable(alt, link,orgcol, overcol){
if(orgcol == "" || orgcol == undefined){
	orgcol = "#E0E5FE";
}

if(overcol == "" || overcol == undefined){
	overcol = "#FAD559";
}

	document.write('<tr>'+
                '<td width="100%" onMouseOver="bgColor=\''+overcol+'\'" onMouseOut="bgColor=\''+orgcol+'\'" bgcolor="'+orgcol+'">'+
                 ' <table width="100%" border="0" cellspacing="0" cellpadding="0">'+
                  '  <tr valign="top"> '+
                   '   <td><img src="'+lev_div+'images/general/sidearrow.gif" alt="image"></td>'+
                    '  <td  width="100%" class="sidesub"><a href="'+link+'" class="sidesublink">'+alt+'</a></td>'+
                   ' </tr>'+
                  '</table>'+
                '</td>'+
              '</tr>'+
              '<tr> '+
               ' <td width="100%" bgcolor="#8E99BA"><img src="'+lev_div+'images/general/spacer.gif" width="11" height="1" alt="image"></td>'+
              '</tr>'); 			  
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
