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", "cmps","photo", "publication", "accessibility", "links", "contactus", "sitemap", "search", "notice","privacy");

level_1_alt = new Array("About Us","What's New","PSR Newsletter","Public Sector Reform","Private Sector Involvement", "Citizen Centric Services Programme", "Major Re-engineering / Transformation", "Business Review / Organisational Re-structuring", "1823 Call Centre", "Youth.gov.hk", "One Stop Centre for Warehouse Construction Permits", "Registration of Management Consultants", "List of Case Studies","Tender/Market Sounding", "Grade Management", "Course Materials of Past EU Seminars","Photo Gallery", "Publications","Access Co-ordinator and Access Officers","Links", "Contact Us", "Site Map", "Search", "Important Notice","Privacy Policy");
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('Welcome Message', lev_div2+'about_wel/about_wel.html');
		gentable('Vision and Mission Statements', lev_div2+'about_vm/about_vm.html');
		gentable('Service offerings', lev_div2+'about_ser/about_ser.html');
		gentable("EU's Role", lev_div2+'about_role/about_role.html');
		gentable("Performance Pledges", lev_div2+'about_pp/about_pp.html');
		gentable('Organisation &amp; Management', 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('Current Issue', lev_div2+'psr_current/psr_current.html');
//		gentable('Past Issues', 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('Overview of Reform', lev_div2+'history_over/history_over.html');
//		gentable('Management Forum 2002', lev_div2+'history_mf/history_mf.html');
//		gentable('Enhanced Productivity Programme', lev_div2+'history_epp/history_epp.html');
//		gentable('Managing for Result', lev_div2+'history_man/history_man.html');
//		gentable('Serving the Community', lev_div2+'history_ser/history_ser.html');
//		gentable('Reform in the 70s &amp; 80s', lev_div2+'history_ref/history_ref.html');
//	}

	if(fol == 3 && sel == 3){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('Overview of Reform', lev_div2+'reform_over/reform_over.html');
		gentable('Future Public Sector Reform Agenda', lev_div2+'reform_agenda/reform_agenda.html');
		gentable('Current and Future Challenges of Public Sector Reform', lev_div2+'reform_cha/reform_cha.html');
//		gentable('References', lev_div2+'reform_ref/reform_ref_glo/reform_ref_glo.html');
	}

	if(fol == 4 && sel == 4){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('About Private Sector Involvement', lev_div2+'psi_psi/psi_psi_over/psi_psi_over.html');
		gentable('Public Private Partnerships', lev_div2+'psi_ppp/psi_ppp_over/psi_ppp_over.html');
		gentable('Outsourcing', lev_div2+'psi_out/psi_out_over/psi_out_over.html');
		gentable('Case Studies', lev_div2+'psi_case/psi_case.html');
		gentable('Guides, References and Links', lev_div2+'psi_guides/psi_guides_ppgpop/psi_guides_ppgpop.html');
//		gentable('Course Materials of Past EU Seminars', lev_div2+'psi_course/psi_course.html', '#F0C1C1', '#FFFFFF');
		gentable('How EU Can Help', 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('Citizen Centric Services Programme', lev_div2+'ccsp_over/ccsp_over.html');
		gentable('Customer Management Assessment Framework', lev_div2+'ccsp_cmaf/ccsp_cmaf.html');
		gentable('Complaints and Public Enquiries Handling', 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('BPR Resource Centre', lev_div2+'mr_resource/mr_resource.html');
//		gentable('Self-Assessment', lev_div2+'mr_self/mr_self_out/mr_self_out.html');
		gentable('Success Stories', lev_div2+'mr_success/mr_success_lcs/mr_success_lcs.html');
		gentable('Useful Links', lev_div2+'mr_useful/mr_useful.html');
		gentable('How Can EU Help', 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('Overview and Benefits', lev_div2+'or_over/or_over.html');
		gentable('Opportunities for Business Review / Organisational Restructuring', lev_div2+'or_oor/or_oor.html');
		gentable("EU's Track Record", lev_div2+'or_eu/or_eu.html');
//		gentable('Case Study', lev_div2+'or_case/or_case.html');
		gentable('How EU Can Help', 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('Overview and Benefits', lev_div2+'icc_over/icc_over.html');
//		gentable('How ICC helps', lev_div2+'icc_howicc/icc_howicc.html');
//		gentable('Participating Departments', lev_div2+'icc_part/icc_part.html');
//		gentable('Some Statistics', lev_div2+'icc_some/icc_some.html');
//		//gentable('How EU Can Help', lev_div2+'icc_howeu/icc_howeu.html');
//		gentable('ISO 10002', lev_div2+'icc_iso/icc_iso.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('Job Opportunities', lev_div2+'youth_job.html');
	}

	if(fol == 11 && sel == 11){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('Overview', lev_div2+'rmc_over/rmc_over.html');
		gentable('Register of Management Consultants', lev_div2+'rmc_reg/rmc_reg.html');
		gentable('General Management Consultancy Services Portal', lev_div2+'rmc_cpr/rmc_cpr.html');
//		gentable('Criteria and Procedures for Programme', lev_div2+'rmc_cpr/rmc_cpr.html');
//		gentable('Updating of Registration Information', 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('Tender', lev_div2+'tender.html');
		gentable('Market Sounding', lev_div2+'market.html');
	}

	if(fol == 14 && sel == 14){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('Management Services<br/>Officer Grade', 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('Photo Gallery', lev_div2+'photo.html');
		gentable('Archive', lev_div2+'photo_arc.html');
	}

	if(fol == 17 && sel == 17){
		for (i=0 ;i<(lev.length - lev_no)-2 ;i++){
			lev_div2 += "../";
		}
		gentable('Best Practice Publications', lev_div2+'pub_bp/pub_bp.html');
		gentable('Other Publications', 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 CEL / Related Government Departments / Organisations', lev_div2+'links_gov/links_gov.html');
		gentable('Related Sites', 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);
}
