if(location.href.search('ogcio.devprj.com/')!=-1){
	cv_nonsc_base_path = "ht"+"tp"+":/"+"/ogcio.devprj.com/20090204_lwb1/test/";
	cv_sc_base_path = cv_nonsc_base_path;
	basic_path = cv_nonsc_base_path;
}else{
	cv_nonsc_base_path = "http:" + "//" + "www.lwb.gov.hk";
	cv_sc_base_path = cv_nonsc_base_path;
	basic_path = cv_nonsc_base_path;
}

var section = '';
var content = '';
idx = 3;
cgistr = '/cgi-bin/';	
basestr = '/';	

org_path=window.location.pathname;
tmpstr=org_path.substring(0, cgistr.length);
if (tmpstr == cgistr) {
	section = 'cgi-bin';
	content = org_path.substring(cgistr.length, org_path.length)
} else {
	path_end=org_path.length;
	path_start=org_path.indexOf(basestr);
	org_path=org_path.substring(path_start ,path_end);
	
	path_end=org_path.length;	
	content = org_path.substring(basestr.length - 1 ,path_end);

	for (var j=1; j<=idx; j++) {
		path_end=org_path.length;
		path_start=org_path.indexOf("/");
		org_path=org_path.substring(path_start + 1 ,path_end);
	}
	
	path_start=org_path.indexOf("/");
	section=org_path.substring(0, path_start);	
}

function changeVer(lang) {
	var langKey = ["c", "simp", "eng"];
	var langs = ["chi", "chs", "eng"];
	var fromLang = '';
	var toLang = '';
	for(counter = 0; counter < langKey.length; counter++){
		if(location.href.search('/'+langs[counter]+'/')!= -1){
			fromLang = langs[counter];
		}
	}
	for(counter = 0; counter < langKey.length; counter++){
		if(langKey[counter]==lang){
			toLang = langs[counter];
		}
	}
	location.href = location.href.replace('/'+fromLang+'/', '/'+toLang+'/');
}

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_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_findObj(n, d) { //v3.0
  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); 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];}
}

cookiename = 'lwb';  
cookieval= '123';  

function GetCookie(cookieName) {
thisCookie = document.cookie.split("; ")
for (i = 0; i < thisCookie.length; i++) {
	if (cookieName == thisCookie[i].split("=")[0]) {
		return thisCookie[i].split("=")[1];
	}
}
return "";
}

