/**************************************/
/* Cookie functions
/* Jason Bingham / Paul Shannon 2005
/**************************************/

function setCookie(cookieName, cookieValue)	{
				cookieValue = escape(cookieValue);
				
				document.cookie = cookieName + "=" + cookieValue + ";path=/";
			}
			
function getCookieValue(cookieName)	{
			var cookieValue = document.cookie;
			var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
			
			if (cookieStartsAt == -1) {
				cookieStartsAt = cookieValue.indexOf(cookieName + "=");
			}
			
			if (cookieStartsAt == -1) {
				cookieValue = null;
			} else {
				cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
				var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
				if (cookieEndsAt == -1)	{
				cookieEndsAt = cookieValue.length;
				}
				cookieValue = unescape(cookieValue.substring(cookieStartsAt, cookieEndsAt));
			}
			return cookieValue;				
}



function killCookie(cookieName) {
	var kill_date = new Date("January 1, 1970");
	document.cookie = cookieName + "=999;expires=" + kill_date.toGMTString();
}

