
    //get a cookie by name
    function GetCookie(c_name)
    {
        if (document.cookie.length>0)
        {
            c_start=document.cookie.indexOf(c_name + "=");
            if (c_start!=-1)
            { 
                c_start=c_start + c_name.length+1;
                c_end=document.cookie.indexOf(";",c_start);
                if (c_end==-1) { c_end=document.cookie.length; }
                return unescape(document.cookie.substring(c_start,c_end));
            } 
        }
        return "";
    }   
    

    function SetCookie (name, val, expires) 
    {
        document.cookie = name + "=" + escape (val) + ";expires=" + expires;
    }
    
    
    function CheckForCookieSupport()
    {	
        SetCookie("test", "enabled", (new Date()).setTime(now.getTime() + 1000 * 60));
        if (GetCookie("test"))
        {
            return true;
        } 
        else
        {
            return false;
        }
    }

    function checkDisclaimerAcceptance()
    {        
        if (disclaimerPath !== "")
        { 
            var c_version = GetCookie(disclaimerPath + "Version");
            var c_accepted = GetCookie(disclaimerPath + "Accepted");
            if (c_accepted === "")
            { 
                window.location.href = disclaimerLocation;
            } 
            else 
            { 
                if (c_version != disclaimerVersion)
                { 
                    window.location.href = disclaimerLocation;
                } 
                else 
                { 
                    var now = new Date();
                    now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 60);
                    SetCookie(disclaimerPath + "Version",c_version, now);
                    SetCookie(disclaimerPath + "Accepted",c_accepted, now);
                } 
            } 
        }   
    }    

    