/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;
var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;
if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);YAHOO.log("ActiveX Program Id  "+A+" added to _msxml_progid.","info","Connection");},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;YAHOO.log("Default POST header set to  "+A,"info","Connection");}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;YAHOO.log("Default XHR header set to  "+A,"info","Connection");}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;YAHOO.log("Default polling interval set to "+A+"ms","info","Connection");}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};YAHOO.log("XHR object created for transaction "+E,"info","Connection");}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};YAHOO.log("ActiveX XHR object created for transaction "+E,"info","Connection");break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){YAHOO.log("Unable to create connection object.","error","Connection");return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);YAHOO.log("Initialize transaction header X-Request-Header to XMLHttpRequest.","info","Connection");}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.","info","Connection");}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");YAHOO.log("Transaction "+D.tId+" sent.","info","Connection");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" created.","info","Connection");A[this._customEvents[B][0]].subscribe(C.customevents[B]);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" subscribed.","info","Connection");}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);YAHOO.log("Success callback. HTTP code is "+D,"info","Connection");}else{G.success.apply(G.scope,[C]);YAHOO.log("Success callback with scope. HTTP code is "+D,"info","Connection");}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);
YAHOO.log("Failure callback. Exception detected. Status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. Exception detected. Status code is "+D,"warn","Connection");}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. HTTP status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. HTTP status code is "+D,"warn","Connection");}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);YAHOO.log("Default HTTP header "+B+" set with value of "+this._default_headers[B],"info","Connection");}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);YAHOO.log("HTTP header "+B+" set with value of "+this._http_headers[B],"info","Connection");}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{YAHOO.log("Unable to create form object "+K,"warn","Connection");return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);YAHOO.log("Form initialized for transaction. HTML form POST message is: "+this._sFormData,"info","Connection");this.initHeader("Content-Type",this._default_form_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.","info","Connection");return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);YAHOO.log("File upload iframe created. Id is:"+B,"info","Connection");},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);
delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);YAHOO.log("Upload callback.","info","Connection");}else{M.upload.apply(M.scope,[P]);YAHOO.log("Upload callback with scope.","info","Connection");}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);YAHOO.log("File upload iframe destroyed. Id is:"+H,"info","Connection");},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);YAHOO.log("File upload iframe destroyed. Id is:"+C,"info","Connection");if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);YAHOO.log("Transaction "+E.tId+" aborted.","info","Connection");}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;YAHOO.log("Connection object for transaction "+A.tId+" destroyed.","info","Connection");A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(this._configs[E[D]]&&!A.isUndefined(this._configs[E[D]].value)&&!A.isNull(this._configs[E[D]].value)){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var D=YAHOO.util.Dom,F=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(G,H){if(arguments.length){this.init(G,H);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(G){G=G.get?G.get("element"):G;this.get("element").appendChild(G);},getElementsByTagName:function(G){return this.get("element").getElementsByTagName(G);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(G,H){G=G.get?G.get("element"):G;H=(H&&H.get)?H.get("element"):H;this.get("element").insertBefore(G,H);},removeChild:function(G){G=G.get?G.get("element"):G;this.get("element").removeChild(G);return true;},replaceChild:function(G,H){G=G.get?G.get("element"):G;H=H.get?H.get("element"):H;return this.get("element").replaceChild(G,H);},initAttributes:function(G){},addListener:function(K,J,L,I){var H=this.get("element");I=I||this;H=this.get("id")||H;var G=this;if(!this._events[K]){if(this.DOM_EVENTS[K]){YAHOO.util.Event.addListener(H,K,function(M){if(M.srcElement&&!M.target){M.target=M.srcElement;}G.fireEvent(K,M);},L,I);}this.createEvent(K,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(H,G){this.unsubscribe.apply(this,arguments);},addClass:function(G){D.addClass(this.get("element"),G);},getElementsByClassName:function(H,G){return D.getElementsByClassName(H,G,this.get("element"));},hasClass:function(G){return D.hasClass(this.get("element"),G);},removeClass:function(G){return D.removeClass(this.get("element"),G);},replaceClass:function(H,G){return D.replaceClass(this.get("element"),H,G);},setStyle:function(I,H){var G=this.get("element");if(!G){return this._queue[this._queue.length]=["setStyle",arguments];}return D.setStyle(G,I,H);},getStyle:function(G){return D.getStyle(this.get("element"),G);},fireQueue:function(){var H=this._queue;for(var I=0,G=H.length;I<G;++I){this[H[I][0]].apply(this,H[I][1]);}},appendTo:function(H,I){H=(H.get)?H.get("element"):D.get(H);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:H});I=(I&&I.get)?I.get("element"):D.get(I);var G=this.get("element");if(!G){return false;}if(!H){return false;}if(G.parent!=H){if(I){H.insertBefore(G,I);}else{H.appendChild(G);}}this.fireEvent("appendTo",{type:"appendTo",target:H});},get:function(G){var I=this._configs||{};var H=I.element;if(H&&!I[G]&&!YAHOO.lang.isUndefined(H.value[G])){return H.value[G];}return F.prototype.get.call(this,G);},setAttributes:function(L,H){var K=this.get("element");
for(var J in L){if(!this._configs[J]&&!YAHOO.lang.isUndefined(K[J])){this.setAttributeConfig(J);}}for(var I=0,G=this._configOrder.length;I<G;++I){if(L[this._configOrder[I]]!==undefined){this.set(this._configOrder[I],L[this._configOrder[I]],H);}}},set:function(H,J,G){var I=this.get("element");if(!I){this._queue[this._queue.length]=["set",arguments];if(this._configs[H]){this._configs[H].value=J;}return ;}if(!this._configs[H]&&!YAHOO.lang.isUndefined(I[H])){C.call(this,H);}return F.prototype.set.apply(this,arguments);},setAttributeConfig:function(G,I,J){var H=this.get("element");if(H&&!this._configs[G]&&!YAHOO.lang.isUndefined(H[G])){C.call(this,G,I);}else{F.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(G);},getAttributeKeys:function(){var H=this.get("element");var I=F.prototype.getAttributeKeys.call(this);for(var G in H){if(!this._configs[G]){I[G]=I[G]||H[G];}}return I;},createEvent:function(H,G){this._events[H]=true;F.prototype.createEvent.apply(this,arguments);},init:function(H,G){A.apply(this,arguments);}};var A=function(H,G){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];G=G||{};G.element=G.element||H||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var I=false;if(YAHOO.lang.isString(H)){C.call(this,"id",{value:G.element});}if(D.get(H)){I=true;E.call(this,G);B.call(this,G);}YAHOO.util.Event.onAvailable(G.element,function(){if(!I){E.call(this,G);}this.fireEvent("available",{type:"available",target:G.element});},this,true);YAHOO.util.Event.onContentReady(G.element,function(){if(!I){B.call(this,G);}this.fireEvent("contentReady",{type:"contentReady",target:G.element});},this,true);};var E=function(G){this.setAttributeConfig("element",{value:D.get(G.element),readOnly:true});};var B=function(G){this.initAttributes(G);this.setAttributes(G,true);this.fireQueue();};var C=function(G,I){var H=this.get("element");I=I||{};I.name=G;I.method=I.method||function(J){H[G]=J;};I.value=I.value||H[G];this._configs[G]=new YAHOO.util.Attribute(I,this);};YAHOO.augment(YAHOO.util.Element,F);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
(function(){YAHOO.widget.TabView=function(K,J){J=J||{};if(arguments.length==1&&!YAHOO.lang.isString(K)&&!K.nodeName){J=K;K=J.element||null;}if(!K&&!J.element){K=I.call(this,J);}YAHOO.widget.TabView.superclass.constructor.call(this,K,J);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var F=YAHOO.widget.TabView.prototype;var E=YAHOO.util.Dom;var H=YAHOO.util.Event;var D=YAHOO.widget.Tab;F.CLASSNAME="yui-navset";F.TAB_PARENT_CLASSNAME="yui-nav";F.CONTENT_PARENT_CLASSNAME="yui-content";F._tabParent=null;F._contentParent=null;F.addTab=function(M,O){var P=this.get("tabs");if(!P){this._queue[this._queue.length]=["addTab",arguments];return false;}O=(O===undefined)?P.length:O;var R=this.getTab(O);var T=this;var L=this.get("element");var S=this._tabParent;var Q=this._contentParent;var J=M.get("element");var K=M.get("contentEl");if(R){S.insertBefore(J,R.get("element"));}else{S.appendChild(J);}if(K&&!E.isAncestor(Q,K)){Q.appendChild(K);}if(!M.get("active")){M.set("contentVisible",false,true);}else{this.set("activeTab",M,true);}var N=function(V){YAHOO.util.Event.preventDefault(V);var U=false;if(this==T.get("activeTab")){U=true;}T.set("activeTab",this,U);};M.addListener(M.get("activationEvent"),N);M.addListener("activationEventChange",function(U){if(U.prevValue!=U.newValue){M.removeListener(U.prevValue,N);M.addListener(U.newValue,N);}});P.splice(O,0,M);};F.DOMEventHandler=function(P){var K=this.get("element");var Q=YAHOO.util.Event.getTarget(P);var S=this._tabParent;if(E.isAncestor(S,Q)){var L;var M=null;var J;var R=this.get("tabs");for(var N=0,O=R.length;N<O;N++){L=R[N].get("element");J=R[N].get("contentEl");if(Q==L||E.isAncestor(L,Q)){M=R[N];break;}}if(M){M.fireEvent(P.type,P);}}};F.getTab=function(J){return this.get("tabs")[J];};F.getTabIndex=function(N){var K=null;var M=this.get("tabs");for(var L=0,J=M.length;L<J;++L){if(N==M[L]){K=L;break;}}return K;};F.removeTab=function(M){var L=this.get("tabs").length;var K=this.getTabIndex(M);var J=K+1;if(M==this.get("activeTab")){if(L>1){if(K+1==L){this.set("activeIndex",K-1);}else{this.set("activeIndex",K+1);}}}this._tabParent.removeChild(M.get("element"));this._contentParent.removeChild(M.get("contentEl"));this._configs.tabs.value.splice(K,1);};F.toString=function(){var J=this.get("id")||this.get("tagName");return"TabView "+J;};F.contentTransition=function(K,J){K.set("contentVisible",true);J.set("contentVisible",false);};F.initAttributes=function(J){YAHOO.widget.TabView.superclass.initAttributes.call(this,J);if(!J.orientation){J.orientation="top";}var L=this.get("element");if(!YAHOO.util.Dom.hasClass(L,this.CLASSNAME)){YAHOO.util.Dom.addClass(L,this.CLASSNAME);}this.setAttributeConfig("tabs",{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,"ul")[0]||G.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,"div")[0]||C.call(this);this.setAttributeConfig("orientation",{value:J.orientation,method:function(M){var N=this.get("orientation");this.addClass("yui-navset-"+M);if(N!=M){this.removeClass("yui-navset-"+N);}switch(M){case"bottom":this.appendChild(this._tabParent);break;}}});this.setAttributeConfig("activeIndex",{value:J.activeIndex,method:function(M){this.set("activeTab",this.getTab(M));},validator:function(M){return !this.getTab(M).get("disabled");}});this.setAttributeConfig("activeTab",{value:J.activeTab,method:function(N){var M=this.get("activeTab");if(N){N.set("active",true);this._configs["activeIndex"].value=this.getTabIndex(N);}if(M&&M!=N){M.set("active",false);}if(M&&N!=M){this.contentTransition(N,M);}else{if(N){N.set("contentVisible",true);}}},validator:function(M){return !M.get("disabled");}});if(this._tabParent){B.call(this);}this.DOM_EVENTS.submit=false;this.DOM_EVENTS.focus=false;this.DOM_EVENTS.blur=false;for(var K in this.DOM_EVENTS){if(YAHOO.lang.hasOwnProperty(this.DOM_EVENTS,K)){this.addListener.call(this,K,this.DOMEventHandler);}}};var B=function(){var Q,L,P;var O=this.get("element");var N=A(this._tabParent);var K=A(this._contentParent);for(var M=0,J=N.length;M<J;++M){L={};if(K[M]){L.contentEl=K[M];}Q=new YAHOO.widget.Tab(N[M],L);this.addTab(Q);if(Q.hasClass(Q.ACTIVE_CLASSNAME)){this._configs.activeTab.value=Q;this._configs.activeIndex.value=this.getTabIndex(Q);}}};var I=function(J){var K=document.createElement("div");if(this.CLASSNAME){K.className=this.CLASSNAME;}return K;};var G=function(J){var K=document.createElement("ul");if(this.TAB_PARENT_CLASSNAME){K.className=this.TAB_PARENT_CLASSNAME;}this.get("element").appendChild(K);return K;};var C=function(J){var K=document.createElement("div");if(this.CONTENT_PARENT_CLASSNAME){K.className=this.CONTENT_PARENT_CLASSNAME;}this.get("element").appendChild(K);return K;};var A=function(M){var K=[];var N=M.childNodes;for(var L=0,J=N.length;L<J;++L){if(N[L].nodeType==1){K[K.length]=N[L];}}return K;};})();(function(){var E=YAHOO.util.Dom,J=YAHOO.util.Event;var B=function(L,K){K=K||{};if(arguments.length==1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element;}if(!L&&!K.element){L=H.call(this,K);}this.loadHandler={success:function(M){this.set("content",M.responseText);},failure:function(M){}};B.superclass.constructor.call(this,L,K);this.DOM_EVENTS={};};YAHOO.extend(B,YAHOO.util.Element);var F=B.prototype;F.LABEL_TAGNAME="em";F.ACTIVE_CLASSNAME="selected";F.ACTIVE_TITLE="active";F.DISABLED_CLASSNAME="disabled";F.LOADING_CLASSNAME="loading";F.dataConnection=null;F.loadHandler=null;F._loading=false;F.toString=function(){var K=this.get("element");var L=K.id||K.tagName;return"Tab "+L;};F.initAttributes=function(K){K=K||{};B.superclass.initAttributes.call(this,K);var M=this.get("element");this.setAttributeConfig("activationEvent",{value:K.activationEvent||"click"});this.setAttributeConfig("labelEl",{value:K.labelEl||G.call(this),method:function(N){var O=this.get("labelEl");if(O){if(O==N){return false;}this.replaceChild(N,O);}else{if(M.firstChild){this.insertBefore(N,M.firstChild);}else{this.appendChild(N);}}}});this.setAttributeConfig("label",{value:K.label||D.call(this),method:function(O){var N=this.get("labelEl");
if(!N){this.set("labelEl",I.call(this));}C.call(this,O);}});this.setAttributeConfig("contentEl",{value:K.contentEl||document.createElement("div"),method:function(N){var O=this.get("contentEl");if(O){if(O==N){return false;}this.replaceChild(N,O);}}});this.setAttributeConfig("content",{value:K.content,method:function(N){this.get("contentEl").innerHTML=N;}});var L=false;this.setAttributeConfig("dataSrc",{value:K.dataSrc});this.setAttributeConfig("cacheData",{value:K.cacheData||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("loadMethod",{value:K.loadMethod||"GET",validator:YAHOO.lang.isString});this.setAttributeConfig("dataLoaded",{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig("dataTimeout",{value:K.dataTimeout||null,validator:YAHOO.lang.isNumber});this.setAttributeConfig("active",{value:K.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(N){if(N===true){this.addClass(this.ACTIVE_CLASSNAME);this.set("title",this.ACTIVE_TITLE);}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set("title","");}},validator:function(N){return YAHOO.lang.isBoolean(N)&&!this.get("disabled");}});this.setAttributeConfig("disabled",{value:K.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(N){if(N===true){E.addClass(this.get("element"),this.DISABLED_CLASSNAME);}else{E.removeClass(this.get("element"),this.DISABLED_CLASSNAME);}},validator:YAHOO.lang.isBoolean});this.setAttributeConfig("href",{value:K.href||this.getElementsByTagName("a")[0].getAttribute("href",2)||"#",method:function(N){this.getElementsByTagName("a")[0].href=N;},validator:YAHOO.lang.isString});this.setAttributeConfig("contentVisible",{value:K.contentVisible,method:function(N){if(N){this.get("contentEl").style.display="block";if(this.get("dataSrc")){if(!this._loading&&!(this.get("dataLoaded")&&this.get("cacheData"))){A.call(this);}}}else{this.get("contentEl").style.display="none";}},validator:YAHOO.lang.isBoolean});};var H=function(K){var O=document.createElement("li");var L=document.createElement("a");L.href=K.href||"#";O.appendChild(L);var N=K.label||null;var M=K.labelEl||null;if(M){if(!N){N=D.call(this,M);}}else{M=I.call(this);}L.appendChild(M);return O;};var G=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var I=function(){var K=document.createElement(this.LABEL_TAGNAME);return K;};var C=function(K){var L=this.get("labelEl");L.innerHTML=K;};var D=function(){var K,L=this.get("labelEl");if(!L){return undefined;}return L.innerHTML;};var A=function(){if(!YAHOO.util.Connect){return false;}E.addClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=true;this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get("loadMethod"),this.get("dataSrc"),{success:function(K){this.loadHandler.success.call(this,K);this.set("dataLoaded",true);this.dataConnection=null;E.removeClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=false;},failure:function(K){this.loadHandler.failure.call(this,K);this.dataConnection=null;E.removeClass(this.get("contentEl").parentNode,this.LOADING_CLASSNAME);this._loading=false;},scope:this,timeout:this.get("dataTimeout")});};YAHOO.widget.Tab=B;})();YAHOO.register("tabview",YAHOO.widget.TabView,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);
if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);
var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.2",build:"1076"});var Figment = {
    /**
     * Converts an object literal to a multi-instance capable object
     * class.
     */
    Class: function()
    {
        return function()
        {
            this.initialize.apply( this,arguments );
        };
    },

    /**
     * Creates a new container for preventing methods from interfering
     * with other namespaces or the default namespace of window.  The
     * new namespace is added to the window object.
     * <p>
     * A namespace is made up of objects that are children of each other.
     *
     * @param   arguments   is a dot seperated name for the container
     */
    Namespace: function()
    {
        var iLen = arguments.length;
        var listOfParts = null;
        var root = window;
        var jLen = 0;
        var j = 0;
        var i = 0;

        for( i=0; i < iLen; i++ )
        {
            listOfParts = arguments[i].split( '.' );
            jLen = listOfParts.length;

            for( j=0; j < jLen; j++ )
            {
                if( !root[ listOfParts[j] ] )
                {
                    // Create a blank object for this part of the namespace
                    root[ listOfParts[j] ] = {};
                }
                root = root[ listOfParts[j] ];
            }
        }

        delete listOfParts;
        delete root;
    },

    /**
     * Attempts to retrieve and load script from another file after
     * determining that the specified namespace is not already loaded.
     *
     * @param   strScript       fully-qualified name of the namespace (a.k.a. fileName) to import
     * @param   strStartURL     name of an alternate URL to retrieve the file from (can be relative or absolute)
     * @param   bDotsAreFolders determines whether to treat dots in the namespace as folders instead of dots in the filename
     */
    Import: function( strScript,strStartURL,bDotsAreFolders )
    {
        // Cache the packaged files that are in base.js.  No need to include
        // these because they are already included.  Also, let's use a "set" to
        // keep lookup time down
        if (typeof arguments.callee.packagedFiles === "undefined") {
            arguments.callee.packagedFiles = {
                "Figment":1,
                "Figment.EntryPoint":1,
                "Figment.EventHandler":1,
                "Figment.Cookies":1,
                "Figment.Date":1,
                "Figment.DOM":1,
                "Figment.HashTable":1,
                "Figment.Net.Request":1,
                "Figment.Window":1,
                "Figment.Form":1,
                "Disney.DOL.Chrome.Settings":1,
                "Disney.WDPRO.UI.Widgets.Modules":1,
                "Disney.WDPRO.UI.InterfaceBlocking":1,
                "Disney.WDPRO.IBC.UI.DynamicPleaseWait":1,
                "Disney.WDPRO.util.EventBus":1
            };
        }
        // If it's 1, then it's in the list and we need to leave
        if (arguments.callee.packagedFiles[strScript] === 1) { return; }

        var bImport = false;
        var strNamespace = null;
        var listOfNamespaces = null;
        var root = null;
        var iLen = null;
        var i = 0;
        var objHead = null;
        var strJs = null;
        var objScript = null;
        var ajaxRequestor = null;

        strNamespace = strScript;
        if( arguments.length === 3 && bDotsAreFolders )
        {
            strScript = strScript.replaceAll( '.','/' );
        }
        strScript += '.js';

        if( arguments.length < 2 )
        {
            strStartURL = '';
        }
        else
        {
            if( strStartURL !== null && strStartURL !== '' && !strStartURL.endsWith( '/' ) )
            {
                strStartURL += '/';
            }
        }

        listOfNamespaces = strNamespace.split( '.' );
        root = window;
        iLen = listOfNamespaces.length;
        for( i=0; i < iLen; i++ )
        {
            if( !root[ listOfNamespaces[i] ] )
            {
                bImport = true;
                break;
            }
            root = root[ listOfNamespaces[i] ];
        }

    // Label the import section
    markImport:

        if( bImport )
        {
            objScript = document.createElement( "SCRIPT" );
            objHead = document.getElementsByTagName( "HEAD" );

            if( objHead.length > 0 )
            {
                objHead = objHead[0];
            }
            else
            {
                alert( "Script not loaded" );
                break markImport;
            }

            objScript.type = "text/javascript";
            objScript.src = Figment.getBase() + strStartURL + strScript;
            objHead.appendChild( objScript );

            delete objScript;
            delete objHead;
        }
        delete listOfNamespaces;
        delete root;
    },

    /**
     * Determines if the specified class already exists.
     *
     * @param   strFQClassName  is the fully-qualified name of the class to check for
     * @return  true or false if the class exists
     */
    doesClassExist: function( strFQClassName )
    {
        var listOfNameSpaces = strFQClassName.split( "." );
        var iLen = listOfNameSpaces.length;
        var oNameSpace = null;
        var oPackage = null;
        var bResult = true;
        var i = 0;
        for( i=0; i < iLen; i++ )
        {
            oPackage = listOfNameSpaces[ i ];
            oNameSpace = oNameSpace !== null ? oNameSpace[oPackage] : eval(oPackage);
            if( typeof oNameSpace === "undefined" )
            {
                bResult = false;
            }
        }

        delete listOfNameSpaces;
        delete oNameSpace;
        return bResult;
    },

    /**
     * Attempts to run code in the order in which they are passed in by arguments.  Upon the
     * first successful completion, the method will return the result and stop processing
     * additional arguments.
     *
     * @param   arguments   individual portions of code to attempt to run
     * @return  result of the first successful code in the arguments list
     */
    Try: function()
    {
        var returnValue = null;
        var iLen = arguments.length;
        var i = 0;
        var lambda = null;

        for( i=0; i < iLen; i++ )
        {
            lambda = arguments[i];
            try
            {
                returnValue = lambda();
                break;
            } catch (e) {}
        }
        return returnValue;
    },

    EmptyFunction: function(){},

    CONST_CONTENT_LANGUAGE_ID:'Content-Language',
    CONST_JS_ROOT_ID: 'jsroot',
    CONST_WEB_ROOT_ROOT_ID: 'webroot',
    CONST_MEDIA_ROOT_ID: 'mediaroot',
    CONST_BASE_ROOT_ID: 'baseuri',
    CONST_SECURE_BASE_ROOT_ID: 'securebaseuri',
    JS_ROOT_VALUE: null,
    WEB_ROOT_VALUE: null,
    MEDIA_ROOT_VALUE: null,
    BASE_ROOT_VALUE: null,
    SECURE_BASE_ROOT_VALUE: null,
    CONTENT_LANGUAGE_VALUE:null,
    loadMetas: function()
    {
        var metas = document.getElementsByTagName("META");
        for( var i=0; i<metas.length; i++)
        {
            var meta = metas[i];
            switch (meta.name || meta.httpEquiv) {
                case Figment.CONST_CONTENT_LANGUAGE_ID:
                    Figment.CONTENT_LANGUAGE_VALUE = meta.content;
                    break;
                case Figment.CONST_WEB_ROOT_ROOT_ID:
                    Figment.WEB_ROOT_VALUE = "/" + meta.content + "/";
                    break;
                case Figment.CONST_JS_ROOT_ID:
                    Figment.JS_ROOT_VALUE = "/" + meta.content + "/js/";
                    break;
                case Figment.CONST_MEDIA_ROOT_ID:
                    Figment.MEDIA_ROOT_VALUE = "/" + meta.content + "/media/";
                    break;
                case Figment.CONST_BASE_ROOT_ID:
                    Figment.BASE_ROOT_VALUE = meta.content;
                    break;
                case Figment.CONST_SECURE_BASE_ROOT_ID:
                    Figment.SECURE_BASE_ROOT_VALUE = meta.content;
                    break;
                default:
                    break;
            }
        }
    },
    getContentLanguage: function()
    {
        if(  Figment.CONTENT_LANGUAGE_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.CONTENT_LANGUAGE_VALUE;
    },
    getJSRoot: function()
    {
        if( Figment.JS_ROOT_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.JS_ROOT_VALUE;
    },

    getWebRoot: function()
    {
        if( Figment.WEB_ROOT_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.WEB_ROOT_VALUE;
    },

    getMediaRoot: function()
    {
        if( Figment.MEDIA_ROOT_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.MEDIA_ROOT_VALUE;
    },

    getBase: function()
    {
        if( Figment.BASE_ROOT_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.BASE_ROOT_VALUE;
    },
    getSecureBase: function()
    {
        if( Figment.SECURE_BASE_ROOT_VALUE === null )
        {
            Figment.loadMetas();
        }
        return Figment.SECURE_BASE_ROOT_VALUE;
    },
    isSecure: function()
    {
        return (window.location.protocol.toLowerCase() === 'https:');
    }
};

//#######################################################################
//# BROWSER OBJECT EXTENSION & ENHANCEMENTS                             #
//# The following methods will either fix or extend default methods     #
//# available to different objects in base language of JavaScript.      #
//#######################################################################
if( !Function.prototype.apply )
{
    // Based on code from http://www.youngpup.net/
    Function.prototype.apply = function( object,parameters )
    {
        var parameterStrings = [];
        if( !object ){ object = window; }
        if( !parameters ){ parameters = []; }

        for( var i=0; i < parameters.length; i++ )
        {
            parameterStrings[i] = 'parameters[' + i + ']';
        }

        object.__apply__ = this;
        var result = eval( 'object.__apply__(' + parameterStrings.join(', ') + ')' );
        object.__apply__ = null;
        return result;
    };
}
if( !Function.prototype.bind )
{
    Function.prototype.bind = function( object )
    {
        var __method = this;
        return function()
        {
            try
            {
                return __method.apply( object,arguments );
            } catch(e) {}
        };
    };
}
// Similar to bind, but used for events
//
// You have to at least pass in one parameter to this method, and that
// parameter is the context to bind this function to
// based on code from Prototype: http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/src/base.js
// LICENSE: http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/LICENSE
if (!Function.prototype.bindAsEventListener) {
    Function.prototype.bindAsEventListener = function() {
        var __method = this,
            args = Array.prototype.slice.call(arguments),
            object = args.shift();
        return function(evt) {
            try {
                return __method.apply(object, [evt].concat(args));
            } catch(e) {}
        };
    };
}

if( !Object.extend )
{
    Object.extend = function( destination,source )
    {
        var property;
        for( property in source )
        {
            destination[property] = source[property];
        }
        return destination;
    };
}

if (!Object.prototype.toQueryString) {
    Object.prototype.toQueryString = function() {
        var tmp = [];
        for (var key in this) {
            if (this.hasOwnProperty(key)) {
                tmp.push(key + "=" + this[key]);
            }
        }
        return tmp.join("&");
    };
}

/**
 * Extends an object to contain the specified object's properties and/or methods.
 *
 * @param   object  to append to the other object
 * @return  result of merged objects
 */
if( !Object.prototype.extend )
{
    Object.prototype.extend = function( object )
    {
        return Object.extend.apply( this,[this,object] );
    };
}
/**
 * Trims the start of a string only.
 *
 * @return  the string trimmed
 */
if( !String.prototype.lTrim )
{
    String.prototype.lTrim = function()
    {
        return this.replace( /^\s*/,'' );
    };
}
/**
 * Trims the end of a string only.
 *
 * @return  the string trimmed
 */
if( !String.prototype.rTrim )
{
    String.prototype.rTrim = function()
    {
        return this.replace( /\s*$/,'' );
    };
}
/**
 * Trims both the beginning and end of a string.
 *
 * @return  the string trimmed
 */
if( !String.prototype.trim )
{
    String.prototype.trim = function()
    {
        return this.rTrim().lTrim();
    };
}
/**
 * Determines if a string ends with the specified string.
 *
 * @param   string  is the string to check for
 * @return  whether or not the string ends with the specified string
 */
if( !String.prototype.endsWith )
{
    String.prototype.endsWith = function( string )
    {
        return this.substr( this.length-string.length )===string;
    };
}
/**
 * Determines if a string starts with the specified string.
 *
 * @param   string  is the string to check for
 * @return  whether or not the string starts with the specified string
 */
if( !String.prototype.startsWith )
{
    String.prototype.startsWith = function( e )
    {
        return this.substr( 0,e.length ) === e;
    };
}
/**
 * Replaces all instances of one string with another string.
 *
 * @param   findStr is the string to locate to replace
 * @param   repStr  is the string to replace each instance of the findStr found
 * @return  the modified string
 */
if( !String.prototype.replaceAll )
{
    String.prototype.replaceAll = function( findStr,repStr )
    {
      var srchNdx = 0;
      var newStr = "";
      while( this.indexOf( findStr,srchNdx ) !== -1)
      {
            newStr += this.substring( srchNdx,this.indexOf( findStr,srchNdx ) );
            newStr += repStr;
            srchNdx = ( this.indexOf( findStr,srchNdx ) + findStr.length );
      }
      newStr += this.substring( srchNdx,this.length );
      return newStr;
    };
}
/**
 * Adds one or more elements to the end of an array and returns the new length of the array.
 *
 * @param   arguments   the objects (as multiple arguments) to add to the array
 * @return  array with the new element(s) appended to the end
 */
if( !Array.prototype.push )
{
    Array.prototype.push = function()
    {
        var startLength = this.length;
        var i= 0;

        for( i=0; i < arguments.length; i++ )
        {
            this[ startLength + i ] = arguments[i];
        }
        return this.length;
    };
}
/**
 * Returns the first (least) index of an element within the array equal to the
 * specified value, or -1 if none is found.
 *
 * @param   object  is the object to attempt to find in the array
 * @return  the location of the specified object or -1 if not found
 */
if( !Array.prototype.indexOf )
{
    Array.prototype.indexOf = function( object )
    {
        var i = 0;

        for( i=0; i < this.length; i++ )
        {
            if( this[i] === object )
            {
                return i;
            }
        }
        return -1;
    };
}
/**
 * Returns whether the specified object is found inside the array.
 *
 * @param   object  is the object to attempt to find in the array
 * @return  whether or not the object was found in the array
 */
if( !Array.prototype.exists )
{
    Array.prototype.exists = function( object )
    {
        return this.indexOf( object ) !== -1;
    };
}
/**
 * Determines whether the specified object is contained inside the array.
 *
 * @param   object  to check for the existence of
 * @return  whether or not the object was found in the array
 */
if( !Array.prototype.contains )
{
    Array.prototype.contains = function( object )
    {
        var index = this.indexOf( object );
        return index >= 0;
    };
}
/**
 * Inserts the specified object into the array at the specified position.
 *
 * @param   index   to place the object in the array
 * @param   object  to place into the array
 */
if( !Array.prototype.insert )
{
    Array.prototype.insert = function( index,object )
    {
        this.splice( index,0,object );
    };
}
/**
 * Copies this array to a new array.
 *
 * @return  the copied array
 */
if( !Array.prototype.clone )
{
    Array.prototype.clone = function()
    {
        var clonedArray = [];
        var length = this.length;
        var i = 0;

        for( i=0; i < length; i++ )
        {
            clonedArray[i] = this[i];
        }
        return clonedArray;
    };
}
/**
 * Removes the element at the specified position from the array.
 *
 * @param   index   of the element to remove from the array
 * @return  the element that was removed
 */
if( !Array.prototype.removeAt )
{
    Array.prototype.removeAt = function( index )
    {
        return this.splice( index,1 );
    };
}
/**
 * Removes the specified object from the array.
 *
 * @param   object  to remove from the array
 * @return  the index of the element that contained the object
 */
if( !Array.prototype.remove )
{
    Array.prototype.remove = function( object )
    {
        var i = this.indexOf( object );
        if( i > -1 )
        {
            this.splice( i,1 );
        }
        return i > -1;
    };
}
/**
 * Removes all elements from the array.
 */
if( !Array.prototype.clear )
{
    Array.prototype.clear = function()
    {
        if( this.length > 0 )
        {
            this.splice( 0,this.length );
        }
    };
}

Date.prototype.formatDate = function( input,time )
{
    var daysLong =    ["Sunday", "Monday", "Tuesday", "Wednesday",
                       "Thursday", "Friday", "Saturday"];
    var daysShort =   ["Sun", "Mon", "Tue", "Wed",
                       "Thu", "Fri", "Sat"];
    var monthsShort = ["Jan", "Feb", "Mar", "Apr",
                       "May", "Jun", "Jul", "Aug", "Sep",
                       "Oct", "Nov", "Dec"];
    var monthsLong =  ["January", "February", "March", "April",
                       "May", "June", "July", "August", "September",
                       "October", "November", "December"];

    var switches = { // switches object

        a : function () {
            // Lowercase Ante meridiem and Post meridiem
            return date.getHours() > 11? "pm" : "am";
        },

        A : function () {
            // Uppercase Ante meridiem and Post meridiem
            return (this.a().toUpperCase ());
        },

        B : function (){
            // Swatch internet time. code simply grabbed from ppk,
            // since I was feeling lazy:
            // http://www.xs4all.nl/~ppk/js/beat.html
            var off = (date.getTimezoneOffset() + 60)*60;
            var theSeconds = (date.getHours() * 3600) +
                             (date.getMinutes() * 60) +
                              date.getSeconds() + off;
            var beat = Math.floor(theSeconds/86.4);
            if (beat > 1000) beat -= 1000;
            if (beat < 0) beat += 1000;
            if ((String(beat)).length == 1) beat = "00"+beat;
            if ((String(beat)).length == 2) beat = "0"+beat;
            return beat;
        },

        c : function () {
            // ISO 8601 date (e.g.: "2004-02-12T15:19:21+00:00"), as per
            // http://www.cl.cam.ac.uk/~mgk25/iso-time.html
            return (this.Y() + "-" + this.m() + "-" + this.d() + "T" +
                    this.h() + ":" + this.i() + ":" + this.s() + this.P());
        },

        d : function () {
            // Day of the month, 2 digits with leading zeros
            var j = String(this.j());
            return (j.length == 1 ? "0"+j : j);
        },

        D : function () {
            // A textual representation of a day, three letters
            return daysShort[date.getDay()];
        },

        F : function () {
            // A full textual representation of a month
            return monthsLong[date.getMonth()];
        },

        g : function () {
            // 12-hour format of an hour without leading zeros
            return date.getHours() > 12? date.getHours()-12 : date.getHours();
        },

        G : function () {
            // 24-hour format of an hour without leading zeros
            return date.getHours();
        },

        h : function () {
            // 12-hour format of an hour with leading zeros
            var g = String(this.g());
            return (g.length == 1 ? "0"+g : g);
        },

        H : function () {
            // 24-hour format of an hour with leading zeros
            var G = String(this.G());
            return (G.length == 1 ? "0"+G : G);
        },

        i : function () {
            // Minutes with leading zeros
            var min = String (date.getMinutes ());
            return (min.length == 1 ? "0" + min : min);
        },

        I : function () {
            // Whether or not the date is in daylight saving time (DST)
            // note that this has no bearing in actual DST mechanics,
            // and is just a pure guess. buyer beware.
            var noDST = new Date ("January 1 " + this.Y() + " 00:00:00");
            return (noDST.getTimezoneOffset () ==
                    date.getTimezoneOffset () ? 0 : 1);
        },

        j : function () {
            // Day of the month without leading zeros
            return date.getDate();
        },

        l : function () {
            // A full textual representation of the day of the week
            return daysLong[date.getDay()];
        },

        L : function () {
            // leap year or not. 1 if leap year, 0 if not.
            // the logic should match iso's 8601 standard.
            // http://www.uic.edu/depts/accc/software/isodates/leapyear.html
            var Y = this.Y();
            if ((Y % 4 == 0 && Y % 100 != 0) ||
                    (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)) {
                return 1;
            } else {
                return 0;
            }
        },

        m : function () {
            // Numeric representation of a month, with leading zeros
            var n = String(this.n());
            return (n.length == 1 ? "0"+n : n);
        },

        M : function () {
            // A short textual representation of a month, three letters
            return monthsShort[date.getMonth()];
        },

        n : function () {
            // Numeric representation of a month, without leading zeros
            return date.getMonth()+1;
        },

        N : function () {
            // ISO-8601 numeric representation of the day of the week
            var w = this.w();
            return (w == 0 ? 7 : w);
        },

        O : function () {
            // Difference to Greenwich time (GMT) in hours
            var os = Math.abs(date.getTimezoneOffset());
            var h = String(Math.floor(os/60));
            var m = String(os%60);
            h.length == 1? h = "0"+h:1;
            m.length == 1? m = "0"+m:1;
            return date.getTimezoneOffset() < 0 ? "+"+h+m : "-"+h+m;
        },

        P : function () {
            // Difference to GMT, with colon between hours and minutes
            var O = this.O();
            return (O.substr(0, 3) + ":" + O.substr(3, 2));
        },

        r : function () {
            // RFC 822 formatted date
            var r; // result
            //  Thu         ,     21               Dec              2000
            r = this.D() + ", " + this.d() + " " + this.M() + " " + this.Y() +
            //    16          :    01          :    07               0200
            " " + this.H() + ":" + this.i() + ":" + this.s() + " " + this.O();
            return r;
        },

        s : function () {
            // Seconds, with leading zeros
            var sec = String (date.getSeconds ());
            return (sec.length == 1 ? "0" + sec : sec);
        },

        S : function () {
            // English ordinal suffix for the day of the month, 2 characters
            switch (date.getDate ()) {
                case  1: return ("st");
                case  2: return ("nd");
                case  3: return ("rd");
                case 21: return ("st");
                case 22: return ("nd");
                case 23: return ("rd");
                case 31: return ("st");
                default: return ("th");
            }
        },

        t : function () {
            // thanks to Matt Bannon for some much needed code-fixes here!
            var daysinmonths = [null,31,28,31,30,31,30,31,31,30,31,30,31];
            if (this.L()==1 && this.n()==2) return 29; // ~leap day
            return daysinmonths[this.n()];
        },

        U : function () {
            // Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
            return Math.round(date.getTime()/1000);
        },

        w : function () {
            // Numeric representation of the day of the week
            return date.getDay();
        },

        W : function () {
            // Weeknumber, as per ISO specification:
            // http://www.cl.cam.ac.uk/~mgk25/iso-time.html

            var DoW = this.N ();
            var DoY = this.z ();

            // If the day is 3 days before New Year's Eve and is Thursday or earlier,
            // it's week 1 of next year.
            var daysToNY = 364 + this.L () - DoY;
            if (daysToNY <= 2 && DoW <= (3 - daysToNY)) {
                return 1;
            }

            // If the day is within 3 days after New Year's Eve and is Friday or later,
            // it belongs to the old year.
            if (DoY <= 2 && DoW >= 5) {
                return new Date (this.Y () - 1, 11, 31).formatDate ("W");
            }

            var nyDoW = new Date (this.Y (), 0, 1).getDay ();
            nyDoW = nyDoW != 0 ? nyDoW - 1 : 6;

            if (nyDoW <= 3) { // First day of the year is a Thursday or earlier
                return (1 + Math.floor ((DoY + nyDoW) / 7));
            } else {  // First day of the year is a Friday or later
                return (1 + Math.floor ((DoY - (7 - nyDoW)) / 7));
            }
        },

        y : function () {
            // A two-digit representation of a year
            var y = String(this.Y());
            return y.substring(y.length-2,y.length);
        },

        Y : function () {
            // A full numeric representation of a year, 4 digits

            // we first check, if getFullYear is supported. if it
            // is, we just use that. ppks code is nice, but wont
            // work with dates outside 1900-2038, or something like that
            if (date.getFullYear) {
                var newDate = new Date("January 1 2001 00:00:00 +0000");
                var x = newDate .getFullYear();
                if (x == 2001) {
                    // i trust the method now
                    return date.getFullYear();
                }
            }
            // else, do this:
            // codes thanks to ppk:
            // http://www.xs4all.nl/~ppk/js/introdate.html
            var x = date.getYear();
            var y = x % 100;
            y += (y < 38) ? 2000 : 1900;
            return y;
        },


        z : function () {
            // The day of the year, zero indexed! 0 through 366
            var t = new Date("January 1 " + this.Y() + " 00:00:00");
            var diff = date.getTime() - t.getTime();
            return Math.floor(diff/1000/60/60/24);
        },

        Z : function () {
            // Timezone offset in seconds
            return (date.getTimezoneOffset () * -60);
        }

    };

    function getSwitch(str) {
        if (switches[str] != undefined) {
            return switches[str]();
        } else {
            return str;
        }
    }

    var date;
    if (time) {
        var date = new Date (time);
    } else {
        var date = this;
    }

    var formatString = input.split("");
    var i = 0;
    while (i < formatString.length) {
        if (formatString[i] == "\\") {
            // this is our way of allowing users to escape stuff
            formatString.splice(i,1);
        } else {
            formatString[i] = getSwitch(formatString[i]);
        }
        i++;
    }

    return formatString.join("");
};

if( typeof Document !== 'undefined' )
{
    Document.prototype.__defineGetter__("xml", function()
    {
       return (new XMLSerializer()).serializeToString(this);
    });
}

if( typeof Element !== 'undefined' )
{
    Element.prototype.__defineGetter__("xml", function()
    {
       return (new XMLSerializer()).serializeToString(this);
    });

    Element.prototype.__defineSetter__("innerHTML",function()
    {
        var r = this.ownerDocument.createRange();
        r.selectNodeContents(this);
        r.deleteContents();
        var df = r.createContextualFragment(str);
        this.appendChild(df);
    });

    Element.prototype.__defineSetter__("outerHTML",function()
    {
        var r = this.ownerDocument.createRange();
        r.setStartBefore(this);
        var df = r.createContextualFragment(str);
        this.parentNode.replaceChild(df, this);
    });

}
Figment.Namespace('Figment.EntryPoint');
Figment.EntryPoint = function() {
    var listOfObjects = [];

    return {
        add: function(obj) {
            listOfObjects.push(obj);
        },

        execute: function() {
            var _this = this;
            setTimeout( function() {
                for (var i = 0; i !== listOfObjects.length; i++) {
                    listOfObjects[i].main();
                }
                _this.isComplete = true;
            }, 200);
        },

        isComplete: false
    };
}();
Figment.Namespace( 'Figment.EventHandler' );

/**
 * @constructor
 */
//Figment.EventHandler = Figment.Class();
//Figment.EventHandler.prototype = {
Figment.EventHandler = {
	/**
	 *	Create a list of events added to help reduce memory on window unload
	 */
	listOfEvents: [],
	//###########################################################################
	//# EVENT HANDLER METHODS TO ASSIST THE DEVELOPER
	//###########################################################################
	/**
	 *	Add event to the DOM for the element specified.
	 *	@param element to attach the event to
	 *	@param event type
	 *	@param method to run when this event is fired
	 *	@return boolean result of adding the event
	 */
	addEvent: function( obj,evType,fn,bubble )
	{
		if( typeof obj === 'undefined' || obj === null ) { return false; }
		obj.id = ( obj.id && obj.id.length > -1 ) ? obj.id : Figment.EventHandler.generateId();
		
		// Create a new event object to manage the events
		var obStoredEvent = new Figment.EventHandler.StoredEvent( obj,evType,fn );
		if( typeof bubble === 'undefined' )
		{
			bubble = false;
		}
		// Add the event object to the elements list
		Figment.EventHandler.listOfEvents.push( obStoredEvent );
		if( obj.addEventListener )
		{
			obj.addEventListener( evType,fn,bubble );
			return true;
		} else if( obj.attachEvent )
		{
			var r = obj.attachEvent( "on"+evType,fn );
			return r;
		} else {
			return false;
		}
		
		delete obStoredEvent;
		
		return false;
	},

	/**
	 *	Remove event from the DOM for the element specified.
	 *	@param element to dettach the event to
	 *	@param event type
	 *	@param method to run when this event is fired
	 *	@return boolean result of removing the event
	 */
	removeEvent: function( obj,evType,fn,bubble )
	{
		if( typeof bubble === 'undefined' )
		{
			bubble = false;
		}
		if( obj.removeEventListener )
		{
			obj.removeEventListener( evType,fn,bubble );
			return true;
		} else if( obj.dettachEvent )
		{
			var r = obj.dettachEvent( "on"+evType,fn );
			return r;
		} else {
			return false;
		}
		return false;
	},

	/**
	 *	Remove all event handlers added by the event sheets from the DOM
	 *	in order to reduce the memory used by the browser.
	 * 
	 * Event handlers of type "unload" and "beforeunload" are NOT removed.
	 * These handlers must remove themselves on execution by calling removeEvent
	 * when they execute, as in this method below.
	 */
	destroy: function()
	{
		var obStoredEvent = null;
		var eventsLength = Figment.EventHandler.listOfEvents.length;
		for( var i=0; i < eventsLength; i++ )
		{
			obStoredEvent = Figment.EventHandler.listOfEvents[i];
			if( obStoredEvent.element !== null )
			{
				// Remove the event from the element
				// Unload and beforeunload events are skipped and must remove themselves (as below)
				if( obStoredEvent.eventType != 'unload' && obStoredEvent.eventType != 'beforeunload')
				{
					Figment.EventHandler.removeEvent( obStoredEvent.element,obStoredEvent.eventType,obStoredEvent.method );
				}
			}
		}
		// Remove myself. Any user-defined unload handers must make this cleanup call
		Figment.EventHandler.removeEvent( window,'unload',Figment.EventHandler.destroy );

		// Reset the event list
		listOfEvents = {};
		
		delete obStoredEvent;
	},

	/**
	 *	Get the target element of the event fired.
	 *	@param event fired in Mozilla-compatiable browser
	 *	@return element that the event fired from
	 */
	getEvent: function( event )
	{
		if ( !event ){ event = window.event; }
		var objWindowEvent = new Figment.EventHandler.WindowEvent();
		var element = null;
		var realTarget = null;
		var mouseFromToTarget = null;
		if( event.target )
		{
			element = event.currentTarget;
			realTarget = event.target;
			mouseFromToTarget = event.relatedTarget;
		} else {
			element = event.srcElement;
			realTarget = event.srcElement;
			mouseFromToTarget = event.fromElement !== null ? event.fromElement : event.toElement;
		}
		objWindowEvent.event = event;
		objWindowEvent.element = element; // The element that the event was registered on
		objWindowEvent.targetElement = realTarget; // Actual element the event fired off of
		objWindowEvent.mouseFromToElement = mouseFromToTarget; // The element that the mouse just left (only for mouseover)
		return objWindowEvent;
	},
	
	/**
	 * Ability to manually trigger and event on a specified object.
	 * @param {IHTMLElement} domElement	to trigger the event on.
	 * @param {String} event				type of event to trigger.
	 */
	fireEvent: function( domElement,event )
	{
		var mouseEvents = ['click','mousedown','mousemove','mouseout','mouseover','mouseup'];
		if( typeof domElement === 'undefined' || domElement === null )
		{
			return;	
		}
		if( typeof event === 'undefined' || event === null )
		{
			return;	
		}
		event = event.toLowerCase();
		if( domElement.fireEvent )
		{
			domElement.fireEvent('on'+event);
		}
		else
		{
			var eventType = mouseEvents.contains(event) ? 'MouseEvents' : 'HTMLEvents';
			var evObj = document.createEvent( eventType );
			evObj.initEvent( event,false,false );
			domElement.dispatchEvent( evObj );
		}
	},
	
	/**
	 * 
	 */
	cleanUp: function(windowEvent)
	{
		delete windowEvent.targetElement;
		delete windowEvent.element;
		delete windowEvent.mouseFromToElement;
		delete windowEvent;
	},
	
	generateId: function()
	{
		var g = "";
		var i = 0;
		for( i=0; i < 32; i++ )
		{
			g += Math.floor(Math.random() * 0xF).toString(0xF) + (i == 8 || i == 12 || i == 16 || i == 20 ? '-' : '');
		}
		return g;
	},
	
	findTarget: function( obj,type,fn )
	{
		var eventsList = Figment.EventHandler.listOfEvents;
		var eventsListLength = eventsList.length;
		var target = null;
		
		for( var i=0; i < eventsListLength; i++ )
		{
			obStoredEvent = eventsList[i];
			if( obStoredEvent.element() === obj && obStoredEvent.eventType === type && obStoredEvent.method === fn )
			{
				target = obStoredEvent.element();
			}
		}
		
		delete obStoredEvent;
		delete eventsList;
		
		return target;
	}
};

Figment.EventHandler.StoredEvent = Figment.Class();
Figment.EventHandler.StoredEvent.prototype = {
	initialize: function( obj,evType,fn )
	{
		this.elementId = obj.id;
		this.element = obj;
		this.eventType = evType;
		this.method = fn;
	}
};

/**
 *	Object to hold the event information.  This object is created
 *	for each event and is added to the list of events created.
 */
Figment.EventHandler.WindowEvent = Figment.Class();
Figment.EventHandler.WindowEvent.prototype = {
	initialize: function( obj,evType,fn,eventObject )
	{
		this.element = obj;
		this.targetElement = null;
		this.eventType = evType;
		this.method = fn;
		this.event = eventObject;
		this.mouseFromToElement = null;
	},
	
	stopEvents: function()
	{
		if( this.event.stopPropagation )
		{
			this.event.stopPropagation();
		}
		else
		{
			this.event.cancelBubble = true;
		}
	},

	preventDefault: function()
	{
		if( this.event.preventDefault )
		{
		      this.event.preventDefault();
		}
		else
		{
			this.event.returnValue = false;
		}
	}
};

/**
 * @fileoverview	Creates a class that will manage observers and notify them
 * 				as needed.
 * @version		1.0.0
 * @constructor
 */
Figment.EventHandler.Observable = Figment.Class();
Figment.EventHandler.Observable.prototype = {
	/**
	 * Constructor
	 * @private
	 */
	initialize: function()
	{
		this.changed = false;
		this.observers = [];
	},
	
	/**
	 * Registers a new observer to this observable.
	 * @param {Figment.EventHandler.Observer} observer
	 * 	The specific observable to add.
	 */
	addObserver: function(observer)
	{
		this.observers.push(observer);
	},
	
	/**
	 * Unregister the observer from the this observable.
	 * @param {Figment.EventHandler.Observer} observer
	 * 	The specific observable to remove.
	 */
	deleteObserver: function(observer)
	{
		this.observers.remove(observer);
	},
	
	/**
	 * Let all the attached observers know that they need to update themselves.
	 * @param {Object} arg
	 * 	Optional data to send to the observer in addition to the observable object.
	 */
	notifyObservers: function(arg)
	{
		var i;
		var observers = this.observers;
		var observersLength = observers.length;
		var observer;
		
		if( observers !== null )
		{
			for( i=0; i < observersLength; i++ )
			{
				// Get the observer from the array
				observer = observers[i];
				// Call the update on the observer (send in this class and
				// any additional data through the arg.
				observer.update(this,arg);
			}
		}
		// Reset the change flag
		this.changed = false;
		
		delete observer;
		delete observers;
	},
	
	setChanged: function()
	{
		this.changed = true;
	}
};

/**
 * @fileoverview	Create an observer that will update when the observable notifys
 * 				this observer that an update has incurred.  An observer should
 * 				inherit this class and build out the update method.
 * @version		1.0.0
 * @constructor
 */
Figment.EventHandler.Observer = Figment.Class();
Figment.EventHandler.Observer.prototype = {
	/**
	 * Constructor
	 * @private
	 */
	initialize: function(observable)
	{
		this.observable = observable;
		// Add this observer to the passed in observable object
		if ( observable !== null && observable !== undefined )
		{
			observable.addObserver(this);
		}
	},
	
	/**
	 * Method to call when the observer has been notified.  This should be overridden
	 * by the object that inherits this method with actual implementation.
	 * @param {Figment.EventHandler.Observable} obs
	 * 	The observable that is notifying this observer.
	 * @param {Object} arg
	 * 	Additional data that may have been passed by the observable.
	 */
	update: function(obs,arg)
	{}
};

//###########################################################################
//# EVENTS TO FIRE WHEN THE WINDOW LOADS
//###########################################################################
// Runs the destroy method when the window unloads.  This helps prevent
// memory leakage that some browsers have when attaching events to DOM
// elements.
Figment.EventHandler.addEvent( window,'unload',Figment.EventHandler.destroy );Figment.Namespace('Figment.Cookies');
/**
 * Cookie manager.
 * @constructor
 * @version         1.0.0
 * @fileoverview    Cookie manager.
 */
Figment.Cookies = {
    /**
     * Get all cookies
     * @return {Array[]cookie[]}    all cookies
     */
    getAllCookies: function()
    {
        var cookies = [];
        var cookieStrings = document.cookie.split(';');
        var cookieString;
        var cookieValue = "";

        for( var i=0; i < cookieStrings.length; i++ )
        {
            cookieString = cookieStrings[i];
            if( cookieString != null )
            {
                cookieString = cookieStrings[i].split('=');
                if( cookieString.length > 0 )
                {
                    try
                    {
                        if( cookieString.length == 2 )
                        {
                            cookieValue = cookieString[1].trim();
                        }
                        cookies.push( {name:cookieString[0].trim(),value:cookieValue} );
                    } catch(e) {
                        // Remove this code after debugging in QA
                        window.status = 'Failed to read cookie for ' + cookieString[0].trim();
                    }
                }
                else
                {
                    cookies.push( {name:cookieString[0].trim(),value:null} );
                }
            }
        }

        return cookies;
    },

    /**
     * Read the specified cookie value.
     * @param {String} name of the cookie value to get
     * @return {String} value of the cookie
     */
    readCookie: function(name)
    {
        var cookies = Figment.Cookies.getAllCookies();
        for( var i=0; i < cookies.length; i++ )
        {
            try
            {
                if( cookies[i].name.toLowerCase() == name.toLowerCase() )
                {
                    return cookies[i].value;
                }
            } catch(e) {}
        }
        return null;
    },

    /**
     * Create a new cookie.
     * @param {String} name     of the cookie
     * @param {String} value    for the new cookie
     * @param {Integer} days    number of days the cookie is valid for.
     * @param {String} domain   the domain for the cookie
     */
    createCookie: function(name, value, days, domain)
    {
        // Store this in an array and then print this back out, joining each
        // element with the ; delimeter
        var cookie = [];

        cookie.push(name + "=" + value);

        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            cookie.push("expires=" + date.toGMTString());
        }

        cookie.push("path=/");

        if (domain) {
            cookie.push("domain=" + domain);
        }

        document.cookie = cookie.join("; ");
    },

    /**
     * Remove an existing cookie
     * @param {String} name the cookie to remove
     */
    removeCookie: function(name)
    {
        Figment.Cookies.createCookie(name,"",-1);
    }
};
Figment.Namespace( "Figment.Date" );

/*
	 Symbol   Meaning                 Presentation        Example 
	 ------   -------                 ------------        ------- 
	 y        year                    (Number)            1996 
	 M        month in year           (Text & Number)     July & 07 
	 d        day in month            (Number)            10 
	 h        hour in am/pm (1~12)    (Number)            12 
	 H        hour in day (0~23)      (Number)            0 
	 m        minute in hour          (Number)            30 
	 s        second in minute        (Number)            55 
	 S        millisecond             (Number)            978 
	 E        day in week             (Text)              Tuesday 
	 D        day in year             (Number)            189 
	 F        day of week in month    (Number)            2 (2nd Wed in July)
	 w        week in year            (Number)            27 
	 W        week in month           (Number)            2 
	 a        am/pm marker            (Text)              PM 
	 k        hour in day (1~24)      (Number)            24 
	 K        hour in am/pm (0~11)    (Number)            0 
	 z        time zone               (Text)              Pacific Standard Time 
	 '        escape for text         (Delimiter) 
	 ''       single quote            (Literal)           ' 
	 
	 The count of pattern letters determine the format.
	 (Text):	4 or more pattern letters--use full form, less than 4--use short 
	 			or abbreviated form if one exists.
	
	 (Number): 	the minimum number of digits. Shorter numbers are zero-padded to 
	 			this amount. Year is handled specially; that is, if the count of 
	 			'y' is 2, the Year will be truncated to 2 digits.
	
	 (Text & Number): 	3 or over, use text, otherwise use number.
	
	 Any characters in the pattern that are not in the ranges of ['a'..'z'] and 
	 ['A'..'Z'] will be treated as quoted text. For instance, characters like  
	 ':', '.', ' ', '#' and '@' will appear in the resulting time text even they
	 are not embraced within single quotes.
	
	 A pattern containing any invalid pattern letter will result in a thrown 
	 exception during formatting or parsing. 
 */

Figment.Date = {
	CONST_WEEKDAYS_SHORT: ["S","M","T","W","T","F","S"],
	CONST_WEEKDAYS_MID: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
	CONST_WEEKDAYS_LONG: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
	CONST_MONTH_SHORT: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
	CONST_MONTHS_LONG: ["January","February","March","April","May","June","July","August","September","October","November","December"],
	
	dateToString: function(date,pattern)
	{
		var tChr;
		var lChr;
		var symbols = [];
		var symbolsCount = [];
		var count = 0;
		var dateString = "";
		
		if( typeof date === 'undefined' || date === null )
		{
			return "";
		}
		if( typeof pattern === 'undefined' || pattern === null )
		{
			return "";
		}
		
		// Splits the pattern into it's different components
		pattern = pattern.split("");
		for( var i=0; i < pattern.length; i++ )
		{
			tChr = pattern[i];
		
			if( typeof lChr !== "undefined" && lChr !== tChr )
			{
				symbols[symbols.length] = lChr;
				symbolsCount[symbolsCount.length] = count;
				count = 0;
			}
			count += 1;
			lChr = tChr;
		}
		symbols[symbols.length] = lChr;
		symbolsCount[symbolsCount.length] = count;
		for( var i=0; i < symbols.length; i++ )
		{
			switch( symbols[i] )
			{
				// year
				case "y":
					switch( symbolsCount[i] )
					{
						case 2:
							dateString += Figment.Date.zeroPaddingNumber( date.getYear()+1900,2,2);
							break;
						default:
							dateString += date.getFullYear();
					}
					break;
				// month in year
				case "M":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getMonth()+1;
							break;
						case 2:
							dateString += Figment.Date.zeroPaddingNumber( date.getMonth()+1,2,2 );
							break;
						case 3:
							dateString += Figment.Date.CONST_MONTHS_SHORT[date.getMonth()];
							break;
						default:
							dateString += Figment.Date.CONST_MONTHS_LONG[date.getMonth()];
					}
					break;
				// day in month
				case "d":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getDate();
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getDate(),2,2 );
					}
					break;
				// hour in am/pm (1~12)
				case "h":
					var iHours = ( date.getHours()+1 > 12 ? (date.getHours()+1)-12 : date.getHours()+1 );
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += iHours;
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( iHours,2,2 );
					}
					break;
				// hour in day (0~23)
				case "H":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getHours();
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getHours(),2,2 );
					}
					break;
				// minute in hour
				case "m":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getMinutes();
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getMinutes(),2,2 );
					}
					break;
				// second in minute
				case "s":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getSeconds();
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getSeconds(),2,2 );
					}
					break;
				// millisecond 
				case "S":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getMilliseconds();
							break;
						case 2:
							dateString += Figment.Date.zeroPaddingNumber( date.getMilliseconds(),2,3 );
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getMilliseconds(),3,3 );
					}
					break;
				// day in week
				case "E":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += Figmnet.Date.CONST_WEEKDAYS_SHORT[date.getDay()];
							break;
						case 2:
							dateString += Figmnet.Date.CONST_WEEKDAYS_MID[date.getDay()].substr(0,2);
							break;
						case 3:
							dateString += Figmnet.Date.CONST_WEEKDAYS_MID[date.getDay()];
							break;
						default:
							dateString += Figmnet.Date.CONST_WEEKDAYS_LONG[date.getDay()];
					}
					break;
				// day in year
				case "D":
					// The day of the year, zero indexed! 0 through 366
		            var t = new Date("January 1 " + date.getFullYear() + " 00:00:00");
		            var diff = date.getTime() - t.getTime();
		            var num = Math.floor(diff/1000/60/60/24);
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += num;
							break;
						case 2:
							dateString += Figment.Date.zeroPaddingNumber( num,2,3 );
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( num,3,3 );
					}
					break;
				// day of week in month
				case "F":
					break;
				// week in year
				case "w":
					var num = Figment.Date.getWeekNumber(date);
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += num;
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( num,2,2 );
					}
					break;
				// week in month
				case "W":
					break;
				// am/pm marker
				case "a":
					var marker = ( date.getHours() >= 12 ? "pm" : "am" );
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += marker.substr(0,1);
							break;
						default:
							dateString += marker;
					}
					break;
				// hour in day (1~24)
				case "k":
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += date.getHours()+1;
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( date.getHours()+1,2,2 );
					}
					break;
				// hour in am/pm (0~11)
				case "K":
					var iHours = ( date.getHours() > 11 ? date.getHours()-11 :  date.getHours() );
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += iHours;
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( iHours,2,2 );
					}
					break;
				// time zone
				case "z":
					var timeZoneOffset = date.getTimezoneOffset();
					switch( symbolsCount[i] )
					{
						case 1:
							dateString += timeZoneOffset;
							break;
						default:
							dateString += Figment.Date.zeroPaddingNumber( timeZoneOffset,2,2 );
					}
					break;
				default:
					dateString += symbols[i];
			}
		}
		
		return dateString;
	},
	
	createDate: function(str)
	{
		if( str !== null )
		{
			var dateParts = str.split('\/');
			str = Figment.Date.correctYear(str);
			var newDate = new Date(str);
			return Figment.Date.add( newDate,"M",1 );
		}
		return null;
	},
	
	correctYear: function(str)
	{
		if( str !== null )
		{
			var dateParts = str.split('\/');
			var year;
			if( dateParts.length === 3 )
			{
				year = dateParts[2];
				if( year.length === 2 )
				{
					// Assume 2000+, so rebuild the date string with 2000+
					str = str.replace( '/' + year,'/20'+year );
				}
			}
		}
		return str;
	},
	
	isValidDate: function(str)
	{
		return (new Date(str) !== null ? true : false );
	},
	
	zeroPaddingNumber: function(value,minDigits,maxDigits)
	{
		var str = "";
		var zeroDigit = 0;
		if( value >= 0 )
		{
			if( value < 100 && minDigits >= 1 && minDigits <= 2 )
			{
			    if( value < 10 )
			    {
					if( minDigits == 2 )
					{
					    str += zeroDigit;
					}
					str += (zeroDigit + value);
			    } else {
					str += (zeroDigit + value / 10);
					str += (zeroDigit + value % 10);
			    }
			    return str;
			}
			else if( value >= 1000 && value < 10000 )
			{
				if( minDigits == 4 )
				{
					str += (zeroDigit + value / 1000);
					value %= 1000;
					str += (zeroDigit + value / 100);
					value %= 100;
					str += (zeroDigit + value / 10);
					str += (zeroDigit + value % 10);
					return str;
			    }
			    if( minDigits == 2 && maxDigits == 2 )
			    {
					return Figment.Date.zeroPaddingNumber(value % 100, 2, 2);
			    }
			}
	    }
	    return null;
	},
	
	add: function(date,field,amount)
	{
		var d = new Date( date.getTime() );
		switch( field )
		{
			case "M":
				var newMonth = date.getMonth() + amount;
				var years = 0;

				if( newMonth < 0 )
				{
					while( newMonth < 0 )
					{
						newMonth += 12;
						years -= 1;
					}
				}
				else if( newMonth > 11 )
				{
					while( newMonth > 11 )
					{
						newMonth -= 12;
						years += 1;
					}
				}
				
				d.setMonth(newMonth);
				d.setFullYear(date.getFullYear() + years);
				break;
			case "D":
				d.setDate(date.getDate() + amount);
				break;
			case "Y":
				d.setFullYear(date.getFullYear() + amount);
				break;
			case "W":
				d.setDate(date.getDate() + (amount * 7));
				break;
		}
		return d;
	},
	
	subtract: function(date,field,amount)
	{
		return Figment.Date.add(date, field, (amount*-1));
	},
	
	getWeekNumber: function(date)
	{
		date.setHours(12,0,0,0);
		var calendarYear = date.getFullYear();
		var weekStartsOn = 0;
		var weekNum = -1;
		var jan1 = new Date(calendarYear,0,1);
		var jan1Offset = jan1.getDay() - weekStartsOn;
		var jan1DayOfWeek = (jan1Offset >= 0 ? jan1Offset : (7 + jan1Offset));
		var endOfWeek1 = Figment.Date.add(jan1,"D",(6 - jan1DayOfWeek));
			endOfWeek1.setHours(23,59,59,999);
		var month = date.getMonth();
		var day = date.getDate();
		var year = date.getFullYear();
		var dayOffset = Figment.Date.getDayOffset(date,calendarYear);
		if( dayOffset < 0 || Figment.Date.before(date,endOfWeek1) )
		{
			weekNum = 1;
		}
		else
		{
			weekNum = 2;
			var weekBegin = new Date(endOfWeek1.getTime() + 1);
			var weekEnd = Figment.Date.add(weekBegin,"W",1);
		
			while( !Figment.Date.between(date,weekBegin,weekEnd) )
			{
				weekBegin = Figment.Date.add(weekBegin,"W",1);
				weekEnd = Figment.Date.add(weekEnd,"W",1);
				weekNum += 1;
			}
		}
				
		return weekNum;
	},
	
	findMonthStart: function(date)
	{
		var start = new Date(date.getFullYear(), date.getMonth(), 1);
		return start;
	},
	
	findMonthEnd: function(date)
	{
		var start = Figment.Date.findMonthStart(date);
		var nextMonth = Figment.Date.add(start,"M",1);
		var end = Figment.Date.subtract(nextMonth,"D",1);
		return end;
	},
	
	getDayOffset: function(date)
	{
		var calendarYear = date.getFullYear();
		var beginYear = new Date(calendarYear,0,1);
		
		var dayOffset = Math.ceil(( date.getTime()-beginYear.getTime()) / (1000*60*60*24) );
		return dayOffset;
	},
	
	before: function(date,compareTo)
	{
		var ms = compareTo.getTime();
		if( date.getTime() <= ms )
		{
			return true;
		}
		else
		{
			return false;
		}
	},

	after: function(date,compareTo)
	{
		var ms = compareTo.getTime();
		if( date.getTime() >= ms )
		{
			return true;
		}
		else
		{
			return false;
		}
	},

	between: function(date,dateBegin,dateEnd )
	{
		if( this.after(date,dateBegin) && this.before(date,dateEnd) )
		{
			return true;
		}
		else
		{
			return false;
		}
	},
	
	compare: function(date1,date2)
	{
		return (Figment.Date.dateToString(date1,'MMddyyyy')===Figment.Date.dateToString(date2,'MMddyyyy'));
	}
};Figment.Namespace( "Figment.DOM" );

(function() {
    var Dom = YAHOO.util.Dom;

	Figment.DOM = {
		getElementById: function( id )
		{
			if( document.all && !document.getElementById )
			{
				return document.all[ id ];
			}
			return document.getElementById( id );
		},
	
		getElementsByTagName: function( strName )
		{
			return document.getElementsByTagName( strName );
		},
	
	
		/**
		 * This is an optimized version for getElementsByClassName.  It is optimized
		 * for Firefox, Safari, and Opera which support XPath.
		 */
		getElementsByClassNameOptimized: function(className, parentElement)
		{
			var arrReturnElements = [];
			if(document.evaluate)
			{
				var query = document.evaluate(".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]", (parentElement || document), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
				var len = query.snapshotLength;
				for( var i=0; i < len; i++)
				{
					arrReturnElements.push(query.snapshotItem(i));
				}
			}
			else
			{
				var arrElements = ( parentElement.getElementsByTagName ) ? parentElement.getElementsByTagName( '*' ) : document.all;
				var elements = []
				var len = arrElements.length;
				for( var i=0; i < len; i++)
				{
					var childElement = arrElements[i];
					if(Figment.DOM.hasClassName(childElement, className))
					{
						arrReturnElements.push(childElement);
					}
				}
			}
			return arrReturnElements;
		},
		
		/**
		 * Ways of calling the function now are:
		 *
		 *	To get all the elements in the document with a ?listItem? class.
	    *		Figment.DOM.getElementsByClassName( 'listItem' );
	    *
		 *	To get all a elements in the document with a ?info-links? class.
	    *		Figment.DOM.getElementsByClassName( 'info-links','a');
	    *
		 *	To get all div elements within the element named ?container?, with a
		 *	?col? and a ?left? class.
		 *		Figment.DOM.getElementsByClassName( ['col','left'],Figment.DOM.getElementById( 'container' ),'div' );
		 *
		 *	Note: You can still use a string when only looking for a single class
		 *	name, but an array when looking for multiple class names.
		 */
		getElementsByClassName: function( oClassNames,oElm,strTagName )
		{
			if( arguments.length < 2 )
			{
				oElm = document.documentElement;
			}
			if( (typeof oClassNames).toLowerCase() === "string" && arguments.length < 3 )
			{
				return Figment.DOM.getElementsByClassNameOptimized(oClassNames,oElm);
			}
			if( arguments.length < 3 )
			{
				strTagName = '*';
			}
			var arrReturnElements = [];
			var arrElements = ( oElm.getElementsByTagName ) ? oElm.getElementsByTagName( strTagName ) : document.all;
			var arrRegExpClassNames = [];
			if( typeof oClassNames === 'object' )
			{
				for( var i=0; i < oClassNames.length; i++ )
				{
					arrRegExpClassNames.push( new RegExp( "(^|\\s)" + oClassNames[i].replace( /\-/g,'\\-') + "(\\s|$)" ) );
				}
			} else {
				arrRegExpClassNames.push( new RegExp( "(^|\\s)" + oClassNames.replace( /\-/g,'\\-' ) + "(\\s|$)" ) );
			}
			var oElement;
			var bMatchesAll;
			for( var j=0; j < arrElements.length; j++ )
			{
				oElement = arrElements[j];
				bMatchesAll = true;
				for( var k=0; k < arrRegExpClassNames.length; k++ )
				{
					if( !arrRegExpClassNames[k].test( oElement.className ) )
					{
						bMatchesAll = false;
						break;
					}
				}
				if( bMatchesAll )
				{
					arrReturnElements.push( oElement );
				}
			}
			return( arrReturnElements );
		},
	
		getX: function( element )
		{
			var curleft = 0;
			if( element.offsetParent )
			{
				while(1)
				{
					curleft += element.offsetLeft;
					if( !element.offsetParent )
					{
						break;
					}
					element = element.offsetParent;
				}
			}
			else if( element.x )
			{
				curleft += element.x;
			}
			return curleft;
		},
	
		getY: function( element )
		{
			var curtop = 0;
			if( element.offsetParent )
			{
				while(1)
				{
					curtop += element.offsetTop;
					if( !element.offsetParent )
					{
						break;
					}
					element = element.offsetParent;
				}
			}
			else if( element.y )
			{
				curtop += element.y;
			}
			return curtop;
		},
	
		getOuterHTML: function( element )
		{
			var strXML = "";
			if( element.nodeType === 1 )
			{
				strXML += "<" + element.nodeName.toLowerCase();
				var attrib;
				var attribsLength = element.attributes.length;
				for( var j=0; j < attribsLength; j++ )
				{
					attrib = element.attributes[j];
					if( attrib.nodeName !== "title" && attrib.nodeValue !== null && attrib.nodeValue.length > 0 )
					{
						strXML += ' ' + attrib.nodeName.toLowerCase() + '="' + attrib.nodeValue + '"';
					}
				}
				strXML += ">";
				var elem;
				var elemChildNodesLength = element.childNodes.length;
				for( var i=0; i < elemChildNodesLength; i++ )
				{
					elem = element.childNodes[i];
					strXML += Figment.DOM.getOuterHTML( elem );
				}
				strXML += "</" + element.nodeName.toLowerCase() + ">";
	
			} else if( element.nodeType === 3 ) {
				strXML += element.nodeValue;
			}
			return strXML;
		},
	
		getInnerHTML: function( element )
		{
			var strXML = "";
			var elem = null;
			var elemChildNodesLength = element.childNodes.length;
			for( var i=0; i < elemChildNodesLength; i++ )
			{
				elem = element.childNodes[i];
				if( elem.nodeType === 1 )
				{
					strXML += "<" + elem.nodeName;
					var attrib;
					var attribsLength = element.attributes.length;
					for( var j=0; j < attribsLength; j++ )
					{
						attrib = element.attributes[j];
						strXML += ' ' + attrib.nodeName + '="' + attrib.nodeValue + '"';
					}
					strXML += ">";
					if( elem.childNodes.length > 0 )
					{
						strXML += Figment.DOM.getInnerHTML( elem );
					}
					strXML += "</" + elem.nodeName + ">";
	
				} else if( elem.nodeType === 3 ) {
					strXML += elem.nodeValue;
				}
			}
			return strXML;
		},
	
		getFirstChildElement: function( parentNode )
		{
			if( parentNode && parentNode.nodeType === 1 && parentNode.hasChildNodes )
			{
				var firstChildNode = parentNode.firstChild;
				if( firstChildNode !== null && firstChildNode.nodeType === 3 )
				{
					var numberOfChildNodes = parentNode.childNodes.length;
					for( var i=0; i < numberOfChildNodes; i++ )
					{
						firstChildNode = parentNode.childNodes[i];
						if( firstChildNode.nodeType === 1 )
						{
							return firstChildNode;
						}
					}
				}
				return firstChildNode;
			}
		},
	
		getPreviousSibling: function( parentNode )
		{
			if( parentNode && parentNode.nodeType === 1 )
			{
				var previousSiblingNode = parentNode.previousSibling;
				if( previousSiblingNode !== null && previousSiblingNode.nodeType === 3 )
				{
					previousSiblingNode = previousSiblingNode.previousSibling;
				}
				if( previousSiblingNode !== null && previousSiblingNode.nodeType !== 1 )
				{
					previousSiblingNode = null;
				}
				return previousSiblingNode;
			}
			return null;
		},
	
		getLastChildElement: function( parentNode )
		{
			if( parentNode && parentNode.nodeType === 1 )
			{
				var lastChildNode = parentNode.lastChild;
				if( lastChildNode.nodeType === 3 )
				{
					var numberOfChildNodes = parentNode.childNodes.length;
					for( var i=numberOfChildNodes; i===0; i-- )
					{
						lastChildNode = parentNode.childNodes[1];
						if( lastChildNode.nodeType === 1 )
						{
							break;
						}
					}
				}
				if( lastChildNode.nodeType !== 1 )
				{
					lastChildNode = null;
				}
				return lastChildNode;
			}
			return null;
		},
	
		getNextSibling: function( parentNode )
		{
			if( parentNode && parentNode.nodeType === 1 )
			{
				var nextSiblingNode = parentNode.nextSibling;
				if( nextSiblingNode !== null && nextSiblingNode.nodeType === 3 )
				{
					nextSiblingNode = nextSiblingNode.nextSibling;
				}
				if( nextSiblingNode !== null && nextSiblingNode.nodeType !== 1 )
				{
					nextSiblingNode = null;
				}
				return nextSiblingNode;
			}
			return null;
		},
	
		getElementsBySelector: function( selector )
		{
			var i = 0;
			var selid = "";
			var selclass = "";
			var tag = selector;
			var f = 0;
			var s = [];
			var objlist = [];
			var fs = null;
			var v = null;
	
			if( selector.indexOf( ' ' ) > 0 )
			{  //descendant selector like "tag#id tag"
				s = selector.split( ' ' );
				fs=s[0].split( '#' );
				if( fs.length==1 ){ return objlist; }
				f=document.getElementById( fs[1] );
				if( f ){ return( f.getElementsByTagName( s[1] ) ); }
				return objlist;
			}
			if( selector.indexOf( '#' ) > 0 )
			{ //id selector like "tag#id"
				s = selector.split( '#' );
				tag = s[0];
				selid = s[1];
			}
			if( selid !== '' )
			{
				f = document.getElementById( selid );
				if( f ){ objlist.push( f ); }
				return objlist;
			}
			if( selector.indexOf( '.' ) > 0 )
			{  //class selector like "tag.class"
				s = selector.split( '.' );
				tag = s[0];
				selclass = s[1];
			}
			v = document.getElementsByTagName( tag );  // tag selector like "tag"
			if( selclass === '' ){ return v; }
			for( i=0; i < v.length; i++ )
			{
				if( v[i].className.indexOf( selclass ) >= 0 )
				{
					objlist.push( v[i] );
				}
			}
			return objlist;
		},
	
		hasClassName: function( element,classNameToCheck )
		{
			var listOfClasses;
			if( element !== null && element.nodeType === 1 )
			{
				listOfClasses = element.className.split(" ");
				return listOfClasses.contains(classNameToCheck);
			}
			return false;
		},
	
		addClassName: function( element,classNameToAdd )
		{
			var listOfClasses = [];
			if( element !== null && element.nodeType === 1 )
			{
				listOfClasses = element.className.split(' ');
				listOfClasses.push(classNameToAdd);
				element.className = listOfClasses.join(' ');
			}
			listOfClasses.clear();
		},
	
		removeClassName: function( element,classNameToRemove )
		{
			var listOfClasses = [];
			if( element !== null && element.nodeType === 1 )
			{
				listOfClasses = element.className.split(' ');
				listOfClasses.remove(classNameToRemove);
				element.className = listOfClasses.join(' ');
			}
			listOfClasses.clear();
		},
	
		replaceClassName: function( element,classNameToReplace,classNameToPlace )
		{
			if( element !== null && element.nodeType === 1 )
			{
				if(Figment.DOM.hasClassName(element,classNameToReplace))
				{
					element.className = element.className.replace(classNameToReplace,classNameToPlace);
				}
				else if(!Figment.DOM.hasClassName(element,classNameToPlace))
				{
					Figment.DOM.addClassName(element,classNameToPlace);
				}
			}
		},
		
		showElement: function( elementToShowId )
		{
			var theElem = document.getElementById(elementToShowId);
			if(theElem != null) {
				theElem.style.visibility = "visible";
			}
		},
		
		hideElement: function( elementToHideId )
		{
			var theElem = document.getElementById(elementToHideId)
			if(theElem != null) {
				theElem.style.visibility = "hidden";
			}
		},
		
		setRelativePos: function( elementToPosId ) {
			var theElem = document.getElementById(elementToPosId);
			if(theElem != null) {
				theElem.style.position = "relative";
			}
		},
		
		setAbsolutePos: function(elementToPosId) {
			var theElem = document.getElementById(elementToPosId);
			if(theElem != null) {
				theElem.style.position = "absolute";
			}
		},
		
		insertNodeBefore: function(elementToAdd,elementToAddBefore)
		{
			elementToAddBefore.parentNode.insertBefore(elementToAdd,elementToAddBefore);
		},
		
		insertNodeAfter: function(elementToAdd,elementToAddAfter)
		{
			if( elementToAddAfter.nextSibling )
			{
				elementToAddAfter.parentNode.insertBefore(elementToAdd,elementToAddAfter.nextSibling);
			}
			else
			{
				elementToAddAfter.parentNode.appendChild(elementToAdd);
			}
		},
		
		removeChildNodes: function(node)
		{
			if( node !== null )
			{
				while( node.childNodes[0] )
				{
					node.removeChild(node.childNodes[0]);
				}
			}
		},
		
		getModule: function(currentElement)
		{
			while( currentElement !== null )
			{
				if( currentElement.nodeType === 1 && currentElement.nodeName.toLowerCase() === 'div' && Figment.DOM.hasClassName(currentElement,'module') )
				{
					return currentElement;
				}
				if( currentElement.parentNode )
				{
					currentElement = currentElement.parentNode;
				}
				else
				{
					currentElement = null;
				}
			}
	
			return currentElement;
		},
		
		getRealModuleName: function(module)
		{
			var moduleFields = Figment.DOM.getElementsByClassName('moduleFields');
			var moduleField = null;
			var moduleList;
			var moduleName;
			var realModuleName = null;
			
			if( moduleFields !== null )
			{
				moduleField = moduleFields[0];
				moduleList = moduleField.value.split(",");
				for( var i=0; i < moduleList.length; i++ )
				{
					moduleName = moduleList[i];
					if( moduleName.endsWith(module.id) )
					{
						realModuleName = moduleName;
						break;
					}
				}
			}
			
			return realModuleName;
		},
		
		/**
		 * Returns the horizontal scroll location of the top of the viewport in px
		 * @public
		 */
		getViewportX: function()
		{
			var x;
			if( self.pageYOffset )
				// all except Explorer
			{
				x = self.pageXOffset;
			}
			else if( document.documentElement && document.documentElement.scrollTop )
				// Explorer 6 Strict
			{
				x = document.documentElement.scrollLeft;
			}
			else if (document.body )
				// all other Explorers
			{
				x = document.body.scrollLeft;
			}
			return x;
		},
	
		/**
		 * Returns the vertical scroll location of the top of the viewport in px
		 * @public
		 */
		getViewportY: function()
		{
			var y;
			if( self.pageYOffset )
				// all except Explorer
			{
				y = self.pageYOffset;
			}
			else if( document.documentElement && document.documentElement.scrollTop )
				// Explorer 6 Strict
			{
				y = document.documentElement.scrollTop;
			}
			else if( document.body )
				// all other Explorers
			{
				y = document.body.scrollTop;
			}
			return y;
		},
		
		getBounds: function(element)
		{
			var iebody = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
			var dsocleft = document.all? this.iebody.scrollLeft : pageXOffset;
			var dsoctop = document.all? this.iebody.scrollTop : pageYOffset;
	
			var posReal = Figment.DOM.getRealOffset(element);
			var pos = Figment.DOM.getCumulativeOffset(element);
		
			var top =  pos[1] - posReal[1] + dsoctop;
			var left = pos[0] + posReal[1] - dsocleft;
			
			var offsetWidth = element.offsetWidth;
			var offsetHeight = element.offsetHeight;
		
			return {left: left, top: top, width: offsetWidth, height: offsetHeight};
		},
		
		getRealOffset: function(element)
		{
			var valueT = 0, valueL = 0;
			do {
				valueT += element.scrollTop  || 0;
				valueL += element.scrollLeft || 0;
				element = element.parentNode;
			} while (element);
			return [valueL, valueT];
		},
		
		getCumulativeOffset: function(element) {
			var valueT = 0, valueL = 0;
			do {
				valueT += element.offsetTop  || 0;
				valueL += element.offsetLeft || 0;
				element = element.offsetParent;
			} while (element);
			return [valueL, valueT];
		},
		
		/**
	     * 
	     */
	    findForm: function(currentElement)
	    {
	        while( typeof currentElement !== 'undefined' && currentElement !== null )
	        {
	            if( currentElement.nodeType === 1 && currentElement.nodeName.toLowerCase() === 'form' )
	            {
	                return currentElement;
	            }
	            if( currentElement.parentNode )
	            {
	                currentElement = currentElement.parentNode;
	            }
	            else
	            {
	                currentElement = null;
	            }
	        }
	
	        return currentElement;  
	    },
	    
	    findNodeOrParent: function(currentElement,tagName,className)
	    {
	        while( typeof currentElement !== 'undefined' && currentElement !== null )
	        {
	            if( currentElement.nodeType === 1 && currentElement.nodeName.toLowerCase() === tagName && Dom.hasClass(currentElement,className) )
	            {
	                return currentElement;
	            }
	            if( currentElement.parentNode )
	            {
	                currentElement = currentElement.parentNode;
	            }
	            else
	            {
	                currentElement = null;
	            }
	        }
	
	        return currentElement;
	    }
	};
})();Figment.Namespace("Figment.HashTable");

// Make capable of being multi-instanced
Figment.HashTable = Figment.Class();
Figment.HashTable.prototype = {
	/**
	 * Hashtable constructor
	 */
	initialize: function()
	{
		// Initialize the hash table
		this.hash = [];
		this.keys = [];
	},
	
	/**
	 * Clears this hashtable so that it contains no keys.
	 */
	clear: function()
	{
		this.hash = [];
		this.keys = [];
	},
	
	/**
	 * Tests if the specified object is a key in this hashtable.
	 */
	containsKey: function(key)
	{
		var str = this.keys.join(";");
		return( str.indexOf(key) > -1 ? true : false );
	},
	
	/**
	 * Returns true if this Hashtable maps one or more keys to this value.
	 */
	containsValue: function(value)
	{
		var hashLength = this.hash.length;
		for( var i=0; i < hashLength; i++ )
		{
			if( value === this.hash[i] )
			{
				return true;
			}
		}
		return false;
	},
	
	/**
	 * Returns the value to which the specified key is mapped in this hashtable.
	 */
	get: function(key)
	{
		var value = null;
		if( typeof this.hash[key] !== "undefined" || this.hash[key] !== null )
		{
			value = this.hash[key];
		}
		return value;
	},
	
	/**
	 * Tests if this hashtable maps no keys to values.
	 */
	isEmpty: function()
	{
		return( this.keys.length > 0 ? false : true );
	},
	
	/**
	 * Maps the specified key to the specified value in this hashtable.
	 */
	put: function(key,value)
	{
		if( value === null )
		{
			return;
		}
		if( typeof this.hash[key] === "undefined" || this.hash[key] === null )
		{
			this.keys[this.keys.length] = key;
		}
		this.hash[key] = value;
	},
	
	/** Places all of the elements of one hash table into this one.  These
	 * mappings will replace any mappings that this Hashtable had for any of
	 * the keys currently in the specified HashTable.
	 *
	 * @author K. Adam Christensen @since 3.1.0
	 */
	putAll: function(hashTable) {
		var iterator = hashTable.iterator();
		var field;
		while(iterator.hasNext()) {
			field = iterator.next();
			this.put(field.key, field.value);
		}
	},

	/**
	 * Removes the key (and its corresponding value) from this hashtable.
	 */
	remove: function(key)
	{
		var keyLength = this.keys.length;
		var removedObject = null;
		for( var i=0; i < keyLength; i++ )
		{
			if( key === this.keys[i] )
			{
				removedObject = this.hash[this.keys[i]];
				this.hash[this.keys[i]] = null;
				this.keys.splice(i ,1);
			}
		}
		return removedObject;
	},
	
	/**
	 * Returns the number of keys in this hashtable.
	 */
	size: function()
	{
		return this.keys.length;
	},
	
	/**
	 * Returns a string representation of this Hashtable object in the form of 
	 * a set of entries, enclosed in braces and separated by the ASCII
	 * characters ", " (comma and space).
	 */
	toString: function()
	{
		var keysLength = this.keys.length;
		var s = new Array(keysLength);
		s[s.length] = "{";
		try
		{	
			for( var i=0; i < keysLength; i++ )
			{
				s[s.length] = this.keys[i];
				s[s.length] = "=";
				var v = this.hash[this.keys[i]];
				if( v )
				{
					s[s.length] = v.toString();
				}
				else
				{
					s[s.length] = v;
				}

				if( i != this.keys.length-1)
				{
					s[s.length] = ", ";
				}
			}
		}
		catch(e){}
		finally
		{
			s[s.length] = "}";
		}
		
		return s.join("");
	},
	
	/**
	 * Returns a Collection view of the values contained in this Hashtable.
	 */
	values: function()
	{
		return this.hash;
	},
	
	/**
	 * Get iterator for this hash table
	 */
	iterator: function()
	{
		return new Figment.HashTable.Iterator(this.keys,this.hash);
	}
};

Figment.HashTable.Iterator = Figment.Class();
Figment.HashTable.Iterator.prototype = {
	/**
	 * Constructor
	 */
	initialize: function(keys,hash)
	{
		this.location = -1;
		this.keys = keys;
		this.hash = hash;
	},

	/**
	 * Gets whether or not there is another item in the hash table
	 */
	hasNext: function()
	{
		return( ++this.location < this.keys.length ? true : false );
	},
	
	/**
	 * Returns the next key/value pair in the hashtable
	 */
	next: function()
	{
		return( {key: this.keys[this.location], value:this.hash[this.keys[this.location]], toString:function(){return this.key + "=" + this.value } } )
	}
};
Figment.Namespace('Figment.Net.Request');

/**
 * Makes it possible to send HTTP requests in the background without requiring a
 * traditional HTTP request via the browser.  Also known as AJAX.
 * 
 * @constructor
 * @version 1.0.0
 * @member Figment
 * @fileoverview  	Makes it possible to send HTTP requests in the background 
 * 					without requiring a traditional HTTP request via the 
 * 					browser.  Also known as AJAX.
 *	@requires Figment
 */
Figment.Net.Request = Figment.Class();
Figment.Net.Request.prototype = {
	/**
	 * Initializes the class with default values.
	 * @private
	 */
	initialize: function()
	{
        this.request = null;
        this.response = null;
		this.options = new Figment.Net.Request.Options();
	},
	
	/**
	 * Sends the HTTP request to the specified URL using the either the default
	 * options or the ones set previous to this call.
	 * @param {String} url of the server to send the request to.
	 */
	send: function(url)
	{
		var postVars = null,
            isAsync = this.getOptions().getUseCallbacks();

        if (!isAsync) {
            // YUI doesn't do sync requests, so use the old-fashoned way
            this.http = Figment.Try( function(){ return new window.ActiveXObject( 'Msxml2.XMLHTTP' ); },function(){ return new window.ActiveXObject( 'Microsoft.XMLHTTP' ); },function(){ return new window.XMLHttpRequest(); } ) || false;
            this.http.open(this.options.method.toUpperCase(),url,false);
        }

		switch( this.options.method.toLowerCase() )
		{
			case "get":
				url += "?" + this.options.params.join('&');
				break;
			case "post":
				postVars = this.options.params.join('&');
				this.addHeader('Content-Type','application/x-www-form-urlencoded');
				break;
		}

		this.addHeader('User-Agent',navigator.userAgent + " via XMLHttpRequest/JavaScript Figment/1.0.0");
        this.setHeaders();
        
        if(isAsync) {
            var callback = 
            {
                success: function(o){o.argument.response = o; ( o.argument.options.callbacks.complete || Figment.EmptyFunction )(o.argument); },
                failure: function(o){o.argument.response = o; ( o.argument.options.callbacks.failed || Figment.EmptyFunction )(o.argument); },
                argument: this
            };

            // Send the HTTP request
            this.request = YAHOO.util.Connect.asyncRequest(this.options.method.toUpperCase(), url, callback, postVars);
        } else {
            this.http.send(postVars);
            this.response = this.http;
        }
	},
		
	/**
	 * Whether or not the HTTP request was successful.
	 * @return {Boolean}
	 */
	wasSuccessful: function()
	{
        return this.response.status === undefined || this.response.status === 0 || (this.response.status >= 200 && this.response.status < 300);
	},
	
	/**
	 * Get the response to the HTTP request as plain text.
	 * @return {String}
	 */
	getResponseText: function()
	{
		if( this.wasSuccessful() )
		{
			return this.response.responseText;
		}
	},
	
	/**
	 * Get the response to the HTTP request as XML.
	 * @return {XMLDocument}
	 */
	getResponseXML: function()
	{
		if( this.wasSuccessful() )
		{
			var xmlDoc = this.response.responseXML;
			/* Fix IE to return an XMLDocument that has been parsed correctly */
			if( window.ActiveXObject )
			{
				xmlDoc = new window.ActiveXObject( 'Microsoft.XMLDOM' );
				xmlDoc.async = 'false';
				xmlDoc.loadXML( this.getResponseText() );
			}
			return xmlDoc;
		}
	},
	
	/**
	 * Adds the headers from the options to the HTTP request object.  This occurs
	 * after the connection is opened but before the request is sent.
	 * @private
	 */
	setHeaders: function()
	{
		var i;
		var header;
		
        YAHOO.util.Connect.resetDefaultHeaders();
        YAHOO.util.Connect.setDefaultPostHeader(false);

        for( i=0; i < this.options.headers.length; i++ )
        {
            header = this.options.headers[i];
            if (this.http) {
				this.http.setRequestHeader(header.name,header.value);
            } else {
                YAHOO.util.Connect.initHeader(header.name, header.value);
            }
        }
		delete header;
	},
	
	/**
	 * Shortcut method to add a new HTTP header to the HTTP request.
	 * @param {String} name of the header.
	 * @param {String} value of the header.
	 */
	addHeader: function(name,value)
	{
        this.options.headers.push({name:name,value:value});
	},
	
	/**
	 * Shortcut method to add a new GET or POST HTTP parameter to the HTTP request.
	 * @param {String} name of the parameter.
	 * @param {String} value of the parameter.
	 */
	addParameter: function(name,value)
	{
		this.options.params.push(name + "=" + value);
	},
	
	/**
	 * Get the current options set for this HTTP request.
	 * @return {Figment.Net.Request.Options}
	 */
	getOptions: function()
	{
		return this.options;
	},
	
	/**
	 * Set the call back method to execute when the HTTP request has completed.
	 * @param {Function} callBack
	 */
	setCompleteCallBack: function(callBack)
	{
		var me = this.options.callbacks.complete;
		if( typeof callBack !== "undefined" && callBack !== null )
		{
			this.options.callbacks.complete = function(objWebRequest)
			{
				me.call(this,objWebRequest);
				callBack(objWebRequest);
			};
		}
	},
    
    /**
	 * Set the call back method to execute when the HTTP request has failed.
	 * @param {Function} callBack
	 */
	setFailedCallBack: function(callBack)
	{
		var me = this.options.callbacks.failed;
		if( typeof callBack !== "undefined" && callBack !== null )
		{
			this.options.callbacks.failed = function(objWebRequest)
			{
				me.call(this,objWebRequest);
				callBack(objWebRequest);
			};
		}
	}
};

/**
 * Holds the options for the Request class.  This includes whether or not the
 * HTTP request with be asynchronous or not, what headers and/or parameters need 
 * to be sent with the request, and what type of HTTP call it will be.
 * 
 * @constructor
 * @version 1.0.0
 * @member Figment.Net.Request
 */
Figment.Net.Request.Options = Figment.Class();
Figment.Net.Request.Options.prototype = {
	/**
	 * Initializes the class with default values.
	 * @private
	 */
	initialize: function()
	{
		this.method = 'get';
		this.async = true;
		this.headers = [];
		this.params = [];
		this.callbacks = {
			start: 		Figment.EmptyFunction,
			open:		Figment.EmptyFunction,
			sent: 		Figment.EmptyFunction,
			data: 		Figment.EmptyFunction,
			complete: 	Figment.EmptyFunction,
            failed:     Figment.EmptyFunction
		};
	},
	
	/**
	 * Change the method of the HTTP request.
	 * @param {String} method 	can be either "post" or "get"
	 */
	setMethod: function(method)
	{
		this.method = method;
	},
	
	/**
	 * Get the current method of the HTTP request.
	 * @return {String} either "post" or "get"
	 */
	getMethod: function()
	{
		return this.method;
	},
	
	/**
	 * Set whether or not this HTTP request should be asynchronous, allowing 
	 * other actions to occur while the request processes, or synchronous, which 
	 * blocks all other actions on the page until the call is complete.
	 * @param {Boolean} async 	true for asynchronous requests or false for 
	 * 							synchronous
	 */
	setUseCallbacks: function(async)
	{
		this.async = async;
	},
	
	/**
	 * Get whether or not this HTTP request is waiting for call backs 
	 * (asynchronous) or blocking (syncronous).
	 * @return {Boolean}
	 */
	getUseCallbacks: function()
	{
		return this.async;
	},
	
	/**
	 * Get the current headers to send for this HTTP request.
	 * @return {Array[]}
	 */
	getHeaders: function()
	{
		return this.headers;
	},
	
	/**
	 * Get the current parameters to send for this HTTP request.
	 * @return {Array[]}
	 */
	getParams: function()
	{
		return this.params;
	},
	
	/**
	 * Get the callbacks that are set to fire at different times during the HTTP
	 * request
	 * @return {Object}
	 */
	getCallBacks: function()
	{
		return this.callbacks;
	},
	
	/**
	 * Override the default toString() to return a nicer output of this class.
	 * @return {String}
	 */
	toString: function()
	{
		var str = "";
		var param = null;
		for( param in this )
		{
			if( (typeof this[param]).toLowerCase() !== 'function' )
			{
				if( str.length > 0 )
				{
					str += ', ';
				}
				str += param + "=" + this[param];
			}
		}
		return ('{' + str + '}');
	}
};
/**
 *	Copyright (c) 2006 Walt Disney Internet Group.  All Rights Reserved.
 *	#############################################################################
 *	#	WINDOW  MODULE (Module to extend the JavaScript Core)		 				 #
 *	#############################################################################
 *
 *  This script adds common WINDOW manipulation scripts to the CORE library. This will provide a consistenant
 *	interface to open and manipulate windows. This file includes TWO (2) types of Window calls. One, the Core.Window
 *	doesn't require instantating and object. Just a simple Core.Window.open that opens up a single window. Properties can
 *	be changed via javascript to accomadate this change. The second it the Core.WindowObj call. This allows for multiple
 *	Window objects to be instantiated and manipulated via javascript.
 *
 *	@author 		Aarron Szalacinski, <aaron.x.szalacinski.-nd@dig.com>
 *	@version 	1.0.0	11/25/2005
 *
 *	$File: //p4-wdpro/Projects/Sites/Development/IBCWDWSite/6.13/wwwroot/js/_framework/Figment.Window.js $
 *	$Author: rlune $
 *	$Revision: #1 $
 *	$Date: 2010/01/27 $
 *	$Change: 633338 $
 *	#############################################################################
 */
Figment.Namespace( 'System' );

Figment.Window = {
	width : 800,
	height : 600,
	directories : true,
	location :  true,
	menubar : true,
	resizable : true,
	scrollbars : true,
	status : true,
	toolbar : true,
	url : "",
	name : 'childOpen',
	popup : false,
	
	/**
	*	open(url)
	*	Opens a full window with all features on
	*	can be used two ways. By calling a specific url and letting the script handle everything with default settings
	*	or can be called as an object, turning on properies by defining before they are called
	*/
 	open: function (url)
	{
		var tUrl;
		var featureString;
		
		if( !this.popup )
		{
			// not being used as a pop up
			featureString = "width=" + this.width + ",height=" + this.height + ",directories=" + this.winParamCheck( this.directories ) + ",location=" + this.winParamCheck( this.location ) + ",menubar=" + this.winParamCheck( this.menubar ) + ",resizable=" + this.winParamCheck( this.resizable ) + ",scrollbars=" + this.winParamCheck( this.scrollbars ) + ",status=" + this.winParamCheck( this.status ) + ",toolbar=" + this.winParamCheck( this.toolbar );
		} else {
			featureString = "width=" + this.width + ",height=" + this.height;
		}
		
		if( url !== null || url !== 'undefined' || url !== "")
		{
			tUrl = url;
		} else {
			tUrl = this.url;
		}
		return window.open( tUrl,this.name,featureString );
	},
	
	close: function() 
	{
		window.close();
	},
	
	/**
	*	winParamCheck(param)
	*	sets window param properly for building string out
	*/
	winParamCheck: function( param )
	{
		if( param === true || param === 'true' || param === 1 || param === '1')
		{
			return 1;
		} else {
			return 0;
		}
	},
	
	/**
	*	getScreenHeight()
	*	returns the users screen height minus the taskbar
	*/
	getScreenHeight: function()
	{
		return window.screen.availHeight;
	},
	
	/**
	*	getScreenWidth()
	*	returns the users screen width
	*/
	getScreenWidth: function()
	{
		return window.screen.availWidth;
	}
 };
 
Figment.Window.WindowObject = Figment.Class();
Figment.Window.WindowObject.prototype = {	
	initialize: function()
	{
		this.width = 800;
		this.height = 600;
		this.directories = true;
		this.location =  true;
		this.menubar = true;
		this.resizable = true;
		this.scrollbars = true;
		this.status = true;
		this.toolbar = true;
		this.url = 'http://www.cnn.com';
		this.name = 'childOpen';
		this.popup = false;
		this.xCor = 0;
		this.yCor = 0;
	},
		
	
	/**
	*	open(url, xCor, yCor)
	*	Opens a full window with all features on
	*	can be used two ways. By calling a specific url and letting the script handle everything with default settings
	*	or can be called as an object, turning on properies by defining before they are called
	* 	@ param OPTIONAL - the first parameter is optional but must be called if one is to call the second or third parameter. Defines the url to be called
	*	@ param OPTION - can only be called if the first parameter was called... defines the X corridnate of where the window appears
	*	@ param OPTIONAL - can only be called if the first and second parameter are called... defines the Y corridnate of where the window appears...
	*	See example WindowSample.html located in ../../../system/debug/html for a working example
	*/
 	open: function( urlPassed,xCor,yCor )
	{
		var tUrl;
		var featureString;
		var txCor;
		var tyCor;
		var tempArg;
		var tempArgB;
		
		if( !this.popup )
		{
			// not being used as a pop up
			featureString = "width=" + this.width + ",height=" + this.height + ",directories=" + Figment.Window.winParamCheck( this.directories ) + ",location=" + Figment.Window.winParamCheck( this.location ) + ",menubar=" + Figment.Window.winParamCheck( this.menubar ) + ",resizable=" + Figment.Window.winParamCheck( this.resizable ) + ",scrollbars=" + Figment.Window.winParamCheck( this.scrollbars ) + ",status=" + Figment.Window.winParamCheck( this.status ) + ",toolbar=" + Figment.Window.winParamCheck( this.toolbar );
		} else {
			featureString = "width=" + this.width + ",height=" + this.height;
		}
		
		switch( arguments.length )
		{
			case 0:
			case 1:
				if( typeof arguments[0] === 'string' )
				{
					tUrl = arguments[0];
				} else {
					tUrl = this.url;
				}
				txCor = this.xCor;
				tyCor = this.yCor;
				break;
			case 2:
				if( typeof arguments[0] === 'string' )
				{
					tUrl = arguments[0];
				} else {
					tUrl = this.url;
				}
				
				tempArg = parseInt( arguments[1],null );
				if( typeof tempArg === 'number' && tempArg > 0 )
				{
					txCor = parseInt( arguments[1],null );
				} else {
					txCor = this.xCor;
				}
				tyCor = this.tyCor;	
				break;
			case 3:
				if( typeof arguments[0] === 'string' )
				{
					tUrl = arguments[0];
				} else {
					tUrl = this.url;
				}
				
				tempArg = parseInt( arguments[1],null );
				if( typeof tempArg === 'number' && tempArg > 0 )
				{
					txCor = parseInt( arguments[1],null );
				} else {
					txCor = this.xCor;
				}
				
				tempArgB = parseInt( arguments[2],null );
				if( typeof tempArgB === 'number' && tempArgB > 0 )
				{
					tyCor = parseInt( arguments[2],null );
				} else {
					tyCor = this.yCor;
				}
				break;
			default:
				tUrl = this.url;
				txCor = this.xCor;
				tyCor = this.yCor;
				break;
		}
						
		var thisWindow = window.open( tUrl,this.name,featureString );
		if( txCor > 0 || tyCor > 0 )
		{
			try {
				thisWindow.moveTo( txCor,tyCor );
			} catch (error){
				// Prevents Access Denied Error In IE
				// This occurs when we try to move a window that's location is a domain other than ours.
			}
		}
	},

	/**
	*	close()
	*	closes containing window
	*/
	close: function() 
	{
		window.close();
	}	
};Figment.Namespace("Figment.Form");

Figment.Form = {
    TMP_BACKUP_FORM_HANDLERS: [],

    /*find associated form that this element belongs to*/
    findForm: function(currentElement)
    {
        while( currentElement !== null )
        {
            if( currentElement.nodeType === 1 && currentElement.tagName.toLowerCase() === 'form' )
            {
                return currentElement;
            }
            if( currentElement.parentNode )
            {
                currentElement = currentElement.parentNode;
            }
            else
            {
                currentElement = null;
            }
        }

        return currentElement;
    },
    //Helper to add either an array of inputs or a single input element to a form
    addInputsToForm: function(form,inputObjects){
        var tempElement;
        var n;
        var i;
        var l;
        var inputElemArr;
        var inputAttr;

        if(inputObjects.length)
        {
          l = inputObjects.length;
          for(i=0;i<l;i++){
            inputAttr = inputObjects[i];

            if (inputAttr!=null) {
                 inputElemArr = document.getElementsByName(inputAttr.name);
                 //prevent duplicate form fields
                if (inputElemArr.length === 1) {
                     tempElement = inputElemArr[0];
                }
                else {
                    tempElement = document.createElement("INPUT");
                }
                for (n in inputAttr ) {
                    if (inputAttr.hasOwnProperty(n)) {
                        if(n.toLowerCase() == 'class'){
                            tempElement.className =  inputAttr[n];
                        }else{
                            tempElement.setAttribute(n, inputAttr[n]);
                        }
                    }
                }
            }
            form.appendChild(tempElement);
          }

        }else
        {
            inputElemArr = document.getElementsByName(inputObjects.name);

            //prevent duplicate form fields
            if (inputElemArr.length === 1) {
                 tempElement = inputElemArr[0];
            }
            else {
                tempElement = document.createElement("INPUT");
            }
            for (n in inputObjects) {
                if (inputObjects.hasOwnProperty(n)) {
                    if(n.toLowerCase() == 'class'){
                       tempElement.className =  inputObjects[n];
                    }else{
                       tempElement.setAttribute(n, inputObjects[n]);
                    }
                }
            }

            form.appendChild(tempElement);
        }
        delete tempElement;
    },
    /**
     * Get all the populated fields on the form.
     */
    getAllSelectedFields: function(domElement)
    {
        var inputElement = null;
        var inputElementList = null;
        var inputElementsLength = null;
        var formElements = [];

        if( arguments.length === 0 )
        {
            domElement = document;
        }

        inputElementList = domElement.getElementsByTagName("input");
        inputElementsLength = inputElementList.length;

            // Loop through all the input tags
            for( var j=0; j < inputElementsLength; j++ )
            {
            inputElement = inputElementList[j];
            if( inputElement.getAttribute("type")!==null )
            {
                switch( inputElement.getAttribute("type").toLowerCase() )
                {
                    case "radio":
                    case "checkbox":
                        if( !inputElement.checked )
                        {
                            continue;
                        }
                        formElements[formElements.length] = inputElement;
                    case "button":
                    case "submit":
                        continue;
                    case "image":
                        continue;
                    default:
                        //alert(inputElement.name);
                        formElements[formElements.length] = inputElement;
                }
            }
            }

        selectElementList = domElement.getElementsByTagName("select");
        selectElementsLength = selectElementList.length;
        textAreaElementList = domElement.getElementsByTagName("textarea");
        textAreaElementsLength = textAreaElementList.length;

        // Loop through all the select tags
        for( j=0; j < selectElementsLength; j++ )
        {
            selectElement = selectElementList[j];
            formElements[formElements.length] = selectElement;
        }

        // Loop through all the text area tags
        for( j=0; j < textAreaElementsLength; j++ )
        {
            textAreaElement = textAreaElementList[j];
            formElements[formElements.length] = textAreaElement;
        }

        delete inputElementList;
        delete selectElementList;
        delete textAreaElementList;

            return formElements;
        },

    /**
     * Get the label associated with the input field.
      */
    getAssociatedLabel: function(inputField)
    {
        var labelElement = null;
        var labels = document.getElementsByTagName("label");
        var labelsLength = labels.length;
        var id;

        if( inputField !== null )
        {
            for( var i=0; i < labelsLength; i++ )
            {
                id = labels[i].getAttribute("for") ? labels[i].getAttribute("for") : labels[i].getAttribute("htmlFor");
                if( id === inputField.id )
                {
                    labelElement = labels[i];
                }
            }
        }

        return labelElement;
    },

    /**
     * Disable all input fields (including select,textarea) in the document.
     */
    disableForms: function()
    {
        var formElement;
        // Get all the forms on the page
        var formElements = document.getElementsByTagName( "FORM" );
        var tmpArray = [];
        var iLen = formElements.length;
        for( var i=0; i < iLen; i++ )
        {
            formElement = formElements[i];
            if( typeof formElement.onsubmit !== 'undefined' && formElement.onsubmit !== null )
            {
                // Back up the current submit method on this form
                tmpArray[tmpArray.length] = formElement.onsubmit;
                // Remove the default handler from the form
                formElement.onsubmit = function(){return false;};
            }
        }

        // Copy temp array to global backup var
        Figment.Form.TMP_BACKUP_FORM_HANDLERS = tmpArray;

        delete formElement;
        delete formElements;
        delete tmpArray;
    },

    /**
     * Enable all input fields (including select,textarea) in the document that
     * were previously disabled.
     */
    enableForms: function()
    {
        // Get the backup form handlers
        var tmpArray = Figment.Form.TMP_BACKUP_FORM_HANDLERS;
        var formElement;
        // Get all the forms on the page
        var formElements = document.getElementsByTagName( "FORM" );
        var tmpArray = [];
        var iLen = formElements.length;
        for( var i=0; i < iLen; i++ )
        {
            formElement = formElements[i];
            if( typeof tmpArray[i] !== 'undefined' && formElement.onsubmit !== null )
            {
                // Restore the default handler to the form
                formElement.onsubmit = tmpArray[i];
            }
        }

        // Blank the back up
        Figment.Form.TMP_BACKUP_FORM_HANDLERS = [];

        delete formElement;
        delete formElements;
        delete tmpArray;
    }
};
// header values:
var chromeColor = "#FFFFFF";
var chromeWidth = 758;

// footer values:
//var chromeColor = '#256f97';
var legalFooterColor = "#056287";

var legalFtrLine1 = "&nbsp;";
var legalFtrLine2 = "<a id=\"footer_legal_ParkAndResortSafety\" class=\"dolFooterLnk\" href=\"\" onclick=\"popup=window.open('http://disneyworld.disney.go.com/wdw/common/externalLink?id=ParkAndResortSafetyPage', 'footerpop', 'width=800, height=600, left=' + (self.screen.width - 800) / 2 + ', top=' + (self.screen.height - 600) / 2 + ', location=0, menubar=0, resizable=1, scrollbars=1, status=0, titlebar=1, toolbar=0, hotkeys=0'); return false;\" class=\"footerLink\" style=\"text-decoration:underline;font-size:10pt !important;\">Park and Resort Safety</a><br/><br/><a id=\"footer_legal_SiteSurvey\" class=\"dolFooterLnk\" href=\"\" onclick=\"window.open('http://vp-nri.com/take?i=142973&h=ZpLXekzc1q8aAIOfdAVyGw','survey','height=650,width=800,resizable=1,scrollbars=1,top=0,left=0'); return false;\" class=\"footerLink\" style=\"text-decoration:underline;font-size:10pt !important;\">Site Survey: Tell us what you think</a><span id=\"footer_legal_ParkAndResortSafety_separator\"><br><br></span>";

// Only set these options if they have already not been defined
if(legalFtrOpts === undefined) {
	var legalFtrOpts = ["Disneyworld.com Help", 		"http://disneyworld.disney.go.com/wdw/common/help?id=HelpLandingPage",
						"Disneyworld.com Site Map", 	"http://disneyworld.disney.go.com/wdw/common/siteMap?id=SiteMapPage",
						"Contact Us", 					"https://disneyworld.disney.go.com/wdw/contact/contactUs?id=ContactUsPage",
						"Guests with Disabilities", 	"javascript:popup=window.open('http://disneyworld.disney.go.com/wdw/common/Plain?id=PlainHomePage', 'footerpop', 'width=800, height=600, left=' + (self.screen.width - 800) / 2 + ', top=' + (self.screen.height - 600) / 2 + ', location=0, menubar=0, resizable=1, scrollbars=1, status=0, titlebar=1, toolbar=0, hotkeys=0'); popup.focus();"];
}

var legalFtrCpyRgt = "&copy; Disney. All rights reserved.";

var legalFooterCat = "travel";
Figment.Namespace('Disney.WDPRO.UI.Widgets.Modules');
/**
 * @fileoverview	Creates the ability to expand/collapse modules.
 * @constructor
 * @version		1.5.0
 */
(function() {
	var self = Disney.WDPRO.UI.Widgets.Modules,
		Event = YAHOO.util.Event,
		Dom = YAHOO.util.Dom;

	/**
	 * Class that identifies a module
	 * @private
	 */
	self.CONST_MODULE_CLASS_NAME = 'module';
	/**
	 * Class that identifies the opened state of a module
	 * @private
	 */
	self.CONST_MODULE_OPENEDSTATE_CLASS_NAME = 'opened';
	/**
	 * Class that identifies the closed state of a module
	 * @private
	 */
	self.CONST_MODULE_CLOSEDSTATE_CLASS_NAME = 'closed';
	/**
	 * Class that is used when the module should show in the opened state.
	 * @private;
	 */
	self.CONST_MODULE_OPENED_STATE_ACTIVE_CLASS_NAME = 'openedModule';
	/**
	 * Class that is used when the module should show in the closed state.
	 * @private;
	 */
	self.CONST_MODULE_CLOSED_STATE_ACTIVE_CLASS_NAME = 'closedModule';
	/**
	 * Class that identifies the call to action element in the module.
	 * @private
	 */
	self.CONST_MODULE_CALL_TO_ACTION_CLASS_NAME = 'moduleAction';
	/**
	 * Class used when the module should be static and have none of this
	 * open/close shenanigans
	 * @private
	 */
	self.CONST_MODULE_STATIC_CLASS_NAME = 'staticModule';
	
	/**
	 * Retrieve all modules that will need expand/collapse functionality added.
	 * @return {Array[IHTMLElement]}
	 */
	self.getModulesOnPage = function()
	{
		var modulesList = Dom.getElementsByClassName(self.CONST_MODULE_CLASS_NAME);
		var i,module;
		var expandableModuleList = [];
		var openedState,closedState;
		
		for (i=0; i < modulesList.length; i++) {
			module = modulesList[i];
			// Do a quick check.  If the module is static, then don't even try
			// to walk the DOM
			if (!Dom.hasClass(module, self.CONST_MODULE_STATIC_CLASS_NAME)) {
				openedState = self.getOpenedState(module);
				closedState = self.getClosedState(module);
				if (openedState !== null && closedState !== null) {
					expandableModuleList.push(module);
				}
			}
		}
		
		delete module;
		delete openedState;
		delete closedState;
		delete modulesList;
		
		return expandableModuleList;
	};
	
	/**
	 * Switches the current class name for hiding/showing the module state to
	 * the opposite state.
	 * @param {HTMLDivElement} module
	 * 	is the state of the module to change.
	 */
	self.switchState = function(module)
	{
		if( module === null ) {
			return;
		}
		
		// What state are we currently showing
		if( Dom.hasClass(module, self.CONST_MODULE_OPENED_STATE_ACTIVE_CLASS_NAME) ) {
			// Showing opened state...switch to closed state
			Dom.replaceClass(module,self.CONST_MODULE_OPENED_STATE_ACTIVE_CLASS_NAME,self.CONST_MODULE_CLOSED_STATE_ACTIVE_CLASS_NAME);
		} else {
			// Showing closed state...switch to open state
			Dom.replaceClass(module,self.CONST_MODULE_CLOSED_STATE_ACTIVE_CLASS_NAME,self.CONST_MODULE_OPENED_STATE_ACTIVE_CLASS_NAME);
		}
		if(module.parentNode.parentNode.parentNode.id == 'columnRight'){
			// Force right column to re-render itself so that bottom corners are corrected if columns height has been increased *IE FIX
			module.parentNode.parentNode.parentNode.style.display = 'none';
			module.parentNode.parentNode.parentNode.style.display = 'block';
		}
		delete module;
	};
	
	/**
	 * Get the element(s) that trigger that switch between the open and closed
	 * states of the module.
	 * @param {HTMLDivElement} module
	 * 	is the state of the module to change.
	 */
	self.getCallToAction = function(module)
	{
		var callToActions = Dom.getElementsByClassName(self.CONST_MODULE_CALL_TO_ACTION_CLASS_NAME,undefined,module);
		if (callToActions !== null && callToActions.length > 0) {
			return callToActions;
		}
		delete callToActions;
		return null;
	};
	
	/**
	 * Get's the opened state of the specified module.
	 * @param {IHTMLElement} module
	 * 	is the DOM element for the module.
	 * @return {HTMLDivElement}
	 * 	is the opened state (DIV) in the module.
	 */
	self.getOpenedState = function(module) {
		return self.getState(module, self.CONST_MODULE_OPENEDSTATE_CLASS_NAME);
	};
	
	/**
	 * Get's the closed state of the specified module.
	 * @param {IHTMLElement} module
	 * 	is the DOM element for the module.
	 * @return {HTMLDivElement}
	 * 	is the closed state (DIV) in the module.
	 */
	self.getClosedState = function(module) {
		return self.getState(module, self.CONST_MODULE_CLOSEDSTATE_CLASS_NAME);
	};

	/**
	 * Get's the state of the specified module specified by class.
	 * @param {IHTMLElement} module
	 * 	is the DOM element for the module.
	 * @param {String} className
	 * 	is the class name of the state module to look for
	 * @return {HTMLDivElement}
	 * 	is the closed state (DIV) in the module.
	 */
	self.getState = function(module, className) {
		// Only check the immediate children
		var state = Dom.getChildrenBy(module, function(elem) {
					return Dom.hasClass(elem, className);
				});
		if (state !== null && state.length > 0) {
			return state[0];
		}
		delete state;
		return null;
	};
	
	/**
	 * Locate the module that this element belongs to.
	 * @param {IHTMLElement} currentElement
	 * 	is the element to use to located the module it belongs to.
	 * @return {HTMLDivElement}
	 * 	is the module that was found (null otherwise)
	 */
	self.findModule = function(currentElement)
	{
		while( currentElement !== null ) {
			if (currentElement.nodeType === 1 && currentElement.nodeName.toLowerCase() === 'div' && Dom.hasClass(currentElement,self.CONST_MODULE_CLASS_NAME)) {
				return currentElement;
			}

			if( currentElement.parentNode ) {
				currentElement = currentElement.parentNode;
			} else {
				currentElement = null;
			}
		}

		return currentElement;
	};
	
	/**
	 * Event to fire when the document finishs loading.  Attachs the event
	 * for the "call to action" element expand/collapse to all modules with 
	 * expandable states.
	 * @param {Event} evt
	 * 	if an event object is based in (W3C event model)
	 * @private
	 */
	self.main = function(evt)
	{
		var modules = self.getModulesOnPage();
		var modulesLength = modules.length;
		var i,
			j,
			module,
			callToAction;
		
		for( i=0; i < modulesLength; i++ ) {
			module = modules[i];
			// Get the call to action for this particular module
			callToAction = self.getCallToAction(module);

			if( callToAction !== null ) {
				var len = callToAction.length;
				for( j=0; j < len; j++ ) {
					// Add the event for switching between the open and closed states
					Figment.EventHandler.addEvent(callToAction[j],'click',self.EVENT_callToAction_onClick);
				}
			}
		}
		
		delete callToAction;
		delete module;
		delete modules;
	};
	
	/**
	 * Event to fire when the "call to action" element is clicked in the module
	 * header.
	 * @param {Event} evt
	 * 	if an event object is based in (W3C event model)
	 * @private
	 */
	self.EVENT_callToAction_onClick = function(evt)
	{
		var windowEvent = Figment.EventHandler.getEvent(evt);
		var element = windowEvent.element;
		var module;
		
		// Find the module that this call to action is part of
		module = self.findModule(element);
		if( module !== null ) {
			// Changes the current state of the module to opposite state
			// of what it is currently in.
			self.switchState(module);
		}
		
		delete module;
		delete windowEvent.element;
		delete windowEvent.targetElement;
		delete element;
		delete windowEvent;
	};

	Event.onDOMReady(self.main);
})();
/*
    Title: Disney.WDPRO.UI.InterfaceBlocking
        Creates a blocking layer to stop user interaction while another
        process is being handled.  Based off of LightBox @ 
        {Link}http://www.huddletogether.com/projects/lightbox2/

    Copyright:
        (c) 2008 Disney Interactive Media Group. All Rights Reserved.

    Original Author:
        Unknown

    Meta Info:
        o $File: //p4-wdpro/Projects/Sites/Development/IBCWDWSite/6.13/wwwroot/js/_global/Disney.WDPRO.UI.InterfaceBlocking.js $
        o $Author: rlune $
        o $Revision: #1 $
        o $DateTime: 2010/01/27 14:55:03 $
*/

// Namespace: Disney.WDPRO.UI.InterfaceBlocking
Figment.Namespace('Disney.WDPRO.UI.InterfaceBlocking');

/*
    Class: Disney.WDPRO.UI.InterfaceBlocking
        Creates a blocking layer to stop user interaction while another
        process is being handled.  Based off of LightBox @ 
        {Link}http://www.huddletogether.com/projects/lightbox2/
*/
Disney.WDPRO.UI.InterfaceBlocking = Figment.Class();
Disney.WDPRO.UI.InterfaceBlocking.prototype = {
    /**
     * Constants
     * @private
     */
    CONST_BLOCKING_LAYER_ID: 'overlay',
    
    /**
     * Constructor
     * @private
     */
    initialize: function(element)
    {
        this.yPos = 0;
        this.xPos = 0;
        this.elementParentBackup = null;
        this.contentElement = null;
        this.element = element;
        this.blockingLayer = document.createElement( 'DIV' );
    },
    
    addContent: function(element)
    {
        element.style.display = 'block';
        this.element = element;
    },
    
    /**
     * Show the blocking layer.
     */
    turnOn: function()
    {
        var blockingLayer,bodyElement,htmlElement;
        
        // IE needs a little help
        if( window.event )
        {
            // Reset the scroll position
            this.changeScrollPosition();
            // Fix IE allow no overflow
            bodyElement = document.getElementsByTagName('BODY')[0];
// It would appear these overflow commands are no longer needed.  They were causing... "issues".
//            bodyElement.style.overflow = 'hidden';
            htmlElement = document.getElementsByTagName('HTML')[0];
//            htmlElement.style.overflow = 'hidden'; 
            // Hide the select boxes
            this.toggleSelectBoxes();
        }
    
// TODO: verify change.....moved layer to property so users can customize
        if( this.blockingLayer === null )
        {
             this.blockingLayer = document.createElement( 'DIV' );
        }
        this.blockingLayer.style.height = document.body.scrollHeight + "px";
        this.blockingLayer.appendChild(document.createTextNode('\u00A0'));
        this.blockingLayer.id = this.CONST_BLOCKING_LAYER_ID;
        document.body.appendChild( this.blockingLayer );
        // Move the content to be inside the overlay
        if ( this.element != null && this.element != undefined )
        {
            document.body.appendChild(this.element);
        }
                
        delete bodyElement;
        delete htmlElement;
//        delete blockingLayer;
    },
    
    /**
     * Hide the blocking layer.
     */
    turnOff: function()
    {
        var blockingLayer;
        
        if( this.element )
        {
            this.element.style.display = 'none';
        }
        if( this.blockingLayer !== null )
        {
            document.body.removeChild( this.blockingLayer );
        }
        // IE needs a little help
        if( document.all )
        {
            // Show the select boxes
            this.toggleSelectBoxes("show");
        }
        
        // Fix IE allow overflow again
        // Otherwise, we never get a scroll bar again!
        bodyElement = document.getElementsByTagName('BODY')[0];
//        bodyElement.style.overflow = 'auto';
        htmlElement = document.getElementsByTagName('HTML')[0];
//        htmlElement.style.overflow = 'auto';
    },
    
    /**
     * Hide select boxes in order to prevent unsightly boxes showing through
     * the blocking layer. Used to fix IE :-(.
     */
    toggleSelectBoxes: function( strDisplay )
    {
        var objBody = Figment.DOM.getElementsByTagName("BODY")[0];

        if( strDisplay === "show" )
        {
            Figment.DOM.removeClassName( objBody,"hideSelects" );
        }
        else
        {
            Figment.DOM.addClassName( objBody,"hideSelects" );
        }
    },
    
    /**
     * Change the scroll location in order to prevent off center focus. Used to
     * fix IE :-(.
     * @private
     */
    changeScrollPosition: function()
    {      var x,y;
        if( document.documentElement && document.documentElement.scrollTop )
        {
            y = document.documentElement.scrollTop; 
        }
        else if( document.body )
        {
            y = document.body.scrollTop;
        }
        window.scroll( x,y );
    }
};
/*
    Title: Disney.WDPRO.IBC.UI.DynamicPleaseWait
        Holds the static properties and methods for the DynamicPleaseWait class.

     Copyright:
        (c) 2008 Disney Interactive Media Group.

     Original Author:
        Unknown

     Remixers:
        o Anson Hoyt
        o Rob Lune
        o Michael Behan

     Dependencies:
        o <Figment.EventHandler>
        o <Figment.Net.Request>
        o <Figment.DOM>
        o <Figment.Form>
        o <Disney.WDPRO.UI.InterfaceBlocking>

     Meta Info:
        o $File: //p4-wdpro/Projects/Sites/Development/IBCWDWSite/ResortPreArrival/wwwroot/js/_global/Disney.WDPRO.IBC.UI.DynamicPleaseWait.js $
        o $Author: mbehan $
        o $Revision: #9 $
        o $DateTime: 2008/09/10 12:19:47 $

     Revisions:
        o 09/10/2008 : Michael Behan - Added functionality to prevent tab key from allowing user to bypass overlay div.
*/

// Import external source files:
Figment.Import('Figment.EventHandler',Figment.getJSRoot() + '_framework/');
Figment.Import('Figment.Net.Request',Figment.getJSRoot() + '_framework/');
Figment.Import('Figment.DOM',Figment.getJSRoot() + '_framework/');
Figment.Import('Figment.Form',Figment.getJSRoot() + '_framework/');
Figment.Import('Disney.WDPRO.UI.InterfaceBlocking',Figment.getJSRoot() + '_global/');

Figment.Namespace('Disney.WDPRO.IBC.UI.DynamicPleaseWait');

/**
 * Holds the static properties and methods for the DynamicPleaseWait class.
 * 
 * @version 1.0.0
 * @requires Figment
 * @requires Figment.EventHandler
 * @requires Figment.Net.Request
 * @requires Figment.DOM
 * @requires Figment.Form
 * @requires Disney.WDPRO.UI.InterfaceBlocking
 */
Disney.WDPRO.IBC.UI.DynamicPleaseWait = {

	ID_WAITING_LAYER: 'pleaseWaitLayer',
	POLL_INCREMENT_IN_MILLISECONDS: 4000,	// 4 secs.
    MAX_POLL_FAILURES: 3, // Consecutive Failures, upon succesful poll counter is reset
    MAX_POST_FAILURES: 3,
	TIMEOUT_IN_MILLISECONDS: 300000,	// 5 MINS.
	PROCESS_ENGINE_LOCATION: Figment.getWebRoot() + 'en_US/_framework/components/processEngine',
	PROCESS_STATUS_REPORT_LOCATION: Figment.getWebRoot() + 'en_US/_framework/components/statusReport',
	CLASSNAME_VALUE_FOR_ASYNC: 'asyncModuleName',
	RESPONSE_STATUS_ISASYNC: 'in_progress',
	RESPONSE_STATUS_ISCOMPLETE: 'complete',
	RESPONSE_STATUS_FAILED: 'failed',
	CLASSNAME_NO_ASYNC: 'noAsync',
	CLASSNAME_REDIRECT_AFTER_ASYNC:'redirectAfterAsync',
//	CLASSNAME_CLOSED_STATE: 'closedState',
//	CLASSNAME_OPENED_STATE: 'openedState',

	getAsyncModuleName: function()
	{
		var moduleName = null;
		//TODO: remove 'prototype' from following:
		var modules = Figment.DOM.getElementsByClassName(Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_VALUE_FOR_ASYNC);
		if( modules.length > 0 )
		{
			moduleName = modules[0].value;
		}
		// Cleanup after ourselves
		delete modules;
		return moduleName;
	},

	getFirstValueByTagName: function(xmlDocument, tagName)
	{
		var firstNode,childNode;
		var firstValue = "";

		firstNode = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getFirstNodeByTagName(xmlDocument, tagName);
		if( firstNode !== null && firstNode !== undefined ) {
			childNode = Figment.DOM.getFirstChildElement( firstNode );
			if( childNode !== null ) {
    			firstValue = childNode.nodeValue;
    			if( firstValue === null )
    			{
    				firstValue = "";
    			}
    		}
		}

		// Cleanup after ourselves
		delete childNode;
		delete firstNode;

		return firstValue;
	},

	getFirstNodeByTagName: function(xmlDocument, tagName)
	{
        var element,nodeList,firstNode,parseError;

		if( typeof xmlDocument !== 'undefined' && xmlDocument !== null && tagName !== null) {
            /* Check for parse errors:
            parseError = Disney.WDPRO.IBC.UI.DynamicPleaseWait.checkForParseError(xmlDocument);
            if(parseError.errorCode != 0) {
                alert(parseError.reason + '\r\n' + parseError.srcText); // shows detailed error message
            }
            */
            element = xmlDocument.documentElement || xmlDocument; // Gets the root XmlElement for the document
			nodeList = element.getElementsByTagName( tagName );
			if( nodeList.length > 0 ) {
				firstNode = nodeList[0];
			}
		}

		// Cleanup after ourselves
		delete element;
		delete nodeList;
        delete parseError;

		return firstNode;
	},

    /* Determines if xmlDocument was badly formed and failed to parse
     */
    checkForParseError: function (xmlDocument) {
        var errorNamespace = 'http://www.mozilla.org/newlayout/xml/parsererror.xml';
        var documentElement = xmlDocument.documentElement;
        var parseError = { errorCode : 0 };
        if (documentElement.nodeName == 'parsererror' && documentElement.namespaceURI == errorNamespace) {
            parseError.errorCode = 1;
            var sourceText = documentElement.getElementsByTagNameNS(errorNamespace, 'sourcetext')[0];
            if (sourceText !== null) {
                parseError.srcText = sourceText.firstChild.data;
            }
            parseError.reason = documentElement.firstChild.data;
        }
        return parseError;
    },

	getStatus: function(doc)
	{
		return Disney.WDPRO.IBC.UI.DynamicPleaseWait.getFirstValueByTagName(doc, "Status");
	},

	isRequestAsync: function(response)
	{
		var strStatus;
		var bResult = false;
		if( response !== null )
		{
			strStatus = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getStatus(response);
			if( strStatus.toLowerCase().indexOf(Disney.WDPRO.IBC.UI.DynamicPleaseWait.RESPONSE_STATUS_ISASYNC) > -1 )
			{
				bResult = true;
			}
		}
		return bResult;
	},

    isRequestFailed: function(response)
    {
        var strStatus;
        var bResult = false;
        if( response !== null )
        {
            strStatus = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getStatus(response);
            if( strStatus == "" || strStatus.toLowerCase().indexOf(Disney.WDPRO.IBC.UI.DynamicPleaseWait.RESPONSE_STATUS_FAILED) > -1 )
            {
                bResult = true;
            }
        }
        else
        {
            bResult = true;
        }
        return bResult;
    },
    
    isRequestFinished: function(response)
	{
		var strStatus;
		var bResult = false;
		if( response !== null )
		{
			strStatus = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getStatus(response);
			if( strStatus.toLowerCase().indexOf(Disney.WDPRO.IBC.UI.DynamicPleaseWait.RESPONSE_STATUS_ISCOMPLETE) > -1 )
			{
				bResult = true;
			}
			else if( strStatus.toLowerCase().indexOf(Disney.WDPRO.IBC.UI.DynamicPleaseWait.RESPONSE_STATUS_FAILED) > -1 )
			{
				bResult = true;
			}
			else if(strStatus === "")
			{
				bResult = true;
			}
		}
		return bResult;
	},

	/* @return The form element containing the currentElement. */
	findForm: function(currentElement)
	{
		while( typeof currentElement !== 'undefined' && currentElement !== null )
		{
			if( currentElement.nodeType === 1 && currentElement.nodeName.toLowerCase() === 'form' )
			{
				return currentElement;
			}
			if( currentElement.parentNode )
			{
				currentElement = currentElement.parentNode;
			}
			else
			{
				currentElement = null;
			}
		}

		return currentElement;
	},

	createElement: function( type,name )
	{
		var element;
		if( document.all )
		{
			//element = document.createElement( '< '+type.toLowerCase()+' name="'+name+'" />' );
			element = document.createElement(type.toUpperCase());
			element.name = name;
		}
		else
		{
			element = document.createElement(type.toUpperCase());
			element.name = name;
		}
		return element;
	},

	EVENT_input_onClick: function(evt, elem)
	{
		var objDynamicPleaseWait = new Disney.WDPRO.IBC.UI.DynamicPleaseWait.Class();
		var windowEvent = null;
		var formElement;

		if( typeof elem !== 'undefined' )
		{
			formElement = elem;
		}
		else
		{
			windowEvent = Figment.EventHandler.getEvent(evt);
			formElement = windowEvent.element;
		}
		objDynamicPleaseWait.setCompleteCallBack.call(objDynamicPleaseWait, objDynamicPleaseWait.onComplete);
		objDynamicPleaseWait.setErrorsCallBack.call(objDynamicPleaseWait, objDynamicPleaseWait.onError);

		// TODO: Move async check to initiateCall so users with custom onClick code get checked....but need reference to windowEvent
		if(Figment.DOM.hasClassName(formElement, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_NO_ASYNC))
		{	// Process non-async calls normally
			return;
		}
		else if( windowEvent !== null )
		{	// Stop the form from submitting as it normally would
			windowEvent.preventDefault();

			//remove scrollbar action
			YAHOO.util.Dom.setStyle(document.body, 'overflow' , 'hidden' );
			//IE specific call
			YAHOO.util.Dom.setStyle(document.documentElement, 'overflow' , 'hidden' );

			//disallow tabs and spaces and key presses while "please wait" is up
			YAHOO.util.Event.addListener(document, "keydown", Disney.WDPRO.IBC.UI.DynamicPleaseWait.disableClick); 

		}
		// This if for IE
		else if( window.event )
		{
			window.event.returnValue = false;
		}

		// Add form parameters to the call
		objDynamicPleaseWait.rememberButtonClicked = formElement;
		var form = Disney.WDPRO.IBC.UI.DynamicPleaseWait.findForm(formElement);
		if(form !== null)
		{
			objDynamicPleaseWait.addParametersFromForm(form);
		}
		objDynamicPleaseWait.addParameter(formElement.name,formElement.value);

		// Cleanup after ourselves
		if( windowEvent !== null )
		{
			Figment.EventHandler.cleanUp(windowEvent);
		}

		//TODO: to return or not to return....that is the question.
		return objDynamicPleaseWait.initiateCall();
	},

	disableClick: function(e)
	{

		YAHOO.util.Event.stopEvent(e);

	}
};

/**
 * Defines the dynamic class portion of DynamicPleaseWait.
 * 
 * @version 1.0.0
 * @member Disney.WDPRO.IBC.UI.DynamicPleaseWait
 * @requires Figment
 * @requires Figment.EventHandler
 * @requires Figment.Net.Request
 * @requires Figment.DOM
 * @requires Figment.Form
 * @requires Disney.WDPRO.UI.InterfaceBlocking
 * @constructor
 */
Disney.WDPRO.IBC.UI.DynamicPleaseWait.Class = Figment.Class();
Disney.WDPRO.IBC.UI.DynamicPleaseWait.Class.prototype = {

	/**
	 * Initializes the class with default values.
	 * @private
	 */
	initialize: function()
	{
		this.counter1 = 0;
		this.counter2 = 0;
        this.failedPosts = 0;
        this.failedPolls = 0;
		this.rememberButtonClicked = null;
		this.timeoutID = null;
		this.intervalID = null;
		this.formSubmitted = null;
		this.options = new Disney.WDPRO.IBC.UI.DynamicPleaseWait.Options();
	},

	/**
	 * Get the current options set for this async request.
	 * @return {Disney.WDPRO.IBC.UI.DynamicPleaseWait.Options}
	 */
	getOptions: function()
	{
		return this.options;
	},

	/**
	 * Set the call back method to execute when the async request has completed.
	 * @param {Function} callBack
	 */
	setCompleteCallBack: function(callBack)
	{
		var context = this;
		if( typeof callBack !== "undefined" && callBack !== null )
		{
			this.options.callbacks.complete = function(response)
			{
				callBack.call(context, response);
			};
		}
	},

	/**
	 * Set the call back method to execute when the async request has errors.
	 * @param {Function} callBack
	 */
	setErrorsCallBack: function(callBack)
	{
		var context = this;
		if( typeof callBack !== "undefined" && callBack !== null )
		{
			this.options.callbacks.error = function()
			{
				callBack.call(context);
			};
		}
	},

	/*
	 * Activate blocking layer and please wait layer
	 * TODO - put this into the initiateCall function
	 *  
	 */
	activateLayer: function(formElement)
	{
		// BEGIN CODE TO THROW UP THE INTERFACE BLOCKER
		var content = document.getElementById(this.options.asyncModuleName);
		
		//TODO: do we always want this "content" displayed? What is it?
		if( content !== null )
		{
			// Put up the blocking layer
			this.options.overlay.addContent(content);
			this.options.overlay.turnOn();
			
			// Put up the please wait layer

			if( this.options.pleaseWaitLayer !== null )
			{
				// Positioning fix for IE6
				var strAppVer = navigator.appVersion.toLowerCase();
				var bMinor = parseFloat( strAppVer );
				var bMajor = parseInt( bMinor );
				var intIePos = strAppVer.indexOf( 'msie' );
				if ( intIePos !=-1 ) {
					bMinor = parseFloat( strAppVer.substring( intIePos+5, strAppVer.indexOf( ';',intIePos )));
					bMajor = parseInt( bMinor );
				}
				var bIe = ( intIePos!=-1);
				var bIe6 = ( bIe && bMajor == 6);

				if( bIe6 )
				{
					y = document.documentElement.scrollTop;
					y = y + 200;
					this.options.pleaseWaitLayer.style.top = y + "px";
				}
				/*
				// Show inline 'please wait' image
				if( Figment.DOM.hasClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE) ){
					Figment.DOM.replaceClassName(this.options.pleaseWaitLayer,Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE);
				} else {
					// Make sure div layer isnt already opened before added the opened class declaration
					if(!Figment.DOM.hasClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE)){
						Figment.DOM.addClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE);
					}
				}
	*/			//TODO: get rid of brute-force display ??
				this.options.pleaseWaitLayer.style.display = 'block';
              

                /*
                    Create an anchor tag which will be a dummy link (link to nowhere).
                    This link will gain focus when the tab key is entered.
                */
                var dummyLink  = document.createElement('A');
                dummyLink.href = 'javascript:void(0);';
                document.body.appendChild(dummyLink);

                /*
                    Prevent the TAB key from bypassing the overlay div which 
                    would allow the user to hit TAB, then ENTER to break out of the
                    IBC. keyup is used because IE6 does not understand keydown or keypress
                    based on my testing.
                */
                document.body.onkeyup = function(evt) {
                    evt = (evt) ? evt : event;
                    var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
                    /*
                        5  - Horizontal tab (EBCDIC) - http://en.wikipedia.org/wiki/EBCDIC
                        9  - Horizontal tab
                        11 - Vertical tab
                    */
                    if ( (charCode === 9) || (charCode === 5) || (charCode === 11) ) {
                        dummyLink.focus();
                    } else {
                        return true;
                    }

                    // Garbage collector
                    delete charCode;
                }.bindAsEventListener({dummyLink:dummyLink});

                // Get over IE6 hurdles with onkeypress events (IE6 is buggy with these):
                document.body.onkeydown  = document.body.onkeyup;
                document.body.onkeypress = document.body.onkeyup;

                /*
                    For some reason, in IE6, even after implementing all of the above code
                    to prevent tabs, you are still able to tab over the very first link if
                    you hit tab twice. We will alter the first link's href to do nothing:
                */
                var firstAnchor = document.getElementsByTagName('A')[0];
     
                if (firstAnchor !== null) {
                    firstAnchor.href = '#';
                    firstAnchor.onclick = function() { return false; };
			}

            }


			// Cleanup
			delete content;
		}
		// END CODE
		
	},
	/**
	 * Initiate async call.
	 * @param {Object} HTMLElement containing form to be submitted. If no form
	 * is specified, only parameters manually added via addParameters() are sent.
	 */
	initiateCall: function(formElement)
	{
		// BEGIN CODE TO THROW UP THE INTERFACE BLOCKER
		var content = document.getElementById(this.options.asyncModuleName);
		
		//TODO: do we always want this "content" displayed? What is it?
		if( content !== null )
		{
			// Put up the blocking layer
			this.options.overlay.addContent(content);
			this.options.overlay.turnOn();
			
			// Put up the please wait layer

			if( this.options.pleaseWaitLayer !== null )
			{
				// Positioning fix for IE6
				var strAppVer = navigator.appVersion.toLowerCase();
				var bMinor = parseFloat( strAppVer );
				var bMajor = parseInt( bMinor );
				var intIePos = strAppVer.indexOf( 'msie' );
				if ( intIePos !=-1 ) {
					bMinor = parseFloat( strAppVer.substring( intIePos+5, strAppVer.indexOf( ';',intIePos )));
					bMajor = parseInt( bMinor );
				}
				var bIe = ( intIePos!=-1);
				var bIe6 = ( bIe && bMajor == 6);

				if( bIe6 )
				{
					y = document.documentElement.scrollTop;
					y = y + 200;
					this.options.pleaseWaitLayer.style.top = y + "px";
				}
				/*
				// Show inline 'please wait' image
				if( Figment.DOM.hasClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE) ){
					Figment.DOM.replaceClassName(this.options.pleaseWaitLayer,Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE);
				} else {
					// Make sure div layer isnt already opened before added the opened class declaration
					if(!Figment.DOM.hasClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE)){
						Figment.DOM.addClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE);
					}
				}
	*/			//TODO: get rid of brute-force display ??
				this.options.pleaseWaitLayer.style.display = 'block';
              

                /*
                    Create an anchor tag which will be a dummy link (link to nowhere).
                    This link will gain focus when the tab key is entered.
                */
                var dummyLink  = document.createElement('A');
                dummyLink.href = 'javascript:void(0);';
                document.body.appendChild(dummyLink);

                /*
                    Prevent the TAB key from bypassing the overlay div which 
                    would allow the user to hit TAB, then ENTER to break out of the
                    IBC. keyup is used because IE6 does not understand keydown or keypress
                    based on my testing.
                */
                document.body.onkeyup = function(evt) {
                    evt = (evt) ? evt : event;
                    var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
                    /*
                        5  - Horizontal tab (EBCDIC) - http://en.wikipedia.org/wiki/EBCDIC
                        9  - Horizontal tab
                        11 - Vertical tab
                    */
                    if ( (charCode === 9) || (charCode === 5) || (charCode === 11) ) {
                        dummyLink.focus();
                    } else {
                        return true;
                    }

                    // Garbage collector
                    delete charCode;
                }.bindAsEventListener({dummyLink:dummyLink});

                // Get over IE6 hurdles with onkeypress events (IE6 is buggy with these):
                document.body.onkeydown  = document.body.onkeyup;
                document.body.onkeypress = document.body.onkeyup;

                /*
                    For some reason, in IE6, even after implementing all of the above code
                    to prevent tabs, you are still able to tab over the very first link if
                    you hit tab twice. We will alter the first link's href to do nothing:
                */
                var firstAnchor = document.getElementsByTagName('A')[0];
     
                if (firstAnchor !== null) {
                    firstAnchor.href = '#';
                    firstAnchor.onclick = function() { return false; };
			}

            }


			// Cleanup
			delete content;
		}
		// END CODE

		var netRequest = new Figment.Net.Request();

		var i, parameter;
		var str = '';
		for( i=0; i < this.options.params.length; i++ )
		{
			parameter = this.options.params[i].split('=');
			netRequest.addParameter(parameter[0], parameter[1]);
		}

		// Add flag to prevent page render
		// Calls processed before an async call should send:
		//	process = true;
		//	pageRender = false;
		netRequest.addParameter('process',true);
		netRequest.addParameter('pageRender',false);
		netRequest.getOptions().setUseCallbacks(true);
		var me = this; // Save context for callbacks
		netRequest.setCompleteCallBack(
			function fnCallback(netRequest) { me.mwCallBack.call(me, netRequest); }
		);
        netRequest.setFailedCallBack(
			function fnCallback(netRequest) { me.mwFailedCallBack.call(me, netRequest); }
		);
		netRequest.getOptions().setMethod('post');
		// Send the request to the server
		netRequest.send(this.options.ajaxProcessor);
		/*netRequest.send('http://content-loc.disney.go.com/ibcwdw_v0101/en_US/_framework/componenets/processEngine');*/

		delete netRequest;
		delete i;
		delete parameter;
		delete me;

		return false;
	},

	addParameter: function(name, value)
	{
		this.options.params.push(name + "=" + value);

	},

	addParametersFromForm: function(form)
	{
		this.formSubmitted = form;
		var formFields = Figment.Form.getAllSelectedFields(form);
		var i,formField;

		// Add all the currently selected form field values that are in this
		// form being submitted
		for( i=0; i < formFields.length; i++ )
		{
			formField = formFields[i];
			if(formField.nodeName.toLowerCase() == 'select' && formField.options && formField.selectedIndex !== -1)
			{
				this.addParameter(formField.name,formField.options[formField.selectedIndex].value);
			}
			else
			{
				this.addParameter(formField.name,formField.value);
			}
		}
		delete formField;
		delete formFields;
		delete form;
	},

	mwCallBack: function(netRequest)
	{
		var response;
		try
		{
			if( netRequest.wasSuccessful() )
			{
				// Attempt to get XML from the response
				response = netRequest.getResponseXML();

                // If request is IN_PROGRESS, start polling
				if( Disney.WDPRO.IBC.UI.DynamicPleaseWait.isRequestAsync(response) )
				{
					// Begin polling every so often
					var me = this; // Save context for callbacks
					this.intervalID = window.setInterval(function fnCallback() { me.pollMW.call(me); }, this.options.pollIncrement);
					// Set a timeout in case something goes wrong
					this.timeoutID = window.setTimeout("this.options.callbacks.complete(null,true)", this.options.timeout);
				}
                // If request died, throw an error
                else if( Disney.WDPRO.IBC.UI.DynamicPleaseWait.isRequestFailed(response) )
				{
					this.options.callbacks.error();
				}
				else
				{
					this.cleanup(response);
					this.options.callbacks.complete(response);
				}
			}
			else
			{
				this.options.callbacks.error();
			}
		}
		catch( error )
		{
//			alert('ERROR: ' + error.name + '\n' + error.message);
			this.options.callbacks.error();
		}

		// Clean up after ourselves
		delete me;
		delete response;
		delete netRequest;
	},

    mwFailedCallBack: function(netRequest)
    {
        this.failedPosts++;
        if(this.failedPosts < Disney.WDPRO.IBC.UI.DynamicPleaseWait.MAX_POST_FAILURES && netRequest.response.status == 400){
            netRequest.addParameter('postRetryCount',this.failedPosts);
            netRequest.send(this.options.ajaxProcessor);
            /*netRequest.send('http://content-loc.disney.go.com/ibcwdw_v0102/en_US/_framework/componenets/processEngine');*/
        } else {
            window.location = Figment.getWebRoot() + 'en_US/_framework/components/processEngine' + '?name=System_Error_500_Page&pageRender=true';
        }
    },

    pollFailedCallBack: function(netRequest)
    {
        this.failedPolls++;
        if(this.failedPolls < Disney.WDPRO.IBC.UI.DynamicPleaseWait.MAX_POLL_FAILURES){
            netRequest.addParameter('pollRetryCount',this.failedPolls);
            netRequest.send(this.options.statusProcessor);
            /*netRequest.send('http://content-loc.disney.go.com/ibcwdw_v0102/en_US/_framework/componenets/processEngine');*/
        } else {
            window.location = Figment.getWebRoot() + 'en_US/_framework/components/processEngine' + '?name=System_Error_500_Page&pageRender=true';
        }
    },

	pollCallBack: function(netRequest)
	{

        this.failedPolls = 0;

		var response;
		var bResult = false;
		if( netRequest!==null )
		{
			this.counter2 += 1;
			//window.status = 'Poll Request: #' + this.counter1 + ';Poll Response: #' + this.counter2;
			if( netRequest.wasSuccessful() )
			{
				// Attempt to get XML from the response
				response = netRequest.getResponseXML();
				if( response === null )
				{
					this.options.callbacks.error();
				}
                bResult = Disney.WDPRO.IBC.UI.DynamicPleaseWait.isRequestFinished(response);
			}
			else
			{
				this.options.callbacks.error();
			}
			// Did the async call complete?
			if( bResult )
			{
				this.cleanup(response);
				this.options.callbacks.complete(response);
			}
		}

		// Clean up after ourselves
		delete response;
		delete netRequest;
	},

	pollMW: function()
	{
		var netRequest = new Figment.Net.Request();
		var bResult = false;
		var me = this; // Save context for callbacks

        if(this.counter1 == 1 || this.counter1 == this.counter2){
            this.counter1 += 1;
            netRequest.getOptions().setUseCallbacks(true);
            netRequest.setCompleteCallBack(
                function fnCallback(netRequest) { me.pollCallBack.call(me, netRequest); }
            );
            netRequest.setFailedCallBack(
                function fnCallback(netRequest) { me.pollFailedCallBack.call(me, netRequest); }
            );
            //window.status = 'Poll Request: #' + this.counter1 + ';Poll Response: #' + this.counter2;
            netRequest.getOptions().setMethod('get');
            // Send the request to the server
            netRequest.send(this.options.statusProcessor);
            /*netRequest.send('http://content-loc.disney.go.com/ibcwdw_v0102/en_US/_framework/componenets/processEngine');*/
       }
	},

    /* Method: cleanup
            Stop polling and remove interface blocking overlay.
     */
	cleanup: function(response)
	{
		// Clear out the interval
		if( this.intervalID !== null )
		{
			window.clearInterval(this.intervalID);
		}

		// Clear out the timeout
		if( this.timeoutID !== null )
		{
			window.clearTimeout(this.timeoutID);
		}

		// Cleanup for when new page not rendering
		if( this.formSubmitted === null )
		{
/*			// Hide please wait text
			if( Figment.DOM.hasClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE) ){
				Figment.DOM.replaceClassName(this.options.pleaseWaitLayer,Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_OPENED_STATE, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE);
			}else{
				Figment.DOM.addClassName(this.options.pleaseWaitLayer, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_CLOSED_STATE);
			}
*/
			//TODO: get rid of brute-force display ??
			if( this.options.pleaseWaitLayer !== null )
			{
				this.options.pleaseWaitLayer.style.display = 'none';
			}

			// Hide overlay
			this.options.overlay.turnOff();
		}
		else {
			this.setFormActionFromResponse(response);
		}

		delete this.timeoutID;
		delete this.intervalID;
	},

	// Change the form action to reflect what the response said the form should post to 
	setFormActionFromResponse: function(response) {
		if(typeof(response) !== 'undefined') {
    		var xmlNextPage = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getFirstNodeByTagName(response, "NextPage");
    		if(xmlNextPage !== "" && xmlNextPage !== undefined) {
    			var	strFormAction = xmlNextPage.getAttribute("url");
    			if(strFormAction !== null) {
        			this.formSubmitted.action = strFormAction;
        		}
        		delete strFormAction;
    		}
    		delete xmlNextPage;
		}
	},

	onComplete: function(response,timeout)
	{
	    var form = this.formSubmitted;
		var redirect = false;
        //check when we need to do a redirect vs a submit

		if (this.rememberButtonClicked) {
				redirect = Figment.DOM.hasClassName(this.rememberButtonClicked, Disney.WDPRO.IBC.UI.DynamicPleaseWait.CLASSNAME_REDIRECT_AFTER_ASYNC);
			}

		if(redirect === true){

			window.location.href = Disney.WDPRO.IBC.UI.DynamicPleaseWait.PROCESS_ENGINE_LOCATION+"?process=false";

		}else if( form !== null )
		{
			// Redirect the user to the process engine again (but not as an
			// AJAX call) - just a page refresh
			// Calls processed after an async call should send:
			//	process = false;
			//	pageRender = true;
			/*   Checks for cases where user simply needs a page refresh without resubmitting.
			 *   This was introduced with the shopperLightReg project where the login/registration page needed
			 *   to redirect to process engine but NOT submit as the secured information would be posted to a
			 *   non-secure page if a submit was done.
			*/
			var hiddenInput = Disney.WDPRO.IBC.UI.DynamicPleaseWait.createElement('input','process');
			hiddenInput.type = 'hidden';
			hiddenInput.value = 'false';
			form.appendChild(hiddenInput);

			if(typeof timeout !== "undefined")
			{
				hiddenInput = Disney.WDPRO.IBC.UI.DynamicPleaseWait.createElement('input','timeout');
				hiddenInput.type = 'hidden';
				hiddenInput.value = 'true';
				form.appendChild(hiddenInput);
			}

			hiddenInput = Disney.WDPRO.IBC.UI.DynamicPleaseWait.createElement('input','pageRender');
			hiddenInput.type = 'hidden';
			hiddenInput.value = 'true';
			form.appendChild(hiddenInput);

			if( this.rememberButtonClicked !== null )
			{
				hiddenInput = Disney.WDPRO.IBC.UI.DynamicPleaseWait.createElement('input',this.rememberButtonClicked.name);
				hiddenInput.type = 'hidden';
				hiddenInput.value = this.rememberButtonClicked.value;
				form.appendChild(hiddenInput);
			}

			form.submit();
		}
		else
		{
			alert('Form not found!');
			this.options.callbacks.error();
		}

		// Clean up after ourselves
		delete form;
		delete this.formSubmitted;
		delete hiddenInput;
	},

	/* Load error page */
	onError: function()
	{

		//add back scrollbar action
		YAHOO.util.Dom.setStyle(document.body, 'overflow' , 'visible' );
		//IE specific call
		YAHOO.util.Dom.setStyle(document.documentElement, 'overflow' , 'visible' );

		//remove event listener to disable keystrokes
		YAHOO.util.Event.removeListener(document, "keydown", Disney.WDPRO.IBC.UI.DynamicPleaseWait.disableClick);
		window.location.href = this.options.errorProcessor + '?name=System_Error_500_Page&pageRender=true';
	},

	/**
	 * Override the default toString() to return a nicer output of this class.
	 * @return {String}
	 */
	toString: function()
	{
		var str = "";
		var param = null;
		for( param in this )
		{
			if( (typeof this[param]).toLowerCase() !== 'function' )
			{
				if( str.length > 0 )
				{
					str += ', ';
				}
				str += param + "=" + this[param];
			}
		}
		return ('{' + str + '}');
	}
};


/**
 * Holds the options for the DynamicPleaseWait class.  This includes timeout, poll
 * increment, message layer, onComplete method, and onError method.
 * 
 * @constructor
 * @version 1.0.0
 * @member Disney.WDPRO.IBC.UI.DynamicPleaseWait.Options
 */
Disney.WDPRO.IBC.UI.DynamicPleaseWait.Options = Figment.Class();
Disney.WDPRO.IBC.UI.DynamicPleaseWait.Options.prototype = {

	/**
	 * Initializes the class with default values.
	 * @private
	 */
	initialize: function()
	{
		this.pollIncrement = Disney.WDPRO.IBC.UI.DynamicPleaseWait.POLL_INCREMENT_IN_MILLISECONDS;
		this.timeout = Disney.WDPRO.IBC.UI.DynamicPleaseWait.TIMEOUT_IN_MILLISECONDS;
		this.ajaxProcessor = Disney.WDPRO.IBC.UI.DynamicPleaseWait.PROCESS_ENGINE_LOCATION;
		this.errorProcessor = Disney.WDPRO.IBC.UI.DynamicPleaseWait.PROCESS_ENGINE_LOCATION;
		this.statusProcessor = Disney.WDPRO.IBC.UI.DynamicPleaseWait.PROCESS_STATUS_REPORT_LOCATION;
		this.overlay = new Disney.WDPRO.UI.InterfaceBlocking();
		this.pleaseWaitLayer = document.getElementById(Disney.WDPRO.IBC.UI.DynamicPleaseWait.ID_WAITING_LAYER);
//TODO: asyncModuleName is not submitted as the module name.....how is it really used? What should it be called?
		this.asyncModuleName = Disney.WDPRO.IBC.UI.DynamicPleaseWait.getAsyncModuleName();
		this.params = [];
		this.callbacks = {
			error:    Figment.EmptyFunction(),
			complete: Figment.EmptyFunction()
		};
	},

	/**
	 * Override the default toString() to return a nicer output of this class.
	 * @return {String}
	 */
	toString: function()
	{
		var str = "";
		var param = null;
		for( param in this )
		{
			if( (typeof this[param]).toLowerCase() !== 'function' )
			{
				if( str.length > 0 )
				{
					str += ', ';
				}
				str += param + "=" + this[param];
			}
		}
		return ('{' + str + '}');
	}
};
/**
 * EventBus is designed to be a global event provider.
 *
 * This is a global instance of YAHOO.util.EventProvider.  Please see the
 * documentation of EventProvider first.
 *
 * Simply subscribe and fire events.  Firing an event will autocreate an event
 * for you.  If you want customized event creation, just use the createEvent
 * function first
 *
 * @module eventbus
 * @title EventBus
 * @extends YAHOO.util.EventProvider
 * @namespace YAHOO.Disney.WDPRO.util
 * @requires YAHOO.lang
 * @requires YAHOO.util.EventProvider
 */
YAHOO.namespace("Disney.WDPRO.util.EventBus");
YAHOO.Disney.WDPRO.util.EventBus = (function() {//{{{
    var ep = new YAHOO.util.EventProvider(),
        eb = {};

    // eb gets augmented with ep so that we can override stuff in eb
    YAHOO.lang.augmentObject(eb, ep);

    /**
     * Fire a custom event by name.  The callback functions will be executed
     * from the scope specified when the event was created, and with the
     * following parameters:
     *   <ul>
     *   <li>The first argument fire() was executed with</li>
     *   <li>The custom object (if any) that was passed into the subscribe()
     *       method</li>
     *   </ul>
     * If an event was not created, then this will auto-create an event for you
     *
     * @method fireEvent
     * @param p_type    {string}  the type, or name of the event
     * @param arguments {Object*} an arbitrary set of parameters to pass to
     *                            the handler.
     * @return {boolean} the return value from CustomEvent.fire
     */
    eb.fireEvent = function() {
        // Check to see if event exists, if not, create it
        if (!this.hasEvent(arguments[0])) {
            this.createEvent(arguments[0]);
        }
        // Call our "super"
        return ep.fireEvent.apply(this, arguments);
    };

    /**
     * Alias of fireEvent
     *
     * @method on
     */
    eb.on = eb.subscribe;

    return eb;
})();//}}}

