// Create a value for the cookie
function setCookie(name,value,domain,path)
{
        document.cookie=name+"="+escape(value)+";path="+path+";domain="+domain;
}
function setCookie(name,value)
{
        document.cookie=name+"="+escape(value)+";expires="+"Fri, 01 Jan 3000 18:56:35 GMT"+";path=/";
}
// Get the value for the cookie
function getCookie(name)
{
        var dc=document.cookie;
        var cname=name+"=";
        var clen=dc.length;
        var cbegin=0;
        while(cbegin < clen)
        {
                var vbegin=cbegin+cname.length;
                if (dc.substring(cbegin,vbegin) == cname)
                {
                        var vend=dc.indexOf(";",vbegin);
                        if (vend == -1)
                                vend = clen;
                        return unescape(dc.substring(vbegin,vend));
                }
                cbegin=dc.indexOf(" ",cbegin) + 1;
                if (cbegin == 0) break;
        }
        return null;
}

// Delete the cookie 
function deleteCookie(name)
{
                if (getCookie(name) != null)
			document.cookie=name+"="+null+";expires="+"Fri, 03 Jan 1997 12:00:00 GMT"+";path=/";
}

