<!--

function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}

function setCookie( SetName, SetVal, ExpireDays )
{
    var the_date = new Date ();
    FixCookieDate (the_date); // Correct for Mac date bug - call only once for given Date object!
    the_date.setTime (the_date.getTime() + (ExpireDays * 24 * 60 * 60 * 1000)); // ExpireDays days from now
    var the_cookie_date = the_date.toGMTString();

    //var the_date = new Date("December 31, 2023");
    //var the_cookie_date = the_date.toGMTString();

    var the_cookie = SetName+"="+SetVal+";expires="+the_cookie_date+";path=/;";
    document.cookie = the_cookie;
	
}

function readCookie( ReadName )
{
    var RetVal = '';
	var the_cookie = document.cookie;
	var the_cookie_split = the_cookie.split("; ");  // split out different cookies
	
	for(i=0; i<the_cookie_split.length; i++){       // loop through cookies to find ours
		//document.write(the_cookie_split[i]+'<br>');
		if (String(the_cookie_split[i]).substring(0,ReadName.length+1)==ReadName+'=') { 
			var the_cookie_value_split = the_cookie_split[i].split("=");
			if (the_cookie_value_split[1]!=null && the_cookie_value_split[1]!='') {
				var the_cookie_value_split2 = the_cookie_value_split[1].split(";");
				var the_value = unescape(the_cookie_value_split2[0]);
				RetVal = the_value;
			}
		}
	}
	
	return RetVal;
}


// -->
