<!--


// Three functions: getGECookie, setGECookie, printGECookie


function getGECookie(name)
{
	if (document.cookie == '')
	{ 
      // there's no cookie, so go no further
    
		return false;
	} 
	else
	{
    
   // there is a cookie
	var firstChar, lastChar;
	var theCookie = document.cookie;
	// find the start of cookie 'name'
	firstChar = theCookie.indexOf(name);
	

	// if you found the 'name' cookie
	if(firstChar != -1 )  
	{
		// skip 'name' and '='
		firstChar += name.length + 1;
		
		// Find the end of the value string (i.e. the next ';').    
		lastChar = theCookie.indexOf(';',firstChar);
		
	    // Or there only one name value pair
		if(lastChar == -1) lastChar = theCookie.length;
	
		return unescape(theCookie.substring(firstChar, lastChar));
		
		return true;
	} 
	else
	{
	
		// If there was no cookie of that name, return false.
	
		return false;
	
	}
  }
}


function setGECookie(NameOfCookie, value, expiredays) 
{

// Three variables are used to set the new cookie. 
// The name of the cookie, the value to be stored,
// and finaly the number of days till the cookie expires.
// The first lines in the function converts 
// the number of days to a valid date.

  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

// The next line stores the cookie, simply by assigning 
// the values to the "document.cookie"-object.
// Note the date is converted to Greenwich Meantime using
// the "toGMTstring()"-function.

  document.cookie = NameOfCookie + "=" + escape(value) + ";" ;
}

// Now, lets check the referer

// alert("referer is: " + escape(window.document.referrer));
// alert("cookie is: " + document.cookie);


function printGECookie(name) {

document.write('<input type="hidden" name="referer" value="' + getGECookie(name) + '">');
//document.write(getGECookie(name));
return true;
}

if (getGECookie("gereferer") == false) {
	setGECookie("gereferer", escape(window.document.referrer), 0)
	// alert("no referer");
}

// -->
