function filename(){
	path = location.href;
	file_id = path.lastIndexOf("/");
	file_id2 = path.lastIndexOf(".");
	fname = path.substring(file_id+1,file_id2);
	return fname;
}

function spacer(){
	document.write("<tr>");
	document.write("<td><img src=\"images/space.jpg\" width=\"200\" height=\"2\"></td>");
	document.write("</tr>");
}

function callmenu(){
	
	document.write("<table width=\"20%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr>");
	document.write("<td><img src=\"images/blank.gif\" width=\"200\" height=\"27\"></td>");
	document.write("</tr>");
	if ((filename() == "index") || (filename() == "est_proj_manage") || (filename() == "population") || (filename() == "flat") || (filename() == "annual") || (filename() == "five")){
		document.write("<tr>");
		document.write("<td><a href=\"index.asp\"><img name=\"Image54\" border=\"0\" src=\"images/nav_02_hl.jpg\" width=\"200\" height=\"14\" alt=\"Statistics\"></a></td>");
		document.write("</tr>");

<!------------------------------------------------------------------------------------------------------------------->
		if (filename() == "index"){
		document.write("<tr>");
    		document.write("<td><a href=\"index.asp\"><img name=\"Image55\" border=\"0\" src=\"images/nav_02f_ro.jpg\" width=\"200\" height=\"29\" alt=\"Estates/ Projects Completed\"></a></td>");
  		document.write("</tr>");
  		}else{
  		document.write("<tr>");
    		document.write("<td><a href=\"index.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue;MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image55','','images/nav_02f_ro.jpg',1);MM_displayStatusMsg('Estates/ Projects Completed');return document.MM_returnValue\"><img name=\"Image55\" border=\"0\" src=\"images/nav_02f.jpg\" width=\"200\" height=\"29\" alt=\"Estates/ Projects Completed\"></a></td>");
  		document.write("</tr>");
  	        }


  	        if (filename() == "est_proj_manage"){
		document.write("<tr>");
    		document.write("<td><a href=\"est_proj_manage.asp\"><img name=\"image65\" border=\"0\" src=\"images/nav_02g_ro.jpg\" width=\"200\" height=\"29\" alt=\"Estates/ Projects Managed\"></a></td>");
  		document.write("</tr>");
  		}else{
  		document.write("<tr>");
    		document.write("<td><a href=\"est_proj_manage.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue;MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('image65','','images/nav_02g_ro.jpg',1);MM_displayStatusMsg('Estates/ Projects Managed');return document.MM_returnValue\"><img name=\"image65\" border=\"0\" src=\"images/nav_02g.jpg\" width=\"200\" height=\"29\" alt=\"Estates/ Projects Managed\"></a></td>");
  		document.write("</tr>");
   		}


<!------------------------------------------------------------------------------------------------------------------->

  	        if (filename() == "population"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"population.asp\"><img name=\"Image56\" border=\"0\" src=\"images/nav_02b_ro.jpg\" width=\"200\" height=\"43\" alt=\"Estimated Population of Rental Estates & Managed Properties\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"population.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue;MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image56','','images/nav_02b_ro.jpg',1);MM_displayStatusMsg('Estimated Population of Rental Estates & Managed Properties');return document.MM_returnValue\"><img name=\"Image56\" border=\"0\" src=\"images/nav_02b.jpg\" width=\"200\" height=\"43\" alt=\"Estimated Population of Rental Estates & Managed Properties\"></a></td>");
   		document.write("</tr>");
   		}
   		if (filename() == "flat"){
    		document.write("<tr>");
    		document.write("<td><a href=\"flat.asp\"><img name=\"Image57\" border=\"0\" src=\"images/nav_02c_ro.jpg\" width=\"200\" height=\"17\" alt=\"Flat Production Forecast\"></a></td>");
  		document.write("</tr>");
  		}else{
  	        document.write("<tr>");
    		document.write("<td><a href=\"flat.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image57','','images/nav_02c_ro.jpg',1);MM_displayStatusMsg('Flat Production Forecast');return document.MM_returnValue\"><img name=\"Image57\" border=\"0\" src=\"images/nav_02c.jpg\" width=\"200\" height=\"17\" alt=\"Flat Production Forecast\"></a></td>");
  		document.write("</tr>");
		}
		if (filename() == "annual"){
    		document.write("<tr>");
    		document.write("<td><a href=\"annual.asp\"><img name=\"Image58\" border=\"0\" src=\"images/nav_02d_ro.jpg\" width=\"200\" height=\"17\" alt=\"Annual Flat Production\"></a></td>");
  		document.write("</tr>");
  		}else{
  	        document.write("<tr>");
    		document.write("<td><a href=\"annual.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image58','','images/nav_02d_ro.jpg',1);MM_displayStatusMsg('Annual Flat Production');return document.MM_returnValue\"><img name=\"Image58\" border=\"0\" src=\"images/nav_02d.jpg\" width=\"200\" height=\"17\" alt=\"Annual Flat Production\"></a></td>");
  		document.write("</tr>");
		}
		if (filename() == "five"){
    		document.write("<tr>");
    		document.write("<td><a href=\"five.asp\"><img name=\"Image59\" border=\"0\" src=\"images/nav_02e_ro.jpg\" width=\"200\" height=\"33\" alt=\"Five Years Financial Highlights\"></a></td>");
  		document.write("</tr>");
  		}else{
  	        document.write("<tr>");
    		document.write("<td><a href=\"five.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image59','','images/nav_02e_ro.jpg',1);MM_displayStatusMsg('Five Years Financial Highlights');return document.MM_returnValue\"><img name=\"Image59\" border=\"0\" src=\"images/nav_02e.jpg\" width=\"200\" height=\"33\" alt=\"Five Years Financial Highlights\"></a></td>");
  		document.write("</tr>");
		}
  	}else{
		document.write("<tr>");
		document.write("<td><a href=\"index.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue;MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image54','','images/nav_02_ro.jpg',1);MM_displayStatusMsg('Statistics');return document.MM_returnValue\"><img name=\"Image54\" border=\"0\" src=\"images/nav_02.jpg\" width=\"200\" height=\"14\" alt=\"Statistics\"></a></td>");
		document.write("</tr>");
		spacer();
	}	

	if ((filename() == "housing") || (filename() == "corporate") || (filename() == "annualr") || (filename() == "envrep") || (filename() == "issue6_1") || (filename() == "issue6_2") || (filename() == "issue6_3") || (filename() == "issue6_4") || (filename() == "issue6_5") || (filename() == "issue6_6") || (filename() == "issue6_7") || (filename() == "issue6_8") || (filename() == "issue6_9") || (filename() == "issue6_10") || (filename() == "issue6_11") || (filename() == "issue6_12")){
		document.write("<tr>");
		document.write("<td><a href=\"housing.asp\"><img name=\"Image60\" border=\"0\" src=\"images/nav_03_hl.jpg\" width=\"200\" height=\"18\" alt=\"Publications\"></a></td>");
		document.write("</tr>");
		if ((filename() == "housing") || (filename() == "issue6_1") || (filename() == "issue6_2") || (filename() == "issue6_3") || (filename() == "issue6_4") || (filename() == "issue6_5") || (filename() == "issue6_6") || (filename() == "issue6_7") || (filename() == "issue6_8") || (filename() == "issue6_9") || (filename() == "issue6_10") || (filename() == "issue6_11") || (filename() == "issue6_12")){
		document.write("<tr>");
    		document.write("<td><a href=\"housing.asp\"><img name=\"Image61\" border=\"0\" src=\"images/nav_03a_ro.jpg\" width=\"200\" height=\"16\" alt=\"Housing Society Today\"></a></td>");
  		document.write("</tr>");
  		}else{
  		document.write("<tr>");
    		document.write("<td><a href=\"housing.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image61','','images/nav_03a_ro.jpg',1);MM_displayStatusMsg('Housing Society Today');return document.MM_returnValue\"><img name=\"Image61\" border=\"0\" src=\"images/nav_03a.jpg\" width=\"200\" height=\"16\" alt=\"Housing Society Today\"></a></td>");
  		document.write("</tr>");
  	        }
  	        if (filename() == "corporate"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"corporate.asp\"><img name=\"Image62\" border=\"0\" src=\"images/nav_03b_ro.jpg\" width=\"200\" height=\"17\" alt=\"Corporate Brochure\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"corporate.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image62','','images/nav_03b_ro.jpg',1);MM_displayStatusMsg('Corporate Brochure');return document.MM_returnValue\"><img name=\"Image62\" border=\"0\" src=\"images/nav_03b.jpg\" width=\"200\" height=\"17\" alt=\"Corporate Brochure\"></a></td>");
   		document.write("</tr>");
   		}
   		if (filename() == "annualr"){
    		document.write("<tr>");
    		document.write("<td><a href=\"annualr.asp\"><img name=\"Image63\" border=\"0\" src=\"images/nav_03c_ro.jpg\" width=\"200\" height=\"18\" alt=\"Annual Report\"></a></td>");
  		document.write("</tr>");
  		}else{
  	        document.write("<tr>");
    		document.write("<td><a href=\"annualr.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image63','','images/nav_03c_ro.jpg',1);MM_displayStatusMsg('Annual Report');return document.MM_returnValue\"><img name=\"Image63\" border=\"0\" src=\"images/nav_03c.jpg\" width=\"200\" height=\"18\" alt=\"Annual Report\"></a></td>");
  		document.write("</tr>");
		}
   		if (filename() == "envrep"){
    		document.write("<tr>");
    		document.write("<td><a href=\"envrep.asp\"><img name=\"Image64d\" border=\"0\" src=\"images/nav_03d_ro.jpg\" width=\"200\" height=\"19\" alt=\"Environmental Report\"></a></td>");
  		document.write("</tr>");
  		}else{
  	        document.write("<tr>");
    		document.write("<td><a href=\"envrep.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image64d','','images/nav_03d_ro.jpg',1);MM_displayStatusMsg('Environmental Report');return document.MM_returnValue\"><img name=\"Image64d\" border=\"0\" src=\"images/nav_03d.jpg\" width=\"200\" height=\"19\" alt=\"Environmental Report\"></a></td>");
  		document.write("</tr>");
		}






  	}else{
		document.write("<tr>");
		document.write("<td><a href=\"housing.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image60','','images/nav_03_ro.jpg',1);MM_displayStatusMsg('Publications');return document.MM_returnValue\"><img name=\"Image60\" border=\"0\" src=\"images/nav_03.jpg\" width=\"200\" height=\"18\" alt=\"Publications\"></a></td>");
		document.write("</tr>");
		spacer();
	}
















// ---------------------------------------------------------------------------------------------
// Comprehensive study on the Housing Needs of the Elderly in Hong Kong (Executive Summary)
// ---------------------------------------------------------------------------------------------



	if (filename() == "elderly_housing"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"elderly_housing.asp\"><img name=\"Image67\" border=\"0\" src=\"images/nav_06_ro.jpg\" alt=\"Comprehensive Study on the Housing Needs of the Elderly in Hong Kong (Executive Summary)\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"elderly_housing.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg('Comprehensive Study on the Housing Needs of the Elderly in Hong Kong (Executive Summary)');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image67','','images/nav_06_ro.jpg',1);MM_displayStatusMsg('Comprehensive Study on the Housing Needs of the Elderly in Hong Kong (Executive Summary)');return document.MM_returnValue\"><img name=\"Image67\" border=\"0\" src=\"images/nav_06.jpg\" alt=\"Comprehensive Study on the Housing Needs of the Elderly in Hong Kong (Executive Summary)\"></a></td>");
   		document.write("</tr>");
   		}








// -------------------------------
// UDG
// -------------------------------



	if (filename() == "udg"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"udg.asp\"><img name=\"Image68\" border=\"0\" src=\"images/nav_07_ro.jpg\" alt=\"Universal Design Guidebook For Residential Development in Hong Kong\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"udg.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image68','','images/nav_07_ro.jpg',1);MM_displayStatusMsg('Universal Design Guidebook For Residential Development in Hong Kong');return document.MM_returnValue\"><img name=\"Image68\" border=\"0\" src=\"images/nav_07.jpg\" alt=\"Universal Design Guidebook For Residential Development in Hong Kong\"></a></td>");
   		document.write("</tr>");
   		}




// -------------------------------
// GUIDEBOOK
// -------------------------------



	if (filename() == "guidebook"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"guidebook.asp\"><img name=\"guidebook\" border=\"0\" src=\"images/nav_08_ro.jpg\" alt=\"Building Management Guidebook\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"guidebook.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('guidebook','','images/nav_08_ro.jpg',1);MM_displayStatusMsg('Building Management Guidebook');return document.MM_returnValue\"><img name=\"guidebook\" border=\"0\" src=\"images/nav_08.jpg\" alt=\"Building Management Guidebook\"></a></td>");
   		document.write("</tr>");
   		}






// -------------------------------
// QFP
// -------------------------------



	if (filename() == "qfp"){
  	        document.write("<tr>");
    		document.write("<td><a href=\"qfp.asp\"><img name=\"Image66\" border=\"0\" src=\"images/nav_05_ro.jpg\" alt=\"Quality Field Practices\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"qfp.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image66','','images/nav_05_ro.jpg',1);MM_displayStatusMsg('Quality Field Practices');return document.MM_returnValue\"><img name=\"Image66\" border=\"0\" src=\"images/nav_05.jpg\" alt=\"Quality Field Practices\"></a></td>");
   		document.write("</tr>");
   		}






















	if ((filename() == "photo")||(filename() == "photo01")||(filename() == "photo02")||(filename() == "photo03")||(filename() == "photo04")||(filename() == "photo05")||(filename() == "photo06")||(filename() == "photo07")||(filename() == "photo08")||(filename() == "photo09")||(filename() == "photo10")||(filename() == "photo11")||(filename() == "photo12")||(filename() == "photo13")||(filename() == "photo14")||(filename() == "photo15")||(filename() == "photo16")){
  	        document.write("<tr>");
    		document.write("<td><a href=\"photo.asp\"><img name=\"Image64\" border=\"0\" src=\"images/nav_04_ro.jpg\" width=\"200\" height=\"21\" alt=\"Photo Gallery\"></a></td>");
   		document.write("</tr>");
   	        }else{
   	        document.write("<tr>");
    		document.write("<td><a href=\"photo.asp\" onMouseOut=\"MM_swapImgRestore();MM_displayStatusMsg(' ');return document.MM_returnValue\" onMouseOver=\"MM_swapImage('Image64','','images/nav_04_ro.jpg',1);MM_displayStatusMsg('Photo Gallery');return document.MM_returnValue\"><img name=\"Image64\" border=\"0\" src=\"images/nav_04.jpg\" width=\"200\" height=\"21\" alt=\"Photo Gallery\"></a></td>");
   		document.write("</tr>");
   		}




























	document.write("</table>");


}


// Dreamweaver

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function lang(version){
	link = location.href;
	english = "/eng/";
	chinese = "/chi/";
	
	//setting for no chinese
	if (version == "nchi"){
		parent.location.href= "";
	}

	//setting for no english
	if (version == "neng"){
		parent.location.href="";
	}
	
	
	if (version == "en"){
		link = link.replace (chinese, english);
		parent.location.href = link;
	}else if (version == "ch"){
		link = link.replace (english, chinese);
		parent.location.href = link;
	}
}