    
        
       /*
        *  Cookie Utilities v1.0.0
        *  by A. Lewis (written forever ago)
        */
        
        // set a cookie
        function setCookie(sName, sValue, sExpires, sPath, sDomain, secure) 
        { 
            document.cookie = sName + "=" + escape(sValue)
                + (sExpires == null ? "" : ";expires=" + sExpires.toGMTString())
                + (sPath == null ? "" : ";path=" + sPath)
                + (sDomain == null ? "" : ";domain=" + sDomain)
                + (secure == null ? "" : ";secure")
        }
        
        // get a cookie (returns string)
        function getCookie(sName) 
        { 
            var search = sName + "=";
            // if there are any cookies
            if (document.cookie.length > 0) 
            { 
                offset = document.cookie.indexOf(search);
                // if cookie exists 
                if (offset != -1) 
                {  
                    // set index of beginning of value
                    offset += search.length; 
                    // set index of end of cookie value
                    end = document.cookie.indexOf(";", offset);
                    if (end == -1) end = document.cookie.length;
                    return unescape(document.cookie.substring(offset, end));
                }
                else 
                {
                    return "";
                } 
            }
        }
        
        // delete a cookie (if path and/or domain were set to other than default
        // when the cookie was written, matching arguments must be passed here.)
        function deleteCookie(sName, sPath, sDomain)
        {
            if(document.cookie.length > 0 && document.cookie.indexOf(sName) != -1)
            {
                var oldDate = new Date();
                    oldDate.setYear(oldDate.getFullYear() - 20);
                document.cookie = sName
                    + "=;expires=" + oldDate.toGMTString()
                    + (sPath == null ? "" : ";path=" + sPath)
                    + (sDomain == null ? "" : ";domain=" + sDomain);
                eval("var re = /" + sName + "\=[^;]*(;|$)/gi;");
                document.cookie = document.cookie.replace(re,"");
            }
        }

