// JavaScript Document


function Mailer(text, who, where, why)
{
   if (where == 'KSTC')
   {
      where = "KentSwimAndTennisClub.Org";
   }
   document.write('<a href="mailto:' + who + '@' + where + '?subject=KSTC' + ((why) ? why : '') +'">' + text + '</a>');
}

function Header(title)
{
   document.write('<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">');
   document.write('<tr><td class="banner" colspan=99>' + title);
   document.write('<tr height="60"><td>&nbsp;</tr></table>');
}

function Footer()
{
   document.write('<table width="100%">');
   document.write('<tr><td colspan=99 align="center"><img src="/images/ruler1a.gif" width="98%" height="9">');
   document.write('</td></tr><tr><td width="50%" align="left">');
   document.write("Last updated on " + document.lastModified);
   document.write('</td><td width="*" align="right">Send comments to ');
   Mailer("KSTC webmaster", "webmaster", "KSTC", "website");
   document.write('</td></tr></table>');
}



function SetCookie (name,value,expires,path,domain,secure){
	document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}
function GetCookie (name){
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	if( (document.cookie == null) || (document.cookie.length == null)){
		return null;
	}
	var i = 0;
	while (i < clen)
	{
	var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		{
       	var endstr = document.cookie.indexOf (";", j);
	       if (endstr == -1)
		      endstr = document.cookie.length;
	        return unescape(document.cookie.substring(j, endstr));
		}	
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function getCookieVal (offset)
{
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
		endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}
