if(location.href.toString().search('westcom') != -1)
{
	var domain_url = 'cmab.westcomzivo.com/cd/'
	var url_sc= 'common.westcomzivo.com/gb/';
}
else if(location.href.toString().search('www0.info.gov.hk/cab/cab-review') != -1)
{
	var domain_url = 'www0.info.gov.hk/cab/cab-review/';
	var url_sc= 'sc.info.gov.hk/gb/';
}
else if(location.href.toString().search('www.info.gov.hk/cab/cab-review') != -1)
{
	var domain_url = 'www.info.gov.hk/cab/cab-review/';
	var url_sc= 'sc.info.gov.hk/gb/';
}
else if(location.href.toString().search('www0.cab.gov.hk/cd') != -1)
{
	var domain_url = 'www0.cab.gov.hk/cd/';
	var url_sc= 'sc.info.gov.hk/gb/';
}
else
{
	var domain_url = 'www.cmab.gov.hk/cd/';
	var url_sc= 'sc.info.gov.hk/gb/';
}

url_sc = '';

var chi_str = document.URL.toString(); 
var sc_str;
var text_locat;
var chi_locat;
var sc_locat;

if(chi_str.search('/gb/') != -1){ 
	chi_str = chi_str.substring( chi_str.indexOf('/gb/')+4, chi_str.length ); 
} 
else {
	chi_str = chi_str.substring( 7, chi_str.length ); 
}

chi_locat = chi_str; 
text_locat = chi_str.replace("/eng/", "/text/eng/");
chi_locat = chi_str.replace("/eng/", "/chi/");
//sc_locat = url_sc + chi_locat;
sc_locat = chi_str.replace("/eng/", "/sim/");

if(location.href.toString().search('search.gov.hk') != -1)
{
	chi_locat=chi_str.replace("ui_lang=en", "ui_lang=zh-hk");
	chi_locat=chi_str.replace("ui_charset=iso-8859-1", "ui_charset=big5");
	sc_locat= sc_locat.replace("ui_lang=en", "ui_lang=zh-cnhk");
	sc_locat= sc_locat.replace("ui_charset=iso-8859-1", "ui_charset=utf-8");
	formAction = 'javascript:document.forms.search1.submit()'
}else{
	formAction = 'javascript:document.forms.search.submit()'
}


function overTopMenu(obj)
{
        if (document.images){
				eval("document.images." + obj + ".src = 'http://" + domain_url + "eng/images/" + obj + "_f2.gif'");
        }
}

