document.write("  <table width=760 border=0 height=87 cellpadding=0 cellspacing=0 background=/en/images/bkgdtexture.gif>");
document.write("    <form action=http://search.gov.hk/search.html method=get name=search target=mainframe id=search>");
document.write("	<input name=tpl_id type=hidden value=stdsearch>");
document.write("	<input name=ui_lang type=hidden value=en>");
document.write("	<input name=ui_charset type=hidden value=utf-8>");
document.write("	<input name=gp0 type=hidden value=elderlycom_home>");
document.write("	<input name=gp1 type=hidden value=elderlycom_home>");
document.write("	<input name=web type=hidden value=this>");
document.write("	<tr align=left valign=top> ");
document.write("      <td height=66 colspan=6 class=sidebar background=/en/images/bkgdtexture.gif><kanhanbypass><a href=http://"+location.host+"/><img src=/en/images/ebs.jpg alt='Elderly Commission - The Government of the Hong Kong Special Administrative Region' border=0></a></kanhanbypass></td>");

// JavaScript Document
// Create Date: 2003-12-23
// file name: header_01st.js
// version: 1.0
// Author: CL
//
// Purpose: use the following chinese and english wording replacment in the current URL to 
//	    redirect to chinese language version in english version page by page; otherwise, 
//	    redirect to english language version in chinese version page by page.
//
var existing_lang_url = "";
var redirect_lang_url = "";
var url_start_index = 0;
var url_length = 0;

// define the existing URL.
existing_lang_url = document.location.pathname;

// find the "english" wording in english page URL and replace is by "chinese";
if (existing_lang_url.search("en") != -1) {
	redirect_lang_url = existing_lang_url.replace(/en/i, "cn" );
}else{
	redirect_lang_url = existing_lang_url.replace(/cn/i, "en" );
}
if (existing_lang_url.search("en") != -1) {
	gb_url_str = existing_lang_url.replace(/en/i, "sc" );
}else{
	gb_url_str = existing_lang_url.replace(/cn/i, "sc" );
}

// define the absolute path of the redirect URL and ignore the HTTP:// and C:/;
url_length = redirect_lang_url.length;
url_start_index = redirect_lang_url.indexOf("http://"+location.host+"/");
// print out the redirect url;
text_ver_url = existing_lang_url.replace(/en/i, "en_txt" );


document.write("      <td height=66 rowspan=2 valign=bottom background=/en/images/bkgdtexture.gif width=99> ");
document.write("        <div align=center> ");
document.write("          <input class=search type=text name=query size=10>");
document.write("        </div></td>");
//document.write("      <td height=66 background=/en/images/bkgdtexture.gif width=22>&nbsp;</td>");
document.write("      <td height=66 background=/en/images/bkgdtexture.gif width=97 colspan=3 valign=bottom> ");
document.write("        <div align=right><a href=http://www.brandhk.gov.hk/brandhk/eindex.htm target=_top><img name=BrandHK src=/en/images/BrandHK.gif width=190 height=60 border=0 alt='Brand Hong Kong'></a></div></td>");
document.write("    </tr>");
document.write("    <tr align=left valign=top> ");
document.write("      <td height=20 width=171 background=/en/images/bkgdtexture.gif><a href=http://www.gov.hk/en/residents/ onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar111','','/en/images/mainbar1_f2.gif',1) ><img src=/en/images/mainbar1.gif alt='GovHK' name=mainbar111 width=171 height=20 border=0 id=mainbar11></a></td>");
document.write("      <td align=left valign=top height=20 width=67><a href="+text_ver_url+" onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar21','','/en/images/mainbar2_f2.gif',1) ><img src=/en/images/mainbar2.gif alt='Text Only' name=mainbar21 width=67 height=20 border=0 id=mainbar21></a></td>");

document.write("      <td align=left valign=top height=20 width=51><a href='"+redirect_lang_url+"' onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar31','','/en/images/mainbar3_f2.gif',1) ><img src=/en/images/mainbar3.gif alt='Traditional Chinese' name=mainbar31 width=51 height=20 border=0 id=mainbar31></a></td>");
document.write("      <td align=left valign=top height=20 width=50><a href='"+gb_url_str+"' onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar411','','/en/images/mainbar4_f2.gif',1) ><img src=/en/images/mainbar4.gif alt='Simplified Chinese' name=mainbar411 width=50 height=20 border=0 id=mainbar41></a></td>");
document.write("      <td height=19 width=280 align=left><img name=mainbar5 src=/en/images/mainbar5.gif width=80 height=20 border=0></td>");

//document.write("      <td align=left valign=top height=19 width=67>&nbsp;</td>");

document.write("      <td height=20 width=54 background=/en/images/bkgdtexture.gif><a href=javascript:window.document.search.submit() onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar611','','/en/images/mainbar6_f2.gif',1) ><img src=/en/images/mainbar6.gif alt=Search name=mainbar611 width=54 height=20 border=0 id=mainbar61></a></td>");
document.write("      <td height=20 width=22 background=/en/images/bkgdtexture.gif><a href=javascript:window.document.search.submit() onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar81','','/en/images/mainbar8_f2.gif',1) ><img src=/en/images/mainbar8.gif alt=Search name=mainbar81 width=22 height=20 border=0 id=mainbar81></a></td>");
document.write("      <td height=20 width=50 background=/en/images/bkgdtexture.gif><a href=/en/sitemap.html onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar911','','/en/images/mainbar9_f2.gif',1) ><img src=/en/images/mainbar9.gif alt='Site Map' name=mainbar911 width=65 height=20 border=0 id=mainbar91></a></td>");
document.write("      <td height=20 width=36 background=/en/images/bkgdtexture.gif><a href=/en/contact_us/ onMouseOut=MM_swapImgRestore()  onMouseOver=MM_swapImage('mainbar1011','','/en/images/mainbar10_f2.gif',1) ><img src=/en/images/mainbar10.gif alt='Contact Us' name=mainbar1011 width=36 height=20 border=0 id=mainbar101></a></td>");
document.write("    </tr>");
document.write("    <tr align=left valign=top bgcolor=#BB3333> ");
document.write("      <td height=2 colspan=10><img src=/en/images/reddot.gif width=1 height=2></td>");
document.write("    </tr>");
document.write("	</form>");
document.write("  </table>");

