YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){varF=YAHOO.lang,E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expiresinstanceofDate){E+="; expires="+A.expires.toUTCString();}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=[];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={};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={};if(YAHOO.lang.isString(J)&&J.length>0){varB=(A===false?function(L){returnL;}:decodeURIComponent);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="";}K[I]=C;}}returnK;},exists:function(A){if(!YAHOO.lang.isString(A)||A===""){thrownewTypeError("Cookie.exists(): Cookie name must be a non-empty string.");}varB=this._parseCookieString(document.cookie,true);returnB.hasOwnProperty(A);},get:function(B,A){varE=YAHOO.lang,C;if(E.isFunction(A)){C=A;A={};}else{if(E.isObject(A)){C=A.converter;}else{A={};}}varD=this._parseCookieString(document.cookie,!A.raw);if(!E.isString(B)||B===""){thrownewTypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(E.isUndefined(D[B])){returnnull;}if(!E.isFunction(C)){returnD[B];}else{returnC(D[B]);}},getSub:function(A,C,B){varE=YAHOO.lang,D=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(B){varA=YAHOO.lang.isString;if(!A(B)||B===""){thrownewTypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");}varC=this._parseCookieString(document.cookie,false);if(A(C[B])){returnthis._parseCookieHash(C[B]);}returnnull;},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){thrownewTypeError("Cookie.remove(): Cookie name must be a non-empty string.");}A=YAHOO.lang.merge(A||{},{expires:newDate(0)});returnthis.set(B,"",A);},removeSub:function(B,E,A){varF=YAHOO.lang;A=A||{};if(!F.isString(B)||B===""){thrownewTypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");}if(!F.isString(E)||E===""){thrownewTypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");}varD=this.getSubs(B);if(F.isObject(D)&&F.hasOwnProperty(D,E)){deleteD[E];if(!A.removeIfEmpty){returnthis.setSubs(B,D,A);}else{for(varCinD){if(F.hasOwnProperty(D,C)&&!F.isFunction(D[C])&&!F.isUndefined(D[C])){returnthis.setSubs(B,D,A);}}returnthis.remove(B,A);}}else{return"";}},set:function(B,C,A){varE=YAHOO.lang;A=A||{};if(!E.isString(B)){thrownewTypeError("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){thrownewTypeError("Cookie.set(): Value cannot be undefined.");}varD=this._createCookieString(B,C,!A.raw,A);document.cookie=D;returnD;},setSub:function(B,D,C,A){varF=YAHOO.lang;if(!F.isString(B)||B===""){thrownewTypeError("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!F.isString(D)||D===""){thrownewTypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(F.isUndefined(C)){thrownewTypeError("Cookie.setSub(): Subcookie value cannot be undefined.");}varE=this.getSubs(B);if(!F.isObject(E)){E={};}E[D]=C;returnthis.setSubs(B,E,A);},setSubs:function(B,C,A){varE=YAHOO.lang;if(!E.isString(B)){thrownewTypeError("Cookie.setSubs(): Cookie name must be a string.");}if(!E.isObject(C)){thrownewTypeError("Cookie.setSubs(): Cookie value must be an object.");}varD=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;returnD;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.9.0",build:"2800"});