

/*** Start - Added for Offline SC ***/

// Language directory
var chi_path= "/chi/";
var sim_path= "/eng/";
var eng_path= "/sim/";

function chglang(lang) {
 	var tmppath = location.href;
 	tmppath = tmppath.replace ("#", "");
	if (isSim()) {
		location.href = tmppath.replace(sim_path, "/" + lang + "/");
	}

	if (isChi()) {
		location.href = tmppath.replace(chi_path, "/" + lang + "/");
	}

	if (isEng()) {
		location.href = tmppath.replace(eng_path, "/" + lang + "/");
	}

}

function isEng() {
	return (location.href.toString().indexOf(eng_path) != -1) ? true : false;
}

function isChi() {
	return (location.href.toString().indexOf(chi_path) != -1) ? true : false;
}

function isSim() {
	return (location.href.toString().indexOf(sim_path) != -1) ? true : false;
}

/*** End - Added for Offline SC ***/
