YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){varF=YAHOO.lang;varE=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expiresinstanceofDate){E+="; expires="+A.expires.toGMTString();}if(F.isString(A.path)&&A.path!=""){E+="; path="+A.path;}if(F.isString(A.domain)&&A.domain!=""){E+="; domain="+A.domain;}if(A.secure===true){E+="; secure";}}returnE;},_createCookieHashString:function(B){varD=YAHOO.lang;if(!D.isObject(B)){thrownewTypeError("Cookie._createCookieHashString(): Argument must be an object.");}varC=newArray();for(varAinB){if(D.hasOwnProperty(B,A)&&!D.isFunction(B[A])&&!D.isUndefined(B[A])){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String(B[A])));}}returnC.join("&");},_parseCookieHash:function(E){varD=E.split("&"),F=null,C=newObject();if(E.length>0){for(varB=0,A=D.length;B<A;B++){F=D[B].split("=");C[decodeURIComponent(F[0])]=decodeURIComponent(F[1]);}}returnC;},_parseCookieString:function(J,A){varK=newObject();if(YAHOO.lang.isString(J)&&J.length>0){varB=(A===false?function(L){returnL;}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(J)){varH=J.split(/;\s/g),I=null,C=null,E=null;for(varD=0,F=H.length;D<F;D++){E=H[D].match(/([^=]+)=/i);if(EinstanceofArray){try{I=decodeURIComponent(E[1]);C=B(H[D].substring(E[1].length+1));}catch(G){}}else{I=decodeURIComponent(H[D]);C=I;}K[I]=C;}}}returnK;},get:function(A,B){varD=YAHOO.lang;varC=this._parseCookieString(document.cookie);if(!D.isString(A)||A===""){thrownewTypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(D.isUndefined(C[A])){returnnull;}if(!D.isFunction(B)){returnC[A];}else{returnB(C[A]);}},getSub:function(A,C,B){varE=YAHOO.lang;varD=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){thrownewTypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(E.isUndefined(D[C])){returnnull;}if(!E.isFunction(B)){returnD[C];}else{returnB(D[C]);}}else{returnnull;}},getSubs:function(A){if(!YAHOO.lang.isString(A)||A===""){thrownewTypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");}varB=this._parseCookieString(document.cookie,false);if(YAHOO.lang.isString(B[A])){returnthis._parseCookieHash(B[A]);}returnnull;},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){thrownewTypeError("Cookie.remove(): Cookie name must be a non-empty string.");}A=A||{};A.expires=newDate(0);returnthis.set(B,"",A);},removeSub:function(B,D,A){if(!YAHOO.lang.isString(B)||B===""){thrownewTypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");}if(!YAHOO.lang.isString(D)||D===""){thrownewTypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");}varC=this.getSubs(B);if(YAHOO.lang.isObject(C)&&YAHOO.lang.hasOwnProperty(C,D)){deleteC[D];returnthis.setSubs(B,C,A);}else{return"";}},set:function(B,C,A){varE=YAHOO.lang;if(!E.isString(B)){thrownewTypeError("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){thrownewTypeError("Cookie.set():Valuecannotbeundefined.");}var D=this._createCookieString(B,C,true,A);document.cookie=D;return D;},setSub:function(B,D,C,A){var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new TypeError("Cookie.setSub():Cookienamemustbeanon-emptystring.");}if(!F.isString(D)||D===""){throw new TypeError("Cookie.setSub():Subcookienamemustbeanon-emptystring.");}if(F.isUndefined(C)){throw new TypeError("Cookie.setSub():Subcookievaluecannotbeundefined.");}var E=this.getSubs(B);if(!F.isObject(E)){E=new Object();}E[D]=C;return this.setSubs(B,E,A);},setSubs:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.setSubs():Cookienamemustbeastring.");}if(!E.isObject(C)){throw new TypeError("Cookie.setSubs():Cookievaluemustbeanobject.");}var D=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;return D;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.7.0",build:"1799"});