//function change lang. of url: from from_lang to to_lang
function ChangeLang(from_lang,to_lang)
{
	tempurl = window.location.href
	if (tempurl.search("/"+from_lang+"/") != -1)
	{
		tempurl = tempurl.replace("/"+from_lang+"/", "/"+to_lang+"/") ;
		//alert(tempurl);
		window.location.href = tempurl
	}
}

function goEnglish() {
	if (window.location.href.indexOf("gb") > 0) //it is gb version now
	{
		s = window.location.href;
		re = '/b5/';
		s = s.replace(re, '/en/');
		re = 'http://translate.itsc.cuhk.edu.hk/gb/';
		s = s.replace(re, 'ht'+'tp://');
		window.location = s;
	}
	else //it is b5 version now
	{
		s = window.location.href;
		re = '/b5/';
		s = s.replace(re, '/en/');
		window.location = s;
	}
}

function goChinese() {
    if (window.location.href.indexOf("gb") > 0) //it is gb version now, so to b5
	{
		s = window.location.href;
		re = 'http://translate.itsc.cuhk.edu.hk/gb/';
		s = s.replace(re, 'ht'+'tp://');
		window.location = s;
	}
	else //it is b5 version nowm, so go to gb
	{
		s = window.location.href;
		re = 'http://';
		s = s.replace(re, 'http://translate.itsc.cuhk.edu.hk/gb/');
		window.location = s;
	}
}