//webserver_path = "www.yearbook.gov.hk";
//kanserver_path = "sc.info.gov.hk/gb";

webserver_path = "www.cweb.com.hk";
kanserver_path = "www.cweb.com.hk";

div_path = "/";
cv_sc_base_path = "http:" + "//" + kanserver_path + "/" + webserver_path;
cv_nonsc_base_path = "http:" + "//" + webserver_path;

sc_path = cv_sc_base_path + div_path;
tc_path = cv_nonsc_base_path + div_path;

if (location.href.toString().search('/gb/') != -1) {
	atgb = 1
} else {
	atgb = 0;
}

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

// Language directory
var chi_path= "/tc/";
var sim_path= "/sc/";
var eng_path= "/en/";

function switchLang(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() {
	if (isSim()) return false;
	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 ***/ 