function setCookie(key, value, expires) {
var exp = new Date();
exp.setTime(exp.getTime() + expires);
document.cookie = key + '=' + escape(value) + ";expires=" + exp.toGMTString() + ';path=/';
var exp = new Date();
exp.setTime(exp.getTime() + expires);
document.cookie = key + '=' + escape(value) + ";expires=" + exp.toGMTString() + ';path=/';
}
function delCookie(key) {
var value = getCookie(key);
if(value !== null)
setCookie(key, value, -1);
}
function getCookie(key) {
var arr, reg = new RegExp('(^| )' + key + '=([^;]*)(;|$)');
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}