/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-stdmod",function(b){var f=b.Lang,q=b.Node,x=b.UA,e=b.Widget,d="",J="hd",G="bd",j="ft",D="header",M="body",K="footer",N="fillHeight",m="stdmod",u="Node",I="Content",C="firstChild",h="childNodes",n="ownerDocument",v="contentBox",z="height",F="offsetHeight",y="auto",l="headerContentChange",B="bodyContentChange",o="footerContentChange",r="fillHeightChange",t="heightChange",O="contentUpdate",w="renderUI",E="bindUI",g="syncUI",H="_applyParsedConfig",s=b.Widget.UI_SRC;function P(L){this._stdModNode=this.get(v);b.before(this._renderUIStdMod,this,w);b.before(this._bindUIStdMod,this,E);b.before(this._syncUIStdMod,this,g);}P.HEADER=D;P.BODY=M;P.FOOTER=K;P.AFTER="after";P.BEFORE="before";P.REPLACE="replace";var k=P.HEADER,A=P.BODY,p=P.FOOTER,a=k+I,c=p+I,i=A+I;P.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:P.BODY,validator:function(L){return this._validateFillHeight(L);}}};P.HTML_PARSER={headerContent:function(L){return this._parseStdModHTML(k);},bodyContent:function(L){return this._parseStdModHTML(A);},footerContent:function(L){return this._parseStdModHTML(p);}};P.SECTION_CLASS_NAMES={header:e.getClassName(J),body:e.getClassName(G),footer:e.getClassName(j)};P.TEMPLATES={header:'<div class="'+P.SECTION_CLASS_NAMES[k]+'"></div>',body:'<div class="'+P.SECTION_CLASS_NAMES[A]+'"></div>',footer:'<div class="'+P.SECTION_CLASS_NAMES[p]+'"></div>'};P.prototype={_syncUIStdMod:function(){var L=this._stdModParsed;if(!L||!L[a]){this._uiSetStdMod(k,this.get(a));}if(!L||!L[i]){this._uiSetStdMod(A,this.get(i));}if(!L||!L[c]){this._uiSetStdMod(p,this.get(c));}this._uiSetFillHeight(this.get(N));},_renderUIStdMod:function(){this._stdModNode.addClass(e.getClassName(m));this._renderStdModSections();this.after(l,this._afterHeaderChange);this.after(B,this._afterBodyChange);this.after(o,this._afterFooterChange);},_renderStdModSections:function(){if(f.isValue(this.get(a))){this._renderStdMod(k);}if(f.isValue(this.get(i))){this._renderStdMod(A);}if(f.isValue(this.get(c))){this._renderStdMod(p);}},_bindUIStdMod:function(){this.after(r,this._afterFillHeightChange);this.after(t,this._fillHeight);this.after(O,this._fillHeight);},_afterHeaderChange:function(L){if(L.src!==s){this._uiSetStdMod(k,L.newVal,L.stdModPosition);}},_afterBodyChange:function(L){if(L.src!==s){this._uiSetStdMod(A,L.newVal,L.stdModPosition);}},_afterFooterChange:function(L){if(L.src!==s){this._uiSetStdMod(p,L.newVal,L.stdModPosition);}},_afterFillHeightChange:function(L){this._uiSetFillHeight(L.newVal);},_validateFillHeight:function(L){return !L||L==P.BODY||L==P.HEADER||L==P.FOOTER;},_uiSetFillHeight:function(R){var Q=this.getStdModNode(R);var L=this._currFillNode;if(L&&Q!==L){L.setStyle(z,d);}if(Q){this._currFillNode=Q;}this._fillHeight();},_fillHeight:function(){if(this.get(N)){var L=this.get(z);if(L!=d&&L!=y){this.fillHeight(this._currFillNode);}}},_uiSetStdMod:function(S,R,L){if(f.isValue(R)){var Q=this.getStdModNode(S)||this._renderStdMod(S);this._addStdModContent(Q,R,L);this.set(S+I,this._getStdModContent(S),{src:s});}else{this._eraseStdMod(S);}this.fire(O);},_renderStdMod:function(R){var L=this.get(v),Q=this._findStdModSection(R);if(!Q){Q=this._getStdModTemplate(R);}this._insertStdModSection(L,R,Q);this[R+u]=Q;return this[R+u];},_eraseStdMod:function(Q){var L=this.getStdModNode(Q);if(L){L.remove(true);delete this[Q+u];}},_insertStdModSection:function(L,S,R){var Q=L.get(C);if(S===p||!Q){L.appendChild(R);}else{if(S===k){L.insertBefore(R,Q);}else{var T=this[p+u];if(T){L.insertBefore(R,T);}else{L.appendChild(R);}}}},_getStdModTemplate:function(L){return q.create(P.TEMPLATES[L],this._stdModNode.get(n));},_addStdModContent:function(R,Q,L){switch(L){case P.BEFORE:L=0;break;case P.AFTER:L=undefined;break;default:L=P.REPLACE;}R.insert(Q,L);},_getPreciseHeight:function(R){var L=(R)?R.get(F):0,S="getBoundingClientRect";if(R&&R.hasMethod(S)){var Q=R.invoke(S);if(Q){L=Q.bottom-Q.top;}}return L;},_findStdModSection:function(L){return this.get(v).one("> ."+P.SECTION_CLASS_NAMES[L]);},_parseStdModHTML:function(Q){var L=this._findStdModSection(Q);if(L){if(!this._stdModParsed){this._stdModParsed={};b.before(this._applyStdModParsedConfig,this,H);}this._stdModParsed[Q+I]=1;return L.get("innerHTML");}return null;},_applyStdModParsedConfig:function(S,L,R){var Q=this._stdModParsed;if(Q){Q[a]=!(a in L)&&(a in Q);Q[i]=!(i in L)&&(i in Q);Q[c]=!(c in L)&&(c in Q);}},_getStdModContent:function(L){return(this[L+u])?this[L+u].get(h):null;},setStdModContent:function(R,Q,L){this.set(R+I,Q,{stdModPosition:L});},getStdModNode:function(L){return this[L+u]||null;},fillHeight:function(Q){if(Q){var V=this.get(v),W=[this.headerNode,this.bodyNode,this.footerNode],L,X,Y=0,T=0,S=false;for(var U=0,R=W.length;U<R;U++){L=W[U];if(L){if(L!==Q){Y+=this._getPreciseHeight(L);}else{S=true;}}}if(S){if(x.ie||x.opera){Q.set(F,0);}X=V.get(F)-parseInt(V.getComputedStyle("paddingTop"),10)-parseInt(V.getComputedStyle("paddingBottom"),10)-parseInt(V.getComputedStyle("borderBottomWidth"),10)-parseInt(V.getComputedStyle("borderTopWidth"),10);if(f.isNumber(X)){T=X-Y;if(T>=0){Q.set(F,T);}}}}}};b.WidgetStdMod=P;},"3.4.0",{requires:["base-build","widget"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-stack",function(e){var m=e.Lang,s=e.UA,B=e.Node,f=e.Widget,A="zIndex",o="shim",y="visible",C="boundingBox",v="renderUI",g="bindUI",r="syncUI",p="offsetWidth",d="offsetHeight",l="parentNode",a="firstChild",w="ownerDocument",h="width",u="height",k="px",n="shimdeferred",D="shimresize",x="visibleChange",c="widthChange",j="heightChange",z="shimChange",b="zIndexChange",i="contentUpdate",q="stacked";function t(E){this._stackNode=this.get(C);this._stackHandles={};e.after(this._renderUIStack,this,v);e.after(this._syncUIStack,this,r);e.after(this._bindUIStack,this,g);}t.ATTRS={shim:{value:(s.ie==6)},zIndex:{value:1,setter:function(E){return this._setZIndex(E);}}};t.HTML_PARSER={zIndex:function(E){return E.getStyle(A);}};t.SHIM_CLASS_NAME=f.getClassName(o);t.STACKED_CLASS_NAME=f.getClassName(q);t.SHIM_TEMPLATE='<iframe class="'+t.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>';t.prototype={_syncUIStack:function(){this._uiSetShim(this.get(o));this._uiSetZIndex(this.get(A));},_bindUIStack:function(){this.after(z,this._afterShimChange);this.after(b,this._afterZIndexChange);},_renderUIStack:function(){this._stackNode.addClass(t.STACKED_CLASS_NAME);},_setZIndex:function(E){if(m.isString(E)){E=parseInt(E,10);}if(!m.isNumber(E)){E=0;}return E;},_afterShimChange:function(E){this._uiSetShim(E.newVal);},_afterZIndexChange:function(E){this._uiSetZIndex(E.newVal);},_uiSetZIndex:function(E){this._stackNode.setStyle(A,E);},_uiSetShim:function(E){if(E){if(this.get(y)){this._renderShim();}else{this._renderShimDeferred();}if(s.ie==6){this._addShimResizeHandlers();}}else{this._destroyShim();}},_renderShimDeferred:function(){this._stackHandles[n]=this._stackHandles[n]||[];var F=this._stackHandles[n],E=function(G){if(G.newVal){this._renderShim();}};F.push(this.on(x,E));},_addShimResizeHandlers:function(){this._stackHandles[D]=this._stackHandles[D]||[];var F=this.sizeShim,E=this._stackHandles[D];E.push(this.after(x,F));E.push(this.after(c,F));E.push(this.after(j,F));E.push(this.after(i,F));},_detachStackHandles:function(E){var F=this._stackHandles[E],G;if(F&&F.length>0){while((G=F.pop())){G.detach();}}},_renderShim:function(){var E=this._shimNode,F=this._stackNode;if(!E){E=this._shimNode=this._getShimTemplate();F.insertBefore(E,F.get(a));this._detachStackHandles(n);this.sizeShim();}},_destroyShim:function(){if(this._shimNode){this._shimNode.get(l).removeChild(this._shimNode);this._shimNode=null;this._detachStackHandles(n);this._detachStackHandles(D);}},sizeShim:function(){var F=this._shimNode,E=this._stackNode;if(F&&s.ie===6&&this.get(y)){F.setStyle(h,E.get(p)+k);F.setStyle(u,E.get(d)+k);}},_getShimTemplate:function(){return B.create(t.SHIM_TEMPLATE,this._stackNode.get(w));}};e.WidgetStack=t;},"3.4.0",{requires:["base-build","widget"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-position",function(a){var i=a.Lang,l=a.Widget,n="xy",j="position",g="positioned",k="boundingBox",h="relative",m="renderUI",f="bindUI",d="syncUI",c=l.UI_SRC,e="xyChange";function b(o){this._posNode=this.get(k);a.after(this._renderUIPosition,this,m);a.after(this._syncUIPosition,this,d);a.after(this._bindUIPosition,this,f);}b.ATTRS={x:{setter:function(o){this._setX(o);},getter:function(){return this._getX();},lazyAdd:false},y:{setter:function(o){this._setY(o);},getter:function(){return this._getY();},lazyAdd:false},xy:{value:[0,0],validator:function(o){return this._validateXY(o);}}};b.POSITIONED_CLASS_NAME=l.getClassName(g);b.prototype={_renderUIPosition:function(){this._posNode.addClass(b.POSITIONED_CLASS_NAME);},_syncUIPosition:function(){var o=this._posNode;if(o.getStyle(j)===h){this.syncXY();}this._uiSetXY(this.get(n));},_bindUIPosition:function(){this.after(e,this._afterXYChange);},move:function(){var o=arguments,p=(i.isArray(o[0]))?o[0]:[o[0],o[1]];this.set(n,p);},syncXY:function(){this.set(n,this._posNode.getXY(),{src:c});},_validateXY:function(o){return(i.isArray(o)&&i.isNumber(o[0])&&i.isNumber(o[1]));},_setX:function(o){this.set(n,[o,this.get(n)[1]]);},_setY:function(o){this.set(n,[this.get(n)[0],o]);},_getX:function(){return this.get(n)[0];},_getY:function(){return this.get(n)[1];},_afterXYChange:function(o){if(o.src!=c){this._uiSetXY(o.newVal);}},_uiSetXY:function(o){this._posNode.setXY(o);}};a.WidgetPosition=b;},"3.4.0",{requires:["base-build","node-screen","widget"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-position-constrain",function(c){var f="constrain",d="constrain|xyChange",b="constrainChange",n="preventOverlap",e="align",o="",g="bindUI",i="xy",a="x",m="y",j=c.Node,p="viewportRegion",l="region",k;function h(q){if(!this._posNode){c.error("WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added");}c.after(this._bindUIPosConstrained,this,g);}h.ATTRS={constrain:{value:null,setter:"_setConstrain"},preventOverlap:{value:false}};k=h._PREVENT_OVERLAP={x:{"tltr":1,"blbr":1,"brbl":1,"trtl":1},y:{"trbr":1,"tlbl":1,"bltl":1,"brtr":1}};h.prototype={getConstrainedXY:function(t,s){s=s||this.get(f);var r=this._getRegion((s===true)?null:s),q=this._posNode.get(l);return[this._constrain(t[0],a,q,r),this._constrain(t[1],m,q,r)];},constrain:function(u,r){var t,q,s=r||this.get(f);if(s){t=u||this.get(i);q=this.getConstrainedXY(t,s);if(q[0]!==t[0]||q[1]!==t[1]){this.set(i,q,{constrained:true});}}},_setConstrain:function(q){return(q===true)?q:j.one(q);},_constrain:function(q,r,z,s){if(s){if(this.get(n)){q=this._preventOverlap(q,r,z,s);}var v=(r==a),y=(v)?s.width:s.height,u=(v)?z.width:z.height,t=(v)?s.left:s.top,w=(v)?s.right-u:s.bottom-u;if(q<t||q>w){if(u<y){if(q<t){q=t;}else{if(q>w){q=w;}}}else{q=t;}}}return q;},_preventOverlap:function(r,s,C,t){var w=this.get(e),B=(s===a),z,v,u,y,A,q;if(w&&w.points&&k[s][w.points.join(o)]){v=this._getRegion(w.node);if(v){z=(B)?C.width:C.height;u=(B)?v.left:v.top;y=(B)?v.right:v.bottom;A=(B)?v.left-t.left:v.top-t.top;q=(B)?t.right-v.right:t.bottom-v.bottom;}if(r>u){if(q<z&&A>z){r=u-z;}}else{if(A<z&&q>z){r=y;}}}return r;},_bindUIPosConstrained:function(){this.after(b,this._afterConstrainChange);this._enableConstraints(this.get(f));},_afterConstrainChange:function(q){this._enableConstraints(q.newVal);},_enableConstraints:function(q){if(q){this.constrain();this._cxyHandle=this._cxyHandle||this.on(d,this._constrainOnXYChange);}else{if(this._cxyHandle){this._cxyHandle.detach();this._cxyHandle=null;}}},_constrainOnXYChange:function(q){if(!q.constrained){q.newVal=this.getConstrainedXY(q.newVal);}},_getRegion:function(q){var r;if(!q){r=this._posNode.get(p);}else{q=j.one(q);if(q){r=q.get(l);}}return r;}};c.WidgetPositionConstrain=h;},"3.4.0",{requires:["widget-position"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-position-align",function(a){var f=a.Lang,d="align",b="alignOn",g="visible",i="boundingBox",e="offsetWidth",j="offsetHeight",h="region",k="viewportRegion";function c(l){if(!this._posNode){a.error("WidgetPosition needs to be added to the Widget, "+"before WidgetPositionAlign is added");}a.after(this._bindUIPosAlign,this,"bindUI");a.after(this._syncUIPosAlign,this,"syncUI");}c.ATTRS={align:{value:null},centered:{setter:"_setAlignCenter",lazyAdd:false,value:false},alignOn:{value:[],validator:a.Lang.isArray}};c.TL="tl";c.TR="tr";c.BL="bl";c.BR="br";c.TC="tc";c.RC="rc";c.BC="bc";c.LC="lc";c.CC="cc";c.prototype={_posAlignUIHandles:null,destructor:function(){this._detachPosAlignUIHandles();},_bindUIPosAlign:function(){this.after("alignChange",this._afterAlignChange);this.after("alignOnChange",this._afterAlignOnChange);this.after("visibleChange",this._syncUIPosAlign);},_syncUIPosAlign:function(){var l=this.get(d);this._uiSetVisiblePosAlign(this.get(g));if(l){this._uiSetAlign(l.node,l.points);}},align:function(m,l){if(arguments.length){this.set(d,{node:m,points:l});}else{this._syncUIPosAlign();}return this;},centered:function(l){return this.align(l,[c.CC,c.CC]);},_setAlignCenter:function(l){if(l){this.set(d,{node:l===true?null:l,points:[c.CC,c.CC]});}return l;},_uiSetAlign:function(o,n){if(!f.isArray(n)||n.length!==2){a.error("align: Invalid Points Arguments");return;}var m=this._getRegion(o),l,p,q;if(!m){return;}l=n[0];p=n[1];switch(p){case c.TL:q=[m.left,m.top];break;case c.TR:q=[m.right,m.top];break;case c.BL:q=[m.left,m.bottom];break;case c.BR:q=[m.right,m.bottom];break;case c.TC:q=[m.left+Math.floor(m.width/2),m.top];break;case c.BC:q=[m.left+Math.floor(m.width/2),m.bottom];break;case c.LC:q=[m.left,m.top+Math.floor(m.height/2)];break;case c.RC:q=[m.right,m.top+Math.floor(m.height/2)];break;case c.CC:q=[m.left+Math.floor(m.width/2),m.top+Math.floor(m.height/2)];break;default:break;}if(q){this._doAlign(l,q[0],q[1]);}},_uiSetVisiblePosAlign:function(l){if(l){this._attachPosAlignUIHandles();}else{this._detachPosAlignUIHandles();}},_attachPosAlignUIHandles:function(){if(this._posAlignUIHandles){return;}var n=this.get(i),m=a.bind(this._syncUIPosAlign,this),l=[];a.Array.each(this.get(b),function(r){var q=r.eventName,p=a.one(r.node)||n;if(q){l.push(p.on(q,m));}});this._posAlignUIHandles=l;},_detachPosAlignUIHandles:function(){var l=this._posAlignUIHandles;if(l){new a.EventHandle(l).detach();this._posAlignUIHandles=null;}},_doAlign:function(m,l,p){var o=this._posNode,n;switch(m){case c.TL:n=[l,p];break;case c.TR:n=[l-o.get(e),p];break;case c.BL:n=[l,p-o.get(j)];break;case c.BR:n=[l-o.get(e),p-o.get(j)];break;case c.TC:n=[l-(o.get(e)/2),p];break;case c.BC:n=[l-(o.get(e)/2),p-o.get(j)];break;case c.LC:n=[l,p-(o.get(j)/2)];break;case c.RC:n=[l-o.get(e),p-(o.get(j)/2)];break;case c.CC:n=[l-(o.get(e)/2),p-(o.get(j)/2)];break;default:break;}if(n){this.move(n);}},_getRegion:function(m){var l;if(!m){l=this._posNode.get(k);}else{m=a.Node.one(m);if(m){l=m.get(h);}}return l;},_afterAlignChange:function(l){var m=l.newVal;if(m){this._uiSetAlign(m.node,m.points);}},_afterAlignOnChange:function(l){this._detachPosAlignUIHandles();if(this.get(g)){this._attachPosAlignUIHandles();}}};a.WidgetPositionAlign=c;},"3.4.0",{requires:["widget-position"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-parent",function(e){var c=e.Lang,d="rendered",b="boundingBox";function a(f){this.publish("addChild",{defaultTargetOnly:true,defaultFn:this._defAddChildFn});this.publish("removeChild",{defaultTargetOnly:true,defaultFn:this._defRemoveChildFn});this._items=[];var g,h;if(f&&f.children){g=f.children;h=this.after("initializedChange",function(i){this._add(g);h.detach();});}e.after(this._renderChildren,this,"renderUI");e.after(this._bindUIParent,this,"bindUI");this.after("selectionChange",this._afterSelectionChange);this.after("selectedChange",this._afterParentSelectedChange);this.after("activeDescendantChange",this._afterActiveDescendantChange);this._hDestroyChild=this.after("*:destroy",this._afterDestroyChild);this.after("*:focusedChange",this._updateActiveDescendant);}a.ATTRS={defaultChildType:{setter:function(h){var f=e.Attribute.INVALID_VALUE,g=c.isString(h)?e[h]:h;if(c.isFunction(g)){f=g;}return f;}},activeDescendant:{readOnly:true},multiple:{value:false,validator:c.isBoolean,writeOnce:true,getter:function(g){var f=this.get("root");return(f&&f!=this)?f.get("multiple"):g;}},selection:{readOnly:true,setter:"_setSelection",getter:function(g){var f=c.isArray(g)?(new e.ArrayList(g)):g;return f;}},selected:{setter:function(g){var f=g;if(g===1&&!this.get("multiple")){f=e.Attribute.INVALID_VALUE;}return f;}}};a.prototype={destructor:function(){this._destroyChildren();},_afterDestroyChild:function(f){var g=f.target;if(g.get("parent")==this){g.remove();}},_afterSelectionChange:function(h){if(h.target==this&&h.src!=this){var f=h.newVal,g=0;if(f){g=2;if(e.instanceOf(f,e.ArrayList)&&(f.size()===this.size())){g=1;}}this.set("selected",g,{src:this});}},_afterActiveDescendantChange:function(g){var f=this.get("parent");if(f){f._set("activeDescendant",g.newVal);}},_afterParentSelectedChange:function(f){var g=f.newVal;if(this==f.target&&f.src!=this&&(g===0||g===1)){this.each(function(h){h.set("selected",g,{src:this});},this);}},_setSelection:function(h){var g=null,f;if(this.get("multiple")&&!this.isEmpty()){f=[];this.each(function(i){if(i.get("selected")>0){f.push(i);}});if(f.length>0){g=f;}}else{if(h.get("selected")>0){g=h;}}return g;},_updateSelection:function(g){var h=g.target,f;if(h.get("parent")==this){if(g.src!="_updateSelection"){f=this.get("selection");if(!this.get("multiple")&&f&&g.newVal>0){f.set("selected",0,{src:"_updateSelection"});}this._set("selection",h);}if(g.src==this){this._set("selection",h,{src:this});}}},_updateActiveDescendant:function(f){var g=(f.newVal===true)?f.target:null;this._set("activeDescendant",g);},_createChild:function(f){var k=this.get("defaultChildType"),h=f.childType||f.type,j,g,i;if(h){g=c.isString(h)?e[h]:h;}if(c.isFunction(g)){i=g;}else{if(k){i=k;}}if(i){j=new i(f);}else{e.error("Could not create a child instance because its constructor is either undefined or invalid.");}return j;},_defAddChildFn:function(h){var i=h.child,f=h.index,g=this._items;if(i.get("parent")){i.remove();}if(c.isNumber(f)){g.splice(f,0,i);}else{g.push(i);}i._set("parent",this);i.addTarget(this);h.index=i.get("index");i.after("selectedChange",e.bind(this._updateSelection,this));},_defRemoveChildFn:function(h){var i=h.child,f=h.index,g=this._items;if(i.get("focused")){i.set("focused",false);}if(i.get("selected")){i.set("selected",0);}g.splice(f,1);i.removeTarget(this);i._oldParent=i.get("parent");i._set("parent",null);},_add:function(j,f){var g,i,h;if(c.isArray(j)){g=[];e.each(j,function(m,l){i=this._add(m,(f+l));if(i){g.push(i);}},this);if(g.length>0){h=g;}}else{if(e.instanceOf(j,e.Widget)){i=j;}else{i=this._createChild(j);}if(i&&this.fire("addChild",{child:i,index:f})){h=i;}}return h;},add:function(){var g=this._add.apply(this,arguments),f=g?(c.isArray(g)?g:[g]):[];return(new e.ArrayList(f));},remove:function(f){var h=this._items[f],g;if(h&&this.fire("removeChild",{child:h,index:f})){g=h;}return g;},removeAll:function(){var f=[],g;e.each(this._items.concat(),function(){g=this.remove(0);if(g){f.push(g);}},this);return(new e.ArrayList(f));},selectChild:function(f){this.item(f).set("selected",1);},selectAll:function(){this.set("selected",1);},deselectAll:function(){this.set("selected",0);},_uiAddChild:function(k,f){k.render(f);var i=k.get("boundingBox"),h,j=k.next(false),g;if(j&&j.get(d)){h=j.get(b);h.insert(i,"before");}else{g=k.previous(false);if(g&&g.get(d)){h=g.get(b);h.insert(i,"after");}else{if(!f.contains(i)){f.appendChild(i);}}}},_uiRemoveChild:function(f){f.get("boundingBox").remove();},_afterAddChild:function(f){var g=f.child;if(g.get("parent")==this){this._uiAddChild(g,this._childrenContainer);}},_afterRemoveChild:function(f){var g=f.child;if(g._oldParent==this){this._uiRemoveChild(g);}},_bindUIParent:function(){this.after("addChild",this._afterAddChild);this.after("removeChild",this._afterRemoveChild);},_renderChildren:function(){var f=this._childrenContainer||this.get("contentBox");this._childrenContainer=f;this.each(function(g){g.render(f);});},_destroyChildren:function(){this._hDestroyChild.detach();this.each(function(f){f.destroy();});}};e.augment(a,e.ArrayList);e.WidgetParent=a;},"3.4.0",{requires:["base-build","arraylist","widget"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("widget-child",function(c){var b=c.Lang;function a(){c.after(this._syncUIChild,this,"syncUI");c.after(this._bindUIChild,this,"bindUI");}a.ATTRS={selected:{value:0,validator:b.isNumber},index:{readOnly:true,getter:function(){var e=this.get("parent"),d=-1;if(e){d=e.indexOf(this);}return d;}},parent:{readOnly:true},depth:{readOnly:true,getter:function(){var e=this.get("parent"),d=this.get("root"),f=-1;while(e){f=(f+1);if(e==d){break;}e=e.get("parent");}return f;}},root:{readOnly:true,getter:function(){var d=function(h){var e=h.get("parent"),f=h.ROOT_TYPE,g=e;if(f){g=(e&&c.instanceOf(e,f));}return(g?d(e):h);};return d(this);}}};a.prototype={ROOT_TYPE:null,_getUIEventNode:function(){var d=this.get("root"),e;if(d){e=d.get("boundingBox");}return e;},next:function(f){var e=this.get("parent"),d;if(e){d=e.item((this.get("index")+1));}if(!d&&f){d=e.item(0);}return d;},previous:function(g){var f=this.get("parent"),d=this.get("index"),e;if(f&&d>0){e=f.item([(d-1)]);}if(!e&&g){e=f.item((f.size()-1));}return e;},remove:function(d){var e,f;if(b.isNumber(d)){f=c.WidgetParent.prototype.remove.apply(this,arguments);}else{e=this.get("parent");if(e){f=e.remove(this.get("index"));}}return f;},isRoot:function(){return(this==this.get("root"));},ancestor:function(f){var d=this.get("root"),e;if(this.get("depth")>f){e=this.get("parent");while(e!=d&&e.get("depth")>f){e=e.get("parent");}}return e;},_uiSetChildSelected:function(e){var f=this.get("boundingBox"),d=this.getClassName("selected");if(e===0){f.removeClass(d);}else{f.addClass(d);}},_afterChildSelectedChange:function(d){this._uiSetChildSelected(d.newVal);},_syncUIChild:function(){this._uiSetChildSelected(this.get("selected"));},_bindUIChild:function(){this.after("selectedChange",this._afterChildSelectedChange);}};c.WidgetChild=a;},"3.4.0",{requires:["base-build","widget"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-xmlschema",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.mix(a,{NS:"schema",NAME:"dataSourceXMLSchema",ATTRS:{schema:{}}});b.extend(a,b.Plugin.Base,{initializer:function(c){this.doBefore("_defDataFn",this._beforeDefDataFn);},_beforeDefDataFn:function(g){var c=this.get("schema"),f=g.details[0],d=g.data.responseXML||g.data;f.response=b.DataSchema.XML.apply.call(this,c,d)||{meta:{},results:d};this.get("host").fire("response",f);return new b.Do.Halt("DataSourceXMLSchema plugin halted _defDataFn");}});b.namespace("Plugin").DataSourceXMLSchema=a;},"3.4.0",{requires:["datasource-local","plugin","dataschema-xml"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-textschema",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.mix(a,{NS:"schema",NAME:"dataSourceTextSchema",ATTRS:{schema:{}}});b.extend(a,b.Plugin.Base,{initializer:function(c){this.doBefore("_defDataFn",this._beforeDefDataFn);},_beforeDefDataFn:function(g){var c=this.get("schema"),f=g.details[0],d=g.data.responseText||g.data;f.response=b.DataSchema.Text.apply.call(this,c,d)||{meta:{},results:d};this.get("host").fire("response",f);return new b.Do.Halt("DataSourceTextSchema plugin halted _defDataFn");}});b.namespace("Plugin").DataSourceTextSchema=a;},"3.4.0",{requires:["datasource-local","plugin","dataschema-text"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-polling",function(b){function a(){this._intervals={};}a.prototype={_intervals:null,setInterval:function(e,d){var c=b.later(e,this,this.sendRequest,[d],true);this._intervals[c.id]=c;b.later(0,this,this.sendRequest,[d]);return c.id;},clearInterval:function(d,c){d=c||d;if(this._intervals[d]){this._intervals[d].cancel();delete this._intervals[d];}},clearAllIntervals:function(){b.each(this._intervals,this.clearInterval,this);}};b.augment(b.DataSource.Local,a);},"3.4.0",{requires:["datasource-local"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-local",function(c){var b=c.Lang,a=function(){a.superclass.constructor.apply(this,arguments);};c.mix(a,{NAME:"dataSourceLocal",ATTRS:{source:{value:null}},_tId:0,transactions:{},issueCallback:function(h,d){var f=h.on||h.callback,i=f&&f.success,g=h.details[0];g.error=(h.error||h.response.error);if(g.error){d.fire("error",g);i=f&&f.failure;}if(i){i(g);}}});c.extend(a,c.Base,{initializer:function(d){this._initEvents();},_initEvents:function(){this.publish("request",{defaultFn:c.bind("_defRequestFn",this),queuable:true});this.publish("data",{defaultFn:c.bind("_defDataFn",this),queuable:true});this.publish("response",{defaultFn:c.bind("_defResponseFn",this),queuable:true});},_defRequestFn:function(g){var d=this.get("source"),f=g.details[0];if(b.isUndefined(d)){f.error=new Error("Local source undefined");}f.data=d;this.fire("data",f);},_defDataFn:function(i){var f=i.data,h=i.meta,d={results:(b.isArray(f))?f:[f],meta:(h)?h:{}},g=i.details[0];g.response=d;this.fire("response",g);},_defResponseFn:function(d){a.issueCallback(d,this);},sendRequest:function(e){var f=a._tId++,d;e=e||{};d=e.on||e.callback;this.fire("request",{tId:f,request:e.request,on:d,callback:d,cfg:e.cfg||{}});return f;}});c.namespace("DataSource").Local=a;},"3.4.0",{requires:["base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-jsonschema",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.mix(a,{NS:"schema",NAME:"dataSourceJSONSchema",ATTRS:{schema:{}}});b.extend(a,b.Plugin.Base,{initializer:function(c){this.doBefore("_defDataFn",this._beforeDefDataFn);},_beforeDefDataFn:function(g){var d=g.data&&(g.data.responseText||g.data),c=this.get("schema"),f=g.details[0];f.response=b.DataSchema.JSON.apply.call(this,c,d)||{meta:{},results:d};this.get("host").fire("response",f);return new b.Do.Halt("DataSourceJSONSchema plugin halted _defDataFn");}});b.namespace("Plugin").DataSourceJSONSchema=a;},"3.4.0",{requires:["datasource-local","plugin","dataschema-json"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-io",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.mix(a,{NAME:"dataSourceIO",ATTRS:{io:{value:b.io,cloneDefaultValue:false},ioConfig:{value:null}}});b.extend(a,b.DataSource.Local,{initializer:function(c){this._queue={interval:null,conn:null,requests:[]};},successHandler:function(h,c,g){var d=this.get("ioConfig"),f=g.details[0];delete b.DataSource.Local.transactions[g.tId];f.data=c;this.fire("data",f);if(d&&d.on&&d.on.success){d.on.success.apply(d.context||b,arguments);}},failureHandler:function(h,c,g){var d=this.get("ioConfig"),f=g.details[0];delete b.DataSource.Local.transactions[g.tId];f.error=new Error("IO data failure");f.data=c;this.fire("data",f);if(d&&d.on&&d.on.failure){d.on.failure.apply(d.context||b,arguments);}},_queue:null,_defRequestFn:function(h){var g=this.get("source"),i=this.get("io"),d=this.get("ioConfig"),f=h.request,c=b.merge(d,h.cfg,{on:b.merge(d,{success:this.successHandler,failure:this.failureHandler}),context:this,"arguments":h});if(b.Lang.isString(f)){if(c.method&&(c.method.toUpperCase()==="POST")){c.data=c.data?c.data+f:f;}else{g+=f;}}b.DataSource.Local.transactions[h.tId]=i(g,c);return h.tId;}});b.DataSource.IO=a;},"3.4.0",{requires:["datasource-local","io-base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-get",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.DataSource.Get=b.extend(a,b.DataSource.Local,{_defRequestFn:function(j){var h=this.get("source"),f=this.get("get"),d=b.guid().replace(/\-/g,"_"),g=this.get("generateRequestCallback"),i=j.details[0],c=this;this._last=d;YUI.Env.DataSource.callbacks[d]=function(e){delete YUI.Env.DataSource.callbacks[d];delete b.DataSource.Local.transactions[j.tId];var k=c.get("asyncMode")!=="ignoreStaleResponses"||c._last===d;if(k){i.data=e;c.fire("data",i);}else{}};h+=j.request+g.call(this,d);b.DataSource.Local.transactions[j.tId]=f.script(h,{autopurge:true,onFailure:function(e){delete YUI.Env.DataSource.callbacks[d];delete b.DataSource.Local.transactions[j.tId];i.error=new Error(e.msg||"Script node data failure");c.fire("data",i);},onTimeout:function(e){delete YUI.Env.DataSource.callbacks[d];delete b.DataSource.Local.transactions[j.tId];i.error=new Error(e.msg||"Script node data timeout");c.fire("data",i);}});return j.tId;},_generateRequest:function(c){return"&"+this.get("scriptCallbackParam")+"=YUI.Env.DataSource.callbacks."+c;}},{NAME:"dataSourceGet",ATTRS:{get:{value:b.Get,cloneDefaultValue:false},asyncMode:{value:"allowAll"},scriptCallbackParam:{value:"callback"},generateRequestCallback:{value:function(){return this._generateRequest.apply(this,arguments);}}}});YUI.namespace("Env.DataSource.callbacks");},"3.4.0",{requires:["datasource-local","get"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-function",function(b){var a=b.Lang,c=function(){c.superclass.constructor.apply(this,arguments);};b.mix(c,{NAME:"dataSourceFunction",ATTRS:{source:{validator:a.isFunction}}});b.extend(c,b.DataSource.Local,{_defRequestFn:function(h){var f=this.get("source"),g=h.details[0];if(f){try{g.data=f(h.request,this,h);}catch(d){g.error=d;}}else{g.error=new Error("Function data failure");}this.fire("data",g);return h.tId;}});b.DataSource.Function=c;},"3.4.0",{requires:["datasource-local"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-cache",function(c){var b=function(){};c.mix(b,{NS:"cache",NAME:"dataSourceCacheExtension"});b.prototype={initializer:function(d){this.doBefore("_defRequestFn",this._beforeDefRequestFn);this.doBefore("_defResponseFn",this._beforeDefResponseFn);},_beforeDefRequestFn:function(g){var d=(this.retrieve(g.request))||null,f=g.details[0];if(d&&d.response){f.cached=d.cached;f.response=d.response;f.data=d.data;this.get("host").fire("response",f);return new c.Do.Halt("DataSourceCache extension halted _defRequestFn");}},_beforeDefResponseFn:function(d){if(d.response&&!d.cached){this.add(d.request,d.response);}}};c.namespace("Plugin").DataSourceCacheExtension=b;function a(f){var e=f&&f.cache?f.cache:c.Cache,g=c.Base.create("dataSourceCache",e,[c.Plugin.Base,c.Plugin.DataSourceCacheExtension]),d=new g(f);g.NS="tmpClass";return d;}c.mix(a,{NS:"cache",NAME:"dataSourceCache"});c.namespace("Plugin").DataSourceCache=a;},"3.4.0",{requires:["datasource-local","cache-base","plugin"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("datasource-arrayschema",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.mix(a,{NS:"schema",NAME:"dataSourceArraySchema",ATTRS:{schema:{}}});b.extend(a,b.Plugin.Base,{initializer:function(c){this.doBefore("_defDataFn",this._beforeDefDataFn);},_beforeDefDataFn:function(g){var d=(b.DataSource.IO&&(this.get("host") instanceof b.DataSource.IO)&&b.Lang.isString(g.data.responseText))?g.data.responseText:g.data,c=b.DataSchema.Array.apply.call(this,this.get("schema"),d),f=g.details[0];if(!c){c={meta:{},results:d};}f.response=c;this.get("host").fire("response",f);return new b.Do.Halt("DataSourceArraySchema plugin halted _defDataFn");}});b.namespace("Plugin").DataSourceArraySchema=a;},"3.4.0",{requires:["datasource-local","plugin","dataschema-array"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("dataschema-xml",function(d){var b=d.Lang,c={1:true,9:true,11:true},a;a={apply:function(g,h){var e=h,f={results:[],meta:{}};if(e&&c[e.nodeType]&&g){f=a._parseResults(g,e,f);f=a._parseMeta(g.metaFields,e,f);}else{f.error=new Error("XML schema parse failure");}return f;},_getLocationValue:function(m,j){var h=m.locator||m.key||m,g=j.ownerDocument||j,f,i,k=null;try{f=a._getXPathResult(h,j,g);while((i=f.iterateNext())){k=i.textContent||i.value||i.text||i.innerHTML||null;}return d.DataSchema.Base.parse.call(this,k,m);}catch(l){}return null;},_getXPathResult:function(n,g,t){if(!b.isUndefined(t.evaluate)){return t.evaluate(n,g,t.createNSResolver(g.ownerDocument?g.ownerDocument.documentElement:g.documentElement),0,null);}else{var q=[],s=n.split(/\b\/\b/),k=0,j=s.length,p,f,h,r;try{t.setProperty("SelectionLanguage","XPath");q=g.selectNodes(n);}catch(o){for(;k<j&&g;k++){p=s[k];if((p.indexOf("[")>-1)&&(p.indexOf("]")>-1)){f=p.slice(p.indexOf("[")+1,p.indexOf("]"));f--;g=g.children[f];r=true;}else{if(p.indexOf("@")>-1){f=p.substr(p.indexOf("@"));g=f?g.getAttribute(f.replace("@","")):g;}else{if(-1<p.indexOf("//")){f=g.getElementsByTagName(p.substr(2));g=f.length?f[f.length-1]:null;}else{if(j!=k+1){for(h=g.childNodes.length-1;0<=h;h-=1){if(p===g.childNodes[h].tagName){g=g.childNodes[h];h=-1;}}}}}}}if(g){if(b.isString(g)){q[0]={value:g};}else{if(r){q[0]={value:g.innerHTML};}else{q=d.Array(g.childNodes,0,true);}}}}return{index:0,iterateNext:function(){if(this.index>=this.values.length){return undefined;}var e=this.values[this.index];this.index+=1;return e;},values:q};}},_parseField:function(i,e,h){var g=i.key||i,f;if(i.schema){f={results:[],meta:{}};f=a._parseResults(i.schema,h,f);e[g]=f.results;}else{e[g]=a._getLocationValue(i,h);}},_parseMeta:function(i,h,g){if(b.isObject(i)){var f,e=h.ownerDocument||h;for(f in i){if(i.hasOwnProperty(f)){g.meta[f]=a._getLocationValue(i[f],e);}}}return g;},_parseResult:function(f,h){var e={},g;for(g=f.length-1;0<=g;g--){a._parseField(f[g],e,h);}return e;},_parseResults:function(h,e,j){if(h.resultListLocator&&b.isArray(h.resultFields)){var n=e.ownerDocument||e,m=h.resultFields,l=[],f,g,k=0;if(h.resultListLocator.match(/^[:\-\w]+$/)){g=e.getElementsByTagName(h.resultListLocator);for(k=g.length-1;k>=0;--k){l[k]=a._parseResult(m,g[k]);}}else{g=a._getXPathResult(h.resultListLocator,e,n);while((f=g.iterateNext())){l[k]=a._parseResult(m,f);k+=1;}}if(l.length){j.results=l;}else{j.error=new Error("XML schema result nodes retrieval failure");}}return j;}};d.DataSchema.XML=d.mix(a,d.DataSchema.Base);},"3.4.0",{requires:["dataschema-base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("dataschema-text",function(e){var c=e.Lang,a=c.isString,d=c.isUndefined,b={apply:function(h,i){var f=i,g={results:[],meta:{}};if(a(i)&&h&&a(h.resultDelimiter)){g=b._parseResults.call(this,h,f,g);}else{g.error=new Error("Text schema parse failure");}return g;},_parseResults:function(g,q,h){var o=g.resultDelimiter,n=a(g.fieldDelimiter)&&g.fieldDelimiter,p=g.resultFields||[],m=[],f=e.DataSchema.Base.parse,r,u,x,w,s,v,t,l,k;if(q.slice(-o.length)===o){q=q.slice(0,-o.length);}r=q.split(g.resultDelimiter);if(n){for(l=r.length-1;l>=0;--l){x={};w=r[l];u=w.split(g.fieldDelimiter);for(k=p.length-1;k>=0;--k){s=p[k];v=(!d(s.key))?s.key:s;t=(!d(u[v]))?u[v]:u[k];x[v]=f.call(this,t,s);}m[l]=x;}}else{m=r;}h.results=m;return h;}};e.DataSchema.Text=e.mix(b,e.DataSchema.Base);},"3.4.0",{requires:["dataschema-base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("dataschema-json",function(g){var c=g.Lang,f=c.isFunction,a=c.isObject,b=c.isArray,e=g.DataSchema.Base,d;d={getPath:function(h){var l=null,k=[],j=0;if(h){h=h.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(m,i,n){k[j]=n;return".@"+(j++);}).replace(/\[(\d+)\]/g,function(m,i){k[j]=parseInt(i,10)|0;return".@"+(j++);}).replace(/^\./,"");l=h.split(".");for(j=l.length-1;j>=0;--j){if(l[j].charAt(0)==="@"){l[j]=k[parseInt(l[j].substr(1),10)];}}}return l;},getLocationValue:function(l,k){var j=0,h=l.length;for(;j<h;j++){if(a(k)&&(l[j] in k)){k=k[l[j]];}else{k=undefined;break;}}return k;},apply:function(j,k){var h=k,i={results:[],meta:{}};if(!a(k)){try{h=g.JSON.parse(k);}catch(l){i.error=l;return i;}}if(a(h)&&j){i=d._parseResults.call(this,j,h,i);if(j.metaFields!==undefined){i=d._parseMeta(j.metaFields,h,i);}}else{i.error=new Error("JSON schema parse failure");}return i;},_parseResults:function(m,h,l){var i=d.getPath,j=d.getLocationValue,n=i(m.resultListLocator),k=n?(j(n,h)||h[m.resultListLocator]):h;if(b(k)){if(b(m.resultFields)){l=d._getFieldValues.call(this,m.resultFields,k,l);}else{l.results=k;}}else{if(m.resultListLocator){l.results=[];l.error=new Error("JSON results retrieval failure");}}return l;},_getFieldValues:function(s,p,n){var u=[],x=s.length,w,v,h,z,m,r,l,A,t=[],y=[],o=[],q,k;for(w=0;w<x;w++){h=s[w];z=h.key||h;m=h.locator||z;r=d.getPath(m);if(r){if(r.length===1){t.push({key:z,path:r[0]});}else{y.push({key:z,path:r,locator:m});}}else{}l=(f(h.parser))?h.parser:g.Parsers[h.parser+""];if(l){o.push({key:z,parser:l});}}for(w=p.length-1;w>=0;--w){k={};q=p[w];if(q){for(v=y.length-1;v>=0;--v){r=y[v];A=d.getLocationValue(r.path,q);if(A===undefined){A=d.getLocationValue([r.locator],q);if(A!==undefined){t.push({key:r.key,path:r.locator});y.splice(w,1);continue;}}k[r.key]=e.parse.call(this,(d.getLocationValue(r.path,q)),r);}for(v=t.length-1;v>=0;--v){r=t[v];k[r.key]=e.parse.call(this,((q[r.path]===undefined)?q[v]:q[r.path]),r);}for(v=o.length-1;v>=0;--v){z=o[v].key;k[z]=o[v].parser.call(this,k[z]);if(k[z]===undefined){k[z]=null;}}u[w]=k;}}n.results=u;return n;},_parseMeta:function(k,h,j){if(a(k)){var i,l;for(i in k){if(k.hasOwnProperty(i)){l=d.getPath(k[i]);if(l&&h){j.meta[i]=d.getLocationValue(l,h);}}}}else{j.error=new Error("JSON meta data retrieval failure");}return j;}};g.DataSchema.JSON=g.mix(d,e);},"3.4.0",{requires:["dataschema-base","json"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("dataschema-base",function(b){var a=b.Lang,c={apply:function(d,e){return e;},parse:function(d,e){if(e.parser){var f=(a.isFunction(e.parser))?e.parser:b.Parsers[e.parser+""];if(f){d=f.call(this,d);}else{}}return d;}};b.namespace("DataSchema").Base=c;b.namespace("Parsers");},"3.4.0",{requires:["base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("dataschema-array",function(c){var a=c.Lang,b={apply:function(f,g){var d=g,e={results:[],meta:{}};if(a.isArray(d)){if(f&&a.isArray(f.resultFields)){e=b._parseResults.call(this,f.resultFields,d,e);}else{e.results=d;}}else{e.error=new Error("Array schema parse failure");}return e;},_parseResults:function(h,m,d){var g=[],q,p,k,l,o,n,f,e;for(f=m.length-1;f>-1;f--){q={};p=m[f];k=(a.isObject(p)&&!a.isFunction(p))?2:(a.isArray(p))?1:(a.isString(p))?0:-1;if(k>0){for(e=h.length-1;e>-1;e--){l=h[e];o=(!a.isUndefined(l.key))?l.key:l;n=(!a.isUndefined(p[o]))?p[o]:p[e];q[o]=c.DataSchema.Base.parse.call(this,n,l);}}else{if(k===0){q=p;}else{q=null;}}g[f]=q;}d.results=g;return d;}};c.DataSchema.Array=c.mix(b,c.DataSchema.Base);},"3.4.0",{requires:["dataschema-base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("cache-base",function(d){var a=d.Lang,b=d.Lang.isDate,c=function(){c.superclass.constructor.apply(this,arguments);};d.mix(c,{NAME:"cache",ATTRS:{max:{value:0,setter:"_setMax"},size:{readOnly:true,getter:"_getSize"},uniqueKeys:{value:false},expires:{value:0,validator:function(e){return d.Lang.isDate(e)||(d.Lang.isNumber(e)&&e>=0);}},entries:{readOnly:true,getter:"_getEntries"}}});d.extend(c,d.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn});this.publish("flush",{defaultFn:this._defFlushFn});this._entries=[];},destructor:function(){this._entries=[];},_setMax:function(f){var e=this._entries;if(f>0){if(e){while(e.length>f){e.shift();}}}else{f=0;this._entries=[];}return f;},_getSize:function(){return this._entries.length;},_getEntries:function(){return this._entries;},_defAddFn:function(i){var g=this._entries,f=this.get("max"),h=i.entry;if(this.get("uniqueKeys")&&(this.retrieve(i.entry.request))){g.shift();}while(f&&g.length>=f){g.shift();}g[g.length]=h;},_defFlushFn:function(h){var f=this._entries,g=h.details[0],i;if(g&&a.isValue(g.request)){i=this._position(g.request);if(a.isValue(i)){f.splice(i,1);}}else{this._entries=[];}},_isMatch:function(f,e){if(!e.expires||new Date()<e.expires){return(f===e.request);}return false;},_position:function(h){var e=this._entries,g=e.length,f=g-1;if((this.get("max")===null)||this.get("max")>0){for(;f>=0;f--){if(this._isMatch(h,e[f])){return f;}}}return null;},add:function(g,f){var e=this.get("expires");if(this.get("initialized")&&((this.get("max")===null)||this.get("max")>0)&&(a.isValue(g)||a.isNull(g)||a.isUndefined(g))){this.fire("add",{entry:{request:g,response:f,cached:new Date(),expires:b(e)?e:(e?new Date(new Date().getTime()+this.get("expires")):null)}});}else{}},flush:function(e){this.fire("flush",{request:(a.isValue(e)?e:null)});},retrieve:function(h){var e=this._entries,g=e.length,f=null,i;if((g>0)&&((this.get("max")===null)||(this.get("max")>0))){this.fire("request",{request:h});i=this._position(h);if(a.isValue(i)){f=e[i];this.fire("retrieve",{entry:f});if(i<g-1){e.splice(i,1);e[e.length]=f;}return f;}}return null;}});d.Cache=c;},"3.4.0",{requires:["base"]});/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.4.0
build: nightly
*/
YUI.add("base-build",function(f){var c=f.Base,a=f.Lang,b="initializer",d="destructor",e;c._build=function(B,p,z,s,t,o){var u=c._build,x=u._ctor(p,o),q=u._cfg(p,o),h=u._mixCust,m=q.aggregates,g=q.custom,k=x._yuibuild.dynamic,w,v,A,j,n,y,r;if(k&&m){for(w=0,v=m.length;w<v;++w){A=m[w];if(p.hasOwnProperty(A)){x[A]=a.isArray(p[A])?[]:{};}}}for(w=0,v=z.length;w<v;w++){j=z[w];n=j.prototype;y=n[b];r=n[d];delete n[b];delete n[d];f.mix(x,j,true,null,1);h(x,j,m,g);if(y){n[b]=y;}if(r){n[d]=r;}x._yuibuild.exts.push(j);}if(s){f.mix(x.prototype,s,true);}if(t){f.mix(x,u._clean(t,m,g),true);h(x,t,m,g);}x.prototype.hasImpl=u._impl;if(k){x.NAME=B;x.prototype.constructor=x;}return x;};e=c._build;f.mix(e,{_mixCust:function(i,h,l,k){if(l){f.aggregate(i,h,true,l);}if(k){for(var g in k){if(k.hasOwnProperty(g)){k[g](g,i,h);}}}},_tmpl:function(g){function h(){h.superclass.constructor.apply(this,arguments);}f.extend(h,g);return h;},_impl:function(m){var p=this._getClasses(),o,h,g,n,q,k;for(o=0,h=p.length;o<h;o++){g=p[o];if(g._yuibuild){n=g._yuibuild.exts;q=n.length;for(k=0;k<q;k++){if(n[k]===m){return true;}}}}return false;},_ctor:function(g,h){var j=(h&&false===h.dynamic)?false:true,k=(j)?e._tmpl(g):g,i=k._yuibuild;if(!i){i=k._yuibuild={};}i.id=i.id||null;i.exts=i.exts||[];i.dynamic=j;return k;},_cfg:function(g,h){var i=[],l={},k,j=(h&&h.aggregates),n=(h&&h.custom),m=g;while(m&&m.prototype){k=m._buildCfg;if(k){if(k.aggregates){i=i.concat(k.aggregates);}if(k.custom){f.mix(l,k.custom,true);}}m=m.superclass?m.superclass.constructor:null;}if(j){i=i.concat(j);}if(n){f.mix(l,h.cfgBuild,true);}return{aggregates:i,custom:l};},_clean:function(o,n,j){var m,h,g,k=f.merge(o);for(m in j){if(k.hasOwnProperty(m)){delete k[m];}}for(h=0,g=n.length;h<g;h++){m=n[h];if(k.hasOwnProperty(m)){delete k[m];}}return k;}});c.build=function(i,g,j,h){return e(i,g,j,null,null,h);};c.create=function(g,j,i,h,k){return e(g,j,i,h,k);};c.mix=function(g,h){return e(null,g,h,null,null,{dynamic:false});};c._buildCfg={custom:{ATTRS:function(l,j,h){j.ATTRS=j.ATTRS||{};if(h.ATTRS){var i=h.ATTRS,k=j.ATTRS,g;for(g in i){if(i.hasOwnProperty(g)){k[g]=k[g]||{};f.mix(k[g],i[g],true);}}}}},aggregates:["_PLUG","_UNPLUG"]};},"3.4.0",{requires:["base-base"]});AUI.add("aui-toolbar",function(n){var e=n.Lang,l=e.isString,u="horizontal",h="toolbar",r="orientation",s="toolbarspacer",o="vertical",i=n.getClassName,g=i(h,"first"),m=i(h,u),k=i(h,"item"),f=i(h,"item","content"),a=i(h,"last"),c=i(h,o),q=function(w){return(w instanceof n.ButtonItem);},p=function(w){return(w instanceof n.ToolbarSpacer);},j="<span></span>";var b=n.Component.create({NAME:h,ATTRS:{activeState:{},defaultState:{},hoverState:{},defaultChildType:{value:"ButtonItem"},orientation:{value:u,validator:function(v){return l(v)&&(v===u||v===o);}}},UI_ATTRS:[r],prototype:{BOUNDING_TEMPLATE:j,CONTENT_TEMPLATE:j,initializer:function(){var v=this;n.Do.before(v._addByIconId,v,"add");},bindUI:function(){var v=this;v.on("addChild",v._onAddButton);v.after("addChild",v._afterAddButton);v.after("removeChild",v._afterRemoveButton);},syncUI:function(){var v=this;var y=v.size()-1;var x=-1;var w=-1;v.each(function(A,z,B){var C=A.get("boundingBox");if(q(A)){if(x==-1){x=z;}else{w=z;}C.toggleClass(g,z==x);C.toggleClass(a,z==y);C.addClass(k);}else{if(z==x+1){w=x;}if(w!=-1){B.item(w).get("boundingBox").toggleClass(a,true);}x=-1;w=-1;}});},_addByIconId:function(w){var v=this;if(e.isString(w)){var x={icon:w};return new n.Do.AlterArgs(null,[x]);}},_afterAddButton:function(w){var v=this;v.syncUI();},_afterRemoveButton:function(w){var v=this;w.child.destroy();v.syncUI();},_uiSetOrientation:function(y){var v=this;var x=v.get("boundingBox");var w=(y==u);x.toggleClass(m,w);x.toggleClass(c,!w);}}});var t=n.Component.create({NAME:s,AUGMENTS:[n.WidgetChild],ATTRS:{},prototype:{BOUNDING_TEMPLATE:j,CONTENT_TEMPLATE:null}});n.ToolbarSpacer=t;var d=function(){var v=this;v._CHILD_MAP=new n.DataSet();v.on("addChild",v._onAddChildById);v.after("addChild",v._afterAddChildById);v.after("removeChild",v._afterRemoveChildById);n.Do.before(v._findById,v,"item");n.Do.before(v._findById,v,"remove");};d.prototype={_afterAddChildById:function(w){var v=this;var x=w.child.get("id");v._CHILD_MAP.insert(w.index,x,w.child);},_afterRemoveChildById:function(w){var v=this;var x=w.child.get("id");v._CHILD_MAP.removeKey(x);},_findById:function(x){var v=this;if(e.isString(x)){var w=v._CHILD_MAP.indexOfKey(x);return new n.Do.AlterArgs(null,[w]);}},_onAddChildById:function(w){var v=this;var x=w.child.get("id");if(v._CHILD_MAP.indexOfKey(x)>-1){w.preventDefault();}}};n.Toolbar=n.Component.build(h,b,[n.WidgetParent,d],{dynamic:false});},"1.5.0",{requires:["aui-base","aui-button-item","aui-data-set","widget-parent"],skinnable:true});AUI.add("aui-state-interaction",function(e){var h=e.Lang,d=h.isBoolean,c=h.isString,f=e.getClassName,i="state",j=f(i,"default"),g=f(i,"hover"),b=f(i,"active");var a=e.Component.create({NAME:"stateinteraction",NS:"StateInteraction",ATTRS:{active:{value:false},activeState:{value:true,validator:d},bubbleTarget:{value:null},classNames:{value:{}},"default":{value:false},defaultState:{value:true,validator:d},hover:{value:false},hoverState:{value:true,validator:d},node:{value:null}},EXTENDS:e.Plugin.Base,constructor:function(k){var m=k.host;var l=m;if(e.Widget&&m instanceof e.Widget){l=m.get("contentBox");}k.node=l;a.superclass.constructor.apply(this,arguments);},prototype:{initializer:function(){var k=this;var m=k.get("classNames.active");var l=k.get("classNames.default");var n=k.get("classNames.hover");k._CSS_STATES={active:c(m)?m:b,"default":c(l)?l:j,hover:c(n)?n:g};if(k.get("defaultState")){k.get("node").addClass(k._CSS_STATES["default"]);}k._createEvents();k._attachInteractionEvents();},_attachInteractionEvents:function(){var k=this;var l=k.get("node");l.on("click",k._fireEvents,k);l.on("mouseenter",e.rbind(k._fireEvents,k,"mouseover"));l.on("mouseleave",e.rbind(k._fireEvents,k,"mouseout"));k.after("activeChange",k._uiSetState);k.after("hoverChange",k._uiSetState);k.after("defaultChange",k._uiSetState);},_fireEvents:function(n,m){var k=this;var l=k.get("bubbleTarget");m=m||n.type;if(l){l.fire(m);}return k.fire(m);},_createEvents:function(){var k=this;var l=k.get("bubbleTarget");if(l){k.addTarget(l);}k.publish("click",{defaultFn:k._defClickFn,emitFacade:true});k.publish("mouseout",{defaultFn:k._defMouseOutFn,emitFacade:true});k.publish("mouseover",{defaultFn:k._defMouseOverFn,emitFacade:true});},_defClickFn:function(l){var k=this;k.set("active",!k.get("active"));},_defMouseOutFn:function(){var k=this;k.set("hover",false);},_defMouseOverFn:function(){var k=this;k.set("hover",true);},_uiSetState:function(m){var k=this;var l=m.attrName;if(k.get(l+"State")){var n="addClass";if(!m.newVal){n="removeClass";}k.get("node")[n](k._CSS_STATES[l]);}}}});e.namespace("Plugin").StateInteraction=a;},"1.5.0",{skinnable:false,requires:["aui-base","plugin"]});AUI.add("aui-overlay-base",function(a){a.OverlayBase=a.Component.create({NAME:"overlay",AUGMENTS:[a.WidgetPosition,a.WidgetStack,a.WidgetPositionAlign,a.WidgetPositionConstrain,a.WidgetStdMod]});},"1.5.0",{requires:["aui-component","widget-position","widget-stack","widget-position-align","widget-position-constrain","widget-stdmod"]});AUI.add("aui-form-textfield",function(a){var e=a.Lang,b=a.getClassName,f="textfield",c=b(f);var d=a.Component.create({NAME:f,ATTRS:{selectOnFocus:{value:false},allowOnly:{value:null,validator:function(h){var g=this;return h instanceof RegExp;}},defaultValue:{value:""},validator:{value:null}},EXTENDS:a.Field,prototype:{bindUI:function(){var g=this;d.superclass.bindUI.call(g);var i=g.get("node");if(g.get("allowOnly")){i.on("keypress",g._filterInputText,g);}if(g.get("selectOnFocus")){i.on("focus",g._selectInputText,g);}var h=g.get("defaultValue");if(h){i.on("blur",g._checkDefaultValue,g);i.on("focus",g._checkDefaultValue,g);}},syncUI:function(){var g=this;var i=g.get("value");if(!i){var h=g.get("defaultValue");g.set("value",g.get("defaultValue"));}d.superclass.syncUI.apply(g,arguments);},_filterInputText:function(j){var g=this;var h=g.get("allowOnly");var i=String.fromCharCode(j.charCode);if(!h.test(i)){j.halt();}},_checkDefaultValue:function(m){var g=this;var i=g.get("defaultValue");var l=g.get("node");var k=e.trim(g.get("value"));var j=m.type;var h=(j=="focus"||j=="focusin");if(i){var n=k;if(h&&(k==i)){n="";}else{if(!h&&!k){n=i;}}g.set("value",n);}},_selectInputText:function(h){var g=this;h.currentTarget.select();}}});a.Textfield=d;},"1.5.0",{requires:["aui-form-field"]});AUI.add("aui-form-textarea",function(b){var f=b.Lang,c=b.getClassName,d=b.config.doc,l="textarea",i=c(l),e=[c(l,"height","monitor"),c("field","text","input"),c("helper","hidden","accessible")].join(" "),m="&nbsp;&nbsp;",j="&nbsp;\n&nbsp;",a='<pre class="'+e+'">',k="</pre>",h='<textarea autocomplete="off" class="{cssClass}" name="{name}"></textarea>';var g=b.Component.create({NAME:l,ATTRS:{autoSize:{value:true},height:{value:"auto"},maxHeight:{value:1000,setter:"_setAutoDimension"},minHeight:{value:45,setter:"_setAutoDimension"},width:{value:"auto",setter:"_setAutoDimension"}},HTML_PARSER:{node:"textarea"},EXTENDS:b.Textfield,prototype:{FIELD_TEMPLATE:h,renderUI:function(){var n=this;g.superclass.renderUI.call(n);if(n.get("autoSize")){n._renderHeightMonitor();}},bindUI:function(){var n=this;g.superclass.bindUI.call(n);if(n.get("autoSize")){n.get("node").on("keyup",n._onKeyup,n);}n.after("adjustSize",n._uiAutoSize);n.after("heightChange",n._afterHeightChange);n.after("widthChange",n._afterWidthChange);},syncUI:function(){var o=this;g.superclass.syncUI.call(o);o._setAutoDimension(o.get("minHeight"),"minHeight");o._setAutoDimension(o.get("maxHeight"),"maxHeight");var p=o.get("width");var n=o.get("minHeight");o._setAutoDimension(p,"width");o._uiSetDim("height",n);o._uiSetDim("width",p);},_afterHeightChange:function(o){var n=this;n._uiSetDim("height",o.newVal,o.prevVal);},_afterWidthChange:function(o){var n=this;n._uiSetDim("width",o.newVal,o.prevVal);},_onKeyup:function(o){var n=this;n.fire("adjustSize");},_renderHeightMonitor:function(){var o=this;var q=b.Node.create(a+k);var s=o.get("node");b.getBody().append(q);o._heightMonitor=q;var n=s.getComputedStyle("fontFamily");var t=s.getComputedStyle("fontSize");var p=s.getComputedStyle("fontWeight");var r=s.getComputedStyle("fontSize");s.setStyle("height",o.get("minHeight")+"px");q.setStyles({fontFamily:n,fontSize:t,fontWeight:p});if("outerHTML" in q.getDOM()){o._updateContent=o._updateOuterContent;}else{o._updateContent=o._updateInnerContent;}},_setAutoDimension:function(p,o){var n=this;n["_"+o]=p;},_uiAutoSize:function(){var o=this;var s=o.get("node");var p=o._heightMonitor;var t=o._minHeight;var r=o._maxHeight;var q=s.val();var u=d.createTextNode(q);p.set("innerHTML","");p.appendChild(u);p.setStyle("width",s.getComputedStyle("width"));q=p.get("innerHTML");if(!q.length){q=m;}else{q+=j;}o._updateContent(q);var n=Math.max(p.get("offsetHeight"),t);n=Math.min(n,r);if(n!=o._lastHeight){o._lastHeight=n;o._uiSetDim("height",n);}},_uiSetDim:function(p,o){var n=this;var q=n.get("node");if(f.isNumber(o)){o+="px";}q.setStyle(p,o);},_updateInnerContent:function(o){var n=this;return n._heightMonitor.set("innerHTML",o);},_updateOuterContent:function(o){var n=this;o=o.replace(/\n/g,"<br />");return n._updateInnerContent(o);}}});b.Textarea=g;},"1.5.0",{skinnable:true,requires:["aui-form-textfield"]});AUI.add("aui-form-field",function(s){var h=s.Lang,l=s.getClassName,j="field",o=" ",u=s.cached(function(C,E){var D=["field"];if(E){D.push(E);}D=D.join("-");var A=[l(D,C)];if(C=="password"){A.push(l(D,"text"));}return A.join(" ");}),b=l(j),g=l(j,"checkbox"),f=l(j,"choice"),B=l(j,"content"),e=l(j,"input"),q=l(j,"hint"),d=l(j,"invalid"),c=l(j,"label"),i=l(j,"radio"),a=l(j,"labels"),y=l(j,"labels","inline"),w={left:[a,"left"].join("-"),right:[a,"right"].join("-"),top:[a,"top"].join("-")},z={radio:i,checkbox:g},n=/left|right/,t='<span class="'+b+'"></span>',x='<span class="'+B+'"></span>',m='<span class="'+q+'"></span>',r='<input autocomplete="off" class="{cssClass}" id="{id}" name="{name}" type="{type}" />',p='<label class="'+c+'"></label>',v={};var k=s.Component.create({NAME:j,ATTRS:{readOnly:{value:false},name:{value:"",getter:function(C){var A=this;return C||A.get("id");}},disabled:{value:false,validator:h.isBoolean},id:{getter:function(D){var A=this;var C=this.get("node");if(C){D=C.get("id");}if(!D){D=s.guid();}return D;}},type:{value:"text",validator:h.isString,writeOnce:true},labelAlign:{valueFn:function(){var A=this;return A._getChoiceCss()?"left":null;}},labelNode:{valueFn:function(){var A=this;return s.Node.create(p);}},labelText:{valueFn:function(){var A=this;return A.get("labelNode").get("innerHTML");},setter:function(C){var A=this;A.get("labelNode").set("innerHTML",C);return C;}},node:{value:null,setter:function(C){var A=this;return s.one(C)||A._createFieldNode();}},fieldHint:{value:""},fieldHintNode:{value:null,setter:function(C){var A=this;return s.one(C)||A._createFieldHint();}},prevVal:{value:""},valid:{value:true,getter:function(E){var A=this;var C=A.get("validator");var D=A.get("disabled")||C(A.get("value"));return D;}},dirty:{value:false,getter:function(D){var A=this;if(A.get("disabled")){D=false;}else{var C=String(A.get("value"));var E=String(A.get("prevVal"));D=(C!==E);}return D;}},size:{},validator:{valueFn:function(){var A=this;return A.fieldValidator;},validator:h.isFunction},value:{getter:"_getNodeValue",setter:"_setNodeValue",validator:"fieldValidator"}},HTML_PARSER:{labelNode:"label",node:"input, textarea, select"},BIND_UI_ATTRS:["disabled","id","readOnly","name","size","tabIndex","type","value"],getTypeClassName:u,getField:function(E){var F=null;if(E instanceof s.Field){F=E;}else{if(E&&(h.isString(E)||E instanceof s.Node||E.nodeName)){var C=s.one(E).get("id");F=v[C];if(!F){var D=E.ancestor(".aui-field");var A=E.ancestor(".aui-field-content");F=new k({boundingBox:D,contentBox:A,node:E});}}else{if(h.isObject(E)){F=new k(E);}}}return F;},prototype:{BOUNDING_TEMPLATE:t,CONTENT_TEMPLATE:x,FIELD_TEMPLATE:r,FIELD_TYPE:"text",initializer:function(){var A=this;var C=A.get("node").guid();v[C]=A;},renderUI:function(){var A=this;A._renderField();A._renderLabel();A._renderFieldHint();},bindUI:function(){var A=this;A.after("labelAlignChange",A._afterLabelAlignChange);A.after("fieldHintChange",A._afterFieldHintChange);},syncUI:function(){var A=this;A.set("prevVal",A.get("value"));},fieldValidator:function(C){var A=this;return true;},isValid:function(){var A=this;return A.get("valid");},isDirty:function(){var A=this;return A.get("dirty");},resetValue:function(){var A=this;A.set("value",A.get("prevVal"));A.clearInvalid();},markInvalid:function(C){var A=this;A.set("fieldHint",C);A.get("fieldHintNode").show();A.get("boundingBox").addClass(d);},clearInvalid:function(){var A=this;A.reset("fieldHint");if(!A.get("fieldHint")){A.get("fieldHintNode").hide();}A.get("boundingBox").removeClass(d);},validate:function(){var A=this;var C=A.get("valid");if(C){A.clearInvalid();}return C;},_afterFieldHintChange:function(C){var A=this;A._uiSetFieldHint(C.newVal,C.prevVal);},_afterLabelAlignChange:function(C){var A=this;A._uiSetLabelAlign(C.newVal,C.prevVal);},_createFieldHint:function(){var A=this;var C=s.Node.create(m);A.get("contentBox").append(C);return C;},_createFieldNode:function(){var A=this;var C=A.FIELD_TEMPLATE;A.FIELD_TEMPLATE=h.sub(C,{cssClass:e,id:A.get("id"),name:A.get("name"),type:A.get("type")});return s.Node.create(A.FIELD_TEMPLATE);},_getChoiceCss:function(){var A=this;var C=A.get("type");return z[C];},_getNodeValue:function(){var A=this;return A.get("node").val();},_renderField:function(){var A=this;var G=A.get("node");G.val(A.get("value"));var E=A.get("boundingBox");var D=A.get("contentBox");var F=A.get("type");var C=[u(F)];var H=A._getChoiceCss();if(H){C.push(f);C.push(H);}E.addClass(C.join(o));G.addClass(u(F,"input"));if(!D.contains(G)){if(G.inDoc()){G.placeBefore(E);D.appendChild(G);}else{D.appendChild(G);}}E.removeAttribute("tabIndex");},_renderFieldHint:function(){var A=this;var C=A.get("fieldHint");if(C){A._uiSetFieldHint(C);}},_renderLabel:function(){var J=this;var D=J.get("labelText");if(D!==false){var E=J.get("node");var A=E.guid();D=J.get("labelText");var G=J.get("labelNode");G.addClass(l(J.name,"label"));G.setAttribute("for",A);G.set("innerHTML",D);J._uiSetLabelAlign(J.get("labelAlign"));var H=J.get("contentBox");var C=J.get("labelAlign");var I=J.get("type").toLowerCase();var K=n.test(C);var F="prepend";if(K&&J._getChoiceCss()){F="append";}H[F](G);}},_setNodeValue:function(C){var A=this;A._uiSetValue(C);return C;},_uiSetDisabled:function(D){var A=this;var C=A.get("node");if(D){C.setAttribute("disabled",D);}else{C.removeAttribute("disabled");}},_uiSetFieldHint:function(C,D){var A=this;A.get("fieldHintNode").set("innerHTML",C);},_uiSetId:function(C,D){var A=this;A.get("node").set("id",C);},_uiSetLabelAlign:function(D,F){var A=this;var C=A.get("boundingBox");C.replaceClass(w[F],w[D]);var E="removeClass";if(n.test(D)){E="addClass";}C[E](y);},_uiSetName:function(C,D){var A=this;A.get("node").setAttribute("name",C);},_uiSetReadOnly:function(C,D){var A=this;A.get("node").setAttribute("readOnly",C);},_uiSetSize:function(C,D){var A=this;A.get("node").setAttribute("size",C);},_uiSetTabIndex:function(C,D){var A=this;A.get("node").setAttribute("tabIndex",C);},_uiSetValue:function(C,D){var A=this;
A.get("node").val(C);},_requireAddAttr:false}});s.Field=k;},"1.5.0",{requires:["aui-base","aui-component"]});AUI.add("aui-form-combobox",function(a){var e=a.Lang,c=a.getClassName,f="combobox",d=c(f);var b=a.Component.create({NAME:f,ATTRS:{field:{},fieldWidget:{value:a.Textfield},node:{getter:function(){var g=this;if(g._field){return g._field.get("node");}}},icons:{value:["circle-triangle-b"],validator:e.isArray}},prototype:{renderUI:function(){var g=this;b.superclass.renderUI.call(g);g._renderField();g._renderIcons();},_renderField:function(){var g=this;var h=g.get("contentBox");var i=g.get("field");var j=g.get("fieldWidget");g._field=new j(i).render();h.appendChild(g._field.get("boundingBox"));},_renderIcons:function(){var g=this;var h=g.get("icons");if(h.length){var i=new a.Toolbar({children:h}).render(g.get("contentBox"));g.icons=i;}}}});a.Combobox=b;},"1.5.0",{skinnable:true,requires:["aui-form-textarea","aui-toolbar"]});AUI.add("aui-data-set",function(a){var c=a.Lang;var b=function(){b.superclass.constructor.apply(this,arguments);};b.NAME="dataset";b.ATTRS={keys:{getter:function(e){var d=this;return d.keys;}},first:{getter:function(){var d=this;var e=d.values;return e[0];}},includeFunctions:{value:false},items:{value:null,getter:function(){var d=this;return d.collection||{};}},last:{getter:function(){var d=this;var e=d.values;return e[e.length-1];}},getKey:{lazyAdd:false,value:null,getter:function(e){var d=this;return e||d.getKey;},setter:function(e){var d=this;if(c.isFunction(e)){d.getKey=e;}return d.getKey;}},values:{getter:function(e){var d=this;return d.values;},readOnly:true}};a.extend(b,a.Base,{initializer:function(){var d=this;d.collection={};d.keys=[];d.values=[];d.length=0;d.publish("add",{defaultFn:d._defaultAddFn});d.publish("clear",{defaultFn:d._defaultClearFn});d.publish("remove",{defaultFn:d._defaultRemoveFn});d.publish("replace",{defaultFn:d._defaultReplaceFn});d.publish("sort",{defaultFn:d._defaultSortFn});},add:function(e,g){var d=this;if(arguments.length==1){g=e;e=d.getKey(g);}if(!c.isNull(e)&&!c.isUndefined(e)){var h=d.collection[e];if(!c.isUndefined(h)){return d.replace(e,g);}}var f=d.length;d.fire("add",{index:f,attrName:e,item:g,newVal:g});},addAll:function(j){var d=this;var e=arguments;var h=e.length;if(h==1){e=j;}if(h>1||c.isArray(j)){h=e.length;for(var f=0;f<h;f++){d.add(e[f]);}}else{for(var f in j){var g=j[f];d.add(f,g);}}},clear:function(){var d=this;d.fire("clear");},clone:function(){var d=this;var j=new b();var h=d.keys;var e=d.values;var g=e.length;for(var f=0;f<g;f++){j.add(h[f],e[f]);}j.set("getKey",d.get("getKey"));return j;},contains:function(e){var d=this;return d.indexOf(e)>-1;},containsKey:function(e){var d=this;return !(c.isUndefined(d.collection[e]));},each:function(f,e){var d=this;return d._each(d.values,f,e);},eachKey:function(f,e){var d=this;var g=d.keys;return d._each(g,f,e);},filter:function(k,d){var n=this;var j=new b();j.set("getKey",n.get("getKey"));var h=n.collection;var p=n.keys;var m=n.values;d=d||n;var l=j.collection;var f=j.values;var e=m.length;var o;for(var g=0;g<e;g++){o=m[g];if(k.call(d,o,g,h)){j.add(p[g],o);}}j.length=f.length;return j;},filterBy:function(h,i,g,e){var d=this;if(c.isUndefined(i)||c.isNull(i)||((c.isArray(i)||c.isString(i))&&!i.length)){return d.clone();}i=d._generateRegEx(i,g,e);var f=a.bind(d._keyFilter,d,h,i);return d.filter(f);},find:function(f,e){var d=this;return a.Array.find(d.values,f,e);},findIndex:function(h,g,l){var d=this;var k=d.collection;var e=d.values;var j=d.length;l=l||0;for(var f=l;f<j;f++){if(h.call(g,e[f],f,k)){return f;}}return -1;},findIndexBy:function(h,i,j,g,e){var d=this;if(c.isUndefined(i)||c.isNull(i)||((c.isArray(i)||c.isString(i))&&!i.length)){return -1;}i=d._generateRegEx(i,g,e);var f=a.bind(d._keyFilter,d,h,i);return d.findIndex(f,null,j);},getKey:function(e){var d=this;return(e.get&&e.get("id"))||e.id;},indexOf:function(e){var d=this;return a.Array.indexOf(d.values,e);},indexOfKey:function(e){var d=this;return a.Array.indexOf(d.keys,e);},insert:function(e,f,g){var d=this;if(arguments.length==2){g=arguments[1];f=d.getKey(g);}if(d.containsKey(f)){d.removeKey(f);}d.fire("add",{index:e,attrName:f,item:g,newVal:g});},invoke:function(l,f){var d=this;var e=d.values;var j=e.length;if(!f){f=[];}else{f=[].concat(f);}for(var g=0;g<j;g++){var h=e[g];var k=h&&h[l];if(c.isFunction(k)){k.apply(h,f);}}return d;},item:function(f){var d=this;var g;if(c.isNumber(f)){var e=d.values;g=e[f];}else{g=d.collection[f];}return g;},keySort:function(f,e){var d=this;d.fire("sort",{direction:f,fn:e||d._keySorter,type:"key"});},remove:function(f){var d=this;var e=d.indexOf(f);return d.removeAt(e);},removeAt:function(e){var d=this;if(e<d.length&&e>=0){var g=d.values[e];var f=d.keys[e];d.fire("remove",{index:e,attrName:f,item:g,prevVal:g});}},removeKey:function(f){var d=this;var e=d.indexOfKey(f);return d.removeAt(e);},replace:function(f,g){var d=this;if(arguments.length==1){g=f;f=d.getKey(g);}var h=d.collection[f];if(c.isUndefined(f)||c.isNull(f)||c.isUndefined(h)){return d.add(f,g);}var e=d.indexOfKey(f);d.fire("replace",{attrName:f,index:e,item:g,prevVal:h,newVal:g});},size:function(){var d=this;return d.length;},slice:function(g,e){var d=this;var f=d.values;return f.slice.apply(f,arguments);},sort:function(f,e){var d=this;d.fire("sort",{direction:f,fn:e,type:"value"});},_defaultAddFn:function(g){var d=this;var f=g.attrName;var h=g.item;var e=g.index;if(!c.isNull(f)&&!c.isUndefined(f)){if(d.get("includeFunctions")||!c.isFunction(h)){d.collection[f]=h;}}d.keys.splice(e,0,f);d.values.splice(e,0,h);++d.length;},_defaultClearFn:function(e){var d=this;d.collection={};d.keys=[];d.values=[];d.length=0;},_defaultRemoveFn:function(h){var d=this;var e=h.index;var i=h.item;var f=h.attrName;var j=d.collection;var g=d.keys;d.values.splice(e,1);if(!c.isUndefined(f)){delete j[f];}g.splice(e,1);d.length--;},_defaultReplaceFn:function(f){var d=this;var e=f.attrName;var g=f.item;d.collection[e]=g;},_defaultSortFn:function(e){var d=this;d._sortBy(e.type,e.direction,e.fn);},_each:function(e,j,h){var d=this;var f=e.slice(0);var k=f.length;h=h||d;for(var g=0;g<k;g++){if(j.call(h,f[g],g,f)===false){return false;}}return true;},_generateRegEx:function(i,h,f){var e=this;if(!(i instanceof RegExp)){i=String(i);var d=[];if(h!==false){d.push("^");}d.push(i);var g;if(!f){g="i";}i=new RegExp(d.join(""),g);}return i;},_keyFilter:function(f,h,g,e,i){var d=this;return g&&h.test(g[f]);},_keySorter:function(h,f){var e=this;var g=String(h).toLowerCase();var d=String(f).toLowerCase();var i=0;if(g>d){i=1;}else{if(g<d){i=-1;}}return i;},_sortBy:function(n,j,h){var p=this;var k=1;var g=[];var r=p.keys;var o=p.values;var d=o.length;h=h||a.Array.numericSort;if(String(j).toLowerCase()=="desc"){k=-1;}for(var e=0;e<d;e++){g.push({key:r[e],value:o[e],index:e});}g.sort(function(s,i){var t=h(s[n],i[n])*k;if(t===0){t=1;if(s.index<i.index){t=-1;}}return t;});d=g.length;var f={};for(var e=0;
e<d;e++){var q=g[e];var m=q.key;var l=q.value;f[m]=l;r[e]=m;o[e]=l;}p.collection=f;}});a.DataSet=b;},"1.5.0",{requires:["oop","collection","base"],skinnable:false});AUI.add("aui-button-item",function(u){var h=u.Lang,p=h.isString,k=u.getClassName,j="buttonitem",D="boundingBox",b="button",s="contentBox",w=".",v="handler",d="icon",a="iconNode",E="label",c="labelNode",C="only",o="reset",B="state",G="submit",t="title",r="type",e=k(j),l=k(j,d),F=k(j,E),y=k(j,d,E),n=k(j,d,C),i=k(j,E,C),m=k(d),g=new RegExp(m+"-([a-zA-Z0-9-]+)"),x='<button type="button"></button>',f='<span class="'+[l,m].join(" ")+'"></span>',q='<span class="'+F+'"></span>';var z=u.Component.create({NAME:j,AUGMENTS:[u.WidgetChild],ATTRS:{activeState:{value:false},classNames:{},defaultState:{},handler:{lazyAdd:false,value:null},hoverState:{},icon:{value:""},iconNode:{valueFn:function(){return u.Node.create(f);}},id:{valueFn:function(){return u.guid();}},label:{value:""},labelNode:{valueFn:function(){return u.Node.create(q);}},title:{setter:"_setTitle",value:false},type:{validator:function(A){return(A===b||A===G||A===o);},value:b}},HTML_PARSER:{iconNode:function(A){return A.one(w+l);},labelNode:function(A){return A.one(w+F);},icon:function(J){var H=J.one(w+l);if(H){this.set(a,H);var A=H.attr("class");var I=A.match(g);return I&&I[1];}},label:function(H){var A=H.one(w+F);if(A){this.set(c,A);return A.text();}}},constructor:function(A){if(p(A)){A={icon:A};}z.superclass.constructor.call(this,A);},UI_ATTRS:[v,d,E,t,r],prototype:{BOUNDING_TEMPLATE:x,CONTENT_TEMPLATE:null,renderUI:function(){var A=this;A._renderStates();A._renderIconNode();A._renderLabelNode();},syncUI:function(){var A=this;var I=A.get("icon");var H=A.get("label");var J=A.get("title");if(I){A._uiSetIcon(I);}if(H){A._uiSetLabel(H);}if(J){A._uiSetTitle(J);}},_renderIconNode:function(){var A=this;A.get(s).append(A.get(a));},_renderLabelNode:function(){var A=this;A.get(s).append(A.get(c));},_getState:function(H,I){var A=this;var K=A.get(H);var J=K;if(I){K=I.get(H);if(!h.isUndefined(K)){J=K;}}return J;},_renderStates:function(K){var A=this;var J=A.get("parent");var I=A._getState("activeState",J);var M=A._getState("classNames",J);var H=A._getState("defaultState",J);var L=A._getState("hoverState",J);A.plug(u.Plugin.StateInteraction,{activeState:I,classNames:M,defaultState:H,hoverState:L});},_setTitle:function(H){var A=this;if(H===null){H=A.get("label");}else{if(H===false){H="";}}return String(H);},_syncChildrenStates:function(){var A=this;var K=A.get("icon");var I=A.get("label");var L=(K&&I);var M=(!K&&I);var J=(K&&!I);var H=A.get(D);H.toggleClass(y,L);H.toggleClass(n,J);H.toggleClass(i,M);},_uiSetHandler:function(N){var P=this;var M=N;var O=P.get("parent");var H=(O&&O._DEFAULT_CONTEXT)||P._DEFAULT_CONTEXT||P;var L="click";var K=P;var I;if(h.isObject(M)){var Q=M;M=Q.fn||M;H=Q.context||H;L=Q.type||L;I=Q.args;}if(h.isFunction(M)){var J=P._interactionHandle;if(J){J.detach();}var A=u.rbind.apply(u,[M,H,K].concat(I||[]));P._interactionHandle=P.on(L,A);}},_uiSetIcon:function(J){var A=this;var H=A.get(a);var I="show";if(!J){I="hide";}J=k(d,J);H.replaceClass(A._iconPrevVal,J);H[I]();A._syncChildrenStates();A._iconPrevVal=J;},_uiSetLabel:function(J){var A=this;var H=A.get(c);var I="show";if(!J){I="hide";}H.text(J);H[I]();A._syncChildrenStates();},_uiSetTitle:function(I){var A=this;var H=A.get(D);H.setAttribute(t,I);},_uiSetType:function(I){var A=this;var H=A.get(D);H.setAttribute(r,I);}}});u.ButtonItem=z;},"1.5.0",{requires:["aui-base","aui-state-interaction","widget-child"],skinnable:true});AUI.add("aui-autocomplete",function(j){var P=j.Lang,r=P.isArray,i=P.isString,E=P.isNull,l=P.isFunction,O=j.getClassName,Q=j.Event.KeyMap,B="alert",y="content",G="helper",H="hidden",w="icon",M="item",C="list",o="loading",x="autocomplete",I="reset",K="results",t="selected",p="circle-triangle-b",z=B,e=o,d=O(x,t),J=O(G,H),h=O(x,C,M),F=O(G,I),a=O(x,K),q=O(x,K,y),c="BACKSPACE",m="TAB",b="ENTER",D="ALT",g="ESC",n="UP",v="DOWN",N="RIGHT",f="WIN_IME",s={node:null,points:["tl","bl"]},L="boundingBox",u="contentBox";var k=j.Component.create({NAME:x,ATTRS:{alwaysShowContainer:{value:false},autoHighlight:{value:true},applyLocalFilter:{value:null},button:{value:true},dataSource:{value:null},dataSourceType:{value:null},delimChar:{value:null,setter:function(A){if(i(A)&&(A.length>0)){A=[A];}else{if(!r(A)){A=j.Attribute.INVALID_VALUE;}}return A;}},forceSelection:{value:false},input:{value:null},matchKey:{value:0},maxResultsDisplayed:{value:10},minQueryLength:{value:1},queryDelay:{value:0.2,getter:function(A){return A*1000;}},queryInterval:{value:0.5,getter:function(A){return A*1000;}},queryMatchCase:{value:false},queryMatchContains:{value:false},queryQuestionMark:{value:true},schema:{value:null},schemaType:{value:"",validator:i},suppressInputUpdate:{value:false},typeAhead:{value:false},typeAheadDelay:{value:0.2,getter:function(A){return A*1000;}},uniqueName:{value:null}},prototype:{initializer:function(R){var A=this;A._overlayAlign=j.mix({},s);A._createDataSource();},renderUI:function(){var A=this;A._renderInput();A._renderOverlay();},bindUI:function(){var A=this;var R=A.button;var S=A.inputNode;A.dataSource.on("request",j.bind(R.set,R,w,e));S.on("blur",A._onTextboxBlur,A);S.on("focus",A._onTextboxFocus,A);S.on("keydown",A._onTextboxKeyDown,A);S.on("keypress",A._onTextboxKeyPress,A);S.on("keyup",A._onTextboxKeyUp,A);var T=A.overlay.get(L);T.on("click",A._onContainerClick,A);T.on("mouseout",A._onContainerMouseout,A);T.on("mouseover",A._onContainerMouseover,A);T.on("scroll",A._onContainerScroll,A);A.publish("containerCollapse");A.publish("containerExpand");A.publish("containerPopulate");A.publish("dataError");A.publish("dataRequest");A.publish("dataReturn");A.publish("itemArrowFrom");A.publish("itemArrowTo");A.publish("itemMouseOut");A.publish("itemMouseOver");A.publish("itemSelect");A.publish("selectionEnforce");A.publish("textboxBlur");A.publish("textboxChange");A.publish("textboxFocus");A.publish("textboxKey");A.publish("typeAhead");A.publish("unmatchedItemSelect");A.overlay.after("visibleChange",A._realignContainer,A);},syncUI:function(){var A=this;A.inputNode.setAttribute("autocomplete","off");},destructor:function(){var A=this;A.overlay.destroy();},doBeforeExpandContainer:function(){return true;},doBeforeLoadData:function(A){return true;},filterResults:function(ab){var ah=this;var S=ab.callback;var T=ab.request;var R=ab.response;if(S&&S.argument&&S.argument.query){T=S.argument.query;}if(T){var ag=ah.dataSource;var ad=R.results;var A=[];var V=false;var U=ah.get("matchKey");var ae=ah.get("queryMatchCase");var Z=ah.get("queryMatchContains");var Y=(T=="*");var aa=ah.get("schema.resultFields");for(var ac=ad.length-1;ac>=0;ac--){var X=ad[ac];var af=null;if(i(X)){af=X;}else{if(r(X)){af=X[0];}else{if(aa){af=X[U||aa[0]];}}}if(i(af)){var W=-1;if(ae){W=af.indexOf(decodeURIComponent(T));}else{W=af.toLowerCase().indexOf(decodeURIComponent(T).toLowerCase());}if((Y)||(!Z&&(W===0))||(Z&&(W>-1))){A.unshift(X);}}}R.results=A;}return R;},formatResult:function(R,S,A){return A||"";},generateRequest:function(A){return{request:A};},handleResponse:function(S){var R=this;R._populateList(S);var A=p;if(S.error){A=z;}R.button.set(w,A);},sendQuery:function(R){var A=this;A.set("focused",null);var S=R;if(A.get("delimChar")){R=A.inputNode.get("value")+R;}A._sendQuery(S);},_clearInterval:function(){var A=this;if(A._queryIntervalId){clearInterval(A._queryIntervalId);A._queryIntervalId=null;}},_clearSelection:function(){var R=this;var S=R.get("delimChar");var A={previous:"",query:R.inputNode.get("value")};if(S){A=R._extractQuery(R.inputNode.get("value"));}R.fire("selectionEnforce",A.query);},_createDataSource:function(){var A=this;A._queryTask=j.debounce(A.sendQuery,A.get("queryDelay"),A);var W=A.get("dataSource");var U=W;var V=A.get("dataSourceType");if(!(W instanceof j.DataSource.Local)){if(!V){V="Local";if(l(U)){V="Function";}else{if(i(U)){V="IO";}}}W=new j.DataSource[V]({source:U});}W.on("error",A.handleResponse,A);W.after("response",A.handleResponse,A);V=W.name;if(V=="dataSourceLocal"){A.set("applyLocalFilter",true);}A.set("dataSource",W);A.set("dataSourceType",V);A.dataSource=W;var T=A.get("schema");if(T){if(T.fn){A.dataSource.plug(T);}else{var R=A.get("schemaType");var S={array:j.Plugin.DataSourceArraySchema,json:j.Plugin.DataSourceJSONSchema,text:j.Plugin.DataSourceTextSchema,xml:j.Plugin.DataSourceXMLSchema};R=R.toLowerCase()||"array";A.dataSource.plug({fn:S[R],cfg:{schema:T}});}}A.set("schema",T);},_enableIntervalDetection:function(){var A=this;var R=A.get("queryInterval");if(!A._queryIntervalId&&R){A._queryInterval=setInterval(j.bind(A._onInterval,A),R);}},_extractQuery:function(U){var Y=this;var W=Y.get("delimChar");var A=-1;var S=W.length-1;var X,V,T;for(;S>=0;S--){X=U.lastIndexOf(W[S]);if(X>A){A=X;}}if(W[S]==" "){for(var R=W.length-1;R>=0;R--){if(U[A-1]==W[R]){A--;break;}}}if(A>-1){V=A+1;while(U.charAt(V)==" "){V+=1;}T=U.substring(0,V);U=U.substring(V);}else{T="";}return{previous:T,query:U};},_focus:function(){var A=this;setTimeout(function(){A.inputNode.focus();},0);},_jumpSelection:function(){var A=this;if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}},_moveSelection:function(ad){var aa=this;if(aa.overlay.get("visible")){var ae=aa._elCurListItem;var R=-1;if(ae){R=Number(ae.getAttribute("data-listItemIndex"));}var S=R-1;if(Q.isKey(ad,v)){S=R+1;}if(S==-1){S=aa._displayedItems-1;}if(S>=aa._displayedItems){S=0;}if(S<-2){return;}if(ae){aa._toggleHighlight(ae,"from");aa.fire("itemArrowFrom",ae);
}if(S==-1){if(aa.get("delimChar")){aa.inputNode.set("value",aa._pastSelections+aa._currentQuery);}else{aa.inputNode.set("value",aa._currentQuery);}return;}if(S==-2){aa._toggleContainer(false);return;}var W=aa.resultList.get("childNodes").item(S);var U=aa.overlay.get(u);var Y=U.getStyle("overflow");var ab=U.getStyle("overflowY");var T=(Y=="auto")||(Y=="scroll")||(ab=="auto")||(ab=="scroll");if(T&&(S>-1)&&(S<aa._displayedItems)){var A=-1;var af=W.get("offsetTop");var V=af+W.get("offsetHeight");var Z=U.get("offsetHeight");var X=U.get("scrollTop");var ac=Z+X;if(Q.isKey(ad,v)){if(V>ac){A=(V-Z);}else{if(V<X){A=af;}}}else{if(af<Z){A=af;}else{if(af>ac){A=(V-Z);}}}if(A>-1){U.set("scrollTop",A);}}aa._toggleHighlight(W,"to");aa.fire("itemArrowTo",W);if(aa.get("typeAhead")){aa._updateValue(W);}}},_onButtonMouseDown:function(R){var A=this;R.halt();A._focus();A._sendQuery(A.inputNode.get("value")+"*");},_onContainerClick:function(S){var A=this;var T=S.target;var R=T.get("nodeName").toLowerCase();S.halt();while(T&&(R!="table")){switch(R){case"body":return;case"li":A._toggleHighlight(T,"to");A._selectItem(T);return;default:break;}T=T.get("parentNode");if(T){R=T.get("nodeName").toLowerCase();}}},_onContainerMouseout:function(S){var A=this;var T=S.target;var R=T.get("nodeName").toLowerCase();while(T&&(R!="table")){switch(R){case"body":return;case"li":A._toggleHighlight(T,"from");A.fire("itemMouseOut",T);break;case"ul":A._toggleHighlight(A._elCurListItem,"to");break;case"div":if(T.hasClass(a)){A._overContainer=false;return;}break;default:break;}T=T.get("parentNode");if(T){R=T.get("nodeName").toLowerCase();}}},_onContainerMouseover:function(S){var A=this;var T=S.target;var R=T.get("nodeName").toLowerCase();while(T&&(R!="table")){switch(R){case"body":return;case"li":A._toggleHighlight(T,"to");A.fire("itemMouseOut",T);break;case"div":if(T.hasClass(a)){A._overContainer=true;return;}break;default:break;}T=T.get("parentNode");if(T){R=T.get("nodeName").toLowerCase();}}},_onContainerScroll:function(R){var A=this;A._focus();},_onInterval:function(){var A=this;var S=A.inputNode.get("value");var R=A._lastValue;if(S!=R){A._lastValue=S;A._sendQuery(S);}},_onTextboxBlur:function(T){var A=this;if(!A._overContainer||Q.isKey(A._keyCode,m)){if(!A._itemSelected){var S=A._textMatchesOption();var R=A.overlay.get("visible");if(!R||(R&&E(S))){if(A.get("forceSelection")){A._clearSelection();}else{A.fire("unmatchedItemSelect",A._currentQuery);}}else{if(A.get("forceSelection")){A._selectItem(S);}}}A._clearInterval();A.blur();if(A._initInputValue!==A.inputNode.get("value")){A.fire("textboxChange");}A.fire("textboxBlur");A._toggleContainer(false);}else{A._focus();}},_onTextboxFocus:function(R){var A=this;if(!A.get("focused")){A.inputNode.setAttribute("autocomplete","off");A.focus();A._initInputValue=A.inputNode.get("value");A.fire("textboxFocus");}},_onTextboxKeyDown:function(R){var A=this;var S=R.keyCode;if(A._typeAheadDelayId!=-1){clearTimeout(A._typeAheadDelayId);}if(R.isKey(m)){if(A._elCurListItem){if(A.get("delimChar")&&A._keyCode!=S){if(A.overlay.get("visible")){R.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}else{if(R.isKey(b)){if(A._elCurListItem){if(A._keyCode!=S){if(A.overlay.get("visible")){R.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}else{if(R.isKey(g)){A._toggleContainer(false);}else{if(R.isKey(n)){if(A.overlay.get("visible")){R.halt();A._moveSelection(S);}}else{if(R.isKey(N)){A._jumpSelection();}else{if(R.isKey(v)){if(A.overlay.get("visible")){R.halt();A._moveSelection(S);}}else{A._itemSelected=false;A._toggleHighlight(A._elCurListItem,"from");A.fire("textboxKey",S);}}}}}}if(R.isKey(D)){A._enableIntervalDetection();}A._keyCode=S;},_onTextboxKeyPress:function(R){var A=this;var S=R.keyCode;if(R.isKey(m)){if(A.overlay.get("visible")){if(A.get("delimChar")){R.halt();}if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}}else{if(R.isKey(b)){if(A.overlay.get("visible")){R.halt();if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}}}if(R.isKey(f)){A._enableIntervalDetection();}},_onTextboxKeyUp:function(S){var A=this;var R=A.inputNode;var T=R.get("value");if(S.isSpecialKey()&&!S.isKey(c)){return;}A._queryTask(T);},_populateList:function(A){var ab=this;if(ab._typeAheadDelayId!=-1){clearTimeout(ab._typeAheadDelayId);}var W=A.request;var U=A.response;var ae=A.callback;var T=(W=="*");if(ae&&ae.argument&&ae.argument.query){A.request=W=ae.argument.query;}var Z=ab.doBeforeLoadData(A);if(Z&&!A.error){ab.fire("dataReturn",A);var Y=ab.get("focused");if(T||Y||Y===null){var X=decodeURIComponent(W);ab._currentQuery=X;ab._itemSelected=false;var S=A.response.results;var ad=Math.min(S.length,ab.get("maxResultsDisplayed"));var V=ab.get("schema.resultFields");var ac=ab.get("matchKey");if(!ac&&V){ac=V[0];}else{ac=ac||0;}if(ad>0){var aa=ab.resultList.get("childNodes");aa.each(function(aj,ai,ah){if(ai<ad){var ag=S[ai];var af="";if(i(ag)){af=ag;}else{if(r(ag)){af=ag[0];}else{af=ag[ac];}}aj._resultMatch=af;aj._resultData=ag;aj.html(ab.formatResult(ag,X,af));aj.removeClass(J);}else{aj.addClass(J);}});ab._displayedItems=ad;ab.fire("containerPopulate",W,S);if(W!="*"&&ab.get("autoHighlight")){var R=ab.resultList.get("firstChild");ab._toggleHighlight(R,"to");ab.fire("itemArrowTo",R);ab._typeAhead(R,W);}else{ab._toggleHighlight(ab._elCurListItem,"from");}Z=ab.doBeforeExpandContainer(W,S);ab._toggleContainer(Z);}else{ab._toggleContainer(false);}return;}}else{ab.fire("dataError",W);}},_realignContainer:function(R){var A=this;var S=A._overlayAlign;if(R.newVal){A.overlay._uiSetAlign(S.node,S.points);}},_renderInput:function(){var R=this;var S=R.get(u);var T=R.get("input");var V={field:{labelText:false},icons:[{icon:"circle-triangle-b",id:"trigger",handler:{fn:R._onButtonMouseDown,context:R}}]};var U=null;var A=null;if(T){T=j.one(T);V.field.node=T;U=T.next();A=T.get("parentNode");}var W=new j.Combobox(V).render(S);if(A){var X=W.get("boundingBox");
A.insertBefore(X,U);}R.inputNode=W.get("node");R.button=W.icons.item("trigger");R.set("uniqueName",j.stamp(R.inputNode));},_renderListElements:function(){var A=this;var T=A.get("maxResultsDisplayed");var R=A.resultList;var S=[];while(T--){S[T]='<li class="'+J+" "+h+'" data-listItemIndex="'+T+'"></li>';}R.html(S.join(""));},_renderOverlay:function(){var A=this;var T=A._overlayAlign;T.node=A.inputNode;var S=new j.OverlayBase({align:T,bodyContent:"<ul></ul>",visible:false,width:A.inputNode.get("offsetWidth"),zIndex:1});var R=S.get(u);S.get(L).addClass(a);R.addClass(q);S.render();S.addTarget(A);A.overlay=S;A.resultList=R.one("ul");A.resultList.addClass(F);A._renderListElements();},_selectItem:function(R){var A=this;A._itemSelected=true;A._updateValue(R);A._pastSelections=A.inputNode.get("value");A._clearInterval();A.fire("itemSelect",R,R._resultData);A._toggleContainer(false);},_sendQuery:function(V){var R=this;if(R.get("disabled")){R._toggleContainer(false);return;}var T=R.get("delimChar");var S=R.get("minQueryLength");if(T){var A=R._extractQuery(V);V=A.query;R._pastSelections=A.previous;}if((V&&(V.length<S))||(!V&&S>0)){R._queryTask.cancel();R._toggleContainer(false);return;}V=encodeURIComponent(V);if(R.get("applyLocalFilter")){R.dataSource.on("response",R.filterResults,R);}var U=R.generateRequest(V);R.fire("dataRequest",V,U);R.dataSource.sendRequest(U);},_textMatchesOption:function(){var A=this;var R=null;var V=A._displayedItems;var W=A.resultList.get("childNodes");for(var T=0;T<V.length;T++){var U=W.item(T);var S=(""+U._resultMatch).toLowerCase();if(S==A._currentQuery.toLowerCase()){R=U;break;}}return R;},_toggleContainer:function(R){var A=this;var S=A.overlay;if(A.get("alwaysShowContainer")&&S.get("visible")){return;}if(!R){A._toggleHighlight(A._elCurListItem,"from");A._displayedItems=0;A._currentQuery=null;}if(R){S.show();A.fire("containerExpand");}else{S.hide();A.fire("containerCollapse");}},_toggleHighlight:function(R,S){var A=this;if(R){if(A._elCurListItem){A._elCurListItem.removeClass(d);A._elCurListItem=null;}if(S=="to"){R.addClass(d);A._elCurListItem=R;}}},_typeAhead:function(R,S){var A=this;if(!A.get("typeAhead")||Q.isKey(A._keyCode,c)){return;}var T=j.Node.getDOMNode(A.inputNode);if(T.setSelectionRange||T.createTextRange){A._typeAheadDelayId=setTimeout(function(){var W=T.value;var X=W.length;A._updateValue(R);var U=T.value.length;A.inputNode.selectText(X,U);var V=T.value.substr(X,U);A.fire("typeAhead",S,V);},A.get("typeAheadDelay"));}},_updateValue:function(V){var R=this;if(!R.get("suppressInputUpdate")){var U=R.inputNode;var A=V._resultMatch;var T=R.get("delimChar");T=(T&&T[0])||T;var W="";if(T){W=R._pastSelections;W+=A+T;if(T!=" "){W+=" ";}}else{W=A;}U.set("value",W);if(U.get("type")=="textarea"){U.set("scrollTop",U.get("scrollHeight"));}var S=W.length;U.selectText(S,S);R._elCurListItem=V;}},_currentQuery:null,_displayedItems:0,_elCurListItem:null,_initInputValue:null,_itemSelected:false,_keyCode:null,_lastValue:null,_overContainer:false,_pastSelections:"",_typeAheadDelayId:-1}});j.AutoComplete=k;},"1.5.0",{skinnable:true,requires:["aui-base","aui-overlay-base","datasource","dataschema","aui-form-combobox"]});