function setCookie(c_name, value, expiredays) {
var exdate = new Date()
exdate.setDate(exdate.getDate() + expiredays)
document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";path=/;expires=" + exdate.toGMTString());
document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
}
//清除cookie
function clearCookie(name) {
setCookie(name, "", -1);
}
//获取cookie
function getCookie(cname) {
var arr = document.cookie.match(new RegExp("(^| )" + cname + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]);
return null;
}
//获取超链接参数
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}