
//Requires
//<script type="text/javascript" src="/Common/Custom/Cookies.js"></script>


//This is function is obsolete, but its definition is left in until we're sure it's not being called anywhere.
// References should only appear in endis.com and churchinsight.com - UK and US variants - and once these are gone, this can be removed.
function GetLocation() {
	return '';
}

function ChangeSite(location) {
	var strHost = document.location.host;
	
	if (strHost.indexOf('endis.com') >= 0) {
		Set_Cookie('GeoLocation', location, 365, '/', 'endis.com', '');
		switch(location) {
			case 'UK' :
				document.location.href = 'http://uk.endis.com';
				break;
			default :
				document.location.href = 'http://www.endis.com';
				break;
		}
	}
	else if (strHost.indexOf('churchinsight.com') >= 0) {
		Set_Cookie('GeoLocation', location, 365, '/', 'churchinsight.com', '');
		switch(location) {
			case 'UK' :
				document.location.href = 'http://www.churchinsight.com';
				break;
			default :
				document.location.href = 'http://us-sales.churchinsight.com';
				break;
		}
	}
	else if (strHost.indexOf('endisinsight.co') >= 0) {
		switch(location) {
			case 'UK' :
				document.location.href = 'http://www.endisinsight.co.uk';
				break;
			default :
				document.location.href = 'http://us.endisinsight.com';
				break;
		}
	}
}
