(function(){function y(){var a="{}";if("userDataBehavior"==i){d.load("jStorage");try{a=d.getAttribute("jStorage")}catch(c){}try{n=d.getAttribute("jStorage_update")}catch(b){}e.jStorage=a}z();t();A()}function q(){var a;clearTimeout(B);B=setTimeout(function(){if("localStorage"==i||"globalStorage"==i)a=e.jStorage_update;else if("userDataBehavior"==i){d.load("jStorage");try{a=d.getAttribute("jStorage_update")}catch(c){}}if(a&&a!=n){n=a;var g=j.parse(j.stringify(b.__jstorage_meta.CRC32)),l;y();l=j.parse(j.stringify(b.__jstorage_meta.CRC32));
var f,u=[],h=[];for(f in g)g.hasOwnProperty(f)&&(l[f]?g[f]!=l[f]&&u.push(f):h.push(f));for(f in l)l.hasOwnProperty(f)&&(g[f]||u.push(f));o(u,"updated");o(h,"deleted")}},25)}function o(a,c){a=[].concat(a||[]);if("flushed"==c){var a=[],b;for(b in h)h.hasOwnProperty(b)&&a.push(b);c="deleted"}b=0;for(var l=a.length;b<l;b++)if(h[a[b]])for(var f=0,d=h[a[b]].length;f<d;f++)h[a[b]][f](a[b],c)}function r(){var a=(+new Date).toString();"localStorage"==i||"globalStorage"==i?e.jStorage_update=a:"userDataBehavior"==
i&&(d.setAttribute("jStorage_update",a),d.save("jStorage"));q()}function z(){if(e.jStorage)try{b=j.parse(String(e.jStorage))}catch(a){e.jStorage="{}"}else e.jStorage="{}";v=e.jStorage?String(e.jStorage).length:0;b.__jstorage_meta||(b.__jstorage_meta={});b.__jstorage_meta.CRC32||(b.__jstorage_meta.CRC32={})}function s(){if(b.__jstorage_meta.PubSub){for(var a=+new Date-2E3,c=0,g=b.__jstorage_meta.PubSub.length;c<g;c++)if(b.__jstorage_meta.PubSub[c][0]<=a){b.__jstorage_meta.PubSub.splice(c,b.__jstorage_meta.PubSub.length-
c);break}b.__jstorage_meta.PubSub.length||delete b.__jstorage_meta.PubSub}try{e.jStorage=j.stringify(b),d&&(d.setAttribute("jStorage",e.jStorage),d.save("jStorage")),v=e.jStorage?String(e.jStorage).length:0}catch(l){}}function m(a){if(!a||"string"!=typeof a&&"number"!=typeof a)throw new TypeError("Key name must be string or numeric");if("__jstorage_meta"==a)throw new TypeError("Reserved key name");return!0}function t(){var a,c,g,l,f=Infinity,d=!1,e=[];clearTimeout(C);if(b.__jstorage_meta&&"object"==
typeof b.__jstorage_meta.TTL){a=+new Date;g=b.__jstorage_meta.TTL;l=b.__jstorage_meta.CRC32;for(c in g)g.hasOwnProperty(c)&&(g[c]<=a?(delete g[c],delete l[c],delete b[c],d=!0,e.push(c)):g[c]<f&&(f=g[c]));Infinity!=f&&(C=setTimeout(t,f-a));d&&(s(),r(),o(e,"deleted"))}}function A(){if(b.__jstorage_meta.PubSub){for(var a,c=w,g=len=b.__jstorage_meta.PubSub.length-1;0<=g;g--)if(a=b.__jstorage_meta.PubSub[g],a[0]>w){var c=a[0],d=a[1];a=a[2];if(p[d])for(var f=0,e=p[d].length;f<e;f++)p[d][f](d,j.parse(j.stringify(a)))}w=
c}}var k=window.jQuery||window.$||(window.$={}),j={parse:window.JSON&&(window.JSON.parse||window.JSON.decode)||String.prototype.evalJSON&&function(a){return String(a).evalJSON()}||k.parseJSON||k.evalJSON,stringify:Object.toJSON||window.JSON&&(window.JSON.stringify||window.JSON.encode)||k.toJSON};if(!j.parse||!j.stringify)throw Error("No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page");var b={},e={jStorage:"{}"},d=null,v=0,i=!1,h={},B=!1,n=0,p={},w=+new Date,
C,x={isXML:function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1},encode:function(a){if(!this.isXML(a))return!1;try{return(new XMLSerializer).serializeToString(a)}catch(b){try{return a.xml}catch(g){}}return!1},decode:function(a){var b="DOMParser"in window&&(new DOMParser).parseFromString||window.ActiveXObject&&function(a){var b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a);return b};if(!b)return!1;a=b.call("DOMParser"in window&&new DOMParser||window,
a,"text/xml");return this.isXML(a)?a:!1}};k.jStorage={version:"0.2.5",set:function(a,c,g){m(a);g=g||{};if("undefined"==typeof c)return this.deleteKey(a),c;if(x.isXML(c))c={_is_xml:!0,xml:x.encode(c)};else{if("function"==typeof c)return;c&&"object"==typeof c&&(c=j.parse(j.stringify(c)))}b[a]=c;var d=b.__jstorage_meta.CRC32,f=j.stringify(c),e,h=0,h=0;e=-1;for(var i=0,k=f.length;i<k;i++)h=(e^f.charCodeAt(i))&255,h="0x"+"00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substr(9*
h,8),e=e>>>8^h;d[a]=e^-1;this.setTTL(a,g.TTL||0);o(a,"updated");return c},get:function(a,c){m(a);return a in b?b[a]&&"object"==typeof b[a]&&b[a]._is_xml&&b[a]._is_xml?x.decode(b[a].xml):b[a]:"undefined"==typeof c?null:c},deleteKey:function(a){m(a);return a in b?(delete b[a],"object"==typeof b.__jstorage_meta.TTL&&a in b.__jstorage_meta.TTL&&delete b.__jstorage_meta.TTL[a],delete b.__jstorage_meta.CRC32[a],s(),r(),o(a,"deleted"),!0):!1},setTTL:function(a,c){var d=+new Date;m(a);c=Number(c)||0;return a in
b?(b.__jstorage_meta.TTL||(b.__jstorage_meta.TTL={}),0<c?b.__jstorage_meta.TTL[a]=d+c:delete b.__jstorage_meta.TTL[a],s(),t(),r(),!0):!1},getTTL:function(a){var c=+new Date;m(a);return a in b&&b.__jstorage_meta.TTL&&b.__jstorage_meta.TTL[a]?(a=b.__jstorage_meta.TTL[a]-c)||0:0},flush:function(){b={__jstorage_meta:{CRC32:{}}};s();r();o(null,"flushed");return!0},storageObj:function(){function a(){}a.prototype=b;return new a},index:function(){var a=[],c;for(c in b)b.hasOwnProperty(c)&&"__jstorage_meta"!=
c&&a.push(c);return a},storageSize:function(){return v},currentBackend:function(){return i},storageAvailable:function(){return!!i},listenKeyChange:function(a,b){m(a);h[a]||(h[a]=[]);h[a].push(b)},stopListening:function(a,b){m(a);if(h[a])if(b)for(var d=h[a].length-1;0<=d;d--)h[a][d]==b&&h[a].splice(d,1);else delete h[a]},subscribe:function(a,b){a=(a||"").toString();if(!a)throw new TypeError("Channel not defined");p[a]||(p[a]=[]);p[a].push(b)},publish:function(a,c){a=(a||"").toString();if(!a)throw new TypeError("Channel not defined");
b.__jstorage_meta||(b.__jstorage_meta={});b.__jstorage_meta.PubSub||(b.__jstorage_meta.PubSub=[]);b.__jstorage_meta.PubSub.unshift([+new Date,a,c]);s();r()},reInit:function(){y()}};a:{k=!1;if("localStorage"in window)try{window.localStorage.setItem("_tmptest","tmpval"),k=!0,window.localStorage.removeItem("_tmptest")}catch(D){}if(k)try{window.localStorage&&(e=window.localStorage,i="localStorage",n=e.jStorage_update)}catch(E){}else if("globalStorage"in window)try{window.globalStorage&&(e=window.globalStorage[window.location.hostname],
i="globalStorage",n=e.jStorage_update)}catch(F){}else if(d=document.createElement("link"),d.addBehavior){d.style.behavior="url(#default#userData)";document.getElementsByTagName("head")[0].appendChild(d);d.load("jStorage");k="{}";try{k=d.getAttribute("jStorage")}catch(G){}try{n=d.getAttribute("jStorage_update")}catch(H){}e.jStorage=k;i="userDataBehavior"}else{d=null;break a}z();t();"localStorage"==i||"globalStorage"==i?"addEventListener"in window?window.addEventListener("storage",q,!1):document.attachEvent("onstorage",
q):"userDataBehavior"==i&&setInterval(q,1E3);A();"addEventListener"in window&&window.addEventListener("pageshow",function(a){a.persisted&&q()},!1)}})();