div_path = "";

//cv_sc_base_path = "http:" + "//" + "sc.info.gov.hk/gb/www.fstb.gov.hk";

//cv_nonsc_base_path = "http:" + "//" + "www.fstb.gov.hk";
if (location.href.toString().search('devprj.com') != -1) {
cv_sc_base_path = "http:" + "//" + "ogcio.devprj.com/20090417_fstb/test";

cv_nonsc_base_path = "http:" + "//" + "ogcio.devprj.com/20090417_fstb/test";
}
else
{
cv_sc_base_path = "http:" + "//" + "www.fstb.gov.hk";

cv_nonsc_base_path = "http:" + "//" + "www.fstb.gov.hk";
}

path = cv_sc_base_path + div_path;

tc_path = cv_nonsc_base_path + div_path;
front_path = cv_nonsc_base_path + div_path;

if (location.href.toString().search('/simpchi/') != -1) {
	atgb = 1
} else {
	atgb = 0;
}

function changeVer(lang) {

	chi_path = "/chinese/";
	eng_path = "/eng/";
	sc_path = "/simpchi/";

	org_path=window.location.pathname;

	if (org_path.indexOf(chi_path) != -1) {
		org_lang_path = chi_path;
		div_path = chi_path;
	} else {
		org_lang_path = eng_path;
		div_path = eng_path;
	}

	if (lang == 'e') {
		des_lang_path = eng_path;
	} else if (lang == 'c') {
		des_lang_path = chi_path;
	} else if (lang == 's') {
		des_lang_path = sc_path;
	}

//	if ((lang == 'c') || (lang == 's')) {
//		des_lang_path = chi_path;
//	} else {
//		des_lang_path = eng_path;
//	}
	
	if (lang == 's') {
		base_path = cv_sc_base_path;
	} else {
		base_path = cv_nonsc_base_path;
	}	
	org_path_start=org_path.indexOf(div_path);
	org_path_end=org_path.length;
	org_path=org_path.substring(org_path_start, org_path_end);


	tail = org_path.replace(org_lang_path, des_lang_path);
	if (lang =='c') {
		
	}
	
//	alert(base_path + tail);
//	alert(base_path);
//	alert(tail);

	window.location.href = base_path + tail;
}
