var CookieJar=Class.create();CookieJar.prototype={G:"__CJ_",initialize:function(options){this.options={expires:3600,path:"",domain:"",secure:""};Object.extend(this.options,options||{});if(this.options.expires!=""){var F=new Date;F=new Date(F.getTime()+this.options.expires*1000);this.options.expires="; expires="+F.toGMTString();}if(this.options.path!=""){this.options.path="; path="+escape(this.options.path);}if(this.options.domain!=""){this.options.domain="; domain="+escape(this.options.domain);}if(this.options.secure=="secure"){this.options.secure="; secure";}else{this.options.secure="";}},put:function(B,H){B=this.G+B;D=this.options;var P=typeof H;switch(P){case"undefined":case"function":case"unknown":return false;case"boolean":case"string":case"number":H=String(H.toString());default:;}var O=B+"="+escape(Object.toJSON(H));try{document.cookie=O+D.expires+D.path+D.domain+D.secure;}catch(e){return false;}return true;},remove:function(B){B=this.G+B;D=this.options;try{var F=new Date;F.setTime(F.getTime()-3600000);var expires="; expires="+F.toGMTString();document.cookie=B+"="+expires+D.path+D.domain+D.secure;}catch(e){return false;}return true;},get:function(B){B=this.G+B;var K=document.cookie.match(B+"=(.*?)(;|$)");if(K){return unescape(K[1]).evalJSON();}else{return null;}},empty:function(){C=this.getKeys();I=C.size();for(i=0;i<I;i++){this.remove(C[i]);}},getPack:function(){J={};C=this.getKeys();I=C.size();for(i=0;i<I;i++){J[C[i]]=this.get(C[i]);}return J;},getKeys:function(){C=$A();L=/[^=; ]+(?=\=)/g;M=document.cookie;N=new RegExp("^"+this.G);while((match=L.exec(M))!=undefined){if(N.test(match[0].strip())){C.push(match[0].strip().gsub("^"+this.G,""));}}return C;}};