/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add("cache-offline",function(E){function D(){D.superclass.constructor.apply(this,arguments);}var A=null,C=E.JSON;try{A=E.config.win.localStorage;}catch(B){}E.mix(D,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:86400000},max:{value:null,readOnly:true},uniqueKeys:{value:true,readOnly:true,setter:function(){return true;}}},flushAll:function(){var F=A,G;if(F){if(F.clear){F.clear();}else{for(G in F){if(F.hasOwnProperty(G)){F.removeItem(G);delete F[G];}}}}else{}}});E.extend(D,E.Cache,A?{_setMax:function(F){return null;},_getSize:function(){var H=0,G=0,F=A.length;for(;G-1;--F){G=A.key(F);if(G.indexOf(this.get("sandbox"))===0){A.removeItem(G);}}},retrieve:function(I){this.fire("request",{request:I});var H,F,G;try{G=this.get("sandbox")+C.stringify({"request":I});try{H=C.parse(A.getItem(G));}catch(K){}}catch(J){}if(H){H.cached=new Date(H.cached);F=H.expires;F=!F?null:new Date(F);H.expires=F;if(this._isMatch(I,H)){this.fire("retrieve",{entry:H});return H;}}return null;}}:{_setMax:function(F){return null;}});E.CacheOffline=D;},"3.3.0",{requires:["cache-base","json"]});