hkp_path = "http://www.hongkongpost.gov.hk/";

if (location.href.toString().search('/gb/') != -1) {
	atgb = 1
} else {
	atgb = 0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openDownloadWindow(theURL,winName){
	MM_openBrWindow(theURL,winName,'width=500,height=300,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes');
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 changeVer(lang) {
	var langs = ["chinese_big5", "english", "sc"];
	var fromLang = '';
	var toLang = '';
	for(counter = 0; counter < langs.length; counter++){
		if(location.href.search('/'+langs[counter]+'/')!= -1){
			fromLang = langs[counter];
		}
	}
	switch(lang){
		case 'c': toLang = langs[0]; break;
		case 'e': toLang = langs[1]; break;
		case 's': toLang = langs[2]; break;
	}
	newlocation = location.href.replace(fromLang, toLang);
	locationofmark = newlocation.indexOf("#");
	if (locationofmark!=-1)	{
		newlocation = newlocation.substring(0,locationofmark);
	}
	location.href = newlocation;
	return true;
}

function newGovHKTab() {
	document.write("<A onmouseover=\"MM_swapImage('info','','images/mainbar1_f2.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"http://www.gov.hk/tc/residents/\" "); 
	document.write("target=\"GovHK\" tabIndex=\"2\"><IMG class=\"langImg\" id=\"info\" alt=\"GovHK 香港政府一站通\" title=\"GovHK 香港政府一站通\" "); 
	document.write("src=\"images/mainbar1.gif\"></A>");
}

function newLangTCTab(){
	document.write("<a tabIndex=\"3\" href=\"javascript:changeVer('c');\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('mainbar3','','images/mainbar3_f2.gif',1)\"><img class=\"langImg\" id=\"mainbar3\" src=\"images/mainbar3.gif\" alt=\"Traditional Chinese\" title=\"Traditional Chinese\"></a></td>");
}
function newLangSCTab(){
	document.write("<a tabIndex=\"3\" href=\"javascript:changeVer('s');\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('mainbar3','','images/mainbar3_f2.gif',1)\"><img class=\"langImg\" id=\"mainbar3\" src=\"images/mainbar3.gif\" alt=\"簡體版\" title=\"簡體版\"></a></td>");
}
function newLangENTab(){	
	document.write("<a tabIndex=\"4\" href=\"JAVASCRIPT:changeVer('e');\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('eng','','images/mainbar4_f2.gif',1)\" tabIndex=\"4\"><IMG class=\"langImg\" id=\"eng\" alt=\"ENGLISH\" title=\"ENGLISH\" src=\"images/mainbar4.gif\"></A></TD>");
}

function newSearchLabel(){ 
	document.write("<A tabIndex=\"5\" onmouseover=\"MM_swapImage('search1','','images/mainbar6_f2.gif',1)\" onmouseout=\"MM_swapImgRestore()\" href=\"javascript:document.forms[0].submit()\"><IMG class=\"langImg\" id=\"search1\" alt=\"搜尋\" title=\"搜尋\" src=\"images/mainbar6.gif\"></A>");
}

function newSearchButton(){
	document.write("<A tabIndex=\"7\" onmouseover=\"MM_swapImage('search2','','../english/images/mainbar8_f2.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" "); 
	document.write("href=\"javascript:document.forms[0].submit()\"><IMG class=\"langImg\" "); 
	document.write("id=\"search2\" alt=\"搜尋\" title=\"搜尋\" src=\"../english/images/mainbar8.gif\"></A>");
}

function newSiteMapTab(){
	document.write("<A tabIndex=\"8\" onmouseover=\"MM_swapImage('sitemap','','images/mainbar9_f2.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"sitemap.html\"><IMG class=\"langImg\" ");  
	document.write("id=\"sitemap\" alt=\"網頁指南\" title=\"網頁指南\" src=\"images/mainbar9.gif\"></A>"); 
}

function newContactUsTab(){
	document.write("<A tabIndex=\"9\" onmouseover=\"MM_swapImage('contact','','../english/images/mainbar10_f2.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"contact_us.html\"><IMG class=\"langImg\" "); 
	document.write("id=\"contact\" alt=\"聯絡我們\" title=\"聯絡我們\" src=\"../english/images/mainbar10.gif\"></A>"); 
}

function newHomeButton(){
	document.write("<A tabIndex=\"12\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_02','','images/left_nav_02-over.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"about_e_form_01.html\"><IMG ");
	document.write("class=\"sidebarImg\" id=\"left_nav_02\" alt=\"主頁\" title=\"主頁\" "); 
	document.write("src=\"images/left_nav_02.gif\"></A>");
}
function newWhatsNewButton(){
	document.write("<A tabIndex=\"13\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_03','','images/left_nav_03-over.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"whatsnew_01.html\"><IMG class=\"sidebarImg\" ");
	document.write("alt=\"最新消息：包括有關改善電子表格服務及新增電子表格的資訊\" "); 
	document.write("title=\"最新消息：包括有關改善電子表格服務及新增電子表格的資訊\" ");
	document.write("id=\"left_nav_03\" "); 
	document.write("src=\"images/left_nav_03.gif\"></A>"); 
}
function newAboutButton(){
	document.write("<A tabIndex=\"14\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_04','','images/left_nav_04-over.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"about_e_form_01.html\"><IMG class=\"sidebarImg\" ");
	document.write("id=\"left_nav_04\" alt=\"關於電子表格：包括電子表格計劃的簡介及所帶來的好處\" "); 
	document.write("title=\"關於電子表格：包括電子表格計劃的簡介及所帶來的好處\" ");
	document.write("src=\"images/left_nav_04.gif\"></A>");
}
function newUsingButton(){
	document.write("<A tabIndex=\"15\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_05','','images/left_nav_05-over.gif',1)\""); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"using_e_form_01.html\"><IMG class=\"sidebarImg\" ");
	document.write("id=\"left_nav_05\" ");
	document.write("alt=\"電子表格服務使用說明：包括怎樣才能使用電子表格及使用步驟指引\" src=\"images/left_nav_05.gif\" ");
	document.write("title=\"電子表格服務使用說明：包括怎樣才能使用電子表格及使用步驟指引\"></A>"); 
}
function newDownloadButton(){
	document.write("<A tabIndex=\"16\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_06','','images/left_nav_06-over.gif',1)\" ");
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"download.html\"><IMG class=\"sidebarImg\" "); 
	document.write("id=\"left_nav_06\" alt=\"下載區：可供下載的電子表格程式檔案及其技術支援手冊\" "); 
	document.write("title=\"下載區：可供下載的電子表格程式檔案及其技術支援手冊\" ");
	document.write("src=\"images/left_nav_06.gif\"></A>");
}
function newFAQButton(){
	document.write("<A tabIndex=\"17\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_07','','images/left_nav_07-over.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"faq_01.html\"><IMG class=\"sidebarImg\" "); 
	document.write("id=\"left_nav_07\" alt=\"常見問題：包括經常遇見的問題\" ");
	document.write("title=\"常見問題：包括經常遇見的問題\" ");
	document.write("src=\"images/left_nav_07.gif\"></A>");
}
function newLinksButton(){
	document.write("<A tabIndex=\"18\" ");
	document.write("onmouseover=\"MM_swapImage('left_nav_08','','images/left_nav_08-over.gif',1)\" "); 
	document.write("onmouseout=\"MM_swapImgRestore()\" href=\"links.html\"><IMG class=\"sidebarImg\" "); 
	document.write("id=\"left_nav_08\" src=\"images/left_nav_08.gif\" ");
	document.write("alt=\"相關網址\" title=\"相關網址\"></A>");
}
