link = top.location.href;
//string_sc2 = "sc.info.gov.hk/TuniS/";
//string_sc = "sc.info.gov.hk/gb/";
string_loc = "www.basiclaw23.gov.hk/";
string_sc2 = "";
string_sc = "";
document.write('<img src="/chinese/images/conchi.gif" alt="簡體版" name="schi" border="0" id="schi">')


function changelan(version){

// chinese version
if (version == 'chinese')
{
	if (link.indexOf(string_sc) != -1){
	//link = link.replace('http' + '://' + string_sc + string_loc, 'http' + '://' + string_loc);
	link = link.replace('chinese', 'sc');
	}
	else { 
	//link = link.replace('http' + '://'+ string_loc, 'http' + '://' +string_sc + string_loc);
	link = link.replace('chinese', 'sc');
	}
}

// english version

else if (version == 'english')
{
	if (link.indexOf(string_sc) != -1){
	//link = link.replace('http' + '://' + string_sc + string_loc + 'chinese', 'http' + '://' + string_loc+ version);
	link = link.replace('chinese', 'english');
	}
else { 
	//link = link.replace('http://' + string_loc + 'chinese', 'http' + '://'+ string_loc+ version);
	link = link.replace('chinese', 'english');
	}

}
//compendium_search
else if (version == 'compendium_search')
{
	if (link.indexOf(string_sc) != -1){
	link = ('http' + '://' + string_sc2 + string_loc + 'chinese/resources/comp_search/compendium_search.htm');
	}
else { 
	
	link = ('http' + '://' + string_loc + 'chinese/resources/comp_search/compendium_search.htm');
	


    }
}
//newsroom


else if (version == 'nr_index')
{
	
	link = ('http' + '://' +  string_loc + 'english/newsroom/speech/index.htm');

}


//newsroom sb


else if (version == 'nr_sb')
{
	
	link = ('http' + '://' +  string_loc + 'english/newsroom/sbreply/index.htm');

}

//newsroomr sb

else if (version == 'nr_do')
{
	
	link = ('http' + '://' +  string_loc + 'english/newsroom/dojreply/index.htm');

}


//pamphlet facts

else if (version == 'pa')
{
	
	link = ('http' + '://' +  string_loc + 'english/pamphlet/index.htm');

}

else if (version == 'pa_fa')
{
	
	link = ('http' + '://' +  string_loc + 'english/pamphlet/facts/leaflet2_f.htm');

}

else if (version == 'pa')
{
	
	link = ('http' + '://' +  string_loc + 'english/pamphlet/index.htm');

}

//logo paper

else if (version == 'le_ar')
{
	
	link = ('http' + '://' +  string_loc + 'english/resources/legco/legco_article/index.htm');

}

//focus

else if (version == 'focus')
{
	
	link = ('http' + '://' +  string_loc + 'english/focus/index.htm');

}


top.location.href = (link);

}