var cookieEnabled=(navigator.cookieEnabled)? true : false
//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
document.cookie="testcookie"
cookieEnabled=(document.cookie=="testcookie")? true : false
document.cookie="" //erase dummy value
}
if (!cookieEnabled) nocookie()

function nocookie(){
	alert("We need to use cookies to identify you on our system.\n\nTo allow cookies you must change your browser's privacy settings.\n\nIn Internet Explorer, on the Tools menu, click Internet Options.\nOn the Privacy tab, move the slider down to Medium or a lower level of privacy.\nAfter that, close your browser, then re-open and try again.")
}

function createCookie(value){
	var name = "TSC";
	var days = 3;
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(){
	var nameEQ = "TSC" + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookieP(value){
	var nameEQ = "TSCpass"+"=";
	var days = 3;
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = nameEQ+value+expires+"; path=/";
}

function readCookieP(){
	var nameEQ = "TSCpass" + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookieD1(value){
	var nameEQ = "TSC_CheckDetails"+"=";
	var days = 1000;
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = nameEQ+value+expires+"; path=/";
}

function readCookieD1(){
	var nameEQ = "TSC_CheckDetails" + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function refreshtop(){
	parent.window.top.focus();
	parent.window.top.location.reload();
}

function logout(){
	createCookie("");
	createCookieP("");
	refreshtop();
}

function prnte(){       // email parameters
var at = '&#64;';
var realemail = 'info' + at + 'timperley-sports.com';
var displayemail = 'info' + at + 'timperley-sports.com';
var emaillabel = 'eMail';

	// Do NOT Edit - Constant styling code
var style = '<font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="#005197">';
var ahref = ': <a href="mail' + 'to:';
var ahref2 = '">';
var close = '</a></font>';
document.write(style+emaillabel+ahref+realemail+ahref2+displayemail+close);
}

function popup(mylink, windowname){
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string') href=mylink;
	else href=mylink.href;
	window.open(href, windowname, 'width=275,height=296,scrollbars=yes');
	return false;
}

function dofooter(){
if(readCookie() == "BellMont-Admin"){
document.write("<table border=0 cellspacing=0 cellpadding=0 style='font-size:10'><tr><td width=26><img src='images/spacer.gif' width=26 height=1></td>");
document.write("<td><img src='images/div.gif' width=54 height=8><br><span style='color:red;font-size;12'>Administration</span><br><a href='comp/users.cfm?set=1&id="+readCookieP()+"' target=screen>Display User Details</a><br>");
document.write("<br><img src='images/div.gif' width=54 height=8></td></tr></table>");
}
}