
document.write('<meta http-equiv="expires" content="0"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="pragma" content="no-cache, no-store, must-revalidate">');



if(location.href.toString().search('test.gld.gov.hk') != -1)
{
	div_path = 'test.gld.gov.hk';
}
else if(location.href.toString().search('www0.gld.gov.hk') != -1)
{
	div_path = 'www0.gld.gov.hk';
}
else
{
	div_path = 'www.gld.gov.hk';
}

//div_path = "www.gld.gov.hk/";

cv_sc_base_path = "http:" + "//" + "sc.info.gov.hk/gb/" + div_path;

cv_nonsc_base_path = "http:" + "//" + div_path;

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('/sc/') != -1) {
	atgb = 1
} else {
	atgb = 0;
}

function changeVer(lang) {

	chi_path = "chi";
	eng_path = "eng";
	
	//Kit Convert 4/3/2009
	sc_path = "sc";
	//====================
	org_path=window.location.href;
	org_path_start=org_path.indexOf(div_path) + div_path.length ;
	org_path_end=org_path.length;
	org_path=org_path.substring(org_path_start, org_path_end);

//Kit Convert 4/3/2009
	/*if (org_path.indexOf(chi_path) != -1) {
		org_lang_path = chi_path;
	} else {
		org_lang_path = eng_path;
	}

	if (lang == 'e') {
		des_lang_path = eng_path;
	} else {
		des_lang_path = chi_path;
	}
	
	if (lang == 's') {
		base_path = cv_sc_base_path;
	} else {
		base_path = cv_nonsc_base_path;
	}
*/
	if (org_path.indexOf(chi_path) != -1) org_lang_path = chi_path;
	if (org_path.indexOf(eng_path) != -1) org_lang_path = eng_path;
	if (org_path.indexOf(sc_path) != -1) org_lang_path = sc_path;

	
	if (lang == 'c') des_lang_path = chi_path;
	if (lang == 'e') des_lang_path = eng_path;
	if (lang == 's') des_lang_path = sc_path;
	base_path = cv_nonsc_base_path;
	
//==============================================
	tail = org_path.replace(org_lang_path, des_lang_path);
	
	//alert(base_path + tail);

	window.location.href = base_path + tail;
}
