function getCookieValue(objName){
//获取指定名称的Cookie的值
var
arrayCookie = document.cookie.split(";");
for(var i = 0;i <
arrayCookie.length;i ++){
var temp =
arrayCookie[i].split("=");
if(temp[0].indexOf(objName)>=0){
return
unescape(temp[1]);
}
}
}
function setCookie(objName,objValue,objHours){
//设置Cookie
var str = objName + "=" +
escape(objValue);
if(objHours > 0){
var date = new Date();
var ms =
objHours*3600*1000;
date.setTime(date.getTime() +
ms);
str += "; expires=" + date.toGMTString();
}
document.cookie = str;
}
function clearCookie(objName){
var date = new Date();
date.setTime
(date.getTime() - 1);
var objValue = getCookieValue
(objName);
document.cookie = objName + "=" + objValue + ";
expires="+ date.toGMTString();
}