function outTopMenu(obj)
{
        if (document.images){
				eval("document.images." + obj + ".src = 'http://" + domain_url + "eng/images/" + obj + ".gif'");
        }
}

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) { //v4.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);
  if(!x && document.getElementById) x=document.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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function simg(obj,src)
{
        if (document.images){
                obj.src = src;
        }
}

function yahooSearch(){
	var gicSearchForm;
	
	/*if(location.href.toString().search('/gb/') != -1)
	{
		gicSearchForm='<form name="search" action="http://sc.info.gov.hk/gb/search.gov.hk/search.html" method="get">\n';
	}
	else
	{*/
		gicSearchForm='<form name="search" action="http://search.gov.hk/search.html" method="get">\n';
	//}
	gicSearchForm=gicSearchForm+'<INPUT name="exact_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="any_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="none_q" type="hidden" value="">';
	gicSearchForm=gicSearchForm+'<INPUT name="gp0" type="hidden" value="cmab-cd_home">';
	gicSearchForm=gicSearchForm+'<INPUT name="gp1" type="hidden" value="cmab-cd_home">';
	gicSearchForm=gicSearchForm+'<INPUT name="p_size" type="hidden" value="10">';
	gicSearchForm=gicSearchForm+'<INPUT name="doc_type" type="hidden" value="all">';
	gicSearchForm=gicSearchForm+'<INPUT name="last_mod" type="hidden" value="#-1">';
	gicSearchForm=gicSearchForm+'<INPUT name="r_lang" type="hidden" value="all">';
	gicSearchForm=gicSearchForm+'<INPUT name="tpl_id" type="hidden" value="cmab-cd">';
	gicSearchForm=gicSearchForm+'<INPUT name="a_submit" type="hidden" value="false">';
	gicSearchForm=gicSearchForm+'<INPUT name="web" type="hidden" value="this">';
	gicSearchForm=gicSearchForm+'<INPUT name="txtonly" type="hidden" value="0">';
	document.write (gicSearchForm);
}


function topNav(upperPath, textPath, imgPath)
{
	document.write('<table width="760" border="0" cellpadding="0" cellspacing="0">\n')
	document.write('<tr align="left" valign="top">\n')
	document.write('<td class="sidebar" background="http://' + domain_url + 'eng/images/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="http://www.cmab.gov.hk"><img src="http://' + domain_url + 'eng/images/logo.gif" border=0 alt="Constitutional and Mainland Affairs Bureau - The Government of the Hong Kong Special Administrative Region"></a></td>\n')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif" colspan="2" valign="bottom" align=right bgcolor="#FAFAEB"><a href="http://www.brandhk.gov.hk/brandhk/eindex.htm" target="_top"><img name="BrandHK" src="http://' + domain_url + 'eng/images/brandhk.gif" border="0" alt="Brand Hong Kong - Asia\'s world city"></a></td>\n')
	document.write('</tr>\n')
	document.write('</table>\n')
	document.write('<table width="760" border="0" cellpadding="0" cellspacing="0">\n')
	document.write('<tr align="left" valign="top">\n')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif"><a href="http://www.gov.hk/en/residents/" onMouseOut="outTopMenu(\'mainbar1\')" onMouseOver="overTopMenu(\'mainbar1\')"><img name="mainbar1" src="http://' + domain_url + 'eng/images/mainbar1.gif" border="0" alt="GovHK"></a></td>')
	document.write('<td align="left"><a href="http://' + text_locat + '" onMouseOut="outTopMenu(\'mainbar2\')" onMouseOver="overTopMenu(\'mainbar2\')" ><img name="mainbar2" src="http://' + domain_url + 'eng/images/mainbar2.gif" border="0" alt="TEXT ONLY"></a></td>')
	document.write('<td align="left" valign="top"><a href="http://' + chi_locat + '" onMouseOut="outTopMenu(\'mainbar3\')" onMouseOver="overTopMenu(\'mainbar3\')"><img name="mainbar3" src="http://' + domain_url + 'eng/images/mainbar3.gif" border="0" alt="Traditional Chinese"></a></td>')
	document.write('<td align="left" valign="top"><a href="http://' + sc_locat + '" onMouseOut="outTopMenu(\'mainbar4\')" onMouseOver="overTopMenu(\'mainbar4\')"><img name="mainbar4" src="http://' + domain_url + 'eng/images/mainbar4.gif" border="0" alt="Simplified Chinese"></a></td>')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif" width="80"><img src="http://' + domain_url + 'eng/images/mainbar5.gif" bgcolor="#FAFAEB"></td>')
	document.write('<td bgcolor="#FAFAEB"><img name="mainbar5" src="http://' + domain_url + 'eng/images/spacer.gif" border="0" height=1 width=49 alt=""></td>')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif"><a href="'+formAction+'" onMouseOut="outTopMenu(\'mainbar6\')" onMouseOver="overTopMenu(\'mainbar6\')"><img name="mainbar6" src="http://' + domain_url + 'eng/images/mainbar6.gif" border="0" alt="Search"></a></td>')
	document.write('<td valign="bottom" background="http://' + domain_url + 'eng/images/bkgdtexture.gif" align=center bgcolor="#FAFAEB" class="search"><INPUT name="ui_charset" type="hidden" value="iso-8859-1"><INPUT name="ui_lang" type="hidden" value="en"><input type="text" name="query" size="16" style="width:86pt;height:18px"></td>')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif"><a href="'+formAction+'" onMouseOut="outTopMenu(\'mainbar8\')" onMouseOver="overTopMenu(\'mainbar8\')"><img name="mainbar8" src="http://' + domain_url + 'eng/images/mainbar8.gif" border="0" alt="Search"></a></td>')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif"><a href="http://' + domain_url + 'eng/sitemap/index.htm" onMouseOut="outTopMenu(\'mainbar9\')" onMouseOver="overTopMenu(\'mainbar9\')"><img name="mainbar9" src="http://' + domain_url + 'eng/images/mainbar9.gif" border="0" alt="Site Map"></a></td>')
	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="http://www.cmab.gov.hk/en/contact/index.htm" onMouseOut="outTopMenu(\'mainbar10\')" onMouseOver="overTopMenu(\'mainbar10\')"><img name="mainbar10" src="http://' + domain_url + 'eng/images/mainbar10.gif" border="0" alt="Contact Us"></a></td>')
//	document.write('<td background="http://' + domain_url + 'eng/images/bkgdtexture.gif" bgcolor="#FAFAEB"><a href="http://' + domain_url + 'eng/contact/index.htm" onMouseOut="outTopMenu(\'mainbar10\')" onMouseOver="overTopMenu(\'mainbar10\')"><img name="mainbar10" src="http://' + domain_url + 'eng/images/mainbar10.gif" border="0" alt="Contact Us"></a></td>\n')
	document.write('</tr>\n')
	document.write('<tr align="left" valign="top" bgcolor="#BB3333">\n')
	document.write('<td height=2 colspan="11"><img src="http://' + domain_url + 'eng/images/reddot.gif" width="760" height="1" alt="" border=0></td>\n')
	document.write('</tr>\n')
	document.write('</table>\n')	
	
}

function leftNav(section, upperPath, imgPath)
{

	imgPath = 'http://' + domain_url + imgPath
	
	document.write('<table border="0" cellpadding="0" cellspacing="0">')
	document.write('<tr>')
	document.write('<td><img src="'+imgPath+'images/cab_inside_02.gif" alt="" border="0"></td>')
	document.write('</tr>')
	document.write('<tr>')
	if (section!=22)
	{
		document.write('<td><a href="'+imgPath+'past/index.htm" onmouseover="simg(document.t22, \''+imgPath+'images/menu_22_on.gif\')" onmouseout="simg(document.t22, \''+imgPath+'images/menu_22.gif\')"><img src="'+imgPath+'images/menu_22.gif" alt="The First to Fifth Report of the Constitutional Development Task Force" name="t22" border="0"></td>')
//		document.write('<td><a href="'+imgPath+'past/index.htm" onmouseover="simg(document.t22, \''+imgPath+'images/menu_22_on.gif\')" onmouseout="simg(document.t22, \''+imgPath+'images/menu_22.gif\')"><img src="'+imgPath+'images/menu_22.gif" alt="Past Reports" name="t22" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'past/index.htm"><img src="'+imgPath+'images/menu_22_on.gif" alt="The First to Fifth Report of the Constitutional Development Task Force" name="t22" border="0"></td>')
//		document.write('<td><a href="'+imgPath+'past/index.htm"><img src="'+imgPath+'images/menu_22_on.gif" alt="Past Reports" name="t22" border="0"></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	if (section!=9)
	{
		document.write('<td><a href="'+imgPath+'legco/index.htm" onmouseover="simg(document.t9, \''+imgPath+'images/menu_09_on.gif\')" onmouseout="simg(document.t9, \''+imgPath+'images/menu_09.gif\')"><img src="'+imgPath+'images/menu_09.gif" alt="Legislative Council Papers" name="t9" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'legco/index.htm"><img src="'+imgPath+'images/menu_09_on.gif" alt="Legislative Council Papers" name="t9" border="0"></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	if (section!=4)
	{
		document.write('<td><a href="'+imgPath+'media/index.htm" onmouseover="simg(document.t4, \''+imgPath+'images/menu_04_on.gif\')" onmouseout="simg(document.t4, \''+imgPath+'images/menu_04.gif\')"><img src="'+imgPath+'images/menu_04.gif" alt="Press Briefings & Releases" name="t4" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'media/index.htm"><img src="'+imgPath+'images/menu_04_on.gif" alt="Press Briefings & Releases" name="t4" border="0"></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	if (section!=5)
	{
		document.write('<td><a href="'+imgPath+'basic/index.htm" onmouseover="simg(document.t5, \''+imgPath+'images/menu_05_on.gif\')" onmouseout="simg(document.t5, \''+imgPath+'images/menu_05.gif\')"><img src="'+imgPath+'images/menu_05.gif" alt="Basic Law and Other Documents" name="t5" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'basic/index.htm"><img src="'+imgPath+'images/menu_05_on.gif" alt="Basic Law and Other Documents" name="t5" border="0"></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	
	if (section!=23)
	{
//		document.write('<td><a href="'+imgPath+'ofs/index.htm" onmouseover="simg(document.t23, \''+imgPath+'images/menu_23_on.gif\')" onmouseout="simg(document.t23, \''+imgPath+'images/menu_23.gif\')"><img src="'+imgPath+'images/menu_23.gif" alt="Fourth Report of the Constitutional Development Task Force Open Forum" name="t23" border="0"></td>')
		document.write('<td><a href="'+imgPath+'ofs/index.htm" onmouseover="simg(document.t23, \''+imgPath+'images/menu_23_on.gif\')" onmouseout="simg(document.t23, \''+imgPath+'images/menu_23.gif\')"><img src="'+imgPath+'images/menu_23.gif" alt="Open Forums" name="t23" border="0"></td>')
	}
	else
	{
//		document.write('<td><a href="'+imgPath+'ofs/index.htm"><img src="'+imgPath+'images/menu_23_on.gif" alt="Fourth Report of the Constitutional Development Task Force Open Forum" name="t23" border="0"></td>')
		document.write('<td><a href="'+imgPath+'ofs/index.htm"><img src="'+imgPath+'images/menu_23_on.gif" alt="Open Forums" name="t23" border="0"></td>')
	}
	document.write('</tr>')

/*
	document.write('<tr>')
	if (section!=2)
	{
		document.write('<td><a href="'+imgPath+'welcome/index.htm" onmouseover="simg(document.t2, \''+imgPath+'images/menu_02_on.gif\')" onmouseout="simg(document.t2, \''+imgPath+'images/menu_02.gif\')"><img src="'+imgPath+'images/menu_02.gif" alt="Welcome Message" name="t2" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'welcome/index.htm"><img src="'+imgPath+'images/menu_02_on.gif" alt="Welcome Message" name="t2" border="0"></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	if (section!=1)
	{
		document.write('<td><a href="'+imgPath+'news/index.htm" onmouseover="simg(document.t1, \''+imgPath+'images/menu_01_on.gif\')" onmouseout="simg(document.t1, \''+imgPath+'images/menu_01.gif\')"><img src="'+imgPath+'images/menu_01.gif" alt="What\'s New" name="t1" border="0"></a></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'news/index.htm"><img src="'+imgPath+'images/menu_01_on.gif" alt="What\'s New" name="t1" border="0"></a></td>')
	}
	document.write('</tr>')
	document.write('<tr>')
	if (section!=3)
	{
		document.write('<td><a href="'+imgPath+'background/index.htm" onmouseover="simg(document.t3, \''+imgPath+'images/menu_03_on.gif\')" onmouseout="simg(document.t3, \''+imgPath+'images/menu_03.gif\')"><img src="'+imgPath+'images/menu_03.gif" alt="Background" name="t3" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'background/index.htm"><img src="'+imgPath+'images/menu_03_on.gif" alt="Background" name="t3" border="0"></td>')
	}
	document.write('</tr>')
*/
/*
	document.write('<tr>')
	if (section!=11)
	{
		document.write('<td><a href="'+imgPath+'materials/index.htm" onmouseover="simg(document.t11, \''+imgPath+'images/menu_11_on.gif\')" onmouseout="simg(document.t11, \''+imgPath+'images/menu_11.gif\')"><img src="'+imgPath+'images/menu_11.gif" alt="Publicity Materials" name="t11" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'materials/index.htm"><img src="'+imgPath+'images/menu_11_on.gif" alt="Publicity Materials" name="t11" border="0"></td>')
	}
	document.write('</tr>')
*/
/*
	document.write('<tr>')
	if (section!=6)
	{
		document.write('<td><a href="http://www.cmab.gov.hk" target="_blank" onmouseover="simg(document.t6, \''+imgPath+'images/menu_06_on.gif\')" onmouseout="simg(document.t6, \''+imgPath+'images/menu_06.gif\')"><img src="'+imgPath+'images/menu_06.gif" alt="Constitutional and Mainland Affairs Bureau" name="t6" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="http://www.cmab.gov.hk" target="_blank"><img src="'+imgPath+'images/menu_06_on.gif" alt="Constitutional and Mainland Affairs Bureau" name="t6" border="0"></td>')
	}
	
	document.write('</tr>')
	document.write('<tr>')
	if (section!=25)
	{
		document.write('<td><a href="'+imgPath+'report5/index.htm" onmouseover="simg(document.t25, \''+imgPath+'images/menu_25_on.gif\')" onmouseout="simg(document.t25, \''+imgPath+'images/menu_25.gif\')"><img src="'+imgPath+'images/menu_25.gif" alt="The Fifth Report" name="t25" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'report5/index.htm"><img src="'+imgPath+'images/menu_25_on.gif" alt="The Fifth Report" name="t25" border="0"></td>')
	}
	
	document.write('</tr>')
	document.write('<tr>')
	if (section!=8)
	{
		document.write('<td><a href="'+imgPath+'contact/index.htm" onmouseover="simg(document.t8, \''+imgPath+'images/menu_08_on.gif\')" onmouseout="simg(document.t8, \''+imgPath+'images/menu_08.gif\')"><img src="'+imgPath+'images/menu_08.gif" alt="Contact Us" name="t8" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+imgPath+'contact/index.htm"><img src="'+imgPath+'images/menu_08_on.gif" alt="Contact Us" name="t8" border="0"></td>')
	}
	document.write('</tr>')
*/
/*	
	document.write('<tr>')
	if (section!=24)
	{
		document.write('<td><a href="'+upperPath+'district/index.htm" onmouseover="simg(document.t24, \''+imgPath+'images/menu_24_on.gif\')" onmouseout="simg(document.t24, \''+imgPath+'images/menu_24.gif\')"><img src="'+imgPath+'images/menu_24.gif" alt="Notes of Meeting with District Councils" name="t24" border="0"></td>')
	}
	else
	{
		document.write('<td><a href="'+upperPath+'district/index.htm"><img src="'+imgPath+'images/menu_24_on.gif" alt="Notes of Meeting with District Councils" name="t24" border="0"></td>')
	}
	document.write('</tr>')
*/	

	document.write('<tr>')
	document.write('<td background="'+imgPath+'images/cab_inside_12.gif" align="center"><br><a href="../../5report/index.htm" target="_blank"><img src="'+imgPath+'images/report5.gif" alt="5&#34399;&#25919;&#25913;&#26041;&#26696;\n&#22686;&#21152;&#22810;&#23569;&#27665;&#20027;&#25104;&#20998;?" border="0"></a></td>')
	document.write('</tr>')
	document.write('<tr>')
	document.write('<td background="'+imgPath+'images/cab_inside_12.gif"><img src="'+imgPath+'images/spacer.gif" width="1" height="60" alt="" border="0"></td>')
	document.write('</tr>')
	document.write('</table>')
}

function switchLang(currLang, tarLang){

	var currPath = document.URL.toString();
	var lang = window.location.hostname;
	
	var head, toPath;
	toPath = "";
	
	
	if (currLang==0)
	{		
		if (tarLang==1)
		{
			currPath = currPath.replace("/eng/", "/text/eng/");
			toPath = currPath;
			location = toPath;
		}
		else if (tarLang==2)
		{
			currPath = currPath.replace("/chi/", "/text/chi/");
			//alert("Text Only Version is not available at the moment.");
			toPath = currPath;
			location = toPath;
		}
		else if (tarLang==3)
		{
			currPath = currPath.replace("/chi/", "/text/chi/");
			//if (document.URL.toString().indexOf('westcomzivo')!=-1){ 
				//currPath = currPath.replace("common.westcomzivo.com/gb/", "");
			//}
			//else
			//{
				//currPath = currPath.replace("sc.info.gov.hk/gb/", "");
			//}
			//alert("Text Only Version is not available at the moment.");
			toPath = currPath;
			location = toPath;
		}
	}
	else if (currLang==1)
	{		
		if (tarLang==2)
		{
			currPath = currPath.replace("/eng/", "/chi/");
			//alert("Traditional Chinese Version is not available at the moment.");
			toPath = currPath;
			location = toPath;
		}
		else if (tarLang==3)
		{
			currPath = currPath.replace("/eng/", "/chi/");
			if (document.URL.toString().indexOf('westcomzivo')!=-1){ 
				currPath = currPath.replace(lang, "common.westcomzivo.com/gb/" + lang);
			}
			else
			{
				currPath = currPath.replace(lang, "sc.info.gov.hk/gb/" + lang);
			}
			//alert("Simplified Chinese Version is not available at the moment.");
			toPath = currPath;
			location = toPath;
		}
	}
	else if (currLang==2)
	{		
		if (tarLang==1)
		{
			currPath = currPath.replace("/chi/", "/eng/");
			toPath = currPath;
			location = toPath;
		}
		else if (tarLang==3)
		{
			if (document.URL.toString().indexOf('westcomzivo')!=-1){ 
				currPath = currPath.replace(lang, "common.westcomzivo.com/gb/" + lang);
			}
			else
			{
				currPath = currPath.replace(lang, "sc.info.gov.hk/gb/" + lang);
			}
			toPath = currPath;
			location = toPath;			
		}
	}
	else if (currLang==3)
	{
		if (tarLang==1)
		{
			currPath = currPath.replace("/chi/", "/eng/");
			if(document.URL.toString().search('sc.info.gov.hk/gb/') == -1){ 
				currPath = currPath.replace("common.westcomzivo.com/gb/","");
			}
			else
			{
				currPath = currPath.replace("sc.info.gov.hk/gb/","");
			}	
			toPath = currPath;
			location = toPath;
		}
		else if (tarLang==2)
		{
			if (document.URL.toString().indexOf('westcomzivo')!=-1){ 
				currPath = currPath.replace("common.westcomzivo.com/gb/","");
			}
			else
			{
				currPath = currPath.replace("sc.info.gov.hk/gb/","");
			}	
			toPath = currPath;
			location = toPath;
		}
	}
	
	//location = toPath;	
}

function PopWin(url, x, y, w, h){
    eval("popup0 = window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,pageXOffset=300,pageYOffset=500,top=" + y + ",left=" + x +",width=" + w + ",height=" + h + "')");
        if ( popup0.focus != null){
        popup0.focus();
    }
}
