function langSwitch() {
	goPath=location.href.replace("english", "txten");
	document.location=goPath;
}
function submit_search_form() {
	window.document.search.submit();
}

document.write("<table width=\"760\" border=\"0\" height=\"87\" cellpadding=\"0\" cellspacing=\"0\" background=\"engimages/bkgdtexture.gif\"> ");
document.write("<form name=search action=http://search.gov.hk/search.html method=get>");
document.write("<input type=hidden name=tpl_id value=stdsearch>");
document.write("<input type=hidden name=ui_lang value=en>");
document.write("<input type=hidden name=ui_charset value=big5>");
document.write("<input type=hidden name=gp0 value=cpu_home>");
document.write("<input type=hidden name=gp1 value=cpu_home>");
document.write("<input type=hidden name=web value=this>");
document.write("    <tr align=\"left\" valign=\"top\">  ");
document.write("      <td height=\"65\" colspan=\"6\" class=\"sidebar\" background=\"engimages/bkgdtexture.gif\"><a href=../index.htm><img src=\"engimages/branding.gif\" alt=\"The Government of the Hong Kong Special Administrative Region - Central Policy Unit\" width=\"432\" height=\"65\" border=\"0\"></a></td> ");
document.write("      <td height=\"65\" rowspan=\"2\" valign=\"bottom\" background=\"engimages/bkgdtexture.gif\" width=\"106\">  ");
document.write("        <div align=\"center\"> ");
document.write("          <input class=\"search\" type=\"text\" name=\"query\" size=\"10\"> ");
document.write("        </div> ");
document.write("      </td> ");
document.write("      <td height=\"65\" background=\"engimages/bkgdtexture.gif\" width=\"22\">&nbsp;</td> ");
document.write("      <td height=\"65\" background=\"engimages/bkgdtexture.gif\" width=\"97\" colspan=\"2\" valign=\"bottom\"> ");
document.write("        <div align=\"right\"><a href=\"http://www.brandhk.gov.hk/brandhk/index.htm\" target=\"_blank\"><img src=\"engimages/brandhk_s.gif\" alt=\"Brand Hong Kong\" name=\"brandhk\" width=\"200\" height=\"60\" border=\"0\"></div> ");
document.write("      </td> ");
document.write("    </tr> ");
document.write("    <tr align=\"left\" valign=\"top\">  ");
document.write("      <td height=\"20\" width=\"170\" background=\"engimages/bkgdtexture.gif\"><a href=\"http://www.gov.hk/en/residents/\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar1','','engimages/mainbar1_f2.gif',1)\" ><img name=\"mainbar1\" src=\"engimages/mainbar1.gif\"  border=\"0\" alt=\"GovHK\"></a></td> ");

var existing_lang_url = "";
var redirect_lang_url = "";
var url_start_index = 0;
var url_length = 0;

existing_lang_url = location.href;

if (existing_lang_url.search("english") != -1) {
	redirect_lang_url = existing_lang_url.replace(/english/i, "tc" );
} else {
	redirect_lang_url = existing_lang_url.replace(/tc/i, "english" );
}

url_length = redirect_lang_url.length;

document.write("      <td align=\"left\" valign=\"top\" height=\"20\" width=\"67\" background=\"engimages/bkgdtexture.gif\"><a href=javascript:langSwitch() onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar2','','engimages/mainbar2_f2.gif',1)\" ><img name=\"mainbar2\" src=\"engimages/mainbar2.gif\" width=\"67\" height=\"20\" border=\"0\" alt=\"Text Only\"></a></td> ");
document.write("      <td align=\"left\" valign=\"top\" height=\"20\" width=\"51\" background=\"engimages/bkgdtexture.gif\"><a href="+redirect_lang_url+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar3','','engimages/mainbar3_f2.gif',1)\" ><img name=\"mainbar3\" src=\"engimages/mainbar3.gif\" width=\"51\" height=\"20\" border=\"0\" alt=\"Traditional Chinese\"></a></td> ");
document.write("      <td align=\"left\" valign=\"top\" height=\"20\" width=\"50\" background=\"engimages/bkgdtexture.gif\"><a href="+redirect_lang_url.replace('tc','chs')+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar4','','engimages/mainbar4_f2.gif',1)\" ><img name=\"mainbar4\" src=\"engimages/mainbar4.gif\" width=\"50\" height=\"20\" border=\"0\" alt=\"Simplified Chinese\"></a></td> "); 
document.write("      <td align=\"left\"  height=\"20\" width=\"185\" background=\"engimages/bkgdtexture.gif\"><img name=\"mainbar5\" src=\"engimages/mainbar5.gif\"  height=\"20\" border=\"0\"></td> ");
document.write("      <td align=\"left\"  height=\"20\" width=\"54\" background=\"engimages/bkgdtexture.gif\"><a href=\"javascript:submit_search_form()\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar6','','engimages/mainbar6_f2.gif',1)\" ><img name=\"mainbar6\" src=\"engimages/mainbar6.gif\" width=\"54\" height=\"20\" border=\"0\" alt=\"Search\"></a></td> ");
document.write("      <td align=\"left\"  height=\"20\" width=\"22\" background=\"engimages/bkgdtexture.gif\"><a href=\"javascript:submit_search_form()\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar8','','engimages/mainbar8_f2.gif',1)\" ><img name=\"mainbar8\" src=\"engimages/mainbar8.gif\" width=\"22\" height=\"20\" border=\"0\" alt=\"Search\"></a></td> ");
document.write("      <td align=\"left\"  height=\"20\" width=\"65\" background=\"engimages/bkgdtexture.gif\"><a href=\"sitemap.htm\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar9','','engimages/mainbar9_f2.gif',1)\" ><img name=\"mainbar9\" src=\"engimages/mainbar9.gif\" width=\"65\" height=\"20\" border=\"0\" alt=\"Sitemap\"></a></td> ");
document.write("      <td align=\"left\"  height=\"20\" width=\"36\" background=\"engimages/bkgdtexture.gif\"><a href=\"contactus.htm\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar10','','engimages/mainbar10_f2.gif',1)\" ><img name=\"mainbar10\" src=\"engimages/mainbar10.gif\" width=\"36\" height=\"20\" border=\"0\" alt=\"Contact Us\"></a></td> ");
document.write("    </tr> ");
document.write("    <tr align=\"left\" valign=\"top\" bgcolor=\"#BB3333\">  ");
document.write("      <td height=\"2\" colspan=\"10\"><img src=\"engimages/reddot.gif\" width=\"760\" height=\"2\"></td> ");
document.write("    </tr></form> ");
document.write("  </table> ");
