// 添加cookie
function addCookie(name,value)
{
var str = name +"="+escape(value);
document.cookie = str;
}
// 取得cookie
function getCookie(name)
{
var str=document.cookie.split(";")
for(var i=0;i<str.length;i++){
var str2=str[i].split("=");
if(str2[0].trim()==name.trim())return unescape(str2[1]);
}
// 去字符串空格
String.prototype.trim = function() {
return this.replace(/^\s+/g,"").replace(/\s+$/g,"");
}