var CookieJar=Class.create();CookieJar.prototype={appendString:"ArticianBrowse_",initialize:function(_1,_2){this.options={expires:2592000,path:"",domain:"",secure:""};Object.extend(this.options,_1||{});if(typeof (_2)!="undefined"){this.appendString=_2;}if(this.options.expires!=""){var _3=new Date();_3=new Date(_3.getTime()+(this.options.expires*1000));this.options.expires="; expires="+_3.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(_4,_5){_4=this.appendString+_4;cookie=this.options;var _6=typeof _5;switch(_6){case "undefined":case "function":case "unknown":return false;case "boolean":case "string":case "number":_5=String(_5.toString());}var _7=_4+"="+escape(Object.toJSON(_5));try{document.cookie=_7+cookie.expires+cookie.path+cookie.domain+cookie.secure;}catch(e){return false;}return true;},remove:function(_8){_8=this.appendString+_8;cookie=this.options;try{var _9=new Date();_9.setTime(_9.getTime()-(3600*1000));var _a="; expires="+_9.toGMTString();document.cookie=_8+"="+_a+cookie.path+cookie.domain+cookie.secure;}catch(e){return false;}return true;},get:function(_b){_b=this.appendString+_b;var _c=document.cookie.match(_b+"=(.*?)(;|$)");if(_c){return (unescape(_c[1])).evalJSON();}else{return null;}},empty:function(){keys=this.getKeys();size=keys.size();for(i=0;i<size;i++){this.remove(keys[i]);}},getPack:function(){pack={};keys=this.getKeys();size=keys.size();for(i=0;i<size;i++){pack[keys[i]]=this.get(keys[i]);}return pack;},getKeys:function(){keys=$A();keyRe=/[^=; ]+(?=\=)/g;str=document.cookie;CJRe=new RegExp("^"+this.appendString);while((match=keyRe.exec(str))!=undefined){if(CJRe.test(match[0].strip())){keys.push(match[0].strip().gsub("^"+this.appendString,""));}}return keys;}};
/**
 * Javascript code to store data as JSON strings in cookies. 
 * Author : Lalit Patel
 * Website: http://www.lalit.org/lab/jsoncookies
 * License: Creative Commons Attribution-ShareAlike 2.5
 * http://creativecommons.org/licenses/by-sa/2.5/
 * Version: 0.4
 * Updated: Aug 11, 2007 10:09am
 */