function addCookie(objName,objValue,objHours,objPath,objDomain){
	var str = objName + "=" + escape(objValue);
	if(objHours > 0){//为0时不设定过期时间，浏览器关闭时cookie自动消失
		var date = new Date();
		var ms = objHours*3600*1000;
		date.setTime(date.getTime() + ms);
		str += "; expires=" + date.toGMTString();
	}
	if(objPath != ""){
		str += "; path=" + objPath;
	}
	if(objDomain != ""){
		str += "; domain=" + objDomain;
	}
	document.cookie = str;
}

addCookie("webpath",self.location,"0","/",".nol.com");

