function eng_cht() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/eng/')!=-1)	{
		document.location.href=(location.href.toString().replace('/eng/','/cht/'));
	} 
}


function eng_chs() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/eng/')!=-1)	{
		document.location.href=(location.href.toString().replace('/eng/','/chs/'));
	} 
}


<!-- ================================= -->


function chs_eng() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/chs/')!=-1)	{
		document.location.href=(location.href.toString().replace('/chs/','/eng/'));
	} 
}



function cht_chs() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/cht/')!=-1)	{
		document.location.href=(location.href.toString().replace('/cht/','/chs/'));
	} 
}


<!-- ================================= -->


function cht_eng() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/cht/')!=-1)	{
		document.location.href=(location.href.toString().replace('/cht/','/eng/'));
	} 
}



function chs_cht() {
	var cur_loc=document.location.pathname; 
	if(location.href.toString().search('/chs/')!=-1)	{
		document.location.href=(location.href.toString().replace('/chs/','/cht/'));
	} 
}




//////add by kevin
var changeLanguage = function (lang) {
  var href = location.href;
  location.replace(href.replace(/\/(eng|cht|chs)\//, '/' + lang + '/'));
};
