var Cookie-function = {
    setCookie: function(name, value) {
        //写cookies 
        var d = new Date();
        d.setTime(d.getTime() + (7 * 24s * 60 * 60 * 1000));
        var expires = "expires=" + d.toUTCString();
        document.cookie = name + "=" + value + "; " + expires;
    },
    getCookie: function(cname) {
        //读取cookies 
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
             var c = ca[i];
             while (c.charAt(0) == ' ') c = c.substring(1);
             if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
         }
        return "";
    },
    delCookie: function(name) {
         //删除cookies 
         f.setCookie(name, "", -1);
    },
}