function replaceCharacters(conversionString,inChar,outChar){

  var convertedString = conversionString.split(inChar);

  convertedString = convertedString.join(outChar);

  return convertedString;

}



function chglanguage(to) { 

  dest=''+this.document.location;

  if (to=='chi' ){ 
	  dest=replaceCharacters(dest,'/translate.legislation.gov.hk/gb/','/'); 
  }

  else if (to=='eng' ){
  	  dest=replaceCharacters(dest,'/translate.legislation.gov.hk/gb/','/'); 
	    dest=replaceCharacters(dest,'://www.legislation.gov.hk/c','://www.legislation.gov.hk/');
  }

  this.document.location=dest;

}



document.writeln('<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">');
document.writeln('<tbody>');
document.writeln('<tr>');
document.writeln('<td valign="top" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="http://translate.legislation.gov.hk/gb/www.legislation.gov.hk/cchoice.htm"><img title="公约及国际协定" src="http://www.legislation.gov.hk/sc/images/tilogo.gif" border="0" alt="公约及国际协定"></a></td>');
document.writeln('<td align="right" valign="top" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="http://www.brandhk.gov.hk/" target="_blank"><img align="right" title="香港品牌形象 - 亚洲国际都会" src="http://www.legislation.gov.hk/sc/images/brandhk.gif" border="0" alt="香港品牌形象 - 亚洲国际都会" width="190" height="60"></a></td>');
document.writeln('</tr>');
document.writeln('</tbody>');
document.writeln('</table>');
document.writeln('<!-- End: Branding -->');

document.writeln('<table style="width: 100%; height: 20px;" border="0" cellspacing="0" cellpadding="0">');
document.writeln('<tbody>');
document.writeln('<tr valign="bottom">');
document.writeln('<form name=\"searchform\" method=\"get\" action=\"http://search.gov.hk/search.html\" target=\"_top\"><input type=\"hidden\" name=\"ui_lang\" value=\"zh-cn\"><input type=\"hidden\" name=\"ui_charset\" value=\"gb2312\"><input type=\"hidden\" name=\"tpl_id\" value=\"ti_doj\"><input type=\"hidden\" name=\"gp0\" value=\"ti_doj_home\"><input type=\"hidden\" name=\"gp1\" value=\"ti_doj_home\"><input type=\"hidden\" name=\"web\" value=\"this\">');
document.writeln('<td width="171" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="http://www.gov.hk/sc/residents/" target="_blank" onMouseOut="MM_swapImgRestore()"  onMouseOver="MM_swapImage(\'mainbar1\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar1_f2.gif\',1);"><img name="mainbar1" src="http://www.legislation.gov.hk/sc/images/mainbar1.gif" width="171" height="20" border="0" alt="GovHK 香港政府一站通"></a></td>');
document.writeln('<td width="50" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="javascript:chglanguage(\'chi\');" onMouseOut="MM_swapImgRestore()"  onMouseOver="MM_swapImage(\'mainbar3\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar3_f2.gif\',1);"><img name="mainbar3" src="http://www.legislation.gov.hk/sc/images/mainbar3.gif" width="50" height="20" border="0" alt="繁体版"></a></td>');
document.writeln('<td width="50" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="javascript:chglanguage(\'eng\');" onMouseOut="MM_swapImgRestore()"  onMouseOver="MM_swapImage(\'mainbar4\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar4_f2.gif\',1);"><img name="mainbar4" src="http://www.legislation.gov.hk/sc/images/mainbar4.gif" width="50" height="20" border="0" alt="英文版"></a></td>');
document.writeln('<td width="30" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><img src="/sc/images/mainbar5.gif" border="0" alt="" width="30" height="20"></td>');
document.writeln('<td background="/sc/images/bkgdtexture.gif" ><img src="http://www.legislation.gov.hk/images/spacer.gif" border="0" alt="" width="1" height="0"></td>');

document.writeln('<td width="54" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a onMouseOver="MM_swapImage(\'mainbar6\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar6_f2.gif\',1)" onMouseOut="MM_swapImgRestore()" href="javascript:document.forms[0].submit()"  target="_top"><img name="mainbar6" src="http://www.legislation.gov.hk/sc/images/mainbar6.gif" alt="搜寻" border="0"></a></td>');
document.writeln('<td width="91" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><input name="query" size="10" class="search" id="query" style="vertical-align: bottom"></td>');
document.writeln('<td width="22" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a onMouseOver="MM_swapImage(\'mainbar8\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar8_f2.gif\',1)" onMouseOut="MM_swapImgRestore()" href="javascript:document.forms[0].submit()" target="_top"><img name="mainbar8" src="http://www.legislation.gov.hk/sc/images/mainbar8.gif" alt="搜寻" border="0 width="54" height="20"></a></td></td>');
document.writeln('<td width="65" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="ctisitemap.htm" onMouseOut="MM_swapImgRestore()"  onMouseOver="MM_swapImage(\'mainbar9\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar9_f2.gif\',1);"><img name="mainbar9" src="http://www.legislation.gov.hk/sc/images/mainbar9.gif" height="20" border="0" alt="网页指南"></a></td>');
document.writeln('<td width="36" background="http://www.legislation.gov.hk/sc/images/bkgdtexture.gif"><a href="cticontactus.htm" onMouseOut="MM_swapImgRestore()"  onMouseOver="MM_swapImage(\'mainbar10\',\'\',\'http://www.legislation.gov.hk/sc/images/mainbar10_f2.gif\',1);"><img name="mainbar10" src="http://www.legislation.gov.hk/sc/images/mainbar10.gif" width=36 height="20" border="0" alt="联络我们"></a></td>');
document.writeln('</form>');
document.writeln('</tr>');
document.writeln('</tbody>');
document.writeln('</table>');

document.writeln('<!-- Red line -->');
document.writeln('<div style="line-height: 2px; background-color: #bb3333; width: 100%; height: 2px; font-size: 2px;"><img src="http://www.legislation.gov.hk/images/spacer.gif" alt="" width="1" height="1"></div>');