/**
* 在Cookie中设置某值,保持一个月
*/
function doSetCookie(sName, sValue)
{
var date = new Date();
date.setMonth(1 + parseInt(date.getMonth()));
if (sValue == "") sValue = "0";
document.cookie = sName + "=" + escape(sValue) + ";expires=" + date.toGMTString() + ";path=/";
}
/**
* 从Cookie中提取某值
*/
function doGetCookie(strName){
var theValue = null;
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=");
if (strName == aCrumb[0]) theValue = unescape(aCrumb[1]);
}
if (theValue == "0") theValue = "";
return theValue;
}