YAHOO.util.History=(function(){var M=null;var P=null;var U=false;var L=[];var N=[];function R(){var B,A;A=top.location.href;B=A.indexOf("#");return B>=0?A.substr(B+1):null}function O(){var D,C,B=[],A=[];for(D in L){if(YAHOO.lang.hasOwnProperty(L,D)){C=L[D];B.push(D+"="+C.initialState);A.push(D+"="+C.currentState)}}P.value=B.join("&")+"|"+A.join("&");if(YAHOO.env.ua.webkit){P.value+="|"+N.join(",")}}function S(I){var D,C,H,F,E,A,B,G;if(!I){for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){F=L[H];F.currentState=F.initialState;F.onStateChange(unescape(F.currentState))}}return }E=[];A=I.split("&");for(D=0,C=A.length;D<C;D++){B=A[D].split("=");if(B.length===2){H=B[0];G=B[1];E[H]=G}}for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){F=L[H];G=E[H];if(!G||F.currentState!==G){F.currentState=G||F.initialState;F.onStateChange(unescape(F.currentState))}}}}function Q(B){var A,C;A='<html><body><div id="state">'+B+"</div></body></html>";try{C=M.contentWindow.document;C.open();C.write(A);C.close();return true}catch(D){return false}}function T(){var B,A,C,D;if(!M.contentWindow||!M.contentWindow.document){setTimeout(T,10);return }B=M.contentWindow.document;A=B.getElementById("state");C=A?A.innerText:null;D=R();setInterval(function(){var E,I,H,G,F,J;B=M.contentWindow.document;A=B.getElementById("state");E=A?A.innerText:null;F=R();if(E!==C){C=E;S(C);if(!C){I=[];for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){G=L[H];I.push(H+"="+G.initialState)}}F=I.join("&")}else{F=C}top.location.hash=F;D=F;O()}else{if(F!==D){D=F;Q(F)}}},50);U=true;YAHOO.util.History.onLoadEvent.fire()}function V(){var E,C,G,A,K,I,B,H,D,J,X,F;G=P.value.split("|");if(G.length>1){B=G[0].split("&");for(E=0,C=B.length;E<C;E++){A=B[E].split("=");if(A.length===2){K=A[0];H=A[1];I=L[K];if(I){I.initialState=H}}}D=G[1].split("&");for(E=0,C=D.length;E<C;E++){A=D[E].split("=");if(A.length>=2){K=A[0];J=A[1];I=L[K];if(I){I.currentState=J}}}}if(G.length>2){N=G[2].split(",")}if(YAHOO.env.ua.ie){T()}else{X=history.length;F=R();setInterval(function(){var W,b,a;b=R();a=history.length;if(b!==F){F=b;X=a;S(F);O()}else{if(a!==X&&YAHOO.env.ua.webkit){F=b;X=a;W=N[X-1];S(W);O()}}},50);U=true;YAHOO.util.History.onLoadEvent.fire()}}return{onLoadEvent:new YAHOO.util.CustomEvent("onLoad"),onReady:function(C,B,A){if(U){setTimeout(function(){var D=window;if(A){if(A===true){D=B}else{D=A}}C.call(D,"onLoad",[],B)},0)}else{YAHOO.util.History.onLoadEvent.subscribe(C,B,A)}},register:function(E,A,C,B,F){var D,G;if(typeof E!=="string"||YAHOO.lang.trim(E)===""||typeof A!=="string"||typeof C!=="function"){throw new Error("Missing or invalid argument")}if(L[E]){return }if(U){throw new Error("All modules must be registered before calling YAHOO.util.History.initialize")}E=escape(E);A=escape(A);D=null;if(F===true){D=B}else{D=F}G=function(H){return C.call(D,H,B)};L[E]={name:E,initialState:A,currentState:A,onStateChange:G}},initialize:function(A,B){if(U){return }if(YAHOO.env.ua.opera){}if(typeof A==="string"){A=document.getElementById(A)}if(!A||A.tagName.toUpperCase()!=="TEXTAREA"&&(A.tagName.toUpperCase()!=="INPUT"||A.type!=="hidden"&&A.type!=="text")){throw new Error("Missing or invalid argument")}P=A;if(YAHOO.env.ua.ie){if(typeof B==="string"){B=document.getElementById(B)}if(!B||B.tagName.toUpperCase()!=="IFRAME"){throw new Error("Missing or invalid argument")}M=B}YAHOO.util.Event.onDOMReady(V)},navigate:function(C,B){var A;if(typeof C!=="string"||typeof B!=="string"){throw new Error("Missing or invalid argument")}A={};A[C]=B;return YAHOO.util.History.multiNavigate(A)},multiNavigate:function(F){var A,E,C,D,B;if(typeof F!=="object"){throw new Error("Missing or invalid argument")}if(!U){throw new Error("The Browser History Manager is not initialized")}for(E in F){if(!L[E]){throw new Error("The following module has not been registered: "+E)}}A=[];for(E in L){if(YAHOO.lang.hasOwnProperty(L,E)){C=L[E];if(YAHOO.lang.hasOwnProperty(F,E)){D=F[unescape(E)]}else{D=unescape(C.currentState)}E=escape(E);D=escape(D);A.push(E+"="+D)}}B=A.join("&");if(YAHOO.env.ua.ie){return Q(B)}else{top.location.hash=B;if(YAHOO.env.ua.webkit){N[history.length]=B;O()}return true}},getCurrentState:function(A){var B;if(typeof A!=="string"){throw new Error("Missing or invalid argument")}if(!U){throw new Error("The Browser History Manager is not initialized")}B=L[A];if(!B){throw new Error("No such registered module: "+A)}return unescape(B.currentState)},getBookmarkedState:function(D){var E,H,A,B,G,C,F;if(typeof D!=="string"){throw new Error("Missing or invalid argument")}A=top.location.href.indexOf("#");B=A>=0?top.location.href.substr(A+1):top.location.href;G=B.split("&");for(E=0,H=G.length;E<H;E++){C=G[E].split("=");if(C.length===2){F=C[0];if(F===D){return unescape(C[1])}}}return null},getQueryStringParameter:function(D,G){var F,H,A,B,C,E;G=G||top.location.href;A=G.indexOf("?");B=A>=0?G.substr(A+1):G;A=B.lastIndexOf("#");B=A>=0?B.substr(0,A):B;C=B.split("&");for(F=0,H=C.length;F<H;F++){E=C[F].split("=");if(E.length>=2){if(E[0]===D){return unescape(E[1])}}}return null}}})();YAHOO.register("history",YAHOO.util.History,{version:"2.6.0",build:"1321"});
