Persist=(function(){var e="0.1.0",d,g,a,f,c,b;b=(function(){var p="Thu, 01-Jan-1970 00:00:01 GMT",j=1000*60*60*24,q=["expires","path","domain"],l=escape,k=unescape,o=document,m;var r=function(){var s=new Date();s.setTime(s.getTime());return s};var h=function(v,y){var u,t,x,w=[],s=(arguments.length>2)?arguments[2]:{};w.push(l(v)+"="+l(y));for(u=0;u<q.length;u++){t=q[u];if(x=s[t]){w.push(t+"="+x)}}if(s.secure){w.push("secure")}return w.join("; ")};var n=function(){var t="__EC_TEST__",s=new Date();s=s.toGMTString();this.set(t,s);this.enabled=(this.remove(t)==s);return this.enabled};m={set:function(w,z){var v=(arguments.length>2)?arguments[2]:{},u=r(),t,s={};if(v.expires){v.expires*=j;s.expires=new Date(u.getTime()+v.expires);s.expires=s.expires.toGMTString()}var y=["path","domain","secure"];for(i=0;i<y.length;i++){if(v[y[i]]){s[y[i]]=v[y[i]]}}var x=h(w,z,s);o.cookie=x;return z},has:function(t){t=l(t);var w=o.cookie,v=w.indexOf(t+"="),s=v+t.length+1,u=w.substring(0,t.length);return((!v&&t!=u)||v<0)?false:true
},get:function(u){u=l(u);var x=o.cookie,w=x.indexOf(u+"="),s=w+u.length+1,v=x.substring(0,u.length),t;if((!w&&u!=v)||w<0){return null}t=x.indexOf(";",s);if(t<0){t=x.length}return k(x.substring(s,t))},remove:function(s){var u=m.get(s),t={expires:p};o.cookie=h(s,"",t);return u},keys:function(){var w=o.cookie,v=w.split("; "),s,u,t=[];for(s=0;s<v.length;s++){u=v[s].split("=");t.push(k(u[0]))}return t},all:function(){var w=o.cookie,v=w.split("; "),s,u,t=[];for(s=0;s<v.length;s++){u=v[s].split("=");t.push([k(u[0]),k(u[1])])}return t},version:"0.2.1",enabled:false};m.enabled=n.call(m);return m}());c=function(){};a=function(h){return"PS"+h.replace(/_/g,"__").replace(/ /g,"_s")};C={search_order:["flash"],name_re:/^[a-z][a-z0-9_ -]+$/i,methods:["init","get","set","remove","load","save"],flash:{div_id:"_persist_flash_wrap",id:"_persist_flash",path:"/script/libs/pobject/persist.swf",size:{w:1,h:1},args:{autostart:true}}};g={globalstorage:{size:5*1024*1024,test:function(){return window.globalStorage?true:false
},methods:{key:function(h){return a(this.name)+a(h)},init:function(){this.store=globalStorage[this.o.domain]},get:function(h,k,j){h=this.key(h);if(k){k.call(j||this,true,this.store.getItem(h))}},set:function(h,l,k,j){h=this.key(h);this.store.setItem(h,l);if(k){k.call(j||this,true,l)}},remove:function(h,k,j){var l;h=this.key(h);l=this.store[h];this.store.removeItem(h);if(k){k.call(j||this,(l!==null),l)}}}},flash:{test:function(){if(!window.SWFObject||!deconcept||!deconcept.SWFObjectUtil){return false}var h=deconcept.SWFObjectUtil.getPlayerVersion().major;return(h>=8)?true:false},methods:{init:function(){if(!g.flash.el){var l,j,k,h=C.flash;k=document.createElement("div");k.id=h.div_id;document.body.appendChild(k);l=new SWFObject(this.o.swf_path||this.o.contextRoot+h.path,h.id,h.size.w,h.size.h,"8");for(j in h.args){l.addVariable(j,h.args[j])}l.write(k);g.flash.el=document.getElementById(h.id)}this.el=g.flash.el},get:function(h,k,j){var l;h=a(h);if(this.el.get){l=this.el.get(this.name,h);if(k){k.call(j||this,l!==null,l)
}}else{if(k){k.call(j||this,false,null)}}},set:function(j,m,l,k){var h;j=a(j);h=this.el.set(this.name,j,m);if(l){l.call(k||this,true,m)}},remove:function(h,k,j){var l;h=a(h);l=this.el.remove(this.name,h);if(k){k.call(j||this,true,l)}}}}};var f=function(){var n,j,h,m,k=C.methods,o=C.search_order;for(n=0,j=k.length;n<j;n++){d.Store.prototype[k[n]]=c}d.type=null;d.size=-1;for(n=0,j=o.length;!d.type&&n<j;n++){h=g[o[n]];if(h.test()){d.type=o[n];d.size=h.size;for(m in h.methods){d.Store.prototype[m]=h.methods[m]}}}d._init=true};d={VERSION:e,type:null,size:0,add:function(h){g[h.id]=h;C.search_order=[h.id].concat(C.search_order);f()},remove:function(j){var h=C.search_order.indexOf(j);if(h<0){return}C.search_order.splice(h,1);delete g[j];f()},Cookie:b,Store:function(h,j){if(!C.name_re.exec(h)){throw new Error("Invalid name")}if(!d.type){}else{j=j||{};this.name=h;j.domain=j.domain||location.hostname||"localhost.localdomain";this.o=j;j.expires=j.expires||365*2;j.path=j.path||"/";this.init()}}};f();
return d})();
