/*
Copyright SiteMaster Webs Ltd 2003 All rights reserved.
*/

var cookstring= new String(document.cookie)
var cookname= "Login="
var startpos = cookstring.indexOf(cookname)


if(startpos==-1){
	//write this page to go to as a cookie
	var strCookVal=window.location.href
	document.cookie="Page="+strCookVal
	alert("You are not authorized to view this page.\n\nMEMBERS: Please login by entering your email address and password.\nNEW MEMBERS: Please follow the links to register before attempting to login.")
	window.location.href="index.htm"
}
else
{
	var start = startpos + cookname.length;                       // Start of cookie value
	var end = cookstring.indexOf(";", start);
	if (end == -1) {
		end = cookstring.length;
	}

	if (cookstring.substring(start,end)!=memberarea) {
		alert("You are not authorized to view this page.\nThis is usually because your membership is for one of the other areas of the site.")
		window.location.href="index.htm"
	}
}