if (cookieval == GetCookie(cookiename)) {
document.write ("Labour and Welfare Bureau<br><br><font size=\"-1\"><a href=\"/eng/text.htm\">Back to menu</a></font>"); 
} else {

document.write("<table width=\"760\" border=\"0\" height=\"87\" cellpadding=\"0\" cellspacing=\"0\" background=\"/eng/images/bkgdtexture.gif\"><form name=\"form1\" method=\"get\" action=\"http://search.gov.hk/search.html\" target=_blank><input name=\"tpl_id\" type=\"hidden\" value=\"stdsearch\"><input name=\"gp0\" type=\"hidden\" value=\"lwb_home\"><input name=\"gp1\" type=\"hidden\" value=\"lwb_home\"><input name=\"web\" type=\"hidden\" value=\"this\"><input name=\"ui_charset\" type=\"hidden\" value=\"iso-8859-1\"><input name=\"ui_lang\" type=\"hidden\" value=\"en\">");
document.write("<tr align=\"left\" valign=\"top\">");
document.write("<td height=\"66\" colspan=\"6\" class=\"sidebar\" background=\"/eng/images/bkgdtexture.gif\"><a href=\"/\"><img src=\"/eng/images/branding.gif\" width=\"484\" height=\"65\" border=0 alt=\"Labour and Welfare Bureau\"></a></td>");
document.write("<td height=\"66\" background=\"/eng/images/bkgdtexture.gif\" colspan=\"5\"><a href=\"http://www.brandhk.gov.hk\" target=\"_blank\"><img name=\"Asia's World City - Hong Kong\" src=\"/eng/images/BrandHK.gif\" width=\"190\" height=\"66\" border=\"0\" alt=\"Brand Hong Kong\"></a></td></tr><tr align=\"left\" valign=\"top\">");
document.write("<td height=\"19\" width=\"236\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><a href=\"http://www.gov.hk/en/residents/\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar1','','/eng/images/mainbar1_f2.gif',1);\"><img name=\"mainbar1\" src=\"/eng/images/mainbar1.gif\" height=\"20\" border=\"0\" alt=\"GovHK\"></a></td>");
document.write("<td align=\"left\" valign=\"bottom\" height=\"19\" width=\"67\" background=\"/eng/images/bkgdtexture.gif\"><a href=\"/eng/text.htm\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar2','','/eng/images/mainbar2_f2.gif',1);\"><img name=\"mainbar2\" src=\"/eng/images/mainbar2.gif\" width=\"67\" height=\"20\" border=\"0\" alt=\"TEXT ONLY\"></a></td>");
document.write("<td align=\"left\" valign=\"bottom\" height=\"19\" width=\"51\" background=\"/eng/images/bkgdtexture.gif\"><a href=\"javascript:changeVer('c');\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar3','','/eng/images/mainbar3_f2.gif',1);\"><img name=\"mainbar3\" src=\"/eng/images/mainbar3.gif\" width=\"51\" height=\"20\" border=\"0\" alt=\"TRADITIONAL CHINESE\"></a></td>");
document.write("<td align=\"left\" valign=\"bottom\" height=\"19\" width=\"50\" background=\"/eng/images/bkgdtexture.gif\"><a href=\"javascript:changeVer('simp');\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar4','','/eng/images/mainbar4_f2.gif',1);\"><img name=\"mainbar4\" src=\"/eng/images/mainbar4.gif\" width=\"50\" height=\"20\" border=\"0\" alt=\"SIMPLIFIED CHINESE\"></a></td>");
document.write("<td height=\"19\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><img name=\"mainbar5\" src=\"/eng/images/mainbar5.gif\" width=\"149\" height=\"20\" border=\"0\"></td>");
document.write("<td height=\"19\" width=\"54\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><a href=\"/eng/search/index.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('mainbar6','','/eng/images/mainbar6_f2.gif',1);\"><img name=\"mainbar6\" src=\"/eng/images/mainbar6.gif\" width=\"54\" height=\"20\" border=\"0\" alt=\"SEARCH\"></a></td>");
document.write("<td height=\"19\" valign=\"bottom\" background=\"/eng/images/bkgdtexture.gif\">");
IE = (document.all) ? 1 : 0;
	if (IE) { document.write("<input class=\"search\" type=\"text\" name=\"query\" size=\"17\">");
	} else {
	document.write("<input class=\"search\" type=\"text\" name=\"query\" size=\"4\">");
	}
document.write("</td>");

document.write("<td height=\"19\" width=\"22\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><input type=\"Image\" src=\"/eng/images/mainbar8.gif\" value=\"search\" alt=\"search\" border=0></td>");
document.write("<td height=\"19\" width=\"50\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><a href=\"/eng/sitemap/index.htm\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar9','','/eng/images/mainbar9_f2.gif',1);\"><img name=\"mainbar9\" src=\"/eng/images/mainbar9.gif\" width=\"65\" height=\"20\" border=\"0\" alt=\"SITE MAP\"></a></td>");
document.write("<td height=\"19\" width=\"36\" background=\"/eng/images/bkgdtexture.gif\" valign=bottom><a href=\"/eng/contact/index.htm\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar10','','/eng/images/mainbar10_f2.gif',1);\"><img name=\"mainbar10\" src=\"/eng/images/mainbar10.gif\" width=\"36\" height=\"20\" border=\"0\" alt=\"CONTACT US\"></a></td>");
document.write("</tr><tr align=\"left\" valign=\"bottom\" bgcolor=\"#CC3333\"><td height=\"2\" colspan=\"10\"><img src=\"/eng/images/reddot.gif\" width=\"760\" height=\"2\"></td></tr></form></table><OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=\"779\" HEIGHT=\"70\"><PARAM NAME=movie VALUE=\"/banner.swf\"><PARAM NAME=loop VALUE=true><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=best><param name=\"wmode\" value=\"transparent\"><PARAM NAME=bgcolor VALUE=\"#FFFFFF\"><EMBED src=\"/banner.swf\" loop=true menu=false quality=best bgcolor=\"#FFFFFF\" WIDTH=\"779\" HEIGHT=\"70\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED></OBJECT><br><img src=\"/images/top.jpg\" width=\"779\" height=\"4\" alt=\"\" border=\"0\">");
}
