//取cookies
GetCookie = function (name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]); return null;
}
//写cookies
WriteCookie = function (name, value, hours) {
var expire = " ";
if (hours != null) {
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires= " + expire.toGMTString();
}
document.cookie = name + "= " + escape(value) + expire + ";path=/";
}
GetCookie = function (name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]); return null;
}
//写cookies
WriteCookie = function (name, value, hours) {
var expire = " ";
if (hours != null) {
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires= " + expire.toGMTString();
}
document.cookie = name + "= " + escape(value) + expire + ";path=/";
}