jQuery.cookie=function(name,value,options){if(typeofvalue!='undefined'){// name and value given, set cookieoptions=options||{};if(value===null){value='';options.expires=-1;}varexpires='';if(options.expires&&(typeofoptions.expires=='number'||options.expires.toUTCString)){vardate;if(typeofoptions.expires=='number'){date=newDate();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();// use expires attribute, max-age is not supported by IE}varpath=options.path?'; path='+options.path:'';vardomain=options.domain?'; domain='+options.domain:'';varsecure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{// only name given, get cookievarcookieValue=null;if(document.cookie&&document.cookie!=''){varcookies=document.cookie.split(';');for(vari=0;i<cookies.length;i++){varcookie=jQuery.trim(cookies[i]);// Does this cookie string begin with the name we want?if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}returncookieValue;}};