var subpage_header_path = ""; // default subpage header for each section
var rel_path = "";
var top_offset = 79; // defautl value for home section
var left_offset = 0; // defautl value for home section

//div left value for submenu
var left_about = 0;
var left_investor = 125; 
var left_properties = 250; 
var left_hotel = 375; 
var left_investment = 500;

//change submenu position and pic for sub level
switch (section) {
  case "home":
    rel_path  =""; 
    top_offset  = 52;
    left_offset = 80;
     subpage_header_path = "images/about/subpage_header_about.gif";
    break;
	case "about": 
    rel_path  ="../"; 
    top_offset  = 52;
    left_offset = 80;
    subpage_header_path = "../images/about/subpage_header_about.gif";
    break;
  case "investor": 
    rel_path  ="../"; 
    top_offset  = 52;
    left_offset = 80;
    subpage_header_path = "../images/investor/subpage_header_investor.gif";
    break;
  case "properties": 
    rel_path  ="../"; 
    top_offset  = 52;
    left_offset = 80;
    subpage_header_path = "../images/properties/subpage_header_prop_offc.gif";
    break;
  case "hotel": 
    rel_path  ="../"; 
    top_offset  = 52;
    left_offset = 80;
    subpage_header_path = "";
    break;
  case "investment": 
    rel_path  ="../"; 
    top_offset  = 52;
    left_offset = 80;
    subpage_header_path = "../images/properties/subpage_header_invest.gif";
    break;
  default:   // for index page, use default setting
} 

// change to special subpage header pic in special case
if(subpage_header_path_special != "") {
   subpage_header_path = subpage_header_path_special;
}


//Function for change language
function ChangeLanguage(objThis) {
	var sTargetLanguage = objThis;
	var sSelfPath = "";
	var sRedirectPath = "";
	
	sSelfPath += document.location;

	if(sSelfPath.indexOf("/english/") != -1) {
		sRedirectPath = sSelfPath.replace(/(\/english\/)/, "/" + sTargetLanguage + "/");
		if (sRedirectPath.indexOf("/english/") != -1) sRedirectPath = sRedirectPath.replace(/(\/english\/)/, "/" + sTargetLanguage + "/");
	} else if(sSelfPath.indexOf("/chinese/") != -1) {
		sRedirectPath = sSelfPath.replace(/(\/chinese\/)/, "/" + sTargetLanguage + "/");
		if (sRedirectPath.indexOf("/chinese/") != -1) sRedirectPath = sRedirectPath.replace(/(\/chinese\/)/, "/" + sTargetLanguage + "/");
	}
	
	//alert(sRedirectPath);
	self.location = sRedirectPath;
}

