function CookieHandler() 
{
    this.setCookie = function (name, value, seconds, path) 
	{
        var expires = "";

		if(seconds > 0) 
		{
            var date = new Date();
            date.setTime(date.getTime() + (seconds*1000));
            var expires = "; expires=" + date.toGMTString();
        }

		var cookieFormat = name+"="+value+expires+"; path=" + path;
        document.cookie = cookieFormat;
    }

    this.getCookie = function (name) 
	{
        name = name + "=";
        var carray = document.cookie.split(';');

        for(var i=0;i < carray.length;i++) 
		{
            var c = carray[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
        }

        return null;
    }

    this.deleteCookie = function (name) 
	{
        this.setCookie(name, "", -1, "/");
    }

}

/*
	// Example code (a counter to detect how many times you've been to the page)
	var Cookies = new CookieHandler();
	var counter = Cookies.getCookie('counter'); // get cookie 'name'
	if (typeof(counter) == 'undefined') counter = 0;
	Cookies.setCookie('counter', ++counter, 365*24*60*60, "/"); // set cookie 'counter' for 1 year
*/
