function cht() {

	var lang_folder=location.href.toString().split('/');
	var lang_file=lang_folder[lang_folder.length-1]
	var new_href="";
	
	if(location.href.toString().search('/chs/')!=-1)	{
		document.location.href=(location.href.toString().replace('/chs/','/cht/'));
	} else {
		for (i=0; i<lang_folder.length-1; i++ )
		{
			new_href=new_href+lang_folder[i]+"/";
		}
		location.href=new_href+"cht/"+lang_file;
	}
}	

function chs() {

	var lang_folder=location.href.toString().split('/');
	var lang_file=lang_folder[lang_folder.length-1]
	var new_href="";
	
	if(location.href.toString().search('/cht/')!=-1)	{
		document.location.href=(location.href.toString().replace('/cht/','/chs/'));
	} else {
		for (i=0; i<lang_folder.length-1; i++ )
		{
			new_href=new_href+lang_folder[i]+"/";
		}
		location.href=new_href+"chs/"+lang_file;
	}
}	

function eng() {
	if(location.href.toString().search('/cht/')!=-1)	{
		document.location.href=(location.href.toString().replace('/cht/','/'));
	} 
	if(location.href.toString().search('/chs/')!=-1)	{
		document.location.href=(location.href.toString().replace('/chs/','/'));
	} 	
}
