

function storeSessionCookie()
{
    makeCookie( "kellerfenceFlashHeader", "seenit");
}

function cookieExists()
{
    if( GetCookie( "kellerfenceFlashHeader" ) )
    {
        return true;
    }
    return false;
}

	function makeCookie(cookieName,cookieData){
		if (cookieData != ""){
		    var expiry = new Date();
		    expiry.setTime(expiry.getTime() + 5 * (24 * 60 * 60 * 1000)); //set time expire 5 days into future
		    //alert(expiry);
		    setCookie(cookieName, cookieData, expiry);
		}
		else{
			//alert("no data for cookie.  cookie will not be set");
			return;			
		}
	}
	function setCookie(cookieName, cookieData, expiry){
	    document.cookie = cookieName + "=" + escape(cookieData) + "; expires=" + expiry.toGMTString();
	    //alert(document.cookie=cookieData);
	}
	function GetCookie(sName){
	  // cookies are separated by semicolons
	  var aCookie = document.cookie.split("; ");
	  for (var i=0; i < aCookie.length; i++){
	    // a name/value pair (a crumb) is separated by an equal sign
	    var aCrumb = aCookie[i].split("=");
	    if (sName == aCrumb[0]) 
	      return unescape(aCrumb[1]);
	  }

	  // a cookie with the requested name does not exist
	  //alert("No Match on GetCookies()");
	  return null;
	}
	function ExistCookie(cookieName){
		//Check if name is not blank
		if(cookieName=="") return false;
		//Get all the cookies stored as an array
		thisCookie=document.cookie.split("; ");
		//Loop trought all the cookies to check if it exists
		for(i=0;i<thisCookie.length;i++){
			if(cookieName==thisCookie[i].split("=")[0]){
				return true;
			}
		 }
		return false;
	}
	function DeleteCookie(cookieName){
		//Check if name is not blank
		if(cookieName=="") return;
		//Check if the cookie already exists
		if(ExistCookie(cookieName)){
			var ExpireDate=new Date();
			ExpireDate.setDate(ExpireDate.getDate()-10);
			ExpireDate=ExpireDate.toGMTString();
			//Set the cookie an expire date in the past to delete it
			document.cookie=cookieName+"=;expires="+ExpireDate;
		}
	 }