// Menu starts

  // Sub Menu ends 
   
  // about
  document.write('<div id="layerabout" style=" position: absolute; top: ' + top_offset + 'px; left: ' + (left_offset + left_about) + 'px; width: 125px; height: 97px; visibility: hidden" onmouseover="f7_showdrop(0)" onmouseout="f7_hidedrop()">\n');
  			document.write('<img src="' + rel_path + 'images/common/navbar_about_over.gif" width="125" height="25" border="0"><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_profile_over.gif"><a href="' + rel_path + 'about/profile.jsp" onmouseover="return CSIShow(/*CMP*/\'profile\',1)" onmouseout="return CSIShow(/*CMP*/\'profile\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_profile.gif" width="125" height="18" name="profile" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_directors_over.gif"><a href="' + rel_path + 'about/directors.jsp" onmouseover="return CSIShow(/*CMP*/\'directors\',1)" onmouseout="return CSIShow(/*CMP*/\'directors\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_directors.gif" width="125" height="18" name="directors" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_management_over.gif"><a href="' + rel_path + 'about/management.jsp" onmouseover="return CSIShow(/*CMP*/\'management\',1)" onmouseout="return CSIShow(/*CMP*/\'management\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_management.gif" width="125" height="18" name="management" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_offices_over.gif"><a href="' + rel_path + 'about/offices.jsp" onmouseover="return CSIShow(/*CMP*/\'offices\',1)" onmouseout="return CSIShow(/*CMP*/\'offices\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_offices.gif" width="125" height="18" name="offices" border="0"></a></csobj>\n');
  document.write('</div>\n');
   
  // investor
  document.write('<div id="layerinvestor" style=" position: absolute; top: ' + top_offset + 'px; left: ' + (left_offset + left_investor) + 'px; width: 125px; height: 151px; visibility: hidden" onmouseover="f7_showdrop(1)" onmouseout="f7_hidedrop()">\n');
  			document.write('<img src="' + rel_path + 'images/common/navbar_investor_over.gif" width="125" height="25" border="0"><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_financials_over.gif"><a href="' + rel_path + 'investor/financials.jsp" onmouseover="return CSIShow(/*CMP*/\'financials\',1)" onmouseout="return CSIShow(/*CMP*/\'financials\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_financials.gif" width="125" height="18" name="financials" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_annual_over.gif"><a href="' + rel_path + 'investor/annual.jsp" onmouseover="return CSIShow(/*CMP*/\'annual\',1)" onmouseout="return CSIShow(/*CMP*/\'annual\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_annual.gif" width="125" height="18" name="annual" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_interim_over.gif"><a href="' + rel_path + 'investor/interim.jsp" onmouseover="return CSIShow(/*CMP*/\'interim\',1)" onmouseout="return CSIShow(/*CMP*/\'interim\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_interim.gif" width="125" height="18" name="interim" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_alerts_over.gif"><a href="' + rel_path + 'investor/alerts.jsp" onmouseover="return CSIShow(/*CMP*/\'alerts\',1)" onmouseout="return CSIShow(/*CMP*/\'alerts\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_alerts.gif" width="125" height="18" name="alerts" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_qa_over.gif"><a href="' + rel_path + 'investor/qa.jsp" onmouseover="return CSIShow(/*CMP*/\'qa\',1)" onmouseout="return CSIShow(/*CMP*/\'qa\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_qa.gif" width="125" height="18" name="qa" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_press_over.gif"><a href="' + rel_path + 'investor/press.jsp" onmouseover="return CSIShow(/*CMP*/\'press\',1)" onmouseout="return CSIShow(/*CMP*/\'press\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_press.gif" width="125" height="18" name="press" border="0"></a></csobj><br>\n');
  			document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_events_over.gif"><a href="' + rel_path + 'investor/events.jsp" onmouseover="return CSIShow(/*CMP*/\'events\',1)" onmouseout="return CSIShow(/*CMP*/\'events\',0)" onclick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_events.gif" width="125" height="18" name="events" border="0"></a></csobj>\n');
  document.write('</div>\n');
  		
  // properties
  document.write('<div id="layerproperties" style=" position: absolute; top: ' + top_offset + 'px; left: ' + (left_offset + left_properties) + 'px; width: 125px; height: 76px; visibility: hidden" onMouseOver="f7_showdrop(2)" onMouseOut="f7_hidedrop()">\n');
    document.write('<img src="' + rel_path + 'images/common/navbar_properties_over.gif" width="125" height="25" border="0"><br>\n');
    document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_off_com_over.gif"><a href="' + rel_path + 'properties/office.jsp" onMouseOver="return CSIShow(/*CMP*/\'offcom\',1)" onMouseOut="return CSIShow(/*CMP*/\'offcom\',0)" onClick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_off_com.gif" width="125" height="18" name="offcom" border="0"></a></csobj><br>\n');
    
    document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_projects_over.gif"></csobj><a href="' + rel_path + 'properties/other.jsp" onMouseOver="return CSIShow(/*CMP*/\'other_prop\',1)" onMouseOut="return CSIShow(/*CMP*/\'other_prop\',0)" onClick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_other_prop.gif" width="125" height="18" name="other_prop" border="0"></a><br> \n');
    document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_other_prop_over.gif"></csobj> \n');
  document.write('</div> \n');
   
  // hotel
  document.write('<div id=layerhotels style="Z-INDEX: 1; LEFT: ' + (left_offset + left_hotel) + 'px; VISIBILITY: hidden; WIDTH: 125px; POSITION: absolute; TOP: ' + top_offset + 'px; HEIGHT: 250px" onMouseOut=f7_hidedrop()><img height=25 src="' + rel_path + 'images/common/navbar_hotel_furn_over.gif" width=125 border=0><br>\n');
    <!--document.write('<csobj ht="..images/common/navbar_hman_over.gif" t="Button" h="18" w="125"><a onMouseOver="return CSIShow(/*CMP*/\'hman\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'hman\',0)" href="' + rel_path + 'hotellink/hotelman.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_hman.gif" width=125 border=0 name=hman></a></csobj><br>\n');-->
    <!--document.write('<csobj ht="images/common/navbar_hkhotels_over.gif" t="Button" h="18" w="125">\n');-->
    <!--document.write('<a onMouseOver="return CSIShow(/*CMP*/\'hkhotels\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'hkhotels\',0)" href="' + rel_path + 'hotellink/hkhotels.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_hkhotels.gif" width=125 border=0 name=hkhotels></a><br></csobj>\n');-->
	
	document.write('<img height=18 src="' + rel_path + 'images/common/navbar_hkhotels.gif" width=125 border=0><br>\n');
	
	document.write('<csobj ht="images/common/navbar_langhamhk_over.gif" t="Button" h="18" w="125">\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'langhamhk\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'langhamhk\',0)" href="http://hongkong.langhamhotels.com/en/" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_langhamhk.gif" width=125 border=0 name=langhamhk></a><br></csobj>\n');
	
	document.write('<csobj ht="images/common/navbar_langhamphotel_over.gif" t="Button" h="18" w="125">\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'langhamphotel\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'langhamphotel\',0)" href="http://hongkong.langhamplacehotels.com/en/" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_langhamphotel.gif" width=125 border=0 name=langhamphotel></a><br></csobj>\n');
	
	document.write('<csobj ht="images/common/navbar_eaton_hotel_over.gif" t="Button" h="18" w="125">\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'eaton\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'eaton\',0)" href="http://hongkong.eatonhotels.com/en/" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_eaton_hotel.gif" width=125 border=0 name=eaton></a><br></csobj>\n');
	
    document.write('<csobj ht="images/common/navbar_furapart_over.gif" t="Button" h="18" w="125">\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'furapart\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'furapart\',0)" href="' + rel_path + 'hotellink/fapart.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_furapart.gif" width=125 border=0 name=furapart></a><br></csobj>\n');
	
    document.write('<img height=20 src="' + rel_path + 'images/common/navbar_overhotels2.gif" width=125 border=0><br>\n');
	
	document.write('<a onMouseOver="return CSIShow(/*CMP*/\'londonh\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'londonh\',0)" href="' + rel_path + 'hotellink/londonh.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_london.gif" width=125 border=0 name=londonh></a><br>\n');
   document.write('<a onMouseOver="return CSIShow(/*CMP*/\'bostonh\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'bostonh\',0)" href="' + rel_path + 'hotellink/bostonh.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_boston.gif" width=125 border=0 name=bostonh></a><br>\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'torontoh\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'torontoh\',0)" href="' + rel_path + 'hotellink/torontoh.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_toronto.gif" width=125 border=0 name=torontoh></a><br>\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'melbourneh\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'melbourneh\',0)" href="' + rel_path + 'hotellink/melbourneh.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_melbourne.gif" width=125 border=0 name=melbourneh></a><br>\n');
    document.write('<a onMouseOver="return CSIShow(/*CMP*/\'aucklandh\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'aucklandh\',0)" href="' + rel_path + 'hotellink/aucklandh.jsp" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_auckland.gif" width=125 border=0 name=aucklandh></a><br>\n');
	document.write('<a onMouseOver="return CSIShow(/*CMP*/\'pasadena\',1)" onClick="return CSButtonReturn()" onMouseOut="return CSIShow(/*CMP*/\'pasadena\',0)" href="http://pasadena.langhamhotels.com/" target="_blank"><img height=18 src="' + rel_path + 'images/common/navbar_pasadena.gif" width=125 border=0 name=pasadena></a><br>\n');
  document.write('</div>\n');

   
  
  // investment
  // Start: edit by Andrew Wong
  document.write('<div id="layerinvestment" style=" position: absolute; top: ' + top_offset + 'px; left: ' + (left_offset + left_investment) + 'px; width: 125px; height: 76px; visibility: hidden" onMouseOver="f7_showdrop(4)" onMouseOut="f7_hidedrop()">\n');
    document.write('<img src="' + rel_path + 'images/common/navbar_invest_over.gif" width="125" height="25" border="0"><br>\n');
    document.write('<a href="' + rel_path + 'investment/champ_reit.jsp" onMouseOver="reit.src=\'' + rel_path + 'images/common/navbar_cham_reit_over.gif\'" onMouseOut="reit.src=\'' + rel_path + 'images/common/navbar_cham_reit.gif\'" onClick="return CSButtonReturn()"><img src="' + rel_path + 'images/common/navbar_cham_reit.gif" width="125" height="18" name="reit" border="0"></a><br>\n');
	<!--document.write('<csobj w="125" h="18" t="Button" ht="' + rel_path + 'images/common/navbar_htl_res_over.gif"></csobj><a href="http://www.langhamplace.com.hk" onMouseOver="return CSIShow(/*CMP*/\'projects\',1)" onMouseOut="return CSIShow(/*CMP*/\'projects\',0)" onClick="return CSButtonReturn()" target="_blank"><img src="' + rel_path + 'images/common/navbar_projects.gif" width="125" height="18" name="projects" border="0"></a\n');-->
	//document.write('></csobj>\n');
  document.write('</div>\n');
  // End: edit by Andrew Wong
  // Sub Menu ends

  if(section != "index") {
    // Page header starts
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
      document.write('<tr>\n');
      document.write('<td width="260" valign="top" bgcolor="#FFFFCC"><a href="' + rel_path + 'index.jsp"><img src="' + rel_path + 'images/common/subpage_header_1l.gif" width="260" height="52" border="0"></a></td>\n');
      document.write('<td valign="top" align="right" bgcolor="#FFFFCC"><img src="' + subpage_header_path + '" width="490" height="52"></td>\n');
      document.write('</tr>\n');
    document.write('</table>\n');
    // Page header ends
    
    // Main menu starts
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
      document.write('<tr>\n');
      document.write('<td width="711" valign="top" bgcolor="#666666"\n');
      document.write('><a href="' + rel_path + 'index.jsp"><img src="' + rel_path + 'images/common/navbar_home.gif" width="80" height="20" border="0"></a\n');
      if(section == "about") {
        document.write('><a href="#"  onmouseover="f7_showdrop(0)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_about_on.gif" width="125" height="20" border="0"></a\n');
      } else {
        document.write('><a href="#"  onmouseover="f7_showdrop(0)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_about.gif" width="125" height="20" border="0"></a\n');
      }
      if(section == "investor") {
        document.write('><a href="#"  onmouseover="f7_showdrop(1)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_investor_on.gif" width="125" height="20" border="0"></a\n');
      } else {
        document.write('><a href="#"  onmouseover="f7_showdrop(1)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_investor.gif" width="125" height="20" border="0"></a\n');
      }
      if(section == "properties") {
        document.write('><a href="#"  onmouseover="f7_showdrop(2)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_properties_on.gif" width="125" height="20" border="0"></a\n');
      } else {
        document.write('><a href="#"  onmouseover="f7_showdrop(2)" onmouseout="f7_hidedrop()"><img src="' + rel_path + 'images/common/navbar_properties.gif" width="125" height="20" border="0"></a\n');
      }
      if(section == "hotel") {
        document.write('><a href="#"  onMouseOver="f7_showdrop(3)" onMouseOut="f7_hidedrop()"><img height=20 src="' + rel_path + 'images/common/navbar_hotel_furn_on.gif" width=125 border=0></a\n');
      } else {
        document.write('><a href="#"  onMouseOver="f7_showdrop(3)" onMouseOut="f7_hidedrop()"><img height=20 src="' + rel_path + 'images/common/navbar_hotel_furn.gif" width=125 border=0></a\n');
      }
      if(section == "investment") {
        document.write('><a href="#"  onmouseover="f7_showdrop(4)" onmouseout="f7_hidedrop()"><!--Start: Edit From Andrew --><img height=20 src="' + rel_path + 'images/common/navbar_invest_on.gif" width=125 border=0></a\n');
      } else {
        document.write('><a href="#"  onmouseover="f7_showdrop(4)" onmouseout="f7_hidedrop()"><!--Start: Edit From Andrew --><img height=20 src="' + rel_path + 'images/common/navbar_invest.gif" width=125 border=0></a\n');
      }
      document.write('></td>\n');
      document.write('<td valign="top" bgcolor="#666666" width="107">&nbsp;</td>\n');
      document.write('<td width="185" valign="top" align="right" bgcolor="#666666"><img src="' + rel_path + 'images/common/navbar_vbar.gif" width="4" height="20" border="0"><a href="' + rel_path + 'contact.jsp"><img src="' + rel_path + 'images/common/navbar_contact.gif" width="66" height="20" border="0"></a><a href="' + rel_path + 'sitemap.jsp"><img src="' + rel_path + 'images/common/navbar_sitemap.gif" width="56" height="20" border="0"></a><a href="javascript:ChangeLanguage(\'chinese\')"><img src="' + rel_path + 'images/common/navbar_chinese.gif" width="42" height="20" border="0"></a><img src="' + rel_path + 'images/common/spacer.gif" width="17" height="20" border="0"></td>\n');
      document.write('</tr>\n');
    document.write('</table> \n');
    // Main menu ends
  }
  
// Menu ends