function checkssl_checkPage(){
	var url = location.href;
	var idx = url.indexOf("?");
	if (idx >= 0){
		url = url.substring(0, idx);
	}

	var sslUrl = new Array(
			"/leisure_gaming/e_newsletter/"
			, "/contact_us/hotel/"
			, "/contact_us/casino/"
			, "/contact_us/public_relations/"
			, "/careers/job_application/"
			);
	var useSecure = false;

	for (i=0; i < sslUrl.length; i++){
		var enUrl = "/en" + sslUrl[i];
		var tcUrl = "/tc" + sslUrl[i];
		var scUrl = "/sc" + sslUrl[i];
		if (url.indexOf(enUrl) >= 0
			|| url.indexOf(tcUrl) >= 0
			|| url.indexOf(scUrl) >= 0){
			useSecure = true;
			break;
		}
	}

	if (useSecure){
		checkssl_toSecureSite();
	}else{
		checkssl_toNormalSite();
	}
}

function checkssl_toSecureSite(){
	if (location.href.indexOf("http://") == 0){
		location.href = location.href.replace("http://","https://");
	}
}

function checkssl_toNormalSite(){
	if (location.href.indexOf("https://") == 0){
		location.href = location.href.replace("https://","http://");
	}
}

checkssl_checkPage();
