
function setCookie()
	{
	document.cookie="LastRegMonth=TRUE;expires=Saturday, 10-Jan-23 01:01:01 GMT";
	}

function checkCookie(destinationHref)
	{
	
	//is the thanksyoujit Cookie there?
	if(document.cookie.indexOf("LastRegMonth")>-1)
		{
		//yes, it is
		return true;
		}
	else	
		{
		//No, it isn't. They haven't filled out the form.
		//is the FreeJit cookie there? Everyone gets one free jit.
		//(this also lets no-cookie people in.)
		if(document.cookie.indexOf("FreeJit1")==-1)
			{
			document.cookie+="FreeJit1=TRUE;expires=Saturday, 10-Jan-23 01:01:01 GMT";
			return true;
			}
		else	if(document.cookie.indexOf("FreeJit2")==-1)
			{
			document.cookie+="FreeJit2=TRUE;expires=Saturday, 10-Jan-23 01:01:01 GMT";
			return true;
			}
		else
			{
			document.cookie+="theDest="+destinationHref+";expires=Saturday, 10-Jan-23 01:01:01 GMT";
			location.href="http://notes.trymentor.com/AutoResponder/AutoRespond.nsf/jitreg?OpenForm";
			return false;
			}
		}


	return false;
	}
	
function findDestination()
	{
	theCookie=document.cookie;
	destStart=theCookie.indexOf("theDest=");
	destEnd=theCookie.indexOf(".html");
	if (destStart>-1 & destEnd>-1)
		{
		theDest=theCookie.substring(destStart+8,destEnd+5);
		//alert(theDest);
		location.href=theDest;
		return false;
		}

	history.go(-3);	
	return false;
	}
