// ../yui/yui/yui-base-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
(function(){var I={},B=new Date().getTime(),A,E,H=function(){if(window.addEventListener){return function(M,L,K,J){M.addEventListener(L,K,(!!J));};}else{if(window.attachEvent){return function(L,K,J){L.attachEvent("on"+K,J);};}else{return function(){};}}}(),F=function(){if(window.removeEventListener){return function(M,L,K,J){M.removeEventListener(L,K,!!J);};}else{if(window.detachEvent){return function(L,K,J){L.detachEvent("on"+K,J);};}else{return function(){};}}}(),D=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;F(window,"load",D);},C={"io.xdrReady":1,"io.xdrResponse":1},G=Array.prototype.slice;if(typeof YUI==="undefined"||!YUI){YUI=function(O,N,M,L,J){var K=this,R=arguments,Q,P=R.length;if(!(K instanceof YUI)){return new YUI(O,N,M,L,J);}else{K._init();for(Q=0;Q<P;Q++){K._config(R[Q]);}K._setup();return K;}};}YUI.prototype={_config:function(N){N=N||{};var O=this.config,L,K,J,M;M=O.modules;for(L in N){if(M&&L=="modules"){J=N[L];for(K in J){if(J.hasOwnProperty(K)){M[K]=J[K];}}}else{if(L=="win"){O[L]=N[L].contentWindow||N[L];O.doc=O[L].document;}else{O[L]=N[L];}}}},_init:function(){var J="3.0.0",K=this;if(J.indexOf("@")>-1){J="test";}K.version=J;K.Env={mods:{},cdn:"http://yui.yahooapis.com/"+J+"/build/",bootstrapped:false,_idx:0,_used:{},_attached:{},_yidx:0,_uidx:0,_loaded:{}};K.Env._loaded[J]={};if(YUI.Env){K.Env._yidx=(++YUI.Env._yidx);K.Env._guidp=("yui_"+J+"-"+K.Env._yidx+"-"+B).replace(/\./g,"_");K.id=K.stamp(K);I[K.id]=K;}K.constructor=YUI;K.config={win:window||{},doc:document,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,fetchCSS:true,base:function(){var L,M,O,N;M=document.getElementsByTagName("script");for(O=0;O<M.length;O=O+1){N=M[O].src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);L=N&&N[1];if(L){break;}}return L||K.Env.cdn;}(),loaderPath:"loader/loader-min.js"};},_setup:function(J){this.use("yui-base");},applyTo:function(P,O,L){if(!(O in C)){this.log(O+": applyTo not allowed","warn","yui");return null;}var K=I[P],N,J,M;if(K){N=O.split(".");J=K;for(M=0;M<N.length;M=M+1){J=J[N[M]];if(!J){this.log("applyTo not found: "+O,"warn","yui");}}return J.apply(K,L);}return null;},add:function(K,M,J,L){YUI.Env.mods[K]={name:K,fn:M,version:J,details:L||{}};return this;},_attach:function(K,O){var T=YUI.Env.mods,L=this.Env._attached,Q,P=K.length,M,N,R,S,J;for(Q=0;Q<P;Q=Q+1){M=K[Q];N=T[M];if(!L[M]&&N){L[M]=true;R=N.details;S=R.requires;J=R.use;if(S){this._attach(this.Array(S));}if(N.fn){N.fn(this);}if(J){this._attach(this.Array(J));}}}},use:function(){if(this._loading){this._useQueue=this._useQueue||new this.Queue();this._useQueue.add(G.call(arguments,0));return this;}var K=this,U=G.call(arguments,0),Z=YUI.Env.mods,b=K.Env._used,V,O=U[0],M=false,X=U[U.length-1],W=K.config.bootstrap,P,R,N,Q=[],J=[],S=K.config.fetchCSS,T=function(d){if(b[d]){return;}var Y=Z[d],c,e,a;if(Y){b[d]=true;e=Y.details.requires;a=Y.details.use;}else{if(!YUI.Env._loaded[K.version][d]){Q.push(d);}else{b[d]=true;}}if(e){if(K.Lang.isString(e)){T(e);}else{for(c=0;c<e.length;c=c+1){T(e[c]);}}}J.push(d);},L;if(typeof X==="function"){U.pop();}else{X=null;}L=function(Y){Y=Y||{success:true,msg:"not dynamic"};if(X){X(K,Y);}if(K.fire){K.fire("yui:load",K,Y);}K._loading=false;if(K._useQueue&&K._useQueue.size()&&!K._loading){K.use.apply(K,K._useQueue.next());}};if(O==="*"){U=[];for(P in Z){if(Z.hasOwnProperty(P)){U.push(P);}}if(X){U.push(X);}return K.use.apply(K,U);}if(K.Loader){M=true;V=new K.Loader(K.config);V.require(U);V.ignoreRegistered=true;V.allowRollup=false;V.calculate(null,(S)?null:"js");U=V.sorted;}N=U.length;for(R=0;R<N;R=R+1){T(U[R]);}N=Q.length;if(N){Q=K.Object.keys(K.Array.hash(Q));}if(W&&N&&K.Loader){K._loading=true;V=new K.Loader(K.config);V.onSuccess=L;V.onFailure=L;V.onTimeout=L;V.context=K;V.attaching=U;V.require((S)?Q:U);V.insert(null,(S)?null:"js");}else{if(W&&N&&K.Get&&!K.Env.bootstrapped){K._loading=true;U=K.Array(arguments,0,true);K.Get.script(K.config.base+K.config.loaderPath,{onEnd:function(){K._loading=false;K.Env.bootstrapped=true;K._attach(["loader"]);K.use.apply(K,U);}});return K;}else{if(N){}K._attach(J);L();}}return K;},namespace:function(){var J=arguments,N=null,L,K,M;for(L=0;L<J.length;L=L+1){M=(""+J[L]).split(".");N=this;for(K=(M[0]=="YAHOO")?1:0;K<M.length;K=K+1){N[M[K]]=N[M[K]]||{};N=N[M[K]];}}return N;},log:function(){},error:function(K,J){if(this.config.throwFail){throw (J||new Error(K));}else{this.message(K,"error");}return this;},guid:function(J){var K=this.Env._guidp+(++this.Env._uidx);return(J)?(J+K):K;},stamp:function(L,M){if(!L){return L;}var J=(typeof L==="string")?L:L._yuid;if(!J){J=this.guid();if(!M){try{L._yuid=J;}catch(K){J=null;}}}return J;}};A=YUI.prototype;for(E in A){YUI[E]=A[E];}YUI._init();H(window,"load",D);YUI.Env.add=H;YUI.Env.remove=F;})();YUI.add("yui-base",function(B){function A(){this._init();this.add.apply(this,arguments);}A.prototype={_init:function(){this._q=[];},next:function(){return this._q.shift();},add:function(){B.Array.each(B.Array(arguments,0,true),function(C){this._q.push(C);},this);return this;},size:function(){return this._q.length;}};B.Queue=A;(function(){B.Lang=B.Lang||{};var R=B.Lang,G="array",I="boolean",D="date",M="error",S="function",H="number",K="null",F="object",O="regexp",N="string",C=Object.prototype.toString,P="undefined",E={"undefined":P,"number":H,"boolean":I,"string":N,"[object Function]":S,"[object RegExp]":O,"[object Array]":G,"[object Date]":D,"[object Error]":M},J=/^\s+|\s+$/g,Q="";R.isArray=function(L){return R.type(L)===G;};R.isBoolean=function(L){return typeof L===I;};R.isFunction=function(L){return R.type(L)===S;};R.isDate=function(L){return R.type(L)===D;};R.isNull=function(L){return L===null;};R.isNumber=function(L){return typeof L===H&&isFinite(L);};R.isObject=function(T,L){return(T&&(typeof T===F||(!L&&R.isFunction(T))))||false;};R.isString=function(L){return typeof L===N;};R.isUndefined=function(L){return typeof L===P;};R.trim=function(L){try{return L.replace(J,Q);}catch(T){return L;}};R.isValue=function(T){var L=R.type(T);
switch(L){case H:return isFinite(T);case K:case P:return false;default:return !!(L);}};R.type=function(L){return E[typeof L]||E[C.call(L)]||(L?F:K);};})();(function(){var C=B.Lang,D=Array.prototype,E=function(M,J,L){var I=(L)?2:B.Array.test(M),H,G,F;if(I){try{return D.slice.call(M,J||0);}catch(K){F=[];for(H=0,G=M.length;H<G;H=H+1){F.push(M[H]);}return F;}}else{return[M];}};B.Array=E;E.test=function(H){var F=0;if(C.isObject(H)){if(C.isArray(H)){F=1;}else{try{if("length" in H&&!("tagName" in H)&&!("alert" in H)&&(!B.Lang.isFunction(H.size)||H.size()>1)){F=2;}}catch(G){}}}return F;};E.each=(D.forEach)?function(F,G,H){D.forEach.call(F||[],G,H||B);return B;}:function(G,I,J){var F=(G&&G.length)||0,H;for(H=0;H<F;H=H+1){I.call(J||B,G[H],H,G);}return B;};E.hash=function(H,G){var K={},F=H.length,J=G&&G.length,I;for(I=0;I<F;I=I+1){K[H[I]]=(J&&J>I)?G[I]:true;}return K;};E.indexOf=(D.indexOf)?function(F,G){return D.indexOf.call(F,G);}:function(F,H){for(var G=0;G<F.length;G=G+1){if(F[G]===H){return G;}}return -1;};E.numericSort=function(G,F){return(G-F);};E.some=(D.some)?function(F,G,H){return D.some.call(F,G,H);}:function(G,I,J){var F=G.length,H;for(H=0;H<F;H=H+1){if(I.call(J,G[H],H,G)){return true;}}return false;};})();(function(){var D=B.Lang,C="__",E=function(H,G){var F=G.toString;if(D.isFunction(F)&&F!=Object.prototype.toString){H.toString=F;}};B.merge=function(){var G=arguments,I={},H,F=G.length;for(H=0;H<F;H=H+1){B.mix(I,G[H],true);}return I;};B.mix=function(F,O,H,N,L,M){if(!O||!F){return F||B;}if(L){switch(L){case 1:return B.mix(F.prototype,O.prototype,H,N,0,M);case 2:B.mix(F.prototype,O.prototype,H,N,0,M);break;case 3:return B.mix(F,O.prototype,H,N,0,M);case 4:return B.mix(F.prototype,O,H,N,0,M);default:}}var K=M&&D.isArray(F),J,I,G;if(N&&N.length){for(J=0,I=N.length;J<I;++J){G=N[J];if(G in O){if(M&&D.isObject(F[G],true)){B.mix(F[G],O[G]);}else{if(!K&&(H||!(G in F))){F[G]=O[G];}else{if(K){F.push(O[G]);}}}}}}else{for(J in O){if(M&&D.isObject(F[J],true)){B.mix(F[J],O[J]);}else{if(!K&&(H||!(J in F))){F[J]=O[J];}else{if(K){F.push(O[J]);}}}}if(B.UA.ie){E(F,O);}}return F;};B.cached=function(H,F,G){F=F||{};return function(L,K){var J=(K)?Array.prototype.join.call(arguments,C):L,I=F[J];if(!(J in F)||(G&&F[J]==G)){F[J]=H.apply(H,arguments);}return F[J];};};})();(function(){B.Object=function(H){var G=function(){};G.prototype=H;return new G();};var E=B.Object,D=undefined,C=function(J,I){var H=(I===2),F=(H)?0:[],G;for(G in J){if(H){F++;}else{if(J.hasOwnProperty(G)){F.push((I)?J[G]:G);}}}return F;};E.keys=function(F){return C(F);};E.values=function(F){return C(F,1);};E.size=function(F){return C(F,2);};E.hasKey=function(G,F){return(F in G);};E.hasValue=function(G,F){return(B.Array.indexOf(E.values(G),F)>-1);};E.owns=function(G,F){return(G.hasOwnProperty(F));};E.each=function(J,I,K,H){var G=K||B,F;for(F in J){if(H||J.hasOwnProperty(F)){I.call(G,J[F],F,J);}}return B;};E.getValue=function(J,I){var H=B.Array(I),F=H.length,G;for(G=0;J!==D&&G<F;G=G+1){J=J[H[G]];}return J;};E.setValue=function(L,J,K){var I=B.Array(J),H=I.length-1,F,G=L;if(H>=0){for(F=0;G!==D&&F<H;F=F+1){G=G[I[F]];}if(G!==D){G[I[F]]=K;}else{return D;}}return L;};})();B.UA=function(){var F=function(J){var K=0;return parseFloat(J.replace(/\./g,function(){return(K++==1)?"":".";}));},I=navigator,H={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:I.cajaVersion,secure:false,os:null},E=I&&I.userAgent,G=B.config.win.location,D=G&&G.href,C;H.secure=D&&(D.toLowerCase().indexOf("https")===0);if(E){if((/windows|win32/i).test(E)){H.os="windows";}else{if((/macintosh/i).test(E)){H.os="macintosh";}}if((/KHTML/).test(E)){H.webkit=1;}C=E.match(/AppleWebKit\/([^\s]*)/);if(C&&C[1]){H.webkit=F(C[1]);if(/ Mobile\//.test(E)){H.mobile="Apple";}else{C=E.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(C){H.mobile=C[0];}}C=E.match(/AdobeAIR\/([^\s]*)/);if(C){H.air=C[0];}}if(!H.webkit){C=E.match(/Opera[\s\/]([^\s]*)/);if(C&&C[1]){H.opera=F(C[1]);C=E.match(/Opera Mini[^;]*/);if(C){H.mobile=C[0];}}else{C=E.match(/MSIE\s([^;]*)/);if(C&&C[1]){H.ie=F(C[1]);}else{C=E.match(/Gecko\/([^\s]*)/);if(C){H.gecko=1;C=E.match(/rv:([^\s\)]*)/);if(C&&C[1]){H.gecko=F(C[1]);}}}}}}return H;}();(function(){var F=["yui-base"],D,I=B.config,H=YUI.Env.mods,G,E;B.use.apply(B,F);if(I.core){D=I.core;}else{D=[];G=["get","loader","yui-log","yui-later"];for(E=0;E<G.length;E++){if(H[G[E]]){D.push(G[E]);}}}B.use.apply(B,D);})();},"3.0.0");
// ../yui/yui/yui-log-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("yui-log",function(A){(function(){var D=A,F="yui:log",B="undefined",C={debug:1,info:1,warn:1,error:1},E;D.log=function(I,Q,G,O){var H=D,P=H.config,K=false,N,L,J,M;if(P.debug){if(G){N=P.logExclude;L=P.logInclude;if(L&&!(G in L)){K=1;}else{if(N&&(G in N)){K=1;}}}if(!K){if(P.useBrowserConsole){J=(G)?G+": "+I:I;if(typeof console!=B&&console.log){M=(Q&&console[Q]&&(Q in C))?Q:"log";console[M](J);}else{if(typeof opera!=B){opera.postError(J);}}}if(H.fire&&!O){if(!E){H.publish(F,{broadcast:2,emitFacade:1});E=1;}H.fire(F,{msg:I,cat:Q,src:G});}}}return H;};D.message=function(){return D.log.apply(D,arguments);};})();},"3.0.0",{requires:["yui-base"]});
// ../yui/yui/yui-later-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("yui-later",function(A){(function(){var B=A.Lang,C=function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=A.Array(G),I,D;if(B.isString(L)){F=E[L];}if(!F){}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{id:D,interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};};A.later=C;B.later=C;})();},"3.0.0",{requires:["yui-base"]});
// ../yui/oop/oop-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("oop",function(F){var E=F.Lang,D=F.Array,C=Object.prototype,B="_~yuim~_";F.augment=function(A,T,I,R,N){var L=T.prototype,P=null,S=T,O=(N)?F.Array(N):[],H=A.prototype,M=H||A,Q=false,G,J,K;if(H&&S){G={};J={};P={};F.each(L,function(V,U){J[U]=function(){for(K in G){if(G.hasOwnProperty(K)&&(this[K]===J[K])){this[K]=G[K];}}S.apply(this,O);return G[U].apply(this,arguments);};if((!R||(U in R))&&(I||!(U in this))){if(E.isFunction(V)){G[U]=V;this[U]=J[U];}else{this[U]=V;}}},P,true);}else{Q=true;}F.mix(M,P||L,I,R);if(Q){T.apply(M,O);}return A;};F.aggregate=function(H,G,A,I){return F.mix(H,G,A,I,0,true);};F.extend=function(I,H,A,K){if(!H||!I){F.error("extend failed, verify dependencies");}var J=H.prototype,G=F.Object(J);I.prototype=G;G.constructor=I;I.superclass=J;if(H!=Object&&J.constructor==C.constructor){J.constructor=H;}if(A){F.mix(G,A,true);}if(K){F.mix(I,K,true);}return I;};F.each=function(H,G,I,A){if(H.each&&H.item){return H.each.call(H,G,I);}else{switch(D.test(H)){case 1:return D.each(H,G,I);case 2:return D.each(F.Array(H,0,true),G,I);default:return F.Object.each(H,G,I,A);}}};F.clone=function(I,J,M,N,H,L){if(!E.isObject(I)){return I;}var K,G=L||{},A;switch(E.type(I)){case"date":return new Date(I);case"regexp":return new RegExp(I.source);case"function":K=F.bind(I,H);break;case"array":K=[];break;default:if(I[B]){return G[I[B]];}A=F.guid();K=(J)?{}:F.Object(I);I[B]=A;G[A]=I;}if(!I.addEventListener&&!I.attachEvent){F.each(I,function(P,O){if(!M||(M.call(N||this,P,O,this,I)!==false)){if(O!==B){this[O]=F.clone(P,J,M,N,H||I,G);}}},K);}if(!L){F.each(G,function(P,O){delete P[B];});G=null;}return K;};F.bind=function(A,H){var G=arguments.length>2?F.Array(arguments,2,true):null;return function(){var J=E.isString(A)?H[A]:A,I=(G)?G.concat(F.Array(arguments,0,true)):arguments;return J.apply(H||J,I);};};F.rbind=function(A,H){var G=arguments.length>2?F.Array(arguments,2,true):null;return function(){var J=E.isString(A)?H[A]:A,I=(G)?F.Array(arguments,0,true).concat(G):arguments;return J.apply(H||J,I);};};},"3.0.0");
// ../yui/event/event-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
(function(){var GLOBAL_ENV=YUI.Env,C=YUI.config,D=C.doc,POLL_INTERVAL=C.pollInterval||40,_ready=function(e){GLOBAL_ENV._ready();};if(!GLOBAL_ENV._ready){GLOBAL_ENV._ready=function(){if(!GLOBAL_ENV.DOMReady){GLOBAL_ENV.DOMReady=true;if(D.removeEventListener){D.removeEventListener("DOMContentLoaded",_ready,false);}}};
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
if(navigator.userAgent.match(/MSIE/)){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;_ready();}};}else{GLOBAL_ENV._dri=setInterval(function(){try{document.documentElement.doScroll("left");clearInterval(GLOBAL_ENV._dri);GLOBAL_ENV._dri=null;_ready();}catch(ex){}},POLL_INTERVAL);}}else{D.addEventListener("DOMContentLoaded",_ready,false);}}})();YUI.add("event-base",function(A){(function(){var C=YUI.Env,B=function(){A.fire("domready");};A.publish("domready",{fireOnce:true});if(C.DOMReady){B();}else{A.before(B,C,"_ready");}})();(function(){var C=A.UA,B={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},D=function(F){try{if(F&&3==F.nodeType){F=F.parentNode;}}catch(E){return null;}return A.one(F);};A.DOMEventFacade=function(L,F,E){E=E||{};var H=L,G=F,I=A.config.doc,M=I.body,N=H.pageX,K=H.pageY,J,O;this.altKey=H.altKey;this.ctrlKey=H.ctrlKey;this.metaKey=H.metaKey;this.shiftKey=H.shiftKey;this.type=H.type;this.clientX=H.clientX;this.clientY=H.clientY;if(!N&&0!==N){N=H.clientX||0;K=H.clientY||0;if(C.ie){N+=Math.max(I.documentElement.scrollLeft,M.scrollLeft);K+=Math.max(I.documentElement.scrollTop,M.scrollTop);}}this._yuifacade=true;this._event=H;this.pageX=N;this.pageY=K;J=H.keyCode||H.charCode||0;if(C.webkit&&(J in B)){J=B[J];}this.keyCode=J;this.charCode=J;this.button=H.which||H.button;this.which=this.button;this.target=D(H.target||H.srcElement);this.currentTarget=D(G);O=H.relatedTarget;if(!O){if(H.type=="mouseout"){O=H.toElement;}else{if(H.type=="mouseover"){O=H.fromElement;}}}this.relatedTarget=D(O);if(H.type=="mousewheel"||H.type=="DOMMouseScroll"){this.wheelDelta=(H.detail)?(H.detail*-1):Math.round(H.wheelDelta/80)||((H.wheelDelta<0)?-1:1);}this.stopPropagation=function(){if(H.stopPropagation){H.stopPropagation();}else{H.cancelBubble=true;}E.stopped=1;};this.stopImmediatePropagation=function(){if(H.stopImmediatePropagation){H.stopImmediatePropagation();}else{this.stopPropagation();}E.stopped=2;};this.preventDefault=function(P){if(H.preventDefault){H.preventDefault();}H.returnValue=P||false;E.prevented=1;};this.halt=function(P){if(P){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();};};})();(function(){A.Env.evt.dom_wrappers={};A.Env.evt.dom_map={};var H=A.Env.evt,J=YUI.Env.add,D=YUI.Env.remove,G=function(){YUI.Env.windowLoaded=true;A.Event._load();D(window,"load",G);},B=function(){A.Event._unload();D(window,"unload",B);},C="domready",E="~yui|2|compat~",F=function(L){try{return(L&&typeof L!=="string"&&A.Lang.isNumber(L.length)&&!L.tagName&&!L.alert);}catch(K){return false;}},I=function(){var M=false,N=0,L=[],O=H.dom_wrappers,K=null,P=H.dom_map;return{POLL_RETRYS:1000,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:false,startInterval:function(){var Q=A.Event;if(!Q._interval){Q._interval=setInterval(A.bind(Q._poll,Q),Q.POLL_INTERVAL);}},onAvailable:function(Q,U,Y,R,V,X){var W=A.Array(Q),S,T;for(S=0;S<W.length;S=S+1){L.push({id:W[S],fn:U,obj:Y,override:R,checkReady:V,compat:X});}N=this.POLL_RETRYS;setTimeout(A.bind(A.Event._poll,A.Event),0);T=new A.EventHandle({_delete:function(){if(T.handle){T.handle.detach();return;}var a,Z;for(a=0;a<W.length;a++){for(Z=0;Z<L.length;Z++){if(W[a]===L[Z].id){L.splice(Z,1);}}}}});return T;},onContentReady:function(U,R,T,S,Q){return this.onAvailable(U,R,T,S,true,Q);},attach:function(T,S,R,Q){return A.Event._attach(A.Array(arguments,0,true));},_createWrapper:function(W,V,Q,R,U){var X=A.stamp(W),T="event:"+X+V,S;if(false===U){T+="native";}if(Q){T+="capture";}S=O[T];if(!S){S=A.publish(T,{silent:true,bubbles:false,contextFn:function(){S.nodeRef=S.nodeRef||A.one(S.el);return S.nodeRef;}});S.el=W;S.key=T;S.domkey=X;S.type=V;S.fn=function(Y){S.fire(A.Event.getEvent(Y,W,(R||(false===U))));};S.capture=Q;if(W==A.config.win&&V=="load"){S.fireOnce=true;K=T;}O[T]=S;P[X]=P[X]||{};P[X][T]=S;J(W,V,S.fn,Q);}return S;},_attach:function(W,S){var a,e=A.Event,c,U,Z,Q,T=false,V,X=W[0],Y=W[1],R=W[2]||A.config.win,d=S&&S.facade,b=S&&S.capture;if(W[W.length-1]===E){a=true;}if(!Y||!Y.call){return false;}if(F(R)){c=[];A.each(R,function(g,f){W[2]=g;c.push(e._attach(W,S));});return new A.EventHandle(c);}else{if(A.Lang.isString(R)){if(a){U=A.DOM.byId(R);}else{U=A.Selector.query(R);switch(U.length){case 0:U=null;break;case 1:U=U[0];break;default:W[2]=U;return e._attach(W,S);}}if(U){R=U;}else{V=this.onAvailable(R,function(){V.handle=e._attach(W,S);},e,true,false,a);return V;}}}if(!R){return false;}if(A.Node&&R instanceof A.Node){R=A.Node.getDOMNode(R);}Z=this._createWrapper(R,X,b,a,d);if(R==A.config.win&&X=="load"){if(YUI.Env.windowLoaded){T=true;}}if(a){W.pop();}Q=W[3];V=Z._on(Y,Q,(W.length>4)?W.slice(4):null);if(T){Z.fire();}return V;},detach:function(X,Z,S,U){var W=A.Array(arguments,0,true),a,V,T,Y,Q,R;if(W[W.length-1]===E){a=true;}if(X&&X.detach){return X.detach();}if(typeof S=="string"){if(a){S=A.DOM.byId(S);}else{S=A.Selector.query(S);T=S.length;if(T<1){S=null;}else{if(T==1){S=S[0];}}}}if(!S){return false;}if(F(S)){Y=true;for(V=0,T=S.length;V<T;++V){W[2]=S[V];Y=(A.Event.detach.apply(A.Event,W)&&Y);}return Y;}if(!X||!Z||!Z.call){return this.purgeElement(S,false,X);}Q="event:"+A.stamp(S)+X;R=O[Q];if(R){return R.detach(Z);}else{return false;}},getEvent:function(T,R,Q){var S=T||window.event;return(Q)?S:new A.DOMEventFacade(S,R,O["event:"+A.stamp(R)+T.type]);},generateId:function(Q){var R=Q.id;if(!R){R=A.stamp(Q);Q.id=R;}return R;},_isValidCollection:F,_load:function(Q){if(!M){M=true;if(A.fire){A.fire(C);}A.Event._poll();}},_poll:function(){if(this.locked){return;
}if(A.UA.ie&&!YUI.Env.DOMReady){this.startInterval();return;}this.locked=true;var V=!M,U,W,R,Q,T,S;if(!V){V=(N>0);}U=[];W=function(Z,a){var Y,X=a.override;if(a.compat){if(a.override){if(X===true){Y=a.obj;}else{Y=X;}}else{Y=Z;}a.fn.call(Y,a.obj);}else{Y=a.obj||A.one(Z);a.fn.apply(Y,(A.Lang.isArray(X))?X:[]);}};for(R=0,Q=L.length;R<Q;++R){T=L[R];if(T&&!T.checkReady){S=(T.compat)?A.DOM.byId(T.id):A.Selector.query(T.id,null,true);if(S){W(S,T);L[R]=null;}else{U.push(T);}}}for(R=0,Q=L.length;R<Q;++R){T=L[R];if(T&&T.checkReady){S=(T.compat)?A.DOM.byId(T.id):A.Selector.query(T.id,null,true);if(S){if(M||(S.get&&S.get("nextSibling"))||S.nextSibling){W(S,T);L[R]=null;}}else{U.push(T);}}}N=(U.length===0)?0:N-1;if(V){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return;},purgeElement:function(W,X,V){var S=(A.Lang.isString(W))?A.Selector.query(W,null,true):W,R=this.getListeners(S,V),T,Q,U;if(R){for(T=0,Q=R.length;T<Q;++T){U=R[T];U.detachAll();D(U.el,U.type,U.fn,U.capture);delete O[U.key];delete P[U.domkey][U.key];}}if(X&&S&&S.childNodes){for(T=0,Q=S.childNodes.length;T<Q;++T){this.purgeElement(S.childNodes[T],X,V);}}},getListeners:function(U,T){var V=A.stamp(U,true),Q=P[V],S=[],R=(T)?"event:"+V+T:null;if(!Q){return null;}if(R){if(Q[R]){S.push(Q[R]);}R+="native";if(Q[R]){S.push(Q[R]);}}else{A.each(Q,function(X,W){S.push(X);});}return(S.length)?S:null;},_unload:function(Q){A.each(O,function(S,R){S.detachAll();D(S.el,S.type,S.fn,S.capture);delete O[R];delete P[S.domkey][R];});},nativeAdd:J,nativeRemove:D};}();A.Event=I;if(A.config.injected||YUI.Env.windowLoaded){G();}else{J(window,"load",G);}if(A.UA.ie){A.on(C,I._poll,I,true);}A.on("unload",B);I.Custom=A.CustomEvent;I.Subscriber=A.Subscriber;I.Target=A.EventTarget;I.Handle=A.EventHandle;I.Facade=A.EventFacade;I._poll();})();A.Env.evt.plugins.available={on:function(D,C,F,E){var B=arguments.length>4?A.Array(arguments,4,true):[];return A.Event.onAvailable.call(A.Event,F,C,E,B);}};A.Env.evt.plugins.contentready={on:function(D,C,F,E){var B=arguments.length>4?A.Array(arguments,4,true):[];return A.Event.onContentReady.call(A.Event,F,C,E,B);}};},"3.0.0",{requires:["event-custom-base"]});YUI.add("event-delegate",function(B){var I=B.Event,F=B.Lang,E={},A={mouseenter:"mouseover",mouseleave:"mouseout"},H=function(K){try{if(K&&3==K.nodeType){return K.parentNode;}}catch(J){}return K;},D=function(K,P,M){var Q=H((P.target||P.srcElement)),N=E[K],T,O,L,S,R;var J=function(X,U,V){var W;if(!X||X===V){W=false;}else{W=B.Selector.test(X,U)?X:J(X.parentNode,U,V);}return W;};for(T in N){if(N.hasOwnProperty(T)){O=N[T];S=N.fn;L=null;if(B.Selector.test(Q,T,M)){L=Q;}else{if(B.Selector.test(Q,((T.replace(/,/gi," *,"))+" *"),M)){L=J(Q,T,M);}}if(L){if(!R){R=new B.DOMEventFacade(P,M);R.container=R.currentTarget;}R.currentTarget=B.Node.get(L);B.publish(O,{contextFn:function(){return R.currentTarget;}});if(S){S(R,O);}else{B.fire(O,R);}}}}},G=function(M,L,K){var O={focus:I._attachFocus,blur:I._attachBlur},N=O[M],J=[M,function(P){D(L,(P||window.event),K);},K];if(N){return N(J,{capture:true,facade:false});}else{return I._attach(J,{facade:false});}},C=B.cached(function(J){return J.replace(/[|,:]/g,"~");});B.Env.evt.plugins.delegate={on:function(O,N,M,J,K){var L=B.Array(arguments,0,true);L.splice(3,1);L[0]=J;return B.delegate.apply(B,L);}};I.delegate=function(R,U,K,W){if(!W){return false;}var O=B.Array(arguments,0,true),M=K,N;if(F.isString(K)){M=B.Selector.query(K,null,true);if(!M){N=I.onAvailable(K,function(){N.handle=I.delegate.apply(I,O);},I,true,false);return N;}}M=B.Node.getDOMNode(M);var S=B.stamp(M),L="delegate:"+S+R+C(W),J=R+S,Q=E[J],T,V,P;if(!Q){Q={};if(A[R]){if(!I._fireMouseEnter){return false;}R=A[R];Q.fn=I._fireMouseEnter;}T=G(R,J,M);B.after(function(X){if(T.sub==X){delete E[J];B.detachAll(L);}},T.evt,"_delete");Q.handle=T;E[J]=Q;}P=Q.listeners;Q.listeners=P?(P+1):1;Q[W]=L;O[0]=L;O.splice(2,2);V=B.on.apply(B,O);B.after(function(){Q.listeners=(Q.listeners-1);if(Q.listeners===0){Q.handle.detach();}},V,"detach");return V;};B.delegate=I.delegate;},"3.0.0",{requires:["node-base"]});YUI.add("event-mousewheel",function(C){var B="DOMMouseScroll",A=function(E){var D=C.Array(E,0,true),F;if(C.UA.gecko){D[0]=B;F=C.config.win;}else{F=C.config.doc;}if(D.length<3){D[2]=F;}else{D.splice(2,0,F);}return D;};C.Env.evt.plugins.mousewheel={on:function(){return C.Event._attach(A(arguments));},detach:function(){return C.Event.detach.apply(C.Event,A(arguments));}};},"3.0.0",{requires:["node-base"]});YUI.add("event-mouseenter",function(F){var C=F.Event,E=F.Lang,B=F.Env.evt.plugins,D={},A={on:function(M,O,H){var L=F.Array(arguments,0,true),J=H,K;if(E.isString(H)){J=F.all(H);if(J.size()===0){K=C.onAvailable(H,function(){K.handle=F.on.apply(F,L);},C,true,false);return K;}}var R=(M==="mouseenter")?"mouseover":"mouseout",Q=M+":"+F.stamp(J)+R,I=D[Q],N,P,G;if(!I){N=F.on(R,F.rbind(C._fireMouseEnter,F,Q),J);F.after(function(S){if(N.sub==S){delete D[Q];F.detachAll(Q);}},N.evt,"_delete");I={};I.handle=N;D[Q]=I;}G=I.count;I.count=G?(G+1):1;L[0]=Q;L.splice(2,1);P=F.on.apply(F,L);F.after(function(){I.count=(I.count-1);if(I.count===0){I.handle.detach();}},P,"detach");return P;}};C._fireMouseEnter=function(J,H){var G=J.relatedTarget,I=J.currentTarget;if(I!==G&&!I.contains(G)){F.publish(H,{contextFn:function(){return I;}});F.fire(H,J);}};B.mouseenter=A;B.mouseleave=A;},"3.0.0",{requires:["node-base"]});YUI.add("event-key",function(A){A.Env.evt.plugins.key={on:function(E,G,B,K,C){var I=A.Array(arguments,0,true),F,J,H,D;F=K&&K.split(":");if(!K||K.indexOf(":")==-1||!F[1]){I[0]="key"+((F&&F[0])||"press");return A.on.apply(A,I);}J=F[0];H=(F[1])?F[1].split(/,|\+/):null;D=(A.Lang.isString(B)?B:A.stamp(B))+K;D=D.replace(/,/g,"_");if(!A.getEvent(D)){A.on(E+J,function(P){var Q=false,M=false,N,L,O;for(N=0;N<H.length;N=N+1){L=H[N];O=parseInt(L,10);if(A.Lang.isNumber(O)){if(P.charCode===O){Q=true;}else{M=true;}}else{if(Q||!M){Q=(P[L+"Key"]);M=!Q;}}}if(Q){A.fire(D,P);}},B);
}I.splice(2,2);I[0]=D;return A.on.apply(A,I);}};},"3.0.0",{requires:["node-base"]});YUI.add("event-focus",function(A){(function(){var I=A.UA,J=A.Event,E=A.Env.evt.plugins,C=I.ie,F=(I.opera||I.webkit),D={focus:(C?"focusin":(F?"DOMFocusIn":"focus")),blur:(C?"focusout":(F?"DOMFocusOut":"blur"))},G={capture:(I.gecko?true:false)},H=function(M,L){var K=A.Array(M,0,true);K[0]=D[K[0]];return J._attach(K,L);},B={on:function(){return H(arguments,G);}};J._attachFocus=H;J._attachBlur=H;E.focus=B;E.blur=B;})();},"3.0.0",{requires:["node-base"]});YUI.add("event-resize",function(A){(function(){var C,B,E="window:resize",D=function(F){if(A.UA.gecko){A.fire(E,F);}else{if(B){B.cancel();}B=A.later(A.config.windowResizeDelay||40,A,function(){A.fire(E,F);});}};A.Env.evt.plugins.windowresize={on:function(H,G){if(!C){C=A.Event._attach(["resize",D]);}var F=A.Array(arguments,0,true);F[0]=E;return A.on.apply(A,F);}};})();},"3.0.0",{requires:["node-base"]});YUI.add("event",function(A){},"3.0.0",{use:["event-base","event-delegate","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize"]});
// ../yui/event/event-key-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("event-key",function(A){A.Env.evt.plugins.key={on:function(E,G,B,K,C){var I=A.Array(arguments,0,true),F,J,H,D;F=K&&K.split(":");if(!K||K.indexOf(":")==-1||!F[1]){I[0]="key"+((F&&F[0])||"press");return A.on.apply(A,I);}J=F[0];H=(F[1])?F[1].split(/,|\+/):null;D=(A.Lang.isString(B)?B:A.stamp(B))+K;D=D.replace(/,/g,"_");if(!A.getEvent(D)){A.on(E+J,function(P){var Q=false,M=false,N,L,O;for(N=0;N<H.length;N=N+1){L=H[N];O=parseInt(L,10);if(A.Lang.isNumber(O)){if(P.charCode===O){Q=true;}else{M=true;}}else{if(Q||!M){Q=(P[L+"Key"]);M=!Q;}}}if(Q){A.fire(D,P);}},B);}I.splice(2,2);I[0]=D;return A.on.apply(A,I);}};},"3.0.0",{requires:["node-base"]});
// ../yui/event-custom/event-custom-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("event-custom-base",function(E){E.Env.evt={handles:{},plugins:{}};(function(){var F=0,G=1;E.Do={objs:{},before:function(I,K,L,M){var J=I,H;if(M){H=[I,M].concat(E.Array(arguments,4,true));J=E.rbind.apply(E,H);}return this._inject(F,J,K,L);},after:function(I,K,L,M){var J=I,H;if(M){H=[I,M].concat(E.Array(arguments,4,true));J=E.rbind.apply(E,H);}return this._inject(G,J,K,L);},_inject:function(H,J,K,M){var N=E.stamp(K),L,I;if(!this.objs[N]){this.objs[N]={};}L=this.objs[N];if(!L[M]){L[M]=new E.Do.Method(K,M);K[M]=function(){return L[M].exec.apply(L[M],arguments);};}I=N+E.stamp(J)+M;L[M].register(I,J,H);return new E.EventHandle(L[M],I);},detach:function(H){if(H.detach){H.detach();}},_unload:function(I,H){}};E.Do.Method=function(H,I){this.obj=H;this.methodName=I;this.method=H[I];this.before={};this.after={};};E.Do.Method.prototype.register=function(I,J,H){if(H){this.after[I]=J;}else{this.before[I]=J;}};E.Do.Method.prototype._delete=function(H){delete this.before[H];delete this.after[H];};E.Do.Method.prototype.exec=function(){var J=E.Array(arguments,0,true),K,I,N,L=this.before,H=this.after,M=false;for(K in L){if(L.hasOwnProperty(K)){I=L[K].apply(this.obj,J);if(I){switch(I.constructor){case E.Do.Halt:return I.retVal;case E.Do.AlterArgs:J=I.newArgs;break;case E.Do.Prevent:M=true;break;default:}}}}if(!M){I=this.method.apply(this.obj,J);}for(K in H){if(H.hasOwnProperty(K)){N=H[K].apply(this.obj,J);if(N&&N.constructor==E.Do.Halt){return N.retVal;}else{if(N&&N.constructor==E.Do.AlterReturn){I=N.newRetVal;}}}}return I;};E.Do.AlterArgs=function(I,H){this.msg=I;this.newArgs=H;};E.Do.AlterReturn=function(I,H){this.msg=I;this.newRetVal=H;};E.Do.Halt=function(I,H){this.msg=I;this.retVal=H;};E.Do.Prevent=function(H){this.msg=H;};E.Do.Error=E.Do.Halt;})();var D="after",B=["broadcast","bubbles","context","contextFn","currentTarget","defaultFn","details","emitFacade","fireOnce","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],C=9,A="yui:log";E.EventHandle=function(F,G){this.evt=F;this.sub=G;};E.EventHandle.prototype={detach:function(){var F=this.evt,G;if(F){if(E.Lang.isArray(F)){for(G=0;G<F.length;G++){F[G].detach();}}else{F._delete(this.sub);}}}};E.CustomEvent=function(F,G){G=G||{};this.id=E.stamp(this);this.type=F;this.context=E;this.logSystem=(F==A);this.silent=this.logSystem;this.subscribers={};this.afters={};this.preventable=true;this.bubbles=true;this.signature=C;this.applyConfig(G,true);};E.CustomEvent.prototype={applyConfig:function(G,F){if(G){E.mix(this,G,F,B);}},_on:function(J,H,G,F){if(!J){this.log("Invalid callback for CE: "+this.type);}var I=new E.Subscriber(J,H,G,F);if(this.fireOnce&&this.fired){E.later(0,this,E.bind(this._notify,this,I,this.firedWith));}if(F==D){this.afters[I.id]=I;this.hasAfters=true;}else{this.subscribers[I.id]=I;this.hasSubscribers=true;}return new E.EventHandle(this,I);},subscribe:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;return this._on(H,G,F,true);},on:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;return this._on(H,G,F,true);},after:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;return this._on(H,G,F,D);},detach:function(J,H){if(J&&J.detach){return J.detach();}var K=0,G=this.subscribers,F,I;for(F in G){if(G.hasOwnProperty(F)){I=G[F];if(I&&(!J||J===I.fn)){this._delete(I);K++;}}}return K;},unsubscribe:function(){return this.detach.apply(this,arguments);},_notify:function(I,H,F){this.log(this.type+"->"+"sub: "+I.id);var G;G=I.notify(H,this);if(false===G||this.stopped>1){this.log(this.type+" cancelled by subscriber");return false;}return true;},log:function(G,F){if(!this.silent){}},fire:function(){if(this.fireOnce&&this.fired){this.log("fireOnce event: "+this.type+" already fired");return true;}else{var F=E.Array(arguments,0,true);this.fired=true;this.firedWith=F;if(this.emitFacade){return this.fireComplex(F);}else{return this.fireSimple(F);}}},fireSimple:function(F){if(this.hasSubscribers||this.hasAfters){this._procSubs(E.merge(this.subscribers,this.afters),F);}this._broadcast(F);return this.stopped?false:true;},fireComplex:function(F){F[0]=F[0]||{};return this.fireSimple(F);},_procSubs:function(I,G,F){var J,H;for(H in I){if(I.hasOwnProperty(H)){J=I[H];if(J&&J.fn){if(false===this._notify(J,G,F)){this.stopped=2;}if(this.stopped==2){return false;}}}}return true;},_broadcast:function(G){if(!this.stopped&&this.broadcast){var F=E.Array(G);F.unshift(this.type);if(this.host!==E){E.fire.apply(E,F);}if(this.broadcast==2){E.Global.fire.apply(E.Global,F);}}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},detachAll:function(){return this.detach();},_delete:function(F){if(F){delete F.fn;delete F.context;delete this.subscribers[F.id];delete this.afters[F.id];}}};E.Subscriber=function(H,G,F){this.fn=H;this.context=G;this.id=E.stamp(this);this.args=F;this.events=null;};E.Subscriber.prototype={_notify:function(J,H,I){var F=this.args,G;switch(I.signature){case 0:G=this.fn.call(J,I.type,H,J);break;case 1:G=this.fn.call(J,H[0]||null,J);break;default:if(F||H){H=H||[];F=(F)?H.concat(F):H;G=this.fn.apply(J,F);}else{G=this.fn.call(J);}}return G;},notify:function(G,I){var J=this.context,F=true;if(!J){J=(I.contextFn)?I.contextFn():I.context;}if(E.config.throwFail){F=this._notify(J,G,I);}else{try{F=this._notify(J,G,I);}catch(H){E.error(this+" failed: "+H.message,H);}}return F;},contains:function(G,F){if(F){return((this.fn==G)&&this.context==F);}else{return(this.fn==G);}}};(function(){var F=E.Lang,H=":",I="|",J="~AFTER~",K=E.cached(function(L,N){if(!N||!F.isString(L)||L.indexOf(H)>-1){return L;}return N+H+L;}),G=E.cached(function(O,Q){var N=O,P,R,L;if(!F.isString(N)){return N;}L=N.indexOf(J);if(L>-1){R=true;N=N.substr(J.length);}L=N.indexOf(I);if(L>-1){P=N.substr(0,(L));N=N.substr(L+1);if(N=="*"){N=null;}}return[P,(Q)?K(N,Q):N,R,N];}),M=function(L){var N=(F.isObject(L))?L:{};this._yuievt=this._yuievt||{id:E.guid(),events:{},targets:{},config:N,chain:("chain" in N)?N.chain:E.config.chain,defaults:{context:N.context||this,host:this,emitFacade:N.emitFacade,fireOnce:N.fireOnce,queuable:N.queuable,broadcast:N.broadcast,bubbles:("bubbles" in N)?N.bubbles:true}};
};M.prototype={on:function(Q,U,O,V){var Z=G(Q,this._yuievt.config.prefix),a,b,N,g,X,W,d,R=E.Env.evt.handles,P,L,S,e=E.Node,Y,T;if(F.isObject(Q)){if(F.isFunction(Q)){return E.Do.before.apply(E.Do,arguments);}a=U;b=O;N=E.Array(arguments,0,true);g={};P=Q._after;delete Q._after;E.each(Q,function(f,c){if(f){a=f.fn||((E.Lang.isFunction(f))?f:a);b=f.context||b;}N[0]=(P)?J+c:c;N[1]=a;N[2]=b;g[c]=this.on.apply(this,N);},this);return(this._yuievt.chain)?this:new E.EventHandle(g);}W=Z[0];P=Z[2];S=Z[3];if(e&&(this instanceof e)&&(S in e.DOM_EVENTS)){N=E.Array(arguments,0,true);N.splice(2,0,e.getDOMNode(this));return E.on.apply(E,N);}Q=Z[1];if(this instanceof YUI){L=E.Env.evt.plugins[Q];N=E.Array(arguments,0,true);N[0]=S;if(e){Y=N[2];if(Y instanceof E.NodeList){Y=E.NodeList.getDOMNodes(Y);}else{if(Y instanceof e){Y=e.getDOMNode(Y);}}T=(S in e.DOM_EVENTS);if(T){N[2]=Y;}}if(L){d=L.on.apply(E,N);}else{if((!Q)||T){d=E.Event._attach(N);}}}if(!d){X=this._yuievt.events[Q]||this.publish(Q);d=X._on(U,O,(arguments.length>3)?E.Array(arguments,3,true):null,(P)?"after":true);}if(W){R[W]=R[W]||{};R[W][Q]=R[W][Q]||[];R[W][Q].push(d);}return(this._yuievt.chain)?this:d;},subscribe:function(){return this.on.apply(this,arguments);},detach:function(P,U,O){var T=this._yuievt.events,Z,d,c=E.Node,Y=(this instanceof c);if(!P&&(this!==E)){for(Z in T){if(T.hasOwnProperty(Z)){d=T[Z].detach(U,O);}}if(Y){E.Event.purgeElement(c.getDOMNode(this));}return d;}var X=G(P,this._yuievt.config.prefix),V=F.isArray(X)?X[0]:null,R=(X)?X[3]:null,b,L,Q=E.Env.evt.handles,S,N,W,a=function(g,f){var e=g[f];if(e){while(e.length){b=e.pop();b.detach();}}};if(V){S=Q[V];P=X[1];if(S){if(P){a(S,P);}else{for(Z in S){if(S.hasOwnProperty(Z)){a(S,Z);}}}return(this._yuievt.chain)?this:true;}}else{if(F.isObject(P)&&P.detach){d=P.detach();return(this._yuievt.chain)?this:d;}else{if(Y&&((!R)||(R in c.DOM_EVENTS))){N=E.Array(arguments,0,true);N[2]=c.getDOMNode(this);return E.detach.apply(E,N);}}}L=E.Env.evt.plugins[R];if(this instanceof YUI){N=E.Array(arguments,0,true);if(L&&L.detach){return L.detach.apply(E,N);}else{if(!P||(!L&&c&&(P in c.DOM_EVENTS))){N[0]=P;return E.Event.detach.apply(E.Event,N);}}}W=T[P];if(W){d=W.detach(U,O);}return(this._yuievt.chain)?this:d;},unsubscribe:function(){return this.detach.apply(this,arguments);},detachAll:function(L){return this.detach(L);},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},publish:function(O,P){var N,R,L,Q=this._yuievt.config.prefix;O=(Q)?K(O,Q):O;if(F.isObject(O)){L={};E.each(O,function(T,S){L[S]=this.publish(S,T||P);},this);return L;}N=this._yuievt.events;R=N[O];if(R){if(P){R.applyConfig(P,true);}}else{R=new E.CustomEvent(O,(P)?E.mix(P,this._yuievt.defaults):this._yuievt.defaults);N[O]=R;}return N[O];},addTarget:function(L){this._yuievt.targets[E.stamp(L)]=L;this._yuievt.hasTargets=true;},removeTarget:function(L){delete this._yuievt.targets[E.stamp(L)];},fire:function(P){var S=F.isString(P),O=(S)?P:(P&&P.type),R,L,N,Q=this._yuievt.config.prefix;O=(Q)?K(O,Q):O;R=this.getEvent(O,true);if(!R){if(this._yuievt.hasTargets){L=(S)?arguments:E.Array(arguments,0,true).unshift(O);return this.bubble(null,L,this);}N=true;}else{L=E.Array(arguments,(S)?1:0,true);N=R.fire.apply(R,L);R.target=null;}return(this._yuievt.chain)?this:N;},getEvent:function(N,L){var P,O;if(!L){P=this._yuievt.config.prefix;N=(P)?K(N,P):N;}O=this._yuievt.events;return(O&&N in O)?O[N]:null;},after:function(O,N){var L=E.Array(arguments,0,true);switch(F.type(O)){case"function":return E.Do.after.apply(E.Do,arguments);case"object":L[0]._after=true;break;default:L[0]=J+O;}return this.on.apply(this,L);},before:function(){return this.on.apply(this,arguments);}};E.EventTarget=M;E.mix(E,M.prototype,false,false,{bubbles:false});M.call(E);YUI.Env.globalEvents=YUI.Env.globalEvents||new M();E.Global=YUI.Env.globalEvents;})();},"3.0.0",{requires:["oop"]});YUI.add("event-custom-complex",function(A){(function(){var C,D,B=A.CustomEvent.prototype;A.EventFacade=function(F,E){F=F||{};this.details=F.details;this.type=F.type;this.target=F.target;this.currentTarget=E;this.relatedTarget=F.relatedTarget;this.stopPropagation=function(){F.stopPropagation();};this.stopImmediatePropagation=function(){F.stopImmediatePropagation();};this.preventDefault=function(){F.preventDefault();};this.halt=function(G){F.halt(G);};};B.fireComplex=function(H){var L=A.Env._eventstack,F,J,E,K,G,I;if(L){if(this.queuable&&this.type!=L.next.type){this.log("queue "+this.type);L.queue.push([this,H]);return true;}}else{A.Env._eventstack={id:this.id,next:this,silent:this.silent,stopped:0,prevented:0,queue:[]};L=A.Env._eventstack;}this.stopped=0;this.prevented=0;this.target=this.target||this.host;I=new A.EventTarget({fireOnce:true,context:this.host});this.events=I;if(this.preventedFn){I.on("prevented",this.preventedFn);}if(this.stoppedFn){I.on("stopped",this.stoppedFn);}this.currentTarget=this.host||this.currentTarget;this.details=H.slice();this.log("Firing "+this.type);this._facade=null;F=this._getFacade(H);if(A.Lang.isObject(H[0])){H[0]=F;}else{H.unshift(F);}if(this.hasSubscribers){this._procSubs(A.merge(this.subscribers),H,F);}if(this.bubbles&&this.host&&this.host.bubble&&!this.stopped){L.stopped=0;L.prevented=0;G=this.host.bubble(this);this.stopped=Math.max(this.stopped,L.stopped);this.prevented=Math.max(this.prevented,L.prevented);}if(this.defaultFn&&!this.prevented){this.defaultFn.apply(this.host||this,H);}this._broadcast(H);if(this.hasAfters&&!this.prevented&&this.stopped<2){this._procSubs(A.merge(this.afters),H,F);}if(L.id===this.id){E=L.queue;while(E.length){J=E.pop();K=J[0];L.stopped=0;L.prevented=0;L.next=K;K.fire.apply(K,J[1]);}A.Env._eventstack=null;}return this.stopped?false:true;};B._getFacade=function(){var E=this._facade,H,G,F=this.details;if(!E){E=new A.EventFacade(this,this.currentTarget);}H=F&&F[0];if(A.Lang.isObject(H,true)){G={};A.mix(G,E,true,D);A.mix(E,H,true);A.mix(E,G,true,D);}E.details=this.details;E.target=this.target;E.currentTarget=this.currentTarget;E.stopped=0;
E.prevented=0;this._facade=E;return this._facade;};B.stopPropagation=function(){this.stopped=1;A.Env._eventstack.stopped=1;this.events.fire("stopped",this);};B.stopImmediatePropagation=function(){this.stopped=2;A.Env._eventstack.stopped=2;this.events.fire("stopped",this);};B.preventDefault=function(){if(this.preventable){this.prevented=1;A.Env._eventstack.prevented=1;this.events.fire("prevented",this);}};B.halt=function(E){if(E){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();};A.EventTarget.prototype.bubble=function(M,K,I){var G=this._yuievt.targets,J=true,N,L,E,F,H;if(!M||((!M.stopped)&&G)){for(F in G){if(G.hasOwnProperty(F)){N=G[F];L=M&&M.type;E=N.getEvent(L,true);if(!E){if(N._yuievt.hasTargets){N.bubble.call(N,M,K,I);}}else{E.target=I||(M&&M.target)||this;E.currentTarget=N;H=E.broadcast;E.broadcast=false;J=J&&E.fire.apply(E,K||M.details);E.broadcast=H;if(E.stopped){break;}}}}}return J;};C=new A.EventFacade();D=A.Object.keys(C);})();},"3.0.0",{requires:["event-custom-base"]});YUI.add("event-custom",function(A){},"3.0.0",{use:["event-custom-base","event-custom-complex"]});
// ../yui/event-simulate/event-simulate-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("event-simulate",function(A){(function(){var H=A.Lang,G=A.Array,D=H.isFunction,C=H.isString,E=H.isBoolean,M=H.isObject,K=H.isNumber,J=A.config.doc,N={click:1,dblclick:1,mouseover:1,mouseout:1,mousedown:1,mouseup:1,mousemove:1},I={keydown:1,keyup:1,keypress:1};function F(S,W,R,P,Y,O,L,X,U,a,Z){if(!S){A.error("simulateKeyEvent(): Invalid target.");}if(C(W)){W=W.toLowerCase();switch(W){case"textevent":W="keypress";break;case"keyup":case"keydown":case"keypress":break;default:A.error("simulateKeyEvent(): Event type '"+W+"' not supported.");}}else{A.error("simulateKeyEvent(): Event type must be a string.");}if(!E(R)){R=true;}if(!E(P)){P=true;}if(!M(Y)){Y=window;}if(!E(O)){O=false;}if(!E(L)){L=false;}if(!E(X)){X=false;}if(!E(U)){U=false;}if(!K(a)){a=0;}if(!K(Z)){Z=0;}var V=null;if(D(J.createEvent)){try{V=J.createEvent("KeyEvents");V.initKeyEvent(W,R,P,Y,O,L,X,U,a,Z);}catch(T){try{V=J.createEvent("Events");}catch(Q){V=J.createEvent("UIEvents");}finally{V.initEvent(W,R,P);V.view=Y;V.altKey=L;V.ctrlKey=O;V.shiftKey=X;V.metaKey=U;V.keyCode=a;V.charCode=Z;}}S.dispatchEvent(V);}else{if(M(J.createEventObject)){V=J.createEventObject();V.bubbles=R;V.cancelable=P;V.view=Y;V.ctrlKey=O;V.altKey=L;V.shiftKey=X;V.metaKey=U;V.keyCode=(Z>0)?Z:a;S.fireEvent("on"+W,V);}else{A.error("simulateKeyEvent(): No event simulation framework present.");}}}function B(X,c,U,R,d,W,T,S,Q,O,P,L,b,Z,V,Y){if(!X){A.error("simulateMouseEvent(): Invalid target.");}if(C(c)){c=c.toLowerCase();if(!N[c]){A.error("simulateMouseEvent(): Event type '"+c+"' not supported.");}}else{A.error("simulateMouseEvent(): Event type must be a string.");}if(!E(U)){U=true;}if(!E(R)){R=(c!="mousemove");}if(!M(d)){d=window;}if(!K(W)){W=1;}if(!K(T)){T=0;}if(!K(S)){S=0;}if(!K(Q)){Q=0;}if(!K(O)){O=0;}if(!E(P)){P=false;}if(!E(L)){L=false;}if(!E(b)){b=false;}if(!E(Z)){Z=false;}if(!K(V)){V=0;}var a=null;if(D(J.createEvent)){a=J.createEvent("MouseEvents");if(a.initMouseEvent){a.initMouseEvent(c,U,R,d,W,T,S,Q,O,P,L,b,Z,V,Y);}else{a=J.createEvent("UIEvents");a.initEvent(c,U,R);a.view=d;a.detail=W;a.screenX=T;a.screenY=S;a.clientX=Q;a.clientY=O;a.ctrlKey=P;a.altKey=L;a.metaKey=Z;a.shiftKey=b;a.button=V;a.relatedTarget=Y;}if(Y&&!a.relatedTarget){if(c=="mouseout"){a.toElement=Y;}else{if(c=="mouseover"){a.fromElement=Y;}}}X.dispatchEvent(a);}else{if(M(J.createEventObject)){a=J.createEventObject();a.bubbles=U;a.cancelable=R;a.view=d;a.detail=W;a.screenX=T;a.screenY=S;a.clientX=Q;a.clientY=O;a.ctrlKey=P;a.altKey=L;a.metaKey=Z;a.shiftKey=b;switch(V){case 0:a.button=1;break;case 1:a.button=4;break;case 2:break;default:a.button=0;}a.relatedTarget=Y;X.fireEvent("on"+c,a);}else{A.error("simulateMouseEvent(): No event simulation framework present.");}}}A.Event.simulate=function(P,O,L){L=L||{};if(N[O]){B(P,O,L.bubbles,L.cancelable,L.view,L.detail,L.screenX,L.screenY,L.clientX,L.clientY,L.ctrlKey,L.altKey,L.shiftKey,L.metaKey,L.button,L.relatedTarget);}else{if(I[O]){F(P,O,L.bubbles,L.cancelable,L.view,L.ctrlKey,L.altKey,L.shiftKey,L.metaKey,L.keyCode,L.charCode);}else{A.error("simulate(): Event '"+O+"' can't be simulated.");}}};})();},"3.0.0",{requires:["event"]});
// ../yui/dom/dom-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("dom-base",function(D){(function(H){var R="nodeType",F="ownerDocument",E="defaultView",J="parentWindow",M="tagName",O="parentNode",Q="firstChild",L="previousSibling",P="nextSibling",K="contains",G="compareDocumentPosition",N=document.documentElement,I=/<([a-z]+)/i;H.DOM={byId:function(T,S){S=S||H.config.doc;return S.getElementById(T);},children:function(U,S){var T=[];if(U){S=S||"*";T=H.Selector.query("> "+S,U);}return T;},firstByTag:function(S,T){var U;T=T||H.config.doc;if(S&&T.getElementsByTagName){U=T.getElementsByTagName(S)[0];}return U||null;},getText:(N.textContent!==undefined)?function(T){var S="";if(T){S=T.textContent;}return S||"";}:function(T){var S="";if(T){S=T.innerText;}return S||"";},setText:(N.textContent!==undefined)?function(S,T){if(S){S.textContent=T;}}:function(S,T){if(S){S.innerText=T;}},previous:function(S,U,T){return H.DOM.elementByAxis(S,L,U,T);},next:function(S,U,T){return H.DOM.elementByAxis(S,P,U,T);},ancestor:function(S,U,T){return H.DOM.elementByAxis(S,O,U,T);},elementByAxis:function(S,V,U,T){while(S&&(S=S[V])){if((T||S[M])&&(!U||U(S))){return S;}}return null;},contains:function(T,U){var S=false;if(!U||!T||!U[R]||!T[R]){S=false;}else{if(T[K]){if(H.UA.opera||U[R]===1){S=T[K](U);}else{S=H.DOM._bruteContains(T,U);}}else{if(T[G]){if(T===U||!!(T[G](U)&16)){S=true;}}}}return S;},inDoc:function(S,T){T=T||S[F];var U=S.id;if(!U){U=S.id=H.guid();}return !!(T.getElementById(U));},create:function(X,Z){if(typeof X==="string"){X=H.Lang.trim(X);}if(!Z&&H.DOM._cloneCache[X]){return H.DOM._cloneCache[X].cloneNode(true);}Z=Z||H.config.doc;var T=I.exec(X),W=H.DOM._create,Y=H.DOM.creators,V=null,S,U;if(T&&Y[T[1]]){if(typeof Y[T[1]]==="function"){W=Y[T[1]];}else{S=Y[T[1]];}}U=W(X,Z,S).childNodes;if(U.length===1){V=U[0].parentNode.removeChild(U[0]);}else{V=H.DOM._nl2frag(U,Z);}if(V){H.DOM._cloneCache[X]=V.cloneNode(true);}return V;},_nl2frag:function(T,W){var U=null,V,S;if(T&&(T.push||T.item)&&T[0]){W=W||T[0].ownerDocument;U=W.createDocumentFragment();if(T.item){T=H.Array(T,0,true);}for(V=0,S=T.length;V<S;V++){U.appendChild(T[V]);}}return U;},CUSTOM_ATTRIBUTES:(!N.hasAttribute)?{"for":"htmlFor","class":"className"}:{"htmlFor":"for","className":"class"},setAttribute:function(U,S,V,T){if(U&&U.setAttribute){S=H.DOM.CUSTOM_ATTRIBUTES[S]||S;U.setAttribute(S,V,T);}},getAttribute:function(V,S,U){U=(U!==undefined)?U:2;var T="";if(V&&V.getAttribute){S=H.DOM.CUSTOM_ATTRIBUTES[S]||S;T=V.getAttribute(S,U);if(T===null){T="";}}return T;},isWindow:function(S){return S.alert&&S.document;},_fragClones:{div:document.createElement("div")},_create:function(T,U,S){S=S||"div";var V=H.DOM._fragClones[S];if(V){V=V.cloneNode(false);}else{V=H.DOM._fragClones[S]=U.createElement(S);}V.innerHTML=T;return V;},_removeChildNodes:function(S){while(S.firstChild){S.removeChild(S.firstChild);}},_cloneCache:{},addHTML:function(W,V,T){if(typeof V==="string"){V=H.Lang.trim(V);}var U=H.DOM._cloneCache[V],S=W.parentNode;if(U){U=U.cloneNode(true);}else{if(V.nodeType){U=V;}else{U=H.DOM.create(V);}}if(T){if(T.nodeType){T.parentNode.insertBefore(U,T);}else{switch(T){case"replace":while(W.firstChild){W.removeChild(W.firstChild);}W.appendChild(U);break;case"before":S.insertBefore(U,W);break;case"after":if(W.nextSibling){S.insertBefore(U,W.nextSibling);}else{S.appendChild(U);}break;default:W.appendChild(U);}}}else{W.appendChild(U);}return U;},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(U){var T="",S;if(U&&U[M]){S=H.DOM.VALUE_GETTERS[U[M].toLowerCase()];if(S){T=S(U);}else{T=U.value;}}return(typeof T==="string")?T:"";},setValue:function(S,T){var U;if(S&&S[M]){U=H.DOM.VALUE_SETTERS[S[M].toLowerCase()];if(U){U(S,T);}else{S.value=T;}}},_bruteContains:function(S,T){while(T){if(S===T){return true;}T=T.parentNode;}return false;},_getRegExp:function(T,S){S=S||"";H.DOM._regexCache=H.DOM._regexCache||{};if(!H.DOM._regexCache[T+S]){H.DOM._regexCache[T+S]=new RegExp(T,S);}return H.DOM._regexCache[T+S];},_getDoc:function(S){S=S||{};return(S[R]===9)?S:S[F]||S.document||H.config.doc;},_getWin:function(S){var T=H.DOM._getDoc(S);return T[E]||T[J]||H.config.win;},_batch:function(V,Z,Y,U,T,X){Z=(typeof name==="string")?H.DOM[Z]:Z;var S,W=[];if(Z&&V){H.each(V,function(a){if((S=Z.call(H.DOM,a,Y,U,T,X))!==undefined){W[W.length]=S;}});}return W.length?W:V;},_testElement:function(T,S,U){S=(S&&S!=="*")?S.toUpperCase():null;return(T&&T[M]&&(!S||T[M].toUpperCase()===S)&&(!U||U(T)));},creators:{},_IESimpleCreate:function(S,T){T=T||H.config.doc;return T.createElement(S);}};(function(W){var X=W.DOM.creators,S=W.DOM.create,V=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,U="<table>",T="</table>";if(W.UA.ie){W.mix(X,{tbody:function(Z,a){var b=S(U+Z+T,a),Y=b.children.tags("tbody")[0];if(b.children.length>1&&Y&&!V.test(Z)){Y[O].removeChild(Y);}return b;},script:function(Y,Z){var a=Z.createElement("div");a.innerHTML="-"+Y;a.removeChild(a[Q]);return a;}},true);W.mix(W.DOM.VALUE_GETTERS,{button:function(Y){return(Y.attributes&&Y.attributes.value)?Y.attributes.value.value:"";}});W.mix(W.DOM.VALUE_SETTERS,{button:function(Z,a){var Y=Z.attributes.value;if(!Y){Y=Z[F].createAttribute("value");Z.setAttributeNode(Y);}Y.value=a;}});}if(W.UA.gecko||W.UA.ie){W.mix(X,{option:function(Y,Z){return S("<select>"+Y+"</select>",Z);},tr:function(Y,Z){return S("<tbody>"+Y+"</tbody>",Z);},td:function(Y,Z){return S("<tr>"+Y+"</tr>",Z);},tbody:function(Y,Z){return S(U+Y+T,Z);}});W.mix(X,{legend:"fieldset",th:X.td,thead:X.tbody,tfoot:X.tbody,caption:X.tbody,colgroup:X.tbody,col:X.tbody,optgroup:X.option});}W.mix(W.DOM.VALUE_GETTERS,{option:function(Z){var Y=Z.attributes;return(Y.value&&Y.value.specified)?Z.value:Z.text;},select:function(Z){var a=Z.value,Y=Z.options;if(Y&&a===""){if(Z.multiple){}else{a=W.DOM.getValue(Y[Z.selectedIndex],"value");}}return a;}});})(H);})(D);var B,A,C;D.mix(D.DOM,{hasClass:function(G,F){var E=D.DOM._getRegExp("(?:^|\\s+)"+F+"(?:\\s+|$)");return E.test(G.className);},addClass:function(F,E){if(!D.DOM.hasClass(F,E)){F.className=D.Lang.trim([F.className,E].join(" "));
}},removeClass:function(F,E){if(E&&A(F,E)){F.className=D.Lang.trim(F.className.replace(D.DOM._getRegExp("(?:^|\\s+)"+E+"(?:\\s+|$)")," "));if(A(F,E)){C(F,E);}}},replaceClass:function(F,E,G){B(F,G);C(F,E);},toggleClass:function(F,E){if(A(F,E)){C(F,E);}else{B(F,E);}}});A=D.DOM.hasClass;C=D.DOM.removeClass;B=D.DOM.addClass;},"3.0.0",{requires:["oop"]});YUI.add("dom-style",function(A){(function(E){var C="documentElement",B="defaultView",D="ownerDocument",L="style",N="float",F="cssFloat",G="styleFloat",J="transparent",H="getComputedStyle",M=E.config.doc,I=undefined,K=/color$/i;E.mix(E.DOM,{CUSTOM_STYLES:{},setStyle:function(R,O,S,Q){Q=Q||R.style;var P=E.DOM.CUSTOM_STYLES;if(Q){if(S===null){S="";}if(O in P){if(P[O].set){P[O].set(R,S,Q);return;}else{if(typeof P[O]==="string"){O=P[O];}}}Q[O]=S;}},getStyle:function(R,O){var Q=R[L],P=E.DOM.CUSTOM_STYLES,S="";if(Q){if(O in P){if(P[O].get){return P[O].get(R,O,Q);}else{if(typeof P[O]==="string"){O=P[O];}}}S=Q[O];if(S===""){S=E.DOM[H](R,O);}}return S;},setStyles:function(P,Q){var O=P.style;E.each(Q,function(R,S){E.DOM.setStyle(P,S,R,O);},E.DOM);},getComputedStyle:function(P,O){var R="",Q=P[D];if(P[L]){R=Q[B][H](P,null)[O];}return R;}});if(M[C][L][F]!==I){E.DOM.CUSTOM_STYLES[N]=F;}else{if(M[C][L][G]!==I){E.DOM.CUSTOM_STYLES[N]=G;}}if(E.UA.opera){E.DOM[H]=function(Q,P){var O=Q[D][B],R=O[H](Q,"")[P];if(K.test(P)){R=E.Color.toRGB(R);}return R;};}if(E.UA.webkit){E.DOM[H]=function(Q,P){var O=Q[D][B],R=O[H](Q,"")[P];if(R==="rgba(0, 0, 0, 0)"){R=J;}return R;};}})(A);(function(D){var B=parseInt,C=RegExp;D.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Color.re_RGB.test(E)){E=D.Color.toHex(E);}if(D.Color.re_hex.exec(E)){E="rgb("+[B(C.$1,16),B(C.$2,16),B(C.$3,16)].join(", ")+")";}return E;},toHex:function(F){F=D.Color.KEYWORDS[F]||F;if(D.Color.re_RGB.exec(F)){F=[Number(C.$1).toString(16),Number(C.$2).toString(16),Number(C.$3).toString(16)];for(var E=0;E<F.length;E++){if(F[E].length<2){F[E]=F[E].replace(D.Color.re_hex3,"$1$1");}}F="#"+F.join("");}if(F.length<6){F=F.replace(D.Color.re_hex3,"$1$1");}if(F!=="transparent"&&F.indexOf("#")<0){F="#"+F;}return F.toLowerCase();}};})(A);(function(D){var W="hasLayout",K="px",L="filter",B="filters",T="opacity",M="auto",G="borderWidth",J="borderTopWidth",Q="borderRightWidth",V="borderBottomWidth",H="borderLeftWidth",I="width",O="height",R="transparent",S="visible",C="getComputedStyle",Z=undefined,X=document.documentElement,P=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,E=function(Y){return Y.currentStyle||Y.style;},N={CUSTOM_STYLES:{},get:function(Y,b){var a="",c;if(Y){c=E(Y)[b];if(b===T&&D.DOM.CUSTOM_STYLES[T]){a=D.DOM.CUSTOM_STYLES[T].get(Y);}else{if(!c||(c.indexOf&&c.indexOf(K)>-1)){a=c;}else{if(D.DOM.IE.COMPUTED[b]){a=D.DOM.IE.COMPUTED[b](Y,b);}else{if(P.test(c)){a=N.getPixel(Y,b)+K;}else{a=c;}}}}}return a;},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(b,g){var d=E(b)[g],Y=g.charAt(0).toUpperCase()+g.substr(1),f="offset"+Y,a="pixel"+Y,e=N.sizeOffsets[g],c="";if(d===M||d.indexOf("%")>-1){c=b["offset"+Y];if(e[0]){c-=N.getPixel(b,"padding"+e[0]);c-=N.getBorderWidth(b,"border"+e[0]+"Width",1);}if(e[1]){c-=N.getPixel(b,"padding"+e[1]);c-=N.getBorderWidth(b,"border"+e[1]+"Width",1);}}else{if(!b.style[a]&&!b.style[g]){b.style[g]=d;}c=b.style[a];}return c+K;},borderMap:{thin:"2px",medium:"4px",thick:"6px"},getBorderWidth:function(a,c,Y){var b=Y?"":K,d=a.currentStyle[c];if(d.indexOf(K)<0){if(N.borderMap[d]){d=N.borderMap[d];}else{}}return(Y)?parseFloat(d):d;},getPixel:function(b,Y){var d=null,a=E(b),e=a.right,c=a[Y];b.style.right=c;d=b.style.pixelRight;b.style.right=e;return d;},getMargin:function(b,Y){var c,a=E(b);if(a[Y]==M){c=0;}else{c=N.getPixel(b,Y);}return c+K;},getVisibility:function(a,Y){var b;while((b=a.currentStyle)&&b[Y]=="inherit"){a=a.parentNode;}return(b)?b[Y]:S;},getColor:function(a,Y){var b=E(a)[Y];if(!b||b===R){D.DOM.elementByAxis(a,"parentNode",null,function(c){b=E(c)[Y];if(b&&b!==R){a=c;return true;}});}return D.Color.toRGB(b);},getBorderColor:function(a,Y){var b=E(a),c=b[Y]||b.color;return D.Color.toRGB(D.Color.toHex(c));}},F={};try{if(X.style[T]===Z&&X[B]){D.DOM.CUSTOM_STYLES[T]={get:function(a){var c=100;try{c=a[B]["DXImageTransform.Microsoft.Alpha"][T];}catch(b){try{c=a[B]("alpha")[T];}catch(Y){}}return c/100;},set:function(a,d,Y){var c,b;if(d===""){b=E(a);c=(T in b)?b[T]:1;d=c;}if(typeof Y[L]=="string"){Y[L]="alpha("+T+"="+d*100+")";if(!a.currentStyle||!a.currentStyle[W]){Y.zoom=1;}}}};}}catch(U){}try{document.createElement("div").style.height="-1px";}catch(U){D.DOM.CUSTOM_STYLES.height={set:function(b,c,a){var Y=parseFloat(c);if(isNaN(Y)||Y>=0){a.height=c;}else{}}};D.DOM.CUSTOM_STYLES.width={set:function(b,c,a){var Y=parseFloat(c);if(isNaN(Y)||Y>=0){a.width=c;}else{}}};}F[I]=F[O]=N.getOffset;F.color=F.backgroundColor=N.getColor;F[G]=F[J]=F[Q]=F[V]=F[H]=N.getBorderWidth;F.marginTop=F.marginRight=F.marginBottom=F.marginLeft=N.getMargin;F.visibility=N.getVisibility;F.borderColor=F.borderTopColor=F.borderRightColor=F.borderBottomColor=F.borderLeftColor=N.getBorderColor;if(!D.config.win[C]){D.DOM[C]=N.get;}D.namespace("DOM.IE");D.DOM.IE.COMPUTED=F;D.DOM.IE.ComputedStyle=N;})(A);},"3.0.0",{requires:["dom-base"]});YUI.add("dom-screen",function(A){(function(F){var D="documentElement",O="compatMode",M="position",C="fixed",K="relative",G="left",H="top",I="BackCompat",N="medium",E="borderLeftWidth",B="borderTopWidth",P="getBoundingClientRect",J="getComputedStyle",L=/^t(?:able|d|h)$/i;F.mix(F.DOM,{winHeight:function(R){var Q=F.DOM._getWinSize(R).height;return Q;},winWidth:function(R){var Q=F.DOM._getWinSize(R).width;
return Q;},docHeight:function(R){var Q=F.DOM._getDocSize(R).height;return Math.max(Q,F.DOM._getWinSize(R).height);},docWidth:function(R){var Q=F.DOM._getDocSize(R).width;return Math.max(Q,F.DOM._getWinSize(R).width);},docScrollX:function(Q){var R=F.DOM._getDoc(Q);return Math.max(R[D].scrollLeft,R.body.scrollLeft);},docScrollY:function(Q){var R=F.DOM._getDoc(Q);return Math.max(R[D].scrollTop,R.body.scrollTop);},getXY:function(){if(document[D][P]){return function(T){var a=null,U,R,V,Y,X,Q,S,W,Z;if(T){if(F.DOM.inDoc(T)){U=F.DOM.docScrollX(T);R=F.DOM.docScrollY(T);V=T[P]();Z=F.DOM._getDoc(T);a=[V.left,V.top];if(F.UA.ie){Y=2;X=2;W=Z[O];Q=F.DOM[J](Z[D],E);S=F.DOM[J](Z[D],B);if(F.UA.ie===6){if(W!==I){Y=0;X=0;}}if((W==I)){if(Q!==N){Y=parseInt(Q,10);}if(S!==N){X=parseInt(S,10);}}a[0]-=Y;a[1]-=X;}if((R||U)){a[0]+=U;a[1]+=R;}}else{a=F.DOM._getOffset(T);}}return a;};}else{return function(R){var T=null,Q,V,S,U;if(R){if(F.DOM.inDoc(R)){T=[R.offsetLeft,R.offsetTop];Q=R;V=((F.UA.gecko||F.UA.webkit>519)?true:false);while((Q=Q.offsetParent)){T[0]+=Q.offsetLeft;T[1]+=Q.offsetTop;if(V){T=F.DOM._calcBorders(Q,T);}}if(F.DOM.getStyle(R,M)!=C){Q=R;while((Q=Q.parentNode)){S=Q.scrollTop;U=Q.scrollLeft;if(F.UA.gecko&&(F.DOM.getStyle(Q,"overflow")!=="visible")){T=F.DOM._calcBorders(Q,T);}if(S||U){T[0]-=U;T[1]-=S;}}T[0]+=F.DOM.docScrollX(R);T[1]+=F.DOM.docScrollY(R);}else{T[0]+=F.DOM.docScrollX(R);T[1]+=F.DOM.docScrollY(R);}}else{T=F.DOM._getOffset(R);}}return T;};}}(),_getOffset:function(Q){var S,R=null;if(Q){S=F.DOM.getStyle(Q,M);R=[parseInt(F.DOM[J](Q,G),10),parseInt(F.DOM[J](Q,H),10)];if(isNaN(R[0])){R[0]=parseInt(F.DOM.getStyle(Q,G),10);if(isNaN(R[0])){R[0]=(S===K)?0:Q.offsetLeft||0;}}if(isNaN(R[1])){R[1]=parseInt(F.DOM.getStyle(Q,H),10);if(isNaN(R[1])){R[1]=(S===K)?0:Q.offsetTop||0;}}}return R;},getX:function(Q){return F.DOM.getXY(Q)[0];},getY:function(Q){return F.DOM.getXY(Q)[1];},setXY:function(R,U,X){var S=F.DOM.setStyle,W,V,Q,T;if(R&&U){W=F.DOM.getStyle(R,M);V=F.DOM._getOffset(R);if(W=="static"){W=K;S(R,M,W);}T=F.DOM.getXY(R);if(U[0]!==null){S(R,G,U[0]-T[0]+V[0]+"px");}if(U[1]!==null){S(R,H,U[1]-T[1]+V[1]+"px");}if(!X){Q=F.DOM.getXY(R);if(Q[0]!==U[0]||Q[1]!==U[1]){F.DOM.setXY(R,U,true);}}}else{}},setX:function(R,Q){return F.DOM.setXY(R,[Q,null]);},setY:function(Q,R){return F.DOM.setXY(Q,[null,R]);},_calcBorders:function(S,T){var R=parseInt(F.DOM[J](S,B),10)||0,Q=parseInt(F.DOM[J](S,E),10)||0;if(F.UA.gecko){if(L.test(S.tagName)){R=0;Q=0;}}T[0]+=Q;T[1]+=R;return T;},_getWinSize:function(T){var V=F.DOM._getDoc(),U=V.defaultView||V.parentWindow,W=V[O],S=U.innerHeight,R=U.innerWidth,Q=V[D];if(W&&!F.UA.opera){if(W!="CSS1Compat"){Q=V.body;}S=Q.clientHeight;R=Q.clientWidth;}return{height:S,width:R};},_getDocSize:function(R){var S=F.DOM._getDoc(),Q=S[D];if(S[O]!="CSS1Compat"){Q=S.body;}return{height:Q.scrollHeight,width:Q.scrollWidth};}});})(A);(function(G){var D="top",C="right",H="bottom",B="left",F=function(L,K){var N=Math.max(L[D],K[D]),O=Math.min(L[C],K[C]),I=Math.min(L[H],K[H]),J=Math.max(L[B],K[B]),M={};M[D]=N;M[C]=O;M[H]=I;M[B]=J;return M;},E=G.DOM;G.mix(E,{region:function(J){var K=E.getXY(J),I=false;if(J&&K){I=E._getRegion(K[1],K[0]+J.offsetWidth,K[1]+J.offsetHeight,K[0]);}return I;},intersect:function(K,I,M){var J=M||E.region(K),L={},O=I,N;if(O.tagName){L=E.region(O);}else{if(G.Lang.isObject(I)){L=I;}else{return false;}}N=F(L,J);return{top:N[D],right:N[C],bottom:N[H],left:N[B],area:((N[H]-N[D])*(N[C]-N[B])),yoff:((N[H]-N[D])),xoff:(N[C]-N[B]),inRegion:E.inRegion(K,I,false,M)};},inRegion:function(L,I,J,N){var M={},K=N||E.region(L),P=I,O;if(P.tagName){M=E.region(P);}else{if(G.Lang.isObject(I)){M=I;}else{return false;}}if(J){return(K[B]>=M[B]&&K[C]<=M[C]&&K[D]>=M[D]&&K[H]<=M[H]);}else{O=F(M,K);if(O[H]>=O[D]&&O[C]>=O[B]){return true;}else{return false;}}},inViewportRegion:function(J,I,K){return E.inRegion(J,E.viewportRegion(J),I,K);},_getRegion:function(K,L,I,J){var M={};M[D]=M[1]=K;M[B]=M[0]=J;M[H]=I;M[C]=L;M.width=M[C]-M[B];M.height=M[H]-M[D];return M;},viewportRegion:function(J){J=J||G.config.doc.documentElement;var I=false,L,K;if(J){L=E.docScrollX(J);K=E.docScrollY(J);I=E._getRegion(K,E.winWidth(J)+L,K+E.winHeight(J),L);}return I;}});})(A);},"3.0.0",{requires:["dom-base","dom-style"]});YUI.add("selector-native",function(A){(function(G){G.namespace("Selector");var E="compareDocumentPosition",F="ownerDocument",D="yui-tmp-",C=0;var B={_foundCache:[],useNative:true,_compare:("sourceIndex" in document.documentElement)?function(K,J){var I=K.sourceIndex,H=J.sourceIndex;if(I===H){return 0;}else{if(I>H){return 1;}}return -1;}:(document.documentElement[E]?function(I,H){if(I[E](H)&4){return -1;}else{return 1;}}:function(L,K){var J,H,I;if(L&&K){J=L[F].createRange();J.setStart(L,0);H=K[F].createRange();H.setStart(K,0);I=J.compareBoundaryPoints(1,H);}return I;}),_sort:function(H){if(H){H=G.Array(H,0,true);if(H.sort){H.sort(B._compare);}}return H;},_deDupe:function(H){var I=[],J,K;for(J=0;(K=H[J++]);){if(!K._found){I[I.length]=K;K._found=true;}}for(J=0;(K=I[J++]);){K._found=null;K.removeAttribute("_found");}return I;},query:function(I,P,Q,H){P=P||G.config.doc;var M=[],J=(G.Selector.useNative&&document.querySelector&&!H),L=[[I,P]],N,R,K,O=(J)?G.Selector._nativeQuery:G.Selector._bruteQuery;if(I&&O){if(!H&&(!J||P.tagName)){L=B._splitQueries(I,P);}for(K=0;(N=L[K++]);){R=O(N[0],N[1],Q);if(!Q){R=G.Array(R,0,true);}if(R){M=M.concat(R);}}if(L.length>1){M=B._sort(B._deDupe(M));}}return(Q)?(M[0]||null):M;},_splitQueries:function(J,M){var I=J.split(","),K=[],N="",L,H;if(M){if(M.tagName){M.id=M.id||G.guid();N="#"+M.id+" ";}for(L=0,H=I.length;L<H;++L){J=N+I[L];K.push([J,M]);}}return K;},_nativeQuery:function(H,I,J){try{return I["querySelector"+(J?"":"All")](H);}catch(K){return G.Selector.query(H,I,J,true);}},filter:function(I,H){var J=[],K,L;if(I&&H){for(K=0;(L=I[K++]);){if(G.Selector.test(L,H)){J[J.length]=L;}}}else{}return J;},test:function(N,I,J){var K=false,H=I.split(","),M,L,O;if(N&&N.tagName){J=J||N.ownerDocument;if(!N.id){N.id=D+C++;
}for(L=0;(O=H[L++]);){O+="#"+N.id;M=G.Selector.query(O,J,true);K=(M===N);if(K){break;}}}return K;}};G.mix(G.Selector,B,true);})(A);},"3.0.0",{requires:["dom-base"]});YUI.add("selector-css2",function(G){var H="parentNode",D="tagName",E="attributes",A="combinator",F="pseudos",C=G.Selector,B={SORT_RESULTS:true,_children:function(M,I){var J=M.children,L,K=[],N,O;if(M.children&&I&&M.children.tags){K=M.children.tags(I);}else{if((!J&&M[D])||(J&&I)){N=J||M.childNodes;J=[];for(L=0;(O=N[L++]);){if(O.tagName){if(!I||I===O.tagName){J.push(O);}}}}}return J||[];},_regexCache:{},_re:{attr:/(\[.*\])/g,pseudos:/:([\-\w]+(?:\(?:['"]?(.+)['"]?\)))*/i},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[className~=$1]"},operators:{"":function(J,I){return G.DOM.getAttribute(J,I)!=="";},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(I){return G.Selector._children(I[H])[0]===I;}},_bruteQuery:function(M,Q,S){var N=[],I=[],P=C._tokenize(M),L=P[P.length-1],R=G.DOM._getDoc(Q),J,O,K;if(P[0]&&R===Q&&(J=P[0].id)&&R.getElementById(J)){Q=R.getElementById(J);}if(L){J=L.id;O=L.className;K=L.tagName||"*";if(J){if(R.getElementById(J)){I=[R.getElementById(J)];}}else{if(O){I=Q.getElementsByClassName(O);}else{if(K){I=Q.getElementsByTagName(K||"*");}}}if(I.length){N=C._filterNodes(I,P,S);}}return N;},_filterNodes:function(R,N,P){var W=0,V,X=N.length,Q=X-1,M=[],T=R[0],a=T,Y=G.Selector.getters,L,U,K,O,I,S,J,Z;for(W=0;(a=T=R[W++]);){Q=X-1;O=null;testLoop:while(a&&a.tagName){K=N[Q];J=K.tests;V=J.length;if(V&&!I){while((Z=J[--V])){L=Z[1];if(Y[Z[0]]){S=Y[Z[0]](a,Z[0]);}else{S=a[Z[0]];if(S===undefined&&a.getAttribute){S=a.getAttribute(Z[0]);}}if((L==="="&&S!==Z[2])||(L.test&&!L.test(S))||(L.call&&!L(a,Z[0]))){if((a=a[O])){while(a&&(!a.tagName||(K.tagName&&K.tagName!==a.tagName))){a=a[O];}}continue testLoop;}}}Q--;if(!I&&(U=K.combinator)){O=U.axis;a=a[O];while(a&&!a.tagName){a=a[O];}if(U.direct){O=null;}}else{M.push(T);if(P){return M;}break;}}}T=a=null;return M;},_getRegExp:function(K,I){var J=C._regexCache;I=I||"";if(!J[K+I]){J[K+I]=new RegExp(K,I);}return J[K+I];},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:true},"+":{axis:"previousSibling",direct:true}},_parsers:[{name:E,re:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,fn:function(K,L){var J=K[2]||"",I=G.Selector.operators,M;if((K[1]==="id"&&J==="=")||(K[1]==="className"&&document.getElementsByClassName&&(J==="~="||J==="="))){L.prefilter=K[1];L[K[1]]=K[3];}if(J in I){M=I[J];if(typeof M==="string"){M=G.Selector._getRegExp(M.replace("{val}",K[3]));}K[2]=M;}if(!L.last||L.prefilter!==K[1]){return K.slice(1);}}},{name:D,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(J,K){var I=J[1].toUpperCase();K.tagName=I;if(I!=="*"&&(!K.last||K.prefilter)){return[D,"=",I];}if(!K.prefilter){K.prefilter="tagName";}}},{name:A,re:/^\s*([>+~]|\s)\s*/,fn:function(I,J){}},{name:F,re:/^:([\-\w]+)(?:\(['"]?(.+)['"]?\))*/i,fn:function(I,J){var K=C[F][I[1]];if(K){return[I[2],K];}else{return false;}}}],_getToken:function(I){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]};},_tokenize:function(K){K=K||"";K=C._replaceShorthand(G.Lang.trim(K));var J=C._getToken(),P=K,O=[],Q=false,M,N,L,I;outer:do{Q=false;for(L=0;(I=C._parsers[L++]);){if((M=I.re.exec(K))){if(I!==A){J.selector=K;}K=K.replace(M[0],"");if(!K.length){J.last=true;}if(C._attrFilters[M[1]]){M[1]=C._attrFilters[M[1]];}N=I.fn(M,J);if(N===false){Q=false;break outer;}else{if(N){J.tests.push(N);}}if(!K.length||I.name===A){O.push(J);J=C._getToken(J);if(I.name===A){J.combinator=G.Selector.combinators[M[1]];}}Q=true;}}}while(Q&&K.length);if(!Q||K.length){O=[];}return O;},_replaceShorthand:function(J){var K=C.shorthand,L=J.match(C._re.attr),O=J.match(C._re.pseudos),N,M,I;if(O){J=J.replace(C._re.pseudos,"!!REPLACED_PSEUDO!!");}if(L){J=J.replace(C._re.attr,"!!REPLACED_ATTRIBUTE!!");}for(N in K){if(K.hasOwnProperty(N)){J=J.replace(C._getRegExp(N,"gi"),K[N]);}}if(L){for(M=0,I=L.length;M<I;++M){J=J.replace("!!REPLACED_ATTRIBUTE!!",L[M]);}}if(O){for(M=0,I=O.length;M<I;++M){J=J.replace("!!REPLACED_PSEUDO!!",O[M]);}}return J;},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(J,I){return G.DOM.getAttribute(J,I);}}};G.mix(G.Selector,B,true);G.Selector.getters.src=G.Selector.getters.rel=G.Selector.getters.href;if(G.Selector.useNative&&document.querySelector){G.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]";}},"3.0.0",{requires:["selector-native"]});YUI.add("selector",function(A){},"3.0.0",{use:["selector-native","selector-css2"]});YUI.add("dom",function(A){},"3.0.0",{use:["dom-base","dom-style","dom-screen","selector"]});
// ../yui/node/node-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("node-base",function(C){var G=".",E="nodeName",I="nodeType",B="ownerDocument",H="tagName",D="_yuid",F=function(L){var K=L[D];if(K&&F._instances[K]&&F._instances[K]._node!==L){L[D]=null;}K=C.stamp(L);if(!K){K=C.guid();}this[D]=K;this._node=L;F._instances[K]=this;this._stateProxy=L;if(this._initPlugins){this._initPlugins();}},J=function(L){var K=null;if(L){K=(typeof L==="string")?function(M){return C.Selector.test(M,L);}:function(M){return L(F.get(M));};}return K;};F.NAME="Node";F.re_aria=/^(?:role$|aria-)/;F.DOM_EVENTS={abort:true,beforeunload:true,blur:true,change:true,click:true,close:true,command:true,contextmenu:true,drag:true,dragstart:true,dragenter:true,dragover:true,dragleave:true,dragend:true,drop:true,dblclick:true,error:true,focus:true,keydown:true,keypress:true,keyup:true,load:true,message:true,mousedown:true,mousemove:true,mouseout:true,mouseover:true,mouseup:true,mousemultiwheel:true,mousewheel:true,submit:true,mouseenter:true,mouseleave:true,scroll:true,reset:true,resize:true,select:true,textInput:true,unload:true};C.mix(F.DOM_EVENTS,C.Env.evt.plugins);F._instances={};F.getDOMNode=function(K){if(K){return(K.nodeType)?K:K._node||null;}return null;};F.scrubVal=function(L,K){if(K&&L){if(typeof L==="object"||typeof L==="function"){if(I in L||C.DOM.isWindow(L)){L=F.get(L);}else{if((L.item&&!L._nodes)||(L[0]&&L[0][I])){L=C.all(L);}}}}else{if(L===undefined){L=K;}}return L;};F.addMethod=function(K,M,L){if(K&&M&&typeof M==="function"){F.prototype[K]=function(){L=L||this;var O=C.Array(arguments),N;if(O[0]&&O[0] instanceof F){O[0]=O[0]._node;}if(O[1]&&O[1] instanceof F){O[1]=O[1]._node;}O.unshift(this._node);N=F.scrubVal(M.apply(L,O),this);return N;};}else{}};F.importMethod=function(M,K,L){if(typeof K==="string"){L=L||K;F.addMethod(L,M[K],M);}else{C.each(K,function(N){F.importMethod(M,N);});}};F.one=function(N){var K=null,M,L;if(N){if(typeof N==="string"){if(N.indexOf("doc")===0){N=C.config.doc;}else{if(N.indexOf("win")===0){N=C.config.win;}else{N=C.Selector.query(N,null,true);}}if(!N){return null;}}else{if(N instanceof F){return N;}}L=N._yuid;K=F._instances[L];M=K?K._node:null;if(!K||(M&&N!==M)){K=new F(N);}}return K;};F.get=function(){return F.one.apply(F,arguments);};F.create=function(){return F.get(C.DOM.create.apply(C.DOM,arguments));};F.ATTRS={text:{getter:function(){return C.DOM.getText(this._node);},setter:function(K){C.DOM.setText(this._node,K);return K;}},"options":{getter:function(){return this._node.getElementsByTagName("option");}},"elements":{getter:function(){return C.all(this._node.elements);}},"children":{getter:function(){var N=this._node,M=N.children,O,L,K;if(!M){O=N.childNodes;M=[];for(L=0,K=O.length;L<K;++L){if(O[L][H]){M[M.length]=O[L];}}}return C.all(M);}},value:{getter:function(){return C.DOM.getValue(this._node);},setter:function(K){C.DOM.setValue(this._node,K);return K;}},data:{getter:function(){return this._data;},setter:function(K){this._data=K;return K;}}};F.DEFAULT_SETTER=function(K,M){var L=this._stateProxy,N;if(K.indexOf(G)>-1){N=K;K=K.split(G);C.Object.setValue(L,K,M);}else{if(L[K]!==undefined){L[K]=M;}}return M;};F.DEFAULT_GETTER=function(K){var L=this._stateProxy,M;if(K.indexOf&&K.indexOf(G)>-1){M=C.Object.getValue(L,K.split(G));}else{if(L[K]!==undefined){M=L[K];}}return M;};C.augment(F,C.Event.Target);C.mix(F.prototype,{toString:function(){var M="",L=this[D]+": not bound to a node",K=this._node;if(K){M+=K[E];if(K.id){M+="#"+K.id;}if(K.className){M+="."+K.className.replace(" ",".");}M+=" "+this[D];}return M||L;},get:function(K){var L;if(this._getAttr){L=this._getAttr(K);}else{L=this._get(K);}if(L){L=C.Node.scrubVal(L,this);}return L;},_get:function(K){var L=F.ATTRS[K],M;if(L&&L.getter){M=L.getter.call(this);}else{if(F.re_aria.test(K)){M=this._node.getAttribute(K,2);}else{M=F.DEFAULT_GETTER.apply(this,arguments);}}return M;},set:function(K,M){var L=F.ATTRS[K];if(this._setAttr){this._setAttr.apply(this,arguments);}else{if(L&&L.setter){L.setter.call(this,M);}else{if(F.re_aria.test(K)){this._node.setAttribute(K,M);}else{F.DEFAULT_SETTER.apply(this,arguments);}}}return this;},setAttrs:function(K){if(this._setAttrs){this._setAttrs(K);}else{C.Object.each(K,function(L,M){this.set(M,L);},this);}return this;},getAttrs:function(L){var K={};if(this._getAttrs){this._getAttrs(L);}else{C.Array.each(L,function(M,N){K[M]=this.get(M);},this);}return K;},create:F.create,compareTo:function(K){var L=this._node;if(K instanceof C.Node){K=K._node;}return L===K;},inDoc:function(L){var K=this._node;L=(L)?L._node||L:K[B];if(L.documentElement){return C.DOM.contains(L.documentElement,K);}},getById:function(M){var L=this._node,K=C.DOM.byId(M,L[B]);if(K&&C.DOM.contains(L,K)){K=C.one(K);}else{K=null;}return K;},ancestor:function(K){return F.get(C.DOM.elementByAxis(this._node,"parentNode",J(K)));},previous:function(L,K){return F.get(C.DOM.elementByAxis(this._node,"previousSibling",J(L),K));},next:function(M,L,K){return F.get(C.DOM.elementByAxis(this._node,"nextSibling",J(L),K));},one:function(K){return C.one(C.Selector.query(K,this._node,true));},query:function(K){return this.one(K);},all:function(K){var L=C.all(C.Selector.query(K,this._node));L._query=K;return L;},queryAll:function(K){return this.all(K);},test:function(K){return C.Selector.test(this._node,K);},remove:function(K){var L=this._node;L.parentNode.removeChild(L);if(K){this.destroy(true);}return this;},replace:function(K){var L=this._node;L.parentNode.replaceChild(K,L);return this;},purge:function(L,K){C.Event.purgeElement(this._node,L,K);},destroy:function(K){delete F._instances[this[D]];if(K){this.purge(true);}if(this.unplug){this.unplug();}this._node._yuid=null;this._node=null;this._stateProxy=null;},invoke:function(R,L,K,Q,P,O){var N=this._node,M;if(L&&L instanceof C.Node){L=L._node;}if(K&&K instanceof C.Node){K=K._node;}M=N[R](L,K,Q,P,O);return C.Node.scrubVal(M,this);},each:function(L,K){K=K||this;return L.call(K,this);},item:function(K){return this;},size:function(){return this._node?1:0;},insert:function(M,K){var L=this._node;
if(M){if(typeof K==="number"){K=this._node.childNodes[K];}if(typeof M!=="string"){if(M._node){M=M._node;}else{if(M._nodes||(!M.nodeType&&M.length)){C.each(M._nodes,function(N){C.DOM.addHTML(L,N,K);});return this;}}}C.DOM.addHTML(L,M,K);}return this;},prepend:function(K){return this.insert(K,0);},append:function(K){return this.insert(K,null);},setContent:function(K){C.DOM.addHTML(this._node,K,"replace");return this;},hasMethod:function(L){var K=this._node;return(K&&(typeof K==="function"));}},true);C.Node=F;C.get=C.Node.get;C.one=C.Node.one;var A=function(K){if(typeof K==="string"){this._query=K;K=C.Selector.query(K);}else{K=C.Array(K,0,true);}A._instances[C.stamp(this)]=this;this._nodes=K;};A.NAME="NodeList";A.getDOMNodes=function(K){return K._nodes;};A._instances=[];A.each=function(K,N,M){var L=K._nodes;if(L&&L.length){C.Array.each(L,N,M||K);}else{}};A.addMethod=function(K,M,L){if(K&&M){A.prototype[K]=function(){var O=[],N=arguments;C.Array.each(this._nodes,function(T){var S="_yuid",Q=C.Node._instances[T[S]],R,P;if(!Q){Q=A._getTempNode(T);}R=L||Q;P=M.apply(R,N);if(P!==undefined&&P!==Q){O[O.length]=P;}});return O.length?O:this;};}else{}};A.importMethod=function(M,K,L){if(typeof K==="string"){L=L||K;A.addMethod(K,M[K]);}else{C.each(K,function(N){A.importMethod(M,N);});}};A._getTempNode=function(L){var K=A._tempNode;if(!K){K=C.Node.create("<div></div>");A._tempNode=K;}K._node=L;K._stateProxy=L;return K;};C.mix(A.prototype,{item:function(K){return C.one((this._nodes||[])[K]);},each:function(M,L){var K=this;C.Array.each(this._nodes,function(O,N){O=C.one(O);return M.call(L||O,O,N,K);});return K;},batch:function(L,K){var M=this;C.Array.each(this._nodes,function(P,O){var N=C.Node._instances[P[D]];if(!N){N=A._getTempNode(P);}return L.call(K||N,N,O,M);});return M;},some:function(M,L){var K=this;return C.Array.some(this._nodes,function(O,N){O=C.one(O);L=L||O;return M.call(L,O,N,K);});},toFrag:function(){return C.one(C.DOM._nl2frag(this._nodes));},indexOf:function(K){return C.Array.indexOf(this._nodes,C.Node.getDOMNode(K));},filter:function(K){return C.all(C.Selector.filter(this._nodes,K));},modulus:function(M,L){L=L||0;var K=[];A.each(this,function(O,N){if(N%M===L){K.push(O);}});return C.all(K);},odd:function(){return this.modulus(2,1);},even:function(){return this.modulus(2);},destructor:function(){delete A._instances[this[D]];},refresh:function(){var L,K=this._nodes;if(this._query){if(K&&K[0]&&K[0].ownerDocument){L=K[0].ownerDocument;}this._nodes=C.Selector.query(this._query,L||C.config.doc);}return this;},on:function(N,M,L){var K=C.Array(arguments,0,true);K.splice(2,0,this._nodes);K[3]=L||this;return C.on.apply(C,K);},after:function(N,M,L){var K=C.Array(arguments,0,true);K.splice(2,0,this._nodes);K[3]=L||this;return C.after.apply(C,K);},size:function(){return this._nodes.length;},toString:function(){var N="",M=this[D]+": not bound to any nodes",K=this._nodes,L;if(K&&K[0]){L=K[0];N+=L[E];if(L.id){N+="#"+L.id;}if(L.className){N+="."+L.className.replace(" ",".");}if(K.length>1){N+="...["+K.length+" items]";}}return N||M;}},true);A.importMethod(C.Node.prototype,["append","detach","detachAll","insert","prepend","remove","set","setContent"]);A.prototype.get=function(L){var O=[],N=this._nodes,M=false,P=A._getTempNode,K,Q;if(N[0]){K=C.Node._instances[N[0]._yuid]||P(N[0]);Q=K._get(L);if(Q&&Q.nodeType){M=true;}}C.Array.each(N,function(R){K=C.Node._instances[R._yuid];if(!K){K=P(R);}Q=K._get(L);if(!M){Q=C.Node.scrubVal(Q,K);}O.push(Q);});return(M)?C.all(O):O;};C.NodeList=A;C.all=function(K){return new A(K);};C.Node.all=C.all;C.Array.each(["replaceChild","appendChild","insertBefore","removeChild","hasChildNodes","cloneNode","hasAttribute","removeAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select"],function(K){C.Node.prototype[K]=function(O,M,L){var N=this.invoke(K,O,M,L);return N;};});F.importMethod(C.DOM,["contains","setAttribute","getAttribute"]);C.NodeList.importMethod(C.Node.prototype,["getAttribute","setAttribute"]);(function(L){var K=["hasClass","addClass","removeClass","replaceClass","toggleClass"];L.Node.importMethod(L.DOM,K);L.NodeList.importMethod(L.Node.prototype,K);})(C);if(!document.documentElement.hasAttribute){C.Node.prototype.hasAttribute=function(K){return C.DOM.getAttribute(this._node,K)!=="";};}C.Node.ATTRS.type={setter:function(L){if(L==="hidden"){try{this._node.type="hidden";}catch(K){this.setStyle("display","none");this._inputType="hidden";}}else{try{this._node.type=L;}catch(K){}}return L;},getter:function(){return this._inputType||this._node.type;},_bypassProxy:true};},"3.0.0",{requires:["dom-base","selector-css2","event-base"]});YUI.add("node-style",function(A){(function(C){var B=["getStyle","getComputedStyle","setStyle","setStyles"];C.Node.importMethod(C.DOM,B);C.NodeList.importMethod(C.Node.prototype,B);})(A);},"3.0.0",{requires:["dom-style","node-base"]});YUI.add("node-screen",function(A){A.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(B){A.Node.ATTRS[B]={getter:function(){var C=Array.prototype.slice.call(arguments);C.unshift(A.Node.getDOMNode(this));return A.DOM[B].apply(this,C);}};});A.Node.ATTRS.scrollLeft={getter:function(){var B=A.Node.getDOMNode(this);return("scrollLeft" in B)?B.scrollLeft:A.DOM.docScrollX(B);},setter:function(C){var B=A.Node.getDOMNode(this);if(B){if("scrollLeft" in B){B.scrollLeft=C;}else{if(B.document||B.nodeType===9){A.DOM._getWin(B).scrollTo(C,A.DOM.docScrollY(B));}}}else{}}};A.Node.ATTRS.scrollTop={getter:function(){var B=A.Node.getDOMNode(this);return("scrollTop" in B)?B.scrollTop:A.DOM.docScrollY(B);},setter:function(C){var B=A.Node.getDOMNode(this);if(B){if("scrollTop" in B){B.scrollTop=C;}else{if(B.document||B.nodeType===9){A.DOM._getWin(B).scrollTo(A.DOM.docScrollX(B),C);}}}else{}}};A.Node.importMethod(A.DOM,["getXY","setXY","getX","setX","getY","setY"]);A.Node.ATTRS.region={getter:function(){var B=A.Node.getDOMNode(this);if(B&&!B.tagName){if(B.nodeType===9){B=B.documentElement;
}else{if(B.alert){B=B.document.documentElement;}}}return A.DOM.region(B);}};A.Node.ATTRS.viewportRegion={getter:function(){return A.DOM.viewportRegion(A.Node.getDOMNode(this));}};A.Node.importMethod(A.DOM,"inViewportRegion");A.Node.prototype.intersect=function(B,D){var C=A.Node.getDOMNode(this);if(B instanceof A.Node){B=A.Node.getDOMNode(B);}return A.DOM.intersect(C,B,D);};A.Node.prototype.inRegion=function(B,D,E){var C=A.Node.getDOMNode(this);if(B instanceof A.Node){B=A.Node.getDOMNode(B);}return A.DOM.inRegion(C,B,D,E);};},"3.0.0",{requires:["dom-screen"]});YUI.add("node-pluginhost",function(A){A.Node.plug=function(){var B=A.Array(arguments);B.unshift(A.Node);A.Plugin.Host.plug.apply(A.Base,B);return A.Node;};A.Node.unplug=function(){var B=A.Array(arguments);B.unshift(A.Node);A.Plugin.Host.unplug.apply(A.Base,B);return A.Node;};A.mix(A.Node,A.Plugin.Host,false,null,1);A.NodeList.prototype.plug=function(){var B=arguments;A.NodeList.each(this,function(C){A.Node.prototype.plug.apply(A.one(C),B);});};A.NodeList.prototype.unplug=function(){var B=arguments;A.NodeList.each(this,function(C){A.Node.prototype.unplug.apply(A.one(C),B);});};},"3.0.0",{requires:["node-base","pluginhost"]});YUI.add("node-event-delegate",function(A){A.Node.prototype.delegate=function(F,E,B){var D=Array.prototype.slice.call(arguments,3),C=[F,E,A.Node.getDOMNode(this),B];C=C.concat(D);return A.delegate.apply(A,C);};},"3.0.0",{requires:["node-base","event-delegate","pluginhost"]});YUI.add("node",function(A){},"3.0.0",{skinnable:false,use:["node-base","node-style","node-screen","node-pluginhost","node-event-delegate"],requires:["dom","event-base","event-delegate","pluginhost"]});
// ../yui/node-focusmanager/node-focusmanager-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("node-focusmanager",function(B){var J="activeDescendant",L="id",I="disabled",N="tabIndex",E="focused",A="focusClass",Q="circular",C="UI",F="key",G=J+"Change",O="host",P={37:true,38:true,39:true,40:true},M={"a":true,"button":true,"input":true,"object":true},H=B.Lang,K=B.UA,D=function(){D.superclass.constructor.apply(this,arguments);};D.ATTRS={focused:{value:false,readOnly:true},descendants:{getter:function(R){return this.get(O).all(R);}},activeDescendant:{setter:function(V){var T=H.isNumber,S=B.Attribute.INVALID_VALUE,R=this._descendantsMap,Y=this._descendants,X,U,W;if(T(V)){X=V;U=X;}else{if((V instanceof B.Node)&&R){X=R[V.get(L)];if(T(X)){U=X;}else{U=S;}}else{U=S;}}if(Y){W=Y.item(X);if(W&&W.get("disabled")){U=S;}}return U;}},keys:{value:{next:null,previous:null}},focusClass:{},circular:{value:true}};B.extend(D,B.Plugin.Base,{_stopped:true,_descendants:null,_descendantsMap:null,_focusedNode:null,_lastNodeIndex:0,_eventHandlers:null,_initDescendants:function(){var Y=this.get("descendants"),R={},W=-1,V,U=this.get(J),X,S,T=0;if(H.isUndefined(U)){U=-1;}if(Y){V=Y.size();if(V>1){for(T=0;T<V;T++){X=Y.item(T);if(W===-1&&!X.get(I)){W=T;}if(U<0&&parseInt(X.getAttribute(N,2),10)===0){U=T;}X.set(N,-1);S=X.get(L);if(!S){S=B.guid();X.set(L,S);}R[S]=T;}if(U<0){U=0;}X=Y.item(U);if(!X||X.get(I)){X=Y.item(W);U=W;}this._lastNodeIndex=V-1;this._descendants=Y;this._descendantsMap=R;this.set(J,U);X.set(N,0);}}},_isDescendant:function(R){return(R.get(L) in this._descendantsMap);},_removeFocusClass:function(){var S=this._focusedNode,T=this.get(A),R;if(T){R=H.isString(T)?T:T.className;}if(S&&R){S.removeClass(R);}},_detachKeyHandler:function(){var S=this._prevKeyHandler,R=this._nextKeyHandler;if(S){S.detach();}if(R){R.detach();}},_preventScroll:function(R){if(P[R.keyCode]){R.preventDefault();}},_fireClick:function(S){var R=S.target,T=R.get("nodeName").toLowerCase();if(S.keyCode===13&&(!M[T]||(T==="a"&&!R.getAttribute("href")))){R.simulate("click");}},_attachKeyHandler:function(){this._detachKeyHandler();var U=this.get("keys.next"),S=this.get("keys.previous"),T=this.get(O),R=this._eventHandlers;if(S){this._prevKeyHandler=B.on(F,B.bind(this._focusPrevious,this),T,S);}if(U){this._nextKeyHandler=B.on(F,B.bind(this._focusNext,this),T,U);}if(K.opera){R.push(T.on("keypress",this._preventScroll,this));}if(!K.opera){R.push(T.on("keypress",this._fireClick,this));}},_detachEventHandlers:function(){this._detachKeyHandler();var R=this._eventHandlers;if(R){B.Array.each(R,function(S){S.detach();});this._eventHandlers=null;}},_attachEventHandlers:function(){var U=this._descendants,R,S,T;if(U&&U.size()>1){R=this._eventHandlers||[];S=this.get(O).get("ownerDocument");if(R.length===0){R.push(S.on("focus",this._onDocFocus,this));R.push(S.on("mousedown",this._onDocMouseDown,this));R.push(this.after("keysChange",this._attachKeyHandler));R.push(this.after("descendantsChange",this._initDescendants));R.push(this.after(G,this._afterActiveDescendantChange));T=this.after("focusedChange",B.bind(function(V){if(V.newVal){this._attachKeyHandler();T.detach();}},this));R.push(T);}this._eventHandlers=R;}},_onDocMouseDown:function(U){var W=this.get(O),R=U.target,V=W.contains(R),T,S=function(Y){var X=false;if(!Y.compareTo(W)){X=this._isDescendant(Y)?Y:S.call(this,Y.get("parentNode"));}return X;};if(V){T=S.call(this,R);if(T){R=T;}else{if(!T&&this.get(E)){this._set(E,false);this._onDocFocus(U);}}}if(V&&this._isDescendant(R)){this.focus(R);}else{if(K.webkit&&this.get(E)&&(!V||(V&&!this._isDescendant(R)))){this._set(E,false);this._onDocFocus(U);}}},_onDocFocus:function(W){var U=this._focusTarget||W.target,S=this.get(E),V=this.get(A),T=this._focusedNode,R;if(this._focusTarget){this._focusTarget=null;}if(this.get(O).contains(U)){R=this._isDescendant(U);if(!S&&R){S=true;}else{if(S&&!R){S=false;}}}else{S=false;}if(V){if(T&&(!T.compareTo(U)||!S)){this._removeFocusClass();}if(R&&S){if(V.fn){U=V.fn(U);U.addClass(V.className);}else{U.addClass(V);}this._focusedNode=U;}}this._set(E,S);},_focusNext:function(S,T){var R=T||this.get(J),U;if(this._isDescendant(S.target)&&(R<=this._lastNodeIndex)){R=R+1;if(R===(this._lastNodeIndex+1)&&this.get(Q)){R=0;}U=this._descendants.item(R);if(U.get(I)){this._focusNext(S,R);}else{this.focus(R);}}this._preventScroll(S);},_focusPrevious:function(S,T){var R=T||this.get(J),U;if(this._isDescendant(S.target)&&R>=0){R=R-1;if(R===-1&&this.get(Q)){R=this._lastNodeIndex;}U=this._descendants.item(R);if(U.get(I)){this._focusPrevious(S,R);}else{this.focus(R);}}this._preventScroll(S);},_afterActiveDescendantChange:function(R){var S=this._descendants.item(R.prevVal);if(S){S.set(N,-1);}S=this._descendants.item(R.newVal);if(S){S.set(N,0);}},initializer:function(R){this.start();},destructor:function(){this.stop();this.get(O).focusManager=null;},focus:function(R){if(H.isUndefined(R)){R=this.get(J);}this.set(J,R,{src:C});var S=this._descendants.item(this.get(J));if(S){S.focus();if(K.opera&&S.get("nodeName").toLowerCase()==="button"){this._focusTarget=S;}}},blur:function(){var R;if(this.get(E)){R=this._descendants.item(this.get(J));if(R){R.blur();this._removeFocusClass();}this._set(E,false,{src:C});}},start:function(){if(this._stopped){this._initDescendants();this._attachEventHandlers();this._stopped=false;}},stop:function(){if(!this._stopped){this._detachEventHandlers();this._descendants=null;this._focusedNode=null;this._lastNodeIndex=0;this._stopped=true;}},refresh:function(){this._initDescendants();}});D.NAME="nodeFocusManager";D.NS="focusManager";B.namespace("Plugin");B.Plugin.NodeFocusManager=D;},"3.0.0",{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]});
// ../yui/node/node-event-simulate-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("node-event-simulate",function(A){A.Node.prototype.simulate=function(C,B){A.Event.simulate(A.Node.getDOMNode(this),C,B);};},"3.0.0",{requires:["node-base","event-simulate"]});
// ../yui/dump/dump-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("dump",function(G){var B=G.Lang,C="{...}",F="f(){...}",A=", ",D=" => ",E=function(N,M){var I,H,K=[],J=B.type(N);if(!B.isObject(N)){return N+"";}else{if(J=="date"){return N;}else{if(N.nodeType&&N.tagName){return N.tagName+"#"+N.id;}else{if(N.document&&N.navigator){return"window";}else{if(N.location&&N.body){return"document";}else{if(J=="function"){return F;}}}}}}M=(B.isNumber(M))?M:3;if(J=="array"){K.push("[");for(I=0,H=N.length;I<H;I=I+1){if(B.isObject(N[I])){K.push((M>0)?B.dump(N[I],M-1):C);}else{K.push(N[I]);}K.push(A);}if(K.length>1){K.pop();}K.push("]");}else{if(J=="regexp"){K.push(N.toString());}else{K.push("{");for(I in N){if(N.hasOwnProperty(I)){try{K.push(I+D);if(B.isObject(N[I])){K.push((M>0)?B.dump(N[I],M-1):C);}else{K.push(N[I]);}K.push(A);}catch(L){K.push("Error: "+L.message);}}}if(K.length>1){K.pop();}K.push("}");}}return K.join("");};G.dump=E;B.dump=E;},"3.0.0");
// ../yui/io/io-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("io-base",function(D){var d="io:start",P="io:complete",B="io:success",F="io:failure",e="io:end",X=0,O={"X-Requested-With":"XMLHttpRequest"},Z={},K=D.config.win;function b(h,p,g){var j,l,Y;p=p||{};l=W(p.xdr||p.form,g);Y=p.method?p.method.toUpperCase():"GET";if(p.form){if(p.form.upload){return D.io._upload(l,h,p);}else{j=D.io._serialize(p.form,p.data);if(Y==="POST"){p.data=j;V("Content-Type","application/x-www-form-urlencoded");}else{if(Y==="GET"){h=Q(h,j);}}}}else{if(p.data&&Y==="GET"){h=Q(h,p.data);}}if(p.xdr){if(p.xdr.use==="native"&&window.XDomainRequest||p.xdr.use==="flash"){return D.io.xdr(h,l,p);}if(p.xdr.credentials){l.c.withCredentials=true;}}l.c.onreadystatechange=function(){c(l,p);};try{l.c.open(Y,h,true);}catch(n){if(p.xdr){return A(l,h,p);}}if(p.data&&Y==="POST"){V("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");}C(l.c,p.headers||{});try{l.c.send(p.data||"");}catch(k){if(p.xdr){return A(l,h,p);}}S(l.id,p);if(p.timeout){R(l,p.timeout);}return{id:l.id,abort:function(){return l.c?N(l,"abort"):false;},isInProgress:function(){return l.c?l.c.readyState!==4&&l.c.readyState!==0:false;}};}function U(f,g){var Y=new D.EventTarget().publish("transaction:"+f);Y.subscribe(g.on[f],(g.context||D),g.arguments);return Y;}function S(g,f){var Y;f.on=f.on||{};D.fire(d,g);if(f.on.start){Y=U("start",f);Y.fire(g);}}function G(g,h){var Y,f=g.status?{status:0,statusText:g.status}:g.c;h.on=h.on||{};D.fire(P,g.id,f);if(h.on.complete){Y=U("complete",h);Y.fire(g.id,f);}}function T(f,g){var Y;g.on=g.on||{};D.fire(B,f.id,f.c);if(g.on.success){Y=U("success",g);Y.fire(f.id,f.c);}J(f,g);}function I(g,h){var Y,f=g.status?{status:0,statusText:g.status}:g.c;h.on=h.on||{};D.fire(F,g.id,f);if(h.on.failure){Y=U("failure",h);Y.fire(g.id,f);}J(g,h);}function J(f,g){var Y;g.on=g.on||{};D.fire(e,f.id);if(g.on.end){Y=U("end",g);Y.fire(f.id);}H(f,g.xdr?true:false);}function N(f,Y){if(f&&f.c){f.status=Y;f.c.abort();}}function A(f,Y,h){var g=parseInt(f.id);H(f);h.xdr.use="flash";return D.io(Y,h,g);}function E(){var Y=X;X++;return Y;}function W(g,Y){var f={};f.id=D.Lang.isNumber(Y)?Y:E();g=g||{};if(!g.use&&!g.upload){f.c=L();}else{if(g.use){if(g.use==="flash"){f.c=D.io._transport[g.use];}else{if(g.use==="native"&&window.XDomainRequest){f.c=new XDomainRequest();}else{f.c=L();}}}else{f.c={};}}return f;}function L(){return K.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");}function Q(Y,f){Y+=((Y.indexOf("?")==-1)?"?":"&")+f;return Y;}function V(Y,f){if(f){O[Y]=f;}else{delete O[Y];}}function C(g,Y){var f;for(f in O){if(O.hasOwnProperty(f)){if(Y[f]){break;}else{Y[f]=O[f];}}}for(f in Y){if(Y.hasOwnProperty(f)){g.setRequestHeader(f,Y[f]);}}}function R(f,Y){Z[f.id]=K.setTimeout(function(){N(f,"timeout");},Y);}function M(Y){K.clearTimeout(Z[Y]);delete Z[Y];}function c(Y,f){if(Y.c.readyState===4){if(f.timeout){M(Y.id);}K.setTimeout(function(){G(Y,f);a(Y,f);},0);}}function a(g,h){var Y;try{if(g.c.status&&g.c.status!==0){Y=g.c.status;}else{Y=0;}}catch(f){Y=0;}if(Y>=200&&Y<300||Y===1223){T(g,h);}else{I(g,h);}}function H(Y,f){if(K.XMLHttpRequest&&!f){if(Y.c){Y.c.onreadystatechange=null;}}Y.c=null;Y=null;}b.start=S;b.complete=G;b.success=T;b.failure=I;b.end=J;b._id=E;b._timeout=Z;b.header=V;D.io=b;D.io.http=b;},"3.0.0",{requires:["event-custom-base"]});YUI.add("io-form",function(A){A.mix(A.io,{_serialize:function(M,R){var I=encodeURIComponent,H=[],N=M.useDisabled||false,Q=0,B=(typeof M.id==="string")?M.id:M.id.getAttribute("id"),K,J,D,P,L,G,O,E,F,C;if(!B){B=A.guid("io:");M.id.setAttribute("id",B);}J=A.config.doc.getElementById(B);for(G=0,O=J.elements.length;G<O;++G){K=J.elements[G];L=K.disabled;D=K.name;if((N)?D:(D&&!L)){D=encodeURIComponent(D)+"=";P=encodeURIComponent(K.value);switch(K.type){case"select-one":if(K.selectedIndex>-1){C=K.options[K.selectedIndex];H[Q++]=D+I((C.attributes.value&&C.attributes.value.specified)?C.value:C.text);}break;case"select-multiple":if(K.selectedIndex>-1){for(E=K.selectedIndex,F=K.options.length;E<F;++E){C=K.options[E];if(C.selected){H[Q++]=D+I((C.attributes.value&&C.attributes.value.specified)?C.value:C.text);}}}break;case"radio":case"checkbox":if(K.checked){H[Q++]=D+P;}break;case"file":case undefined:case"reset":case"button":break;case"submit":default:H[Q++]=D+P;}}}return R?H.join("&")+"&"+R:H.join("&");}},true);},"3.0.0",{requires:["io-base","node-base","node-style"]});YUI.add("io-xdr",function(A){var I="io:xdrReady",D={},E={};function F(J,M){var K='<object id="yuiIoSwf" type="application/x-shockwave-flash" data="'+J+'" width="0" height="0">'+'<param name="movie" value="'+J+'">'+'<param name="FlashVars" value="yid='+M+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",L=document.createElement("div");document.body.appendChild(L);L.innerHTML=K;}function G(J,K){J.c.onprogress=function(){E[J.id]=3;};J.c.onload=function(){E[J.id]=4;A.io.xdrResponse(J,K,"success");};J.c.onerror=function(){E[J.id]=4;A.io.xdrResponse(J,K,"failure");};if(K.timeout){J.c.ontimeout=function(){E[J.id]=4;A.io.xdrResponse(J,K,"timeout");};J.c.timeout=K.timeout;}}function B(M,K,N){var L,J;if(!M.status){L=K?decodeURI(M.c.responseText):M.c.responseText;J=N?A.DataType.XML.parse(L):null;return{id:M.id,c:{responseText:L,responseXML:J}};}else{return{id:M.id,status:M.status};}}function H(J,K){return K.xdr.use==="flash"?J.c.abort(J.id,K):J.c.abort();}function C(K,J){return(J==="flash"&&K.c)?K.c.isInProgress(K.id):E[K.id]!==4;}A.mix(A.io,{_transport:{},xdr:function(J,K,L){if(L.on&&L.xdr.use==="flash"){D[K.id]={on:L.on,context:L.context,arguments:L.arguments};L.context=null;L.form=null;K.c.send(J,L,K.id);}else{if(window.XDomainRequest){G(K,L);K.c.open(L.method||"GET",J);K.c.send(L.data);}}return{id:K.id,abort:function(){return K.c?H(K,L):false;},isInProgress:function(){return K.c?C(K,L.xdr.use):false;}};},xdrResponse:function(N,P,M){var J,L,K=P.xdr.use==="flash"?true:false,O=P.xdr.dataType==="xml"?true:false;P.on=P.on||{};if(K){J=D||{};L=J[N.id]?J[N.id]:null;if(L){P.on=L.on;
P.context=L.context;P.arguments=L.arguments;}}if(M===("abort"||"timeout")){N.status=M;}switch(M){case"start":A.io.start(N.id,P);break;case"success":A.io.success(B(N,K,O),P);K?delete J[N.id]:delete E[N.id];break;case"timeout":case"abort":case"failure":A.io.failure(B(N,K,O),P);K?delete J[N.id]:delete E[N.id];break;}},xdrReady:function(J){A.fire(I,J);},transport:function(J){var K=J.yid?J.yid:A.id;F(J.src,K);this._transport.flash=A.config.doc.getElementById("yuiIoSwf");}});},"3.0.0",{requires:["io-base","datatype-xml"]});YUI.add("io-upload-iframe",function(B){var I=B.config.win;function D(P,O){var Q=[],L=O.split("="),N,M;for(N=0,M=L.length-1;N<M;N++){Q[N]=document.createElement("input");Q[N].type="hidden";Q[N].name=L[N].substring(L[N].lastIndexOf("&")+1);Q[N].value=(N+1===M)?L[N+1]:L[N+1].substring(0,(L[N+1].lastIndexOf("&")));P.appendChild(Q[N]);}return Q;}function F(N,O){var M,L;for(M=0,L=O.length;M<L;M++){N.removeChild(O[M]);}}function E(N,O,M){var L=(document.documentMode&&document.documentMode===8)?true:false;N.setAttribute("action",M);N.setAttribute("method","POST");N.setAttribute("target","ioupload"+O);N.setAttribute(B.UA.ie&&!L?"encoding":"enctype","multipart/form-data");}function K(M,L){var N;for(N in L){if(L.hasOwnProperty(L,N)){if(L[N]){M.setAttribute(N,M[N]);}else{M.removeAttribute(N);}}}}function J(M,N){var L=B.Node.create('<iframe id="ioupload'+M.id+'" name="ioupload'+M.id+'" />');L._node.style.position="absolute";L._node.style.top="-1000px";L._node.style.left="-1000px";B.one("body").appendChild(L);B.on("load",function(){A(M,N);},"#ioupload"+M.id);}function A(P,Q){var O=B.one("#ioupload"+P.id).get("contentWindow.document"),L=O.one("body"),M=(O._node.nodeType===9),N;if(Q.timeout){H(P.id);}if(L){N=L.query("pre:first-child");P.c.responseText=N?N.get("innerHTML"):L.get("innerHTML");}else{if(M){P.c.responseXML=O._node;}}B.io.complete(P,Q);B.io.end(P,Q);I.setTimeout(function(){G(P.id);},0);}function C(L,M){B.io._timeout[L.id]=I.setTimeout(function(){var N={id:L.id,status:"timeout"};B.io.complete(N,M);B.io.end(N,M);},M.timeout);}function H(L){I.clearTimeout(B.io._timeout[L]);delete B.io._timeout[L];}function G(L){B.Event.purgeElement("#ioupload"+L,false);B.one("body").removeChild(B.one("#ioupload"+L));}B.mix(B.io,{_upload:function(P,N,Q){var O=(typeof Q.form.id==="string")?B.config.doc.getElementById(Q.form.id):Q.form.id,M,L={action:O.getAttribute("action"),target:O.getAttribute("target")};J(P,Q);E(O,P.id,N);if(Q.data){M=D(O,Q.data);}if(Q.timeout){C(P,Q);}O.submit();B.io.start(P.id,Q);if(Q.data){F(O,M);}K(O,L);return{id:P.id,abort:function(){var R={id:P.id,status:"abort"};if(B.one("#ioupload"+P.id)){G(P.id);B.io.complete(R,Q);B.io.end(R,Q);}else{return false;}},isInProgress:function(){return B.one("#ioupload"+P.id)?true:false;}};}});},"3.0.0",{requires:["io-base","node-base","event-base"]});YUI.add("io-queue",function(B){var A=new B.Queue(),I,G,M=1;function J(N,P){var O={uri:N,id:B.io._id(),cfg:P};A.add(O);if(M===1){F();}return O;}function F(){var N=A.next();G=N.id;M=0;B.io(N.uri,N.cfg,N.id);}function D(N){A.promote(N);}function C(N){M=1;if(G===N&&A.size()>0){F();}}function L(N){A.remove(N);}function E(){M=1;if(A.size()>0){F();}}function H(){M=0;}function K(){return A.size();}I=B.on("io:complete",function(N){C(N);},B.io);J.size=K;J.start=E;J.stop=H;J.promote=D;J.remove=L;B.mix(B.io,{queue:J},true);},"3.0.0",{requires:["io-base","queue-promote"]});YUI.add("io",function(A){},"3.0.0",{use:["io-base","io-form","io-xdr","io-upload-iframe","io-queue"]});
// ../yui/json/json-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("json-parse",function(Y){var _JSON=Y.config.win.JSON,Native=(Object.prototype.toString.call(_JSON)==="[object JSON]"&&_JSON),_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(c){return"\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);},_revive=function(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(value.hasOwnProperty(k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;},_parse=function(s,reviver){if(typeof s==="string"){s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))){return _revive(eval("("+s+")"),reviver);}}throw new SyntaxError("JSON.parse");};Y.namespace("JSON").parse=function(s,reviver){return Native&&Y.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);};Y.JSON.useNativeParse=!!Native;},"3.0.0");YUI.add("json-stringify",function(C){var b=C.config.win.JSON,E=C.Lang,A=E.isFunction,L=E.isObject,N=E.isArray,X=Object.prototype.toString,W=(X.call(b)==="[object JSON]"&&b),h="undefined",O="object",e="null",R="string",U="number",Q="boolean",D="date",H={"undefined":h,"string":R,"[object String]":R,"number":U,"[object Number]":U,"boolean":Q,"[object Boolean]":Q,"[object Date]":D,"[object RegExp]":O},i="",g="{",G="}",F="[",V="]",T=",",K=",\n",B="\n",I=":",f=": ",M='"',Z=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function c(j){var Y=typeof j;return H[Y]||H[X.call(j)]||(Y===O?(j?O:e):h);}function P(Y){if(!a[Y]){a[Y]="\\u"+("0000"+(+(Y.charCodeAt(0))).toString(16)).slice(-4);}return a[Y];}function J(Y){return M+Y.replace(Z,P)+M;}function d(Y,j){return Y.replace(/^/gm,j);}function S(j,s,Y){if(j===undefined){return undefined;}var l=A(s)?s:null,r=X.call(Y).match(/String|Number/)||[],t=C.JSON.dateToString,q=[],n,m,p;if(l||!N(s)){s=undefined;}if(s){n={};for(m=0,p=s.length;m<p;++m){n[s[m]]=true;}s=n;}Y=r[0]==="Number"?new Array(Math.min(Math.max(0,Y),10)+1).join(" "):(Y||i).slice(0,10);function k(w,AC){var AA=w[AC],AE=c(AA),z=[],y=Y?f:I,x,u,AD,o,AB;if(L(AA)&&A(AA.toJSON)){AA=AA.toJSON(AC);}else{if(AE===D){AA=t(AA);}}if(A(l)){AA=l.call(w,AC,AA);}if(AA!==w[AC]){AE=c(AA);}switch(AE){case D:case O:break;case R:return J(AA);case U:return isFinite(AA)?AA+i:e;case Q:return AA+i;case e:return e;default:return undefined;}for(u=q.length-1;u>=0;--u){if(q[u]===AA){throw new Error("JSON.stringify. Cyclical reference");}}x=N(AA);q.push(AA);if(x){for(u=AA.length-1;u>=0;--u){z[u]=k(AA,u)||e;}}else{AD=s||AA;u=0;for(o in AD){if(AD.hasOwnProperty(o)){AB=k(AA,o);if(AB){z[u++]=J(o)+y+AB;}}}}q.pop();if(Y&&z.length){return x?F+B+d(z.join(K),Y)+B+V:g+B+d(z.join(K),Y)+B+G;}else{return x?F+z.join(T)+V:g+z.join(T)+G;}}return k({"":j},"");}C.mix(C.namespace("JSON"),{useNativeStringify:!!W,dateToString:function(j){function Y(k){return k<10?"0"+k:k;}return j.getUTCFullYear()+"-"+Y(j.getUTCMonth()+1)+"-"+Y(j.getUTCDate())+"T"+Y(j.getUTCHours())+I+Y(j.getUTCMinutes())+I+Y(j.getUTCSeconds())+"Z";},stringify:function(k,Y,j){return W&&C.JSON.useNativeStringify?W.stringify(k,Y,j):S(k,Y,j);}});},"3.0.0");YUI.add("json",function(A){},"3.0.0",{use:["json-parse","json-stringify"]});
// ../yui/attribute/attribute-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("attribute-base",function(C){C.State=function(){this.data={};};C.State.prototype={add:function(O,Y,e){var c=this.data;c[Y]=c[Y]||{};c[Y][O]=e;},addAll:function(O,c){var Y;for(Y in c){if(c.hasOwnProperty(Y)){this.add(O,Y,c[Y]);}}},remove:function(O,Y){var c=this.data;if(c[Y]&&(O in c[Y])){delete c[Y][O];}},removeAll:function(O,c){var Y=this.data;C.each(c||Y,function(e,d){if(C.Lang.isString(d)){this.remove(O,d);}else{this.remove(O,e);}},this);},get:function(O,Y){var c=this.data;return(c[Y]&&O in c[Y])?c[Y][O]:undefined;},getAll:function(O){var c=this.data,Y;C.each(c,function(e,d){if(O in c[d]){Y=Y||{};Y[d]=e[O];}},this);return Y;}};var K=C.Object,F=C.Lang,L=C.EventTarget,W=".",U="Change",N="getter",M="setter",P="readOnly",X="writeOnce",b="validator",H="value",Q="valueFn",E="broadcast",S="lazyAdd",J="_bypassProxy",a="added",B="initializing",I="initValue",V="published",T="defaultValue",A="lazy",R="isLazyAdd",G,Z={};Z[P]=1;Z[X]=1;Z[N]=1;Z[E]=1;function D(){var c=this,O=this.constructor.ATTRS,Y=C.Base;c._ATTR_E_FACADE={};L.call(c,{emitFacade:true});c._conf=c._state=new C.State();c._stateProxy=c._stateProxy||null;c._requireAddAttr=c._requireAddAttr||false;if(O&&!(Y&&c instanceof Y)){c.addAttrs(this._protectAttrs(O));}}D.INVALID_VALUE={};G=D.INVALID_VALUE;D._ATTR_CFG=[M,N,b,H,Q,X,P,S,E,J];D.prototype={addAttr:function(Y,O,d){var e=this,g=e._state,f,c;d=(S in O)?O[S]:d;if(d&&!e.attrAdded(Y)){g.add(Y,A,O||{});g.add(Y,a,true);}else{if(!e.attrAdded(Y)||g.get(Y,R)){O=O||{};c=(H in O);if(c){f=O.value;delete O.value;}O.added=true;O.initializing=true;g.addAll(Y,O);if(c){e.set(Y,f);}g.remove(Y,B);}}return e;},attrAdded:function(O){return !!this._state.get(O,a);},modifyAttr:function(Y,O){var c=this,e,d;if(c.attrAdded(Y)){if(c._isLazyAttr(Y)){c._addLazyAttr(Y);}d=c._state;for(e in O){if(Z[e]&&O.hasOwnProperty(e)){d.add(Y,e,O[e]);if(e===E){d.remove(Y,V);}}}}},removeAttr:function(O){this._state.removeAll(O);},get:function(O){return this._getAttr(O);},_isLazyAttr:function(O){return this._state.get(O,A);},_addLazyAttr:function(Y){var c=this._state,O=c.get(Y,A);c.add(Y,R,true);c.remove(Y,A);this.addAttr(Y,O);},set:function(O,c,Y){return this._setAttr(O,c,Y);},reset:function(O){var c=this,Y;if(O){if(c._isLazyAttr(O)){c._addLazyAttr(O);}c.set(O,c._state.get(O,I));}else{Y=c._state.data.added;C.each(Y,function(d,e){c.reset(e);},c);}return c;},_set:function(O,c,Y){return this._setAttr(O,c,Y,true);},_getAttr:function(c){var d=this,h=c,e=d._state,f,O,g,Y;if(c.indexOf(W)!==-1){f=c.split(W);c=f.shift();}if(d._tCfgs&&d._tCfgs[c]){Y={};Y[c]=d._tCfgs[c];delete d._tCfgs[c];d._addAttrs(Y,d._tVals);}if(d._isLazyAttr(c)){d._addLazyAttr(c);}g=d._getStateVal(c);O=e.get(c,N);g=(O)?O.call(d,g,h):g;g=(f)?K.getValue(g,f):g;return g;},_setAttr:function(c,f,O,d){var i=true,Y=this._state,g=this._stateProxy,j=Y.data,h,k,l,e;if(c.indexOf(W)!==-1){k=c;l=c.split(W);c=l.shift();}if(this._isLazyAttr(c)){this._addLazyAttr(c);}h=(!j.value||!(c in j.value));if(g&&c in g&&!this._state.get(c,J)){h=false;}if(this._requireAddAttr&&!this.attrAdded(c)){}else{if(!h&&!d){if(Y.get(c,X)){i=false;}if(Y.get(c,P)){i=false;}}if(i){if(!h){e=this.get(c);}if(l){f=K.setValue(C.clone(e),l,f);if(f===undefined){i=false;}}if(i){if(Y.get(c,B)){this._setAttrVal(c,k,e,f);}else{this._fireAttrChange(c,k,e,f,O);}}}}return this;},_fireAttrChange:function(g,f,d,c,O){var i=this,e=g+U,Y=i._state,h;if(!Y.get(g,V)){i.publish(e,{queuable:false,defaultFn:i._defAttrChangeFn,silent:true,broadcast:Y.get(g,E)});Y.add(g,V,true);}h=(O)?C.merge(O):i._ATTR_E_FACADE;h.type=e;h.attrName=g;h.subAttrName=f;h.prevVal=d;h.newVal=c;i.fire(h);},_defAttrChangeFn:function(O){if(!this._setAttrVal(O.attrName,O.subAttrName,O.prevVal,O.newVal)){O.stopImmediatePropagation();}else{O.newVal=this._getStateVal(O.attrName);}},_getStateVal:function(O){var Y=this._stateProxy;return Y&&(O in Y)&&!this._state.get(O,J)?Y[O]:this._state.get(O,H);},_setStateVal:function(O,c){var Y=this._stateProxy;if(Y&&(O in Y)&&!this._state.get(O,J)){Y[O]=c;}else{this._state.add(O,H,c);}},_setAttrVal:function(l,k,h,f){var n=this,i=true,c=n._state,d=c.get(l,b),g=c.get(l,M),j=c.get(l,B),m=this._getStateVal(l),Y=k||l,e,O;if(d){O=d.call(n,f,Y);if(!O&&j){f=c.get(l,T);O=true;}}if(!d||O){if(g){e=g.call(n,f,Y);if(e===G){i=false;}else{if(e!==undefined){f=e;}}}if(i){if(!k&&(f===m)&&!F.isObject(f)){i=false;}else{if(c.get(l,I)===undefined){c.add(l,I,f);}n._setStateVal(l,f);}}}else{i=false;}return i;},setAttrs:function(O,Y){return this._setAttrs(O,Y);},_setAttrs:function(Y,c){for(var O in Y){if(Y.hasOwnProperty(O)){this.set(O,Y[O]);}}return this;},getAttrs:function(O){return this._getAttrs(O);},_getAttrs:function(d){var f=this,h={},e,Y,O,g,c=(d===true);d=(d&&!c)?d:K.keys(f._state.data.added);for(e=0,Y=d.length;e<Y;e++){O=d[e];g=f.get(O);if(!c||f._getStateVal(O)!=f._state.get(O,I)){h[O]=f.get(O);}}return h;},addAttrs:function(O,Y,c){var d=this;if(O){d._tCfgs=O;d._tVals=d._normAttrVals(Y);d._addAttrs(O,d._tVals,c);d._tCfgs=d._tVals=null;}return d;},_addAttrs:function(Y,c,d){var f=this,O,e,g;for(O in Y){if(Y.hasOwnProperty(O)){e=Y[O];e.defaultValue=e.value;g=f._getAttrInitVal(O,e,f._tVals);if(g!==undefined){e.value=g;}if(f._tCfgs[O]){delete f._tCfgs[O];}f.addAttr(O,e,d);}}},_protectAttrs:function(Y){if(Y){Y=C.merge(Y);for(var O in Y){if(Y.hasOwnProperty(O)){Y[O]=C.merge(Y[O]);}}}return Y;},_normAttrVals:function(O){return(O)?C.merge(O):null;},_getAttrInitVal:function(O,Y,c){var d=(!Y[P]&&c&&c.hasOwnProperty(O))?d=c[O]:(Y[Q])?Y[Q].call(this):Y[H];return d;}};C.mix(D,L,false,null,1);C.Attribute=D;},"3.0.0",{requires:["event-custom"]});YUI.add("attribute-complex",function(B){var A=B.Object,C=".";B.Attribute.Complex=function(){};B.Attribute.Complex.prototype={_normAttrVals:function(G){var I={},H={},J,D,F,E;if(G){for(E in G){if(G.hasOwnProperty(E)){if(E.indexOf(C)!==-1){J=E.split(C);D=J.shift();F=H[D]=H[D]||[];F[F.length]={path:J,value:G[E]};}else{I[E]=G[E];}}}return{simple:I,complex:H};}else{return null;}},_getAttrInitVal:function(K,I,M){var E=(I.valueFn)?I.valueFn.call(this):I.value,D,F,H,G,N,L,J;
if(!I.readOnly&&M){D=M.simple;if(D&&D.hasOwnProperty(K)){E=D[K];}F=M.complex;if(F&&F.hasOwnProperty(K)){J=F[K];for(H=0,G=J.length;H<G;++H){N=J[H].path;L=J[H].value;A.setValue(E,N,L);}}}return E;}};B.mix(B.Attribute,B.Attribute.Complex,true,null,1);},"3.0.0",{requires:["attribute-base"]});YUI.add("attribute",function(A){},"3.0.0",{use:["attribute-base","attribute-complex"]});
// ../yui/base/base-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("base-base",function(B){var H=B.Object,J=B.Lang,I=".",F="destroy",P="init",N="initialized",G="destroyed",D="initializer",C=Object.prototype.constructor,K="deep",Q="shallow",M="destructor",A=B.Attribute;function E(){A.call(this);var L=B.Plugin&&B.Plugin.Host;if(this._initPlugins&&L){L.call(this);}if(this._lazyAddAttrs!==false){this._lazyAddAttrs=true;}this.init.apply(this,arguments);}E._ATTR_CFG=A._ATTR_CFG.concat("cloneDefaultValue");E.NAME="base";E.ATTRS={initialized:{readOnly:true,value:false},destroyed:{readOnly:true,value:false}};E.prototype={init:function(L){this._yuievt.config.prefix=this.name=this.constructor.NAME;this.publish(P,{queuable:false,defaultFn:this._defInitFn});if(L){if(L.on){this.on(L.on);}if(L.after){this.after(L.after);}}this.fire(P,{cfg:L});return this;},destroy:function(){this.publish(F,{queuable:false,defaultFn:this._defDestroyFn});this.fire(F);return this;},_defInitFn:function(L){this._initHierarchy(L.cfg);if(this._initPlugins){this._initPlugins(L.cfg);}this._set(N,true);},_defDestroyFn:function(L){this._destroyHierarchy();if(this._destroyPlugins){this._destroyPlugins();}this._set(G,true);},_getClasses:function(){if(!this._classes){this._initHierarchyData();}return this._classes;},_getAttrCfgs:function(){if(!this._attrs){this._initHierarchyData();}return this._attrs;},_filterAttrCfgs:function(T,O){var R=null,L,S=T.ATTRS;if(S){for(L in S){if(S.hasOwnProperty(L)&&O[L]){R=R||{};R[L]=O[L];delete O[L];}}}return R;},_initHierarchyData:function(){var R=this.constructor,O=[],L=[];while(R){O[O.length]=R;if(R.ATTRS){L[L.length]=R.ATTRS;}R=R.superclass?R.superclass.constructor:null;}this._classes=O;this._attrs=this._aggregateAttrs(L);},_aggregateAttrs:function(W){var T,X,S,L,Y,O,V,R=E._ATTR_CFG,U={};if(W){for(O=W.length-1;O>=0;--O){X=W[O];for(T in X){if(X.hasOwnProperty(T)){S=B.mix({},X[T],true,R);L=S.value;V=S.cloneDefaultValue;if(L){if((V===undefined&&(C===L.constructor||J.isArray(L)))||V===K||V===true){S.value=B.clone(L);}else{if(V===Q){S.value=B.merge(L);}}}Y=null;if(T.indexOf(I)!==-1){Y=T.split(I);T=Y.shift();}if(Y&&U[T]&&U[T].value){H.setValue(U[T].value,Y,L);}else{if(!Y){if(!U[T]){U[T]=S;}else{B.mix(U[T],S,true,R);}}}}}}}return U;},_initHierarchy:function(U){var R=this._lazyAddAttrs,V,W,X,S,O,T=this._getClasses(),L=this._getAttrCfgs();for(X=T.length-1;X>=0;X--){V=T[X];W=V.prototype;if(V._yuibuild&&V._yuibuild.exts&&!V._yuibuild.dynamic){for(S=0,O=V._yuibuild.exts.length;S<O;S++){V._yuibuild.exts[S].apply(this,arguments);}}this.addAttrs(this._filterAttrCfgs(V,L),U,R);if(W.hasOwnProperty(D)){W.initializer.apply(this,arguments);}}},_destroyHierarchy:function(){var T,O,S,L,R=this._getClasses();for(S=0,L=R.length;S<L;S++){T=R[S];O=T.prototype;if(O.hasOwnProperty(M)){O.destructor.apply(this,arguments);}}},toString:function(){return this.constructor.NAME+"["+B.stamp(this)+"]";}};B.mix(E,A,false,null,1);E.prototype.constructor=E;B.Base=E;E.prototype.constructor=E;},"3.0.0",{requires:["attribute-base"]});YUI.add("base-pluginhost",function(C){var A=C.Base,B=C.Plugin.Host;C.mix(A,B,false,null,1);A.plug=B.plug;A.unplug=B.unplug;},"3.0.0",{requires:["base-base","pluginhost"]});YUI.add("base-build",function(C){var B=C.Base,A=C.Lang;B._buildCfg={aggregates:["ATTRS","_PLUG","_UNPLUG"]};B.build=function(D,I,M,L){var O=B.build,E=O._getClass(I,L),K=O._getAggregates(I,L),G=E._yuibuild.dynamic,J,H,F,N;if(G){if(K){for(J=0,H=K.length;J<H;++J){F=K[J];if(I.hasOwnProperty(F)){E[F]=A.isArray(I[F])?[]:{};}}C.aggregate(E,I,true,K);}}for(J=0,H=M.length;J<H;J++){N=M[J];if(K){C.aggregate(E,N,true,K);}C.mix(E,N,true,null,1);E._yuibuild.exts.push(N);}E.prototype.hasImpl=O._hasImpl;if(G){E.NAME=D;E.prototype.constructor=E;}return E;};C.mix(B.build,{_template:function(D){function E(){E.superclass.constructor.apply(this,arguments);var H=E._yuibuild.exts,F=H.length,G;for(G=0;G<F;G++){H[G].apply(this,arguments);}return this;}C.extend(E,D);return E;},_hasImpl:function(G){var J=this._getClasses();for(var I=0,E=J.length;I<E;I++){var D=J[I];if(D._yuibuild){var H=D._yuibuild.exts,K=H.length,F;for(F=0;F<K;F++){if(H[F]===G){return true;}}}}return false;},_getClass:function(D,E){var F=(E&&false===E.dynamic)?false:true,G=(F)?B.build._template(D):D;G._yuibuild={id:null,exts:[],dynamic:F};return G;},_getAggregates:function(D,E){var F=[],H=(E&&E.aggregates),I=D,G;while(I&&I.prototype){G=I._buildCfg&&I._buildCfg.aggregates;if(G){F=F.concat(G);}I=I.superclass?I.superclass.constructor:null;}if(H){F=F.concat(H);}return F;}});},"3.0.0",{requires:["base-base"]});YUI.add("base",function(A){},"3.0.0",{use:["base-base","base-pluginhost","base-build"]});
// ../yui/substitute/substitute-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("substitute",function(G){var B=G.Lang,D="dump",F=" ",C="{",E="}",A=function(U,I,P,K,H){var N,M,L,S,R,T,Q=[],J,O;K=K||C;H=H||E;for(;;){N=U.lastIndexOf(K);if(N<0){break;}M=U.indexOf(H,N);if(N+1>=M){break;}J=U.substring(N+1,M);S=J;T=null;L=S.indexOf(F);if(L>-1){T=S.substring(L+1);S=S.substring(0,L);}R=I[S];if(P){R=P(S,R,T);}if(B.isObject(R)){if(!G.dump){R=R.toString();}else{if(B.isArray(R)){R=G.dump(R,parseInt(T,10));}else{T=T||"";O=T.indexOf(D);if(O>-1){T=T.substring(4);}if(R.toString===Object.prototype.toString||O>-1){R=G.dump(R,parseInt(T,10));}else{R=R.toString();}}}}else{if(!B.isString(R)&&!B.isNumber(R)){R="~-"+Q.length+"-~";Q[Q.length]=J;}}U=U.substring(0,N)+R+U.substring(M+1);}for(N=Q.length-1;N>=0;N=N-1){U=U.replace(new RegExp("~-"+N+"-~"),K+Q[N]+H,"g");}return U;};G.substitute=A;B.substitute=A;},"3.0.0",{optional:["dump"]});
// ../yui/anim/anim-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("anim-base",function(B){var C="running",N="startTime",L="elapsedTime",J="start",I="tween",M="end",D="node",K="paused",P="reverse",H="iterationCount",A=Number;var F={},O={},E;B.Anim=function(){B.Anim.superclass.constructor.apply(this,arguments);O[B.stamp(this)]=this;};B.Anim.NAME="anim";B.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;B.Anim.DEFAULT_UNIT="px";B.Anim.DEFAULT_EASING=function(R,Q,T,S){return T*R/S+Q;};B.Anim.behaviors={left:{get:function(R,Q){return R._getOffset(Q);}}};B.Anim.behaviors.top=B.Anim.behaviors.left;B.Anim.DEFAULT_SETTER=function(U,R,X,W,Q,V,S,T){T=T||"";U._node.setStyle(R,S(Q,A(X),A(W)-A(X),V)+T);};B.Anim.DEFAULT_GETTER=function(Q,R){return Q._node.getComputedStyle(R);};B.Anim.ATTRS={node:{setter:function(Q){Q=B.get(Q);this._node=Q;if(!Q){}return Q;}},duration:{value:1},easing:{value:B.Anim.DEFAULT_EASING,setter:function(Q){if(typeof Q==="string"&&B.Easing){return B.Easing[Q];}}},from:{},to:{},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{getter:function(){return !!F[B.stamp(this)];},value:false,readOnly:true},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{readOnly:true,value:false},reverse:{value:false}};B.Anim.run=function(){for(var Q in O){if(O[Q].run){O[Q].run();}}};B.Anim.pause=function(){for(var Q in F){if(F[Q].pause){F[Q].pause();}}B.Anim._stopTimer();};B.Anim.stop=function(){for(var Q in F){if(F[Q].stop){F[Q].stop();}}B.Anim._stopTimer();};B.Anim._startTimer=function(){if(!E){E=setInterval(B.Anim._runFrame,1);}};B.Anim._stopTimer=function(){clearInterval(E);E=0;};B.Anim._runFrame=function(){var Q=true;for(var R in F){if(F[R]._runFrame){Q=false;F[R]._runFrame();}}if(Q){B.Anim._stopTimer();}};B.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var G={run:function(){if(!this.get(C)){this._start();}else{if(this.get(K)){this._resume();}}return this;},pause:function(){if(this.get(C)){this._pause();}return this;},stop:function(Q){if(this.get(C)||this.get(K)){this._end(Q);}return this;},_added:false,_start:function(){this._set(N,new Date()-this.get(L));this._actualFrames=0;if(!this.get(K)){this._initAnimAttr();}F[B.stamp(this)]=this;B.Anim._startTimer();this.fire(J);},_pause:function(){this._set(N,null);this._set(K,true);delete F[B.stamp(this)];this.fire("pause");},_resume:function(){this._set(K,false);F[B.stamp(this)]=this;this.fire("resume");},_end:function(Q){this._set(N,null);this._set(L,0);this._set(K,false);delete F[B.stamp(this)];this.fire(M,{elapsed:this.get(L)});},_runFrame:function(){var X=this._runtimeAttr,S=B.Anim.behaviors,Y=X.easing,Z=X.duration,a=new Date()-this.get(N),W=this.get(P),U=(a>=Z),Q=Z,R,T;if(W){a=Z-a;U=(a<=0);Q=0;}for(var V in X){if(X[V].to){R=X[V];T=(V in S&&"set" in S[V])?S[V].set:B.Anim.DEFAULT_SETTER;if(!U){T(this,V,R.from,R.to,a,Z,Y,R.unit);}else{T(this,V,R.from,R.to,Q,Z,Y,R.unit);}}}this._actualFrames+=1;this._set(L,a);this.fire(I);if(U){this._lastFrame();}},_lastFrame:function(){var Q=this.get("iterations"),R=this.get(H);R+=1;if(Q==="infinite"||R<Q){if(this.get("direction")==="alternate"){this.set(P,!this.get(P));}this.fire("iteration");}else{R=0;this._end();}this._set(N,new Date());this._set(H,R);},_initAnimAttr:function(){var X=this.get("from")||{},Y=this.get("to")||{},Q=this.get("duration")*1000,T=this.get(D),W=this.get("easing")||{},V={},R=B.Anim.behaviors,Z,S,U;B.each(Y,function(d,b){if(typeof d==="function"){d=d.call(this,T);}S=X[b];if(S===undefined){S=(b in R&&"get" in R[b])?R[b].get(this,b):B.Anim.DEFAULT_GETTER(this,b);}else{if(typeof S==="function"){S=S.call(this,T);}}var a=B.Anim.RE_UNITS.exec(S);var c=B.Anim.RE_UNITS.exec(d);S=a?a[1]:S;U=c?c[1]:d;Z=c?c[2]:a?a[2]:"";if(!Z&&B.Anim.RE_DEFAULT_UNIT.test(b)){Z=B.Anim.DEFAULT_UNIT;}if(!S||!U){B.error('invalid "from" or "to" for "'+b+'"',"Anim");return;}V[b]={from:S,to:U,unit:Z};V.duration=Q;V.easing=W;},this);this._runtimeAttr=V;},_getOffset:function(R){var T=this._node,U=T.getComputedStyle(R),S=(R==="left")?"getX":"getY",V=(R==="left")?"setX":"setY";if(U==="auto"){var Q=T.getStyle("position");if(Q==="absolute"||Q==="fixed"){U=T[S]();T[V](U);}else{U=0;}}return U;}};B.extend(B.Anim,B.Base,G);},"3.0.0",{requires:["base-base","node-style"]});YUI.add("anim-color",function(B){var A=Number;B.Anim.behaviors.color={set:function(F,D,I,H,C,G,E){I=B.Color.re_RGB.exec(B.Color.toRGB(I));H=B.Color.re_RGB.exec(B.Color.toRGB(H));if(!I||I.length<3||!H||H.length<3){B.error("invalid from or to passed to color behavior");}F._node.setStyle(D,"rgb("+[Math.floor(E(C,A(I[1]),A(H[1])-A(I[1]),G)),Math.floor(E(C,A(I[2]),A(H[2])-A(I[2]),G)),Math.floor(E(C,A(I[3]),A(H[3])-A(I[3]),G))].join(", ")+")");},get:function(D,C){var E=D._node.getComputedStyle(C);E=(E==="transparent")?"rgb(255, 255, 255)":E;return E;}};B.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(C,D){B.Anim.behaviors[C]=B.Anim.behaviors.color;});},"3.0.0",{requires:["anim-base"]});YUI.add("anim-curve",function(A){A.Anim.behaviors.curve={set:function(F,C,I,H,B,G,E){I=I.slice.call(I);H=H.slice.call(H);var D=E(B,0,100,G)/100;H.unshift(I);F._node.setXY(A.Anim.getBezier(H,D));},get:function(C,B){return C._node.getXY();}};A.Anim.getBezier=function(F,E){var G=F.length;var D=[];for(var C=0;C<G;++C){D[C]=[F[C][0],F[C][1]];}for(var B=1;B<G;++B){for(C=0;C<G-B;++C){D[C][0]=(1-E)*D[C][0]+E*D[parseInt(C+1,10)][0];D[C][1]=(1-E)*D[C][1]+E*D[parseInt(C+1,10)][1];}}return[D[0][0],D[0][1]];};},"3.0.0",{requires:["anim-xy"]});YUI.add("anim-easing",function(A){A.Easing={easeNone:function(C,B,E,D){return E*C/D+B;},easeIn:function(C,B,E,D){return E*(C/=D)*C+B;},easeOut:function(C,B,E,D){return -E*(C/=D)*(C-2)+B;},easeBoth:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C+B;}return -E/2*((--C)*(C-2)-1)+B;},easeInStrong:function(C,B,E,D){return E*(C/=D)*C*C*C+B;},easeOutStrong:function(C,B,E,D){return -E*((C=C/D-1)*C*C*C-1)+B;},easeBothStrong:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C*C*C+B;
}return -E/2*((C-=2)*C*C*C-2)+B;},elasticIn:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G)===1){return B+H;}if(!F){F=G*0.3;}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}return -(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B;},elasticOut:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G)===1){return B+H;}if(!F){F=G*0.3;}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}return C*Math.pow(2,-10*D)*Math.sin((D*G-E)*(2*Math.PI)/F)+H+B;},elasticBoth:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G/2)===2){return B+H;}if(!F){F=G*(0.3*1.5);}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}if(D<1){return -0.5*(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B;}return C*Math.pow(2,-10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F)*0.5+H+B;},backIn:function(C,B,F,E,D){if(D===undefined){D=1.70158;}if(C===E){C-=0.001;}return F*(C/=E)*C*((D+1)*C-D)+B;},backOut:function(C,B,F,E,D){if(typeof D==="undefined"){D=1.70158;}return F*((C=C/E-1)*C*((D+1)*C+D)+1)+B;},backBoth:function(C,B,F,E,D){if(typeof D==="undefined"){D=1.70158;}if((C/=E/2)<1){return F/2*(C*C*(((D*=(1.525))+1)*C-D))+B;}return F/2*((C-=2)*C*(((D*=(1.525))+1)*C+D)+2)+B;},bounceIn:function(C,B,E,D){return E-A.Easing.bounceOut(D-C,0,E,D)+B;},bounceOut:function(C,B,E,D){if((C/=D)<(1/2.75)){return E*(7.5625*C*C)+B;}else{if(C<(2/2.75)){return E*(7.5625*(C-=(1.5/2.75))*C+0.75)+B;}else{if(C<(2.5/2.75)){return E*(7.5625*(C-=(2.25/2.75))*C+0.9375)+B;}}}return E*(7.5625*(C-=(2.625/2.75))*C+0.984375)+B;},bounceBoth:function(C,B,E,D){if(C<D/2){return A.Easing.bounceIn(C*2,0,E,D)*0.5+B;}return A.Easing.bounceOut(C*2-D,0,E,D)*0.5+E*0.5+B;}};},"3.0.0",{requires:["anim-base"]});YUI.add("anim-node-plugin",function(B){var A=function(C){C=(C)?B.merge(C):{};C.node=C.host;A.superclass.constructor.apply(this,arguments);};A.NAME="nodefx";A.NS="fx";B.extend(A,B.Anim);B.namespace("Plugin");B.Plugin.NodeFX=A;},"3.0.0",{requires:["node-pluginhost","anim-base"]});YUI.add("anim-scroll",function(B){var A=Number;B.Anim.behaviors.scroll={set:function(F,G,I,J,K,E,H){var D=F._node,C=([H(K,A(I[0]),A(J[0])-A(I[0]),E),H(K,A(I[1]),A(J[1])-A(I[1]),E)]);if(C[0]){D.set("scrollLeft",C[0]);}if(C[1]){D.set("scrollTop",C[1]);}},get:function(D){var C=D._node;return[C.get("scrollLeft"),C.get("scrollTop")];}};},"3.0.0",{requires:["anim-base"]});YUI.add("anim-xy",function(B){var A=Number;B.Anim.behaviors.xy={set:function(F,D,I,H,C,G,E){F._node.setXY([E(C,A(I[0]),A(H[0])-A(I[0]),G),E(C,A(I[1]),A(H[1])-A(I[1]),G)]);},get:function(C){return C._node.getXY();}};},"3.0.0",{requires:["anim-base","node-screen"]});YUI.add("anim",function(A){},"3.0.0",{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],skinnable:false});
// ../yui/classnamemanager/classnamemanager-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("classnamemanager",function(C){var B="classNamePrefix",D="classNameDelimiter",A=C.config;A[B]=A[B]||"yui";A[D]=A[D]||"-";C.ClassNameManager=function(){var E=A[B],F=A[D];return{getClassName:C.cached(function(I,G){var H=E+F+((G)?Array.prototype.join.call(arguments,F):I);return H.replace(/\s/g,"");})};}();},"3.0.0");
// ../yui/plugin/plugin-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("plugin",function(B){function A(C){A.superclass.constructor.apply(this,arguments);}A.ATTRS={host:{writeOnce:true}};A.NAME="plugin";A.NS="plugin";B.extend(A,B.Base,{_handles:null,initializer:function(C){this._handles=[];},destructor:function(){if(this._handles){for(var D=0,C=this._handles.length;D<C;D++){this._handles[D].detach();}}},doBefore:function(G,D,C){var E=this.get("host"),F;C=C||this;if(G in E){F=B.Do.before(D,E,G,C);}else{if(E.on){F=E.on(G,D,C);}}this._handles.push(F);return F;},doAfter:function(G,D,C){var E=this.get("host"),F;C=C||this;if(G in E){F=B.Do.after(D,E,G,C);}else{if(E.after){F=E.after(G,D,C);}}this._handles.push(F);return F;},toString:function(){return this.constructor.NAME+"["+this.constructor.NS+"]";}});B.namespace("Plugin").Base=A;},"3.0.0",{requires:["base-base"]});
// ../yui/pluginhost/pluginhost-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("pluginhost",function(C){var A=C.Lang;function B(){this._plugins={};}B.prototype={plug:function(G,D){if(G){if(A.isFunction(G)){this._plug(G,D);}else{if(A.isArray(G)){for(var E=0,F=G.length;E<F;E++){this.plug(G[E]);}}else{this._plug(G.fn,G.cfg);}}}return this;},unplug:function(E){if(E){this._unplug(E);}else{var D;for(D in this._plugins){if(this._plugins.hasOwnProperty(D)){this._unplug(D);}}}return this;},hasPlugin:function(D){return(this._plugins[D]&&this[D]);},_initPlugins:function(E){this._plugins=this._plugins||{};var G=(this._getClasses)?this._getClasses():[this.constructor],D=[],H={},F,I,K,L,J;for(I=G.length-1;I>=0;I--){F=G[I];L=F._UNPLUG;if(L){C.mix(H,L,true);}K=F._PLUG;if(K){C.mix(D,K,true);}}for(J in D){if(D.hasOwnProperty(J)){if(!H[J]){this.plug(D[J]);}}}if(E&&E.plugins){this.plug(E.plugins);}},_destroyPlugins:function(){this._unplug();},_plug:function(F,D){if(F&&F.NS){var E=F.NS;D=D||{};D.host=this;if(this.hasPlugin(E)){this[E].setAttrs(D);}else{this[E]=new F(D);this._plugins[E]=F;}}},_unplug:function(F){var E=F,D=this._plugins;if(A.isFunction(F)){E=F.NS;if(E&&(!D[E]||D[E]!==F)){E=null;}}if(E){if(this[E]){this[E].destroy();delete this[E];}if(D[E]){delete D[E];}}}};B.plug=function(E,I,G){var J,H,D,F;if(E!==C.Base){E._PLUG=E._PLUG||{};if(!A.isArray(I)){if(G){I={fn:I,cfg:G};}I=[I];}for(H=0,D=I.length;H<D;H++){J=I[H];F=J.NAME||J.fn.NAME;E._PLUG[F]=J;}}};B.unplug=function(E,H){var I,G,D,F;if(E!==C.Base){E._UNPLUG=E._UNPLUG||{};if(!A.isArray(H)){H=[H];}for(G=0,D=H.length;G<D;G++){I=H[G];F=I.NAME;if(!E._PLUG[F]){E._UNPLUG[F]=I;}else{delete E._PLUG[F];}}}};C.namespace("Plugin").Host=B;},"3.0.0",{requires:["yui-base"]});
// ../yui/widget/widget-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget",function(D){var Q=D.Lang,K=D.Object,g=D.Node,M=D.ClassNameManager,a="widget",J="content",c="visible",e="hidden",f="disabled",T="focused",G="width",X="height",i="",Z="-",h="boundingBox",U="contentBox",P="parentNode",B="firstChild",b="ownerDocument",d="body",C="tabIndex",F="locale",H="initValue",R="id",S="render",A="rendered",W="destroyed",I="contentUpdate",V={};function E(L){this._yuid=D.guid(a);this._strings={};E.superclass.constructor.apply(this,arguments);}E._buildCfg={aggregates:["HTML_PARSER"]};E.NAME=a;E.UI_SRC="ui";var N=E.UI_SRC;E.ATTRS={rendered:{value:false,readOnly:true},boundingBox:{value:null,setter:function(L){return this._setBoundingBox(L);},writeOnce:true},contentBox:{value:null,setter:function(L){return this._setContentBox(L);},writeOnce:true},tabIndex:{value:0,validator:function(L){return(Q.isNumber(L)||Q.isNull(L));}},focused:{value:false,readOnly:true},disabled:{value:false},visible:{value:true},height:{value:i},width:{value:i},moveStyles:{value:false},locale:{value:"en"},strings:{setter:function(L){return this._setStrings(L,this.get(F));},getter:function(){return this.getStrings(this.get(F));}}};E._NAME_LOWERCASE=E.NAME.toLowerCase();E.getClassName=function(){var L=D.Array(arguments,0,true);L.splice(0,0,this._NAME_LOWERCASE);return M.getClassName.apply(M,L);};E.getByNode=function(L){var O,Y=E.getClassName();L=g.get(L);if(L){L=(L.hasClass(Y))?L:L.ancestor("."+Y);if(L){O=V[L.get(R)];}}return O||null;};E.HTML_PARSER={};D.extend(E,D.Base,{getClassName:function(){var L=D.Array(arguments,0,true);L.splice(0,0,this._name);return M.getClassName.apply(M,L);},initializer:function(L){this.publish(I,{preventable:false});this._name=this.constructor.NAME.toLowerCase();var Y=this.get(h).get(R);if(Y){V[Y]=this;}var O=this._parseHTML(this.get(U));if(O){D.aggregate(L,O,false);}},destructor:function(){var L=this.get(h);D.Event.purgeElement(L,true);var O=L.get(R);if(O&&O in V){delete V[O];}},render:function(L){if(this.get(W)){return;}if(!this.get(A)){this.publish(S,{queuable:false,defaultFn:this._defRenderFn});L=(L)?g.get(L):null;if(L&&!L.inDoc()){L=null;}this.fire(S,{parentNode:L});}return this;},_defRenderFn:function(L){this._renderUI(L.parentNode);this._bindUI();this._syncUI();this.renderer();this._set(A,true);},renderer:function(){this.renderUI();this.bindUI();this.syncUI();},bindUI:function(){},renderUI:function(){},syncUI:function(){},hide:function(){return this.set(c,false);},show:function(){return this.set(c,true);},focus:function(){return this._set(T,true);},blur:function(){return this._set(T,false);},enable:function(){return this.set(f,false);},disable:function(){return this.set(f,true);},_parseHTML:function(O){var L=this._getHtmlParser(),Y,j;if(L&&O&&O.hasChildNodes()){K.each(L,function(m,l,n){j=null;if(Q.isFunction(m)){j=m.call(this,O);}else{if(Q.isArray(m)){j=O.queryAll(m[0]);}else{j=O.query(m);}}if(j!==null&&j!==undefined){Y=Y||{};Y[l]=j;}},this);}return Y;},_moveStyles:function(k,m){var j=this.WRAP_STYLES,n=k.getStyle("position"),O=this.get(U),l=[0,0],Y,L;if(!this.get("height")){Y=O.get("offsetHeight");}if(!this.get("width")){L=O.get("offsetWidth");}if(n==="absolute"){l=k.getXY();m.setStyles({right:"auto",bottom:"auto"});k.setStyles({right:"auto",bottom:"auto"});}D.each(j,function(p,o){var q=k.getStyle(o);m.setStyle(o,q);if(p===false){k.setStyle(o,"");}else{k.setStyle(o,p);}});if(n==="absolute"){m.setXY(l);}if(Y){this.set("height",Y);}if(L){this.set("width",L);}},_renderBox:function(O){var Y=this.get(U),j=this.get(h),k=j.get(b)||Y.get(b),L;if(!j.compareTo(Y.get(P))){if(this.get("moveStyles")){this._moveStyles(Y,j);}if(Y.inDoc(k)){Y.get(P).replaceChild(j,Y);}j.appendChild(Y);}if(!j.inDoc(k)&&!O){L=g.get(d);if(L.get(B)){L.insertBefore(j,L.get(B));}else{L.appendChild(j);}}else{if(O&&!O.compareTo(j.get(P))){O.appendChild(j);}}},_setBoundingBox:function(L){return this._setBox(L,this.BOUNDING_TEMPLATE);},_setContentBox:function(L){return this._setBox(L,this.CONTENT_TEMPLATE);},_setBox:function(Y,O){Y=g.get(Y)||g.create(O);var L=D.stamp(Y);if(!Y.get(R)){Y.set(R,L);}return Y;},_renderUI:function(L){this._renderBoxClassNames();this._renderBox(L);},_renderBoxClassNames:function(){var k=this._getClasses(),Y=this.get(h),L=this.get(U),O,j;Y.addClass(E.getClassName());for(j=k.length-3;j>=0;j--){O=k[j].NAME;if(O){Y.addClass(M.getClassName(O.toLowerCase()));}}L.addClass(this.getClassName(J));},_bindUI:function(){this.after("visibleChange",this._afterVisibleChange);this.after("disabledChange",this._afterDisabledChange);this.after("heightChange",this._afterHeightChange);this.after("widthChange",this._afterWidthChange);this.after("focusedChange",this._afterFocusedChange);this._bindDOMListeners();},_bindDOMListeners:function(){var L=this.get(h).get("ownerDocument");L.on("focus",this._onFocus,this);if(D.UA.webkit){L.on("mousedown",this._onDocMouseDown,this);}},_syncUI:function(){this._uiSetVisible(this.get(c));this._uiSetDisabled(this.get(f));this._uiSetHeight(this.get(X));this._uiSetWidth(this.get(G));this._uiSetFocused(this.get(T));this._uiSetTabIndex(this.get(C));},_uiSetHeight:function(L){if(Q.isNumber(L)){L=L+this.DEF_UNIT;}this.get(h).setStyle(X,L);},_uiSetWidth:function(L){if(Q.isNumber(L)){L=L+this.DEF_UNIT;}this.get(h).setStyle(G,L);},_uiSetVisible:function(Y){var O=this.get(h),L=this.getClassName(e);if(Y===true){O.removeClass(L);}else{O.addClass(L);}},_uiSetDisabled:function(Y){var O=this.get(h),L=this.getClassName(f);if(Y===true){O.addClass(L);}else{O.removeClass(L);}},_uiSetTabIndex:function(O){var L=this.get(h);if(Q.isNumber(O)){L.set(C,O);}else{L.removeAttribute(C);}},_uiSetFocused:function(j,Y){var O=this.get(h),L=this.getClassName(T);if(j===true){O.addClass(L);if(Y!==N){O.focus();}}else{O.removeClass(L);if(Y!==N){O.blur();}}},_afterVisibleChange:function(L){this._uiSetVisible(L.newVal);},_afterDisabledChange:function(L){this._uiSetDisabled(L.newVal);},_afterHeightChange:function(L){this._uiSetHeight(L.newVal);},_afterWidthChange:function(L){this._uiSetWidth(L.newVal);
},_afterFocusedChange:function(L){this._uiSetFocused(L.newVal,L.src);},_onDocMouseDown:function(L){if(this._hasDOMFocus){this._onFocus(L);}},_onFocus:function(O){var j=O.target,Y=this.get(h),L=(Y.compareTo(j)||Y.contains(j));this._hasDOMFocus=L;this._set(T,L,{src:N});},toString:function(){return this.constructor.NAME+"["+this._yuid+"]";},DEF_UNIT:"px",CONTENT_TEMPLATE:"<div></div>",BOUNDING_TEMPLATE:"<div></div>",WRAP_STYLES:{height:"100%",width:"100%",zIndex:false,position:"static",top:"0",left:"0",bottom:"",right:"",padding:"",margin:""},_setStrings:function(O,L){var Y=this._strings;L=L.toLowerCase();if(!Y[L]){Y[L]={};}D.aggregate(Y[L],O,true);return Y[L];},_getStrings:function(L){return this._strings[L.toLowerCase()];},getStrings:function(p){p=(p||this.get(F)).toLowerCase();var n=this.getDefaultLocale().toLowerCase(),O=this._getStrings(n),o=(O)?D.merge(O):{},m=p.split(Z);if(p!==n||m.length>1){var L="";for(var j=0,Y=m.length;j<Y;++j){L+=m[j];var k=this._getStrings(L);if(k){D.aggregate(o,k,true);}L+=Z;}}return o;},getString:function(Y,O){O=(O||this.get(F)).toLowerCase();var j=(this.getDefaultLocale()).toLowerCase(),k=this._getStrings(j)||{},l=k[Y],L=O.lastIndexOf(Z);if(O!==j||L!=-1){do{k=this._getStrings(O);if(k&&Y in k){l=k[Y];break;}L=O.lastIndexOf(Z);if(L!=-1){O=O.substring(0,L);}}while(L!=-1);}return l;},getDefaultLocale:function(){return this._conf.get(F,H);},_strings:null,_getHtmlParser:function(){if(!this._HTML_PARSER){var O=this._getClasses(),j={},L,Y;for(L=O.length-1;L>=0;L--){Y=O[L].HTML_PARSER;if(Y){D.mix(j,Y,true);}}this._HTML_PARSER=j;}return this._HTML_PARSER;}});D.Widget=E;},"3.0.0",{requires:["attribute","event-focus","base","node","classnamemanager"]});
// ../yui/widget/widget-position-ext-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget-position-ext",function(A){var H=A.Lang,C="align",E="bindUI",B="syncUI",D="offsetWidth",I="offsetHeight",K="viewportRegion",G="region",J="alignChange";function F(L){if(!this._posNode){A.error("WidgetPosition needs to be added to the Widget, before WidgetPositionExt is added");}A.after(this._syncUIPosExtras,this,B);A.after(this._bindUIPosExtras,this,E);}F.ATTRS={align:{value:null},centered:{setter:function(L){return this._setAlignCenter(L);},lazyAdd:false,value:false}};F.TL="tl";F.TR="tr";F.BL="bl";F.BR="br";F.TC="tc";F.RC="rc";F.BC="bc";F.LC="lc";F.CC="cc";F.prototype={_syncUIPosExtras:function(){var L=this.get(C);if(L){this._uiSetAlign(L.node,L.points);}},_bindUIPosExtras:function(){this.after(J,this._afterAlignChange);},_setAlignCenter:function(L){if(L){this.set(C,{node:L===true?null:L,points:[F.CC,F.CC]});}return L;},_afterAlignChange:function(L){if(L.newVal){this._uiSetAlign(L.newVal.node,L.newVal.points);}},_uiSetAlign:function(O,N){if(!H.isArray(N)||N.length!=2){A.error("align: Invalid Points Arguments");return;}var M,L,P,Q;if(!O){M=this._posNode.get(K);}else{O=A.Node.get(O);if(O){M=O.get(G);}}if(M){M.width=M.width||M.right-M.left;M.height=M.height||M.bottom-M.top;L=N[0];P=N[1];switch(P){case F.TL:Q=[M.left,M.top];break;case F.TR:Q=[M.right,M.top];break;case F.BL:Q=[M.left,M.bottom];break;case F.BR:Q=[M.right,M.bottom];break;case F.TC:Q=[M.left+Math.floor(M.width/2),M.top];break;case F.BC:Q=[M.left+Math.floor(M.width/2),M.bottom];break;case F.LC:Q=[M.left,M.top+Math.floor(M.height/2)];break;case F.RC:Q=[M.right,M.top+Math.floor(M.height/2),L];break;case F.CC:Q=[M.left+Math.floor(M.width/2),M.top+Math.floor(M.height/2),L];break;default:break;}if(Q){this._doAlign(L,Q[0],Q[1]);}}},_doAlign:function(M,L,P){var O=this._posNode,N;switch(M){case F.TL:N=[L,P];break;case F.TR:N=[L-O.get(D),P];break;case F.BL:N=[L,P-O.get(I)];break;case F.BR:N=[L-O.get(D),P-O.get(I)];break;case F.TC:N=[L-(O.get(D)/2),P];break;case F.BC:N=[L-(O.get(D)/2),P-O.get(I)];break;case F.LC:N=[L,P-(O.get(I)/2)];break;case F.RC:N=[(L-O.get(D)),P-(O.get(I)/2)];break;case F.CC:N=[L-(O.get(D)/2),P-(O.get(I)/2)];break;default:break;}if(N){this.move(N);}},align:function(M,L){this.set(C,{node:M,points:L});},centered:function(L){this.align(L,[F.CC,F.CC]);}};A.WidgetPositionExt=F;},"3.0.0",{requires:["widget","widget-position"]});
// ../yui/cookie/cookie-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("cookie",function(C){var K=C.Lang,I=C.Object,G=null,D=K.isString,P=K.isObject,F=K.isUndefined,E=K.isFunction,H=encodeURIComponent,B=decodeURIComponent,N=C.config.doc;function J(L){throw new TypeError(L);}function M(L){if(!D(L)||L===""){J("Cookie name must be a non-empty string.");}}function A(L){if(!D(L)||L===""){J("Subcookie name must be a non-empty string.");}}C.Cookie={_createCookieString:function(Q,T,R,O){O=O||{};var V=H(Q)+"="+(R?H(T):T),L=O.expires,U=O.path,S=O.domain;if(P(O)){if(L instanceof Date){V+="; expires="+L.toUTCString();}if(D(U)&&U!==""){V+="; path="+U;}if(D(S)&&S!==""){V+="; domain="+S;}if(O.secure===true){V+="; secure";}}return V;},_createCookieHashString:function(L){if(!P(L)){J("Cookie._createCookieHashString(): Argument must be an object.");}var O=[];I.each(L,function(R,Q){if(!E(R)&&!F(R)){O.push(H(Q)+"="+H(String(R)));}});return O.join("&");},_parseCookieHash:function(S){var R=S.split("&"),T=G,Q={};if(S.length){for(var O=0,L=R.length;O<L;O++){T=R[O].split("=");Q[B(T[0])]=B(T[1]);}}return Q;},_parseCookieString:function(W,Y){var X={};if(D(W)&&W.length>0){var L=(Y===false?function(Z){return Z;}:B),U=W.split(/;\s/g),V=G,O=G,R=G;for(var Q=0,S=U.length;Q<S;Q++){R=U[Q].match(/([^=]+)=/i);if(R instanceof Array){try{V=B(R[1]);O=L(U[Q].substring(R[1].length+1));}catch(T){}}else{V=B(U[Q]);O="";}X[V]=O;}}return X;},exists:function(L){M(L);var O=this._parseCookieString(N.cookie,true);return O.hasOwnProperty(L);},get:function(O,L){M(O);var S,Q,R;if(E(L)){R=L;L={};}else{if(P(L)){R=L.converter;}else{L={};}}S=this._parseCookieString(N.cookie,!L.raw);Q=S[O];if(F(Q)){return G;}if(!E(R)){return Q;}else{return R(Q);}},getSub:function(L,Q,O){var R=this.getSubs(L);if(R!==G){A(Q);if(F(R[Q])){return G;}if(!E(O)){return R[Q];}else{return O(R[Q]);}}else{return G;}},getSubs:function(L){M(L);var O=this._parseCookieString(N.cookie,false);if(D(O[L])){return this._parseCookieHash(O[L]);}return G;},remove:function(O,L){M(O);L=C.merge(L||{},{expires:new Date(0)});return this.set(O,"",L);},removeSub:function(O,S,L){M(O);A(S);L=L||{};var R=this.getSubs(O);if(P(R)&&R.hasOwnProperty(S)){delete R[S];if(!L.removeIfEmpty){return this.setSubs(O,R,L);}else{for(var Q in R){if(R.hasOwnProperty(Q)&&!E(R[Q])&&!F(R[Q])){return this.setSubs(O,R,L);}}return this.remove(O,L);}}else{return"";}},set:function(O,Q,L){M(O);if(F(Q)){J("Cookie.set(): Value cannot be undefined.");}L=L||{};var R=this._createCookieString(O,Q,!L.raw,L);N.cookie=R;return R;},setSub:function(O,R,Q,L){M(O);A(R);if(F(Q)){J("Cookie.setSub(): Subcookie value cannot be undefined.");}var S=this.getSubs(O);if(!P(S)){S={};}S[R]=Q;return this.setSubs(O,S,L);},setSubs:function(O,Q,L){M(O);if(!P(Q)){J("Cookie.setSubs(): Cookie value must be an object.");}var R=this._createCookieString(O,this._createCookieHashString(Q),false,L);N.cookie=R;return R;}};},"3.0.0",{requires:["yui-base"]});
// ../yui/widget/widget-position-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget-position",function(A){var H=A.Lang,J=A.Widget,K="xy",F="positioned",I="boundingBox",L="renderUI",G="bindUI",D="syncUI",C=J.UI_SRC,E="xyChange";function B(M){this._posNode=this.get(I);A.after(this._renderUIPosition,this,L);A.after(this._syncUIPosition,this,D);A.after(this._bindUIPosition,this,G);}B.ATTRS={x:{setter:function(M){this._setX(M);},lazyAdd:false,getter:function(){return this._getX();}},y:{setter:function(M){this._setY(M);},lazyAdd:false,getter:function(){return this._getY();}},xy:{value:[0,0],validator:function(M){return this._validateXY(M);}}};B.POSITIONED_CLASS_NAME=J.getClassName(F);B.prototype={_renderUIPosition:function(){this._posNode.addClass(B.POSITIONED_CLASS_NAME);},_syncUIPosition:function(){this._uiSetXY(this.get(K));},_bindUIPosition:function(){this.after(E,this._afterXYChange);},move:function(){var M=arguments,N=(H.isArray(M[0]))?M[0]:[M[0],M[1]];this.set(K,N);},syncXY:function(){this.set(K,this._posNode.getXY(),{src:C});},_validateXY:function(M){return(H.isArray(M)&&H.isNumber(M[0])&&H.isNumber(M[1]));},_setX:function(M){this.set(K,[M,this.get(K)[1]]);},_setY:function(M){this.set(K,[this.get(K)[0],M]);},_getX:function(){return this.get(K)[0];},_getY:function(){return this.get(K)[1];},_afterXYChange:function(M){if(M.src!=C){this._uiSetXY(M.newVal);}},_uiSetXY:function(M){this._posNode.setXY(M);}};A.WidgetPosition=B;},"3.0.0",{requires:["widget"]});
// ../yui/widget/widget-position-ext-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget-position-ext",function(A){var H=A.Lang,C="align",E="bindUI",B="syncUI",D="offsetWidth",I="offsetHeight",K="viewportRegion",G="region",J="alignChange";function F(L){if(!this._posNode){A.error("WidgetPosition needs to be added to the Widget, before WidgetPositionExt is added");}A.after(this._syncUIPosExtras,this,B);A.after(this._bindUIPosExtras,this,E);}F.ATTRS={align:{value:null},centered:{setter:function(L){return this._setAlignCenter(L);},lazyAdd:false,value:false}};F.TL="tl";F.TR="tr";F.BL="bl";F.BR="br";F.TC="tc";F.RC="rc";F.BC="bc";F.LC="lc";F.CC="cc";F.prototype={_syncUIPosExtras:function(){var L=this.get(C);if(L){this._uiSetAlign(L.node,L.points);}},_bindUIPosExtras:function(){this.after(J,this._afterAlignChange);},_setAlignCenter:function(L){if(L){this.set(C,{node:L===true?null:L,points:[F.CC,F.CC]});}return L;},_afterAlignChange:function(L){if(L.newVal){this._uiSetAlign(L.newVal.node,L.newVal.points);}},_uiSetAlign:function(O,N){if(!H.isArray(N)||N.length!=2){A.error("align: Invalid Points Arguments");return;}var M,L,P,Q;if(!O){M=this._posNode.get(K);}else{O=A.Node.get(O);if(O){M=O.get(G);}}if(M){M.width=M.width||M.right-M.left;M.height=M.height||M.bottom-M.top;L=N[0];P=N[1];switch(P){case F.TL:Q=[M.left,M.top];break;case F.TR:Q=[M.right,M.top];break;case F.BL:Q=[M.left,M.bottom];break;case F.BR:Q=[M.right,M.bottom];break;case F.TC:Q=[M.left+Math.floor(M.width/2),M.top];break;case F.BC:Q=[M.left+Math.floor(M.width/2),M.bottom];break;case F.LC:Q=[M.left,M.top+Math.floor(M.height/2)];break;case F.RC:Q=[M.right,M.top+Math.floor(M.height/2),L];break;case F.CC:Q=[M.left+Math.floor(M.width/2),M.top+Math.floor(M.height/2),L];break;default:break;}if(Q){this._doAlign(L,Q[0],Q[1]);}}},_doAlign:function(M,L,P){var O=this._posNode,N;switch(M){case F.TL:N=[L,P];break;case F.TR:N=[L-O.get(D),P];break;case F.BL:N=[L,P-O.get(I)];break;case F.BR:N=[L-O.get(D),P-O.get(I)];break;case F.TC:N=[L-(O.get(D)/2),P];break;case F.BC:N=[L-(O.get(D)/2),P-O.get(I)];break;case F.LC:N=[L,P-(O.get(I)/2)];break;case F.RC:N=[(L-O.get(D)),P-(O.get(I)/2)];break;case F.CC:N=[L-(O.get(D)/2),P-(O.get(I)/2)];break;default:break;}if(N){this.move(N);}},align:function(M,L){this.set(C,{node:M,points:L});},centered:function(L){this.align(L,[F.CC,F.CC]);}};A.WidgetPositionExt=F;},"3.0.0",{requires:["widget","widget-position"]});
// ../yui/widget/widget-stack-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget-stack",function(E){var N=E.Lang,T=E.UA,d=E.Node,F=E.Widget,c="zIndex",P="shim",a="visible",e="boundingBox",W="renderUI",G="bindUI",S="syncUI",Q="offsetWidth",D="offsetHeight",M="parentNode",A="firstChild",X="ownerDocument",H="width",V="height",K="px",O="shimdeferred",f="shimresize",Z="visibleChange",C="widthChange",J="heightChange",b="shimChange",B="zIndexChange",I="contentUpdate",R="stacked";function U(L){this._stackNode=this.get(e);this._stackHandles={};E.after(this._renderUIStack,this,W);E.after(this._syncUIStack,this,S);E.after(this._bindUIStack,this,G);}U.ATTRS={shim:{value:(T.ie==6)},zIndex:{value:0,setter:function(L){return this._setZIndex(L);}}};U.HTML_PARSER={zIndex:function(L){return L.getStyle(c);}};U.SHIM_CLASS_NAME=F.getClassName(P);U.STACKED_CLASS_NAME=F.getClassName(R);U.SHIM_TEMPLATE='<iframe class="'+U.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>';U.prototype={_syncUIStack:function(){this._uiSetShim(this.get(P));this._uiSetZIndex(this.get(c));},_bindUIStack:function(){this.after(b,this._afterShimChange);this.after(B,this._afterZIndexChange);},_renderUIStack:function(){this._stackNode.addClass(U.STACKED_CLASS_NAME);},_setZIndex:function(L){if(N.isString(L)){L=parseInt(L,10);}if(!N.isNumber(L)){L=0;}return L;},_afterShimChange:function(L){this._uiSetShim(L.newVal);},_afterZIndexChange:function(L){this._uiSetZIndex(L.newVal);},_uiSetZIndex:function(L){this._stackNode.setStyle(c,L);},_uiSetShim:function(L){if(L){if(this.get(a)){this._renderShim();}else{this._renderShimDeferred();}}else{this._destroyShim();}},_renderShimDeferred:function(){this._stackHandles[O]=this._stackHandles[O]||[];var Y=this._stackHandles[O],L=function(g){if(g.newVal){this._renderShim();}};Y.push(this.on(Z,L));},_addShimResizeHandlers:function(){this._stackHandles[f]=this._stackHandles[f]||[];var Y=this.sizeShim,L=this._stackHandles[f];this.sizeShim();L.push(this.after(Z,Y));L.push(this.after(C,Y));L.push(this.after(J,Y));L.push(this.after(I,Y));},_detachStackHandles:function(L){var Y=this._stackHandles[L],g;if(Y&&Y.length>0){while((g=Y.pop())){g.detach();}}},_renderShim:function(){var L=this._shimNode,Y=this._stackNode;if(!L){L=this._shimNode=this._getShimTemplate();Y.insertBefore(L,Y.get(A));if(T.ie==6){this._addShimResizeHandlers();}this._detachStackHandles(O);}},_destroyShim:function(){if(this._shimNode){this._shimNode.get(M).removeChild(this._shimNode);this._shimNode=null;this._detachStackHandles(O);this._detachStackHandles(f);}},sizeShim:function(){var Y=this._shimNode,L=this._stackNode;if(Y&&T.ie===6&&this.get(a)){Y.setStyle(H,L.get(Q)+K);Y.setStyle(V,L.get(D)+K);}},_getShimTemplate:function(){return d.create(U.SHIM_TEMPLATE,this._stackNode.get(X));}};E.WidgetStack=U;},"3.0.0",{requires:["widget"]});
// ../yui/widget/widget-stdmod-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("widget-stdmod",function(A){var D=A.Lang,P=A.Node,c=A.NodeList,W=A.UA,C=A.Widget,B="",j="hd",h="bd",H="ft",e="header",m="body",k="footer",q="fillHeight",K="stdmod",t="px",T="Node",i="Content",o="innerHTML",d="firstChild",G="childNodes",l="createDocumentFragment",M="ownerDocument",U="contentBox",p="boundingBox",Z="height",g="offsetHeight",X="auto",J="headerContentChange",b="bodyContentChange",N="footerContentChange",R="fillHeightChange",S="HeightChange",r="contentUpdate",V="renderUI",f="bindUI",E="syncUI",Q=A.Widget.UI_SRC;function s(L){this._stdModNode=this.get(U);A.after(this._renderUIStdMod,this,V);A.after(this._bindUIStdMod,this,f);A.after(this._syncUIStdMod,this,E);}s.HEADER=e;s.BODY=m;s.FOOTER=k;s.AFTER="after";s.BEFORE="before";s.REPLACE="replace";var I=s.HEADER,a=s.BODY,O=s.FOOTER,n=s.AFTER,F=s.BEFORE;s.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:s.BODY,validator:function(L){return this._validateFillHeight(L);}}};s.HTML_PARSER={headerContent:function(L){return this._parseStdModHTML(I);},bodyContent:function(L){return this._parseStdModHTML(a);},footerContent:function(L){return this._parseStdModHTML(O);}};s.SECTION_CLASS_NAMES={header:C.getClassName(j),body:C.getClassName(h),footer:C.getClassName(H)};s.TEMPLATES={header:'<div class="'+s.SECTION_CLASS_NAMES[I]+'"></div>',body:'<div class="'+s.SECTION_CLASS_NAMES[a]+'"></div>',footer:'<div class="'+s.SECTION_CLASS_NAMES[O]+'"></div>'};s.prototype={_syncUIStdMod:function(){this._uiSetStdMod(I,this.get(I+i));this._uiSetStdMod(a,this.get(a+i));this._uiSetStdMod(O,this.get(O+i));this._uiSetFillHeight(this.get(q));},_renderUIStdMod:function(){this._stdModNode.addClass(C.getClassName(K));},_bindUIStdMod:function(){this.after(J,this._afterHeaderChange);this.after(b,this._afterBodyChange);this.after(N,this._afterFooterChange);this.after(R,this._afterFillHeightChange);this.after(S,this._fillHeight);this.after(r,this._fillHeight);},_afterHeaderChange:function(L){if(L.src!==Q){this._uiSetStdMod(I,L.newVal,L.stdModPosition);}},_afterBodyChange:function(L){if(L.src!==Q){this._uiSetStdMod(a,L.newVal,L.stdModPosition);}},_afterFooterChange:function(L){if(L.src!==Q){this._uiSetStdMod(O,L.newVal,L.stdModPosition);}},_afterFillHeightChange:function(L){this._uiSetFillHeight(L.newVal);},_validateFillHeight:function(L){return !L||L==s.BODY||L==s.HEADER||L==s.FOOTER;},_uiSetFillHeight:function(u){var Y=this.getStdModNode(u);var L=this._currFillNode;if(L&&Y!==L){L.setStyle(Z,B);}if(Y){this._currFillNode=Y;}this._fillHeight();},_fillHeight:function(){if(this.get(q)){var L=this.get(Z);if(L!=B&&L!=X){this.fillHeight(this._currFillNode);}}},_uiSetStdMod:function(v,u,L){if(u){var Y=this.getStdModNode(v)||this._renderStdMod(v);if(u instanceof P||u instanceof c){this._addNodeRef(Y,u,L);}else{this._addNodeHTML(Y,u,L);}this.set(v+i,this._getStdModContent(v),{src:Q});this.fire(r);}},_renderStdMod:function(u){var L=this.get(U),Y=this._findStdModSection(u);if(!Y){Y=this._getStdModTemplate(u);}this._insertStdModSection(L,u,Y);this[u+T]=Y;return this[u+T];},_insertStdModSection:function(L,v,u){var Y=L.get(d);if(v===O||!Y){L.appendChild(u);}else{if(v===I){L.insertBefore(u,Y);}else{var w=this[O+T];if(w){L.insertBefore(u,w);}else{L.appendChild(u);}}}},_getStdModTemplate:function(L){return P.create(s.TEMPLATES[L],this._stdModNode.get(M));},_addNodeHTML:function(u,Y,L){if(L==n){u.set(o,u.get(o)+Y);}else{if(L==F){u.set(o,Y+u.get(o));}else{u.set(o,Y);}}},_addNodeRef:function(x,v,Y){var L=true,u,w;if(Y==F){var y=x.get(d);if(y){if(v instanceof c){for(u=v.size()-1;u>=0;--u){x.insertBefore(v.item(u),y);}}else{x.insertBefore(v,y);}L=false;}}else{if(Y!=n){x.set(o,B);}}if(L){if(v instanceof c){for(u=0,w=v.size();u<w;++u){x.appendChild(v.item(u));}}else{x.appendChild(v);}}},_getPreciseHeight:function(u){var L=(u)?u.get(g):0,v="getBoundingClientRect";if(u&&u.hasMethod(v)){var Y=u.invoke(v);if(Y){L=Y.bottom-Y.top;}}return L;},_findStdModSection:function(L){return this.get(U).query("> ."+s.SECTION_CLASS_NAMES[L]);},_parseStdModHTML:function(x){var w=this._findStdModSection(x),u,Y;if(w){u=w.get(M).invoke(l);Y=w.get(G);for(var L=Y.size()-1;L>=0;L--){var v=u.get(d);if(v){u.insertBefore(Y.item(L),v);}else{u.appendChild(Y.item(L));}}return u;}return null;},_getStdModContent:function(L){return(this[L+T])?this[L+T].get(G):null;},setStdModContent:function(u,Y,L){this.set(u+i,Y,{stdModPosition:L});},getStdModNode:function(L){return this[L+T]||null;},fillHeight:function(u){if(u){var y=this.get(p),AA=[this.headerNode,this.bodyNode,this.footerNode],Y,AB=0,AC=0,x=0,w=false;for(var z=0,v=AA.length;z<v;z++){Y=AA[z];if(Y){if(Y!==u){AC+=this._getPreciseHeight(Y);}else{w=true;}}}if(w){if(W.ie||W.opera){u.setStyle(Z,0+t);}AB=parseInt(y.getComputedStyle(Z),10);if(D.isNumber(AB)){x=AB-AC;if(x>=0){u.setStyle(Z,x+t);}var L=this.get(U).get(g);if(L!=AB){x=x-(L-AB);u.setStyle(Z,x+t);}}}}}};A.WidgetStdMod=s;},"3.0.0",{requires:["widget"]});
// ../yui/overlay/overlay-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("overlay",function(A){A.Overlay=A.Base.build("overlay",A.Widget,[A.WidgetPosition,A.WidgetStack,A.WidgetPositionExt,A.WidgetStdMod]);},"3.0.0",{requires:["widget","widget-position","widget-stack","widget-position-ext","widget-stdmod"]});
// ../yui/node-menunav/node-menunav-min.js
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0
build: 1549
*/
YUI.add("node-menunav",function(D){var m=D.UA,t=D.later,AL=D.ClassNameManager.getClassName,R="menu",G="menuitem",AH="hidden",S="parentNode",V="children",z="offsetHeight",AC="offsetWidth",AN="px",g="id",I=".",E="handledMouseOut",r="handledMouseOver",a="active",AJ="label",d="a",w="mousedown",AO="keydown",AB="click",Q="",U="first-of-type",AP="role",N="presentation",AD="descendants",j="UI",u="activeDescendant",J="useARIA",x="aria-hidden",y="content",c="host",h=u+"Change",AM=">.yui-menu-content>ul>li>a",O=">.yui-menu-content>ul>li>.yui-menu-label>a:first-child",v="autoSubmenuDisplay",T="mouseOutHideDelay",l=AL(R),AF=AL(R,AH),Z=AL(R,"horizontal"),AI=AL(R,AJ),k=AL(R,AJ,a),X=AL(R,AJ,(R+"visible")),K=AL(G),A=AL(G,a),i=I+l,AG=(I+AL(R,"toggle"));var L=function(Y){var AR=Y.previous(),AQ;if(!AR){AQ=Y.get(S).get(V);AR=AQ.item(AQ.size()-1);}return AR;};var b=function(Y){var AQ=Y.next();if(!AQ){AQ=Y.get(S).get(V).item(0);}return AQ;};var F=function(Y){var AQ=false;if(Y){AQ=Y.get("nodeName").toLowerCase()===d;}return AQ;};var P=function(Y){return Y.hasClass(K);};var s=function(Y){return Y.hasClass(AI);};var q=function(Y){return Y.hasClass(Z);};var n=function(Y){return Y.hasClass(X);};var p=function(Y){return F(Y)?Y:Y.one(d);};var AA=function(AR,AQ,Y){var AS;if(AR){if(AR.hasClass(AQ)){AS=AR;}if(!AS&&Y){AS=AR.ancestor((I+AQ));}}return AS;};var M=function(Y){return Y.ancestor(i);};var W=function(AQ,Y){return AA(AQ,l,Y);};var AE=function(AQ,Y){var AR;if(AQ){AR=AA(AQ,K,Y);}return AR;};var o=function(AQ,Y){var AR;if(AQ){if(Y){AR=AA(AQ,AI,Y);}else{AR=AA(AQ,AI)||AQ.one((I+AI));}}return AR;};var B=function(AQ,Y){var AR;if(AQ){AR=AE(AQ,Y)||o(AQ,Y);}return AR;};var C=function(Y){return B(Y.one("li"));};var f=function(Y){return P(Y)?A:k;};var e=function(Y,AQ){return Y&&!Y[r]&&(Y.compareTo(AQ)||Y.contains(AQ));};var H=function(AQ,Y){return AQ&&!AQ[E]&&(!AQ.compareTo(Y)&&!AQ.contains(Y));};var AK=function(){AK.superclass.constructor.apply(this,arguments);};AK.NAME="nodeMenuNav";AK.NS="menuNav";AK.SHIM_TEMPLATE_TITLE="Menu Stacking Shim";AK.SHIM_TEMPLATE='<iframe frameborder="0" tabindex="-1" class="'+AL("shim")+'" title="'+AK.SHIM_TEMPLATE_TITLE+'" src="javascript:false;"></iframe>';AK.ATTRS={useARIA:{value:true,writeOnce:true,lazyAdd:false,setter:function(AT){var AQ=this.get(c),AU,Y,AS,AR;if(AT){AQ.set(AP,R);AQ.all("ul,li,."+AL(R,y)).set(AP,N);AQ.all((I+AL(G,y))).set(AP,G);AQ.all((I+AI)).each(function(AV){AU=AV;Y=AV.one(AG);if(Y){Y.set(AP,N);AU=Y.previous();}AU.set(AP,G);AU.set("aria-haspopup",true);AS=AV.next();if(AS){AS.set(AP,R);AU=AS.previous();Y=AU.one(AG);if(Y){AU=Y;}AR=D.stamp(AU);if(!AU.get(g)){AU.set(g,AR);}AS.set("aria-labelledby",AR);AS.set(x,true);}});}}},autoSubmenuDisplay:{value:true,writeOnce:true},submenuShowDelay:{value:250,writeOnce:true},submenuHideDelay:{value:250,writeOnce:true},mouseOutHideDelay:{value:750,writeOnce:true}};D.extend(AK,D.Plugin.Base,{_rootMenu:null,_activeItem:null,_activeMenu:null,_hasFocus:false,_blockMouseEvent:false,_currentMouseX:0,_movingToSubmenu:false,_showSubmenuTimer:null,_hideSubmenuTimer:null,_hideAllSubmenusTimer:null,_firstItem:null,initializer:function(AR){var AS=this,AT=this.get(c),AQ=[],Y;if(AT){AS._rootMenu=AT;AT.all("ul:first-child").addClass(U);AT.all(i).addClass(AF);AQ.push(AT.on("mouseover",AS._onMouseOver,AS));AQ.push(AT.on("mouseout",AS._onMouseOut,AS));AQ.push(AT.on("mousemove",AS._onMouseMove,AS));AQ.push(AT.on(w,AS._toggleSubmenuDisplay,AS));AQ.push(D.on("key",AS._toggleSubmenuDisplay,AT,"down:13",AS));AQ.push(AT.on(AB,AS._toggleSubmenuDisplay,AS));AQ.push(AT.on("keypress",AS._onKeyPress,AS));AQ.push(AT.on(AO,AS._onKeyDown,AS));Y=AT.get("ownerDocument");AQ.push(Y.on(w,AS._onDocMouseDown,AS));AQ.push(Y.on("focus",AS._onDocFocus,AS));this._eventHandlers=AQ;AS._initFocusManager();}},destructor:function(){var Y=this._eventHandlers;if(Y){D.Array.each(Y,function(AQ){AQ.detach();});this._eventHandlers=null;}this.get(c).unplug("focusManager");},_isRoot:function(Y){return this._rootMenu.compareTo(Y);},_getTopmostSubmenu:function(AS){var AR=this,Y=M(AS),AQ;if(!Y){AQ=AS;}else{if(AR._isRoot(Y)){AQ=AS;}else{AQ=AR._getTopmostSubmenu(Y);}}return AQ;},_clearActiveItem:function(){var AQ=this,Y=AQ._activeItem;if(Y){Y.removeClass(f(Y));}AQ._activeItem=null;},_setActiveItem:function(AQ){var Y=this;if(AQ){Y._clearActiveItem();AQ.addClass(f(AQ));Y._activeItem=AQ;}},_focusItem:function(AR){var AQ=this,Y,AS;if(AR&&AQ._hasFocus){Y=M(AR);AS=p(AR);if(Y&&!Y.compareTo(AQ._activeMenu)){AQ._activeMenu=Y;AQ._initFocusManager();}AQ._focusManager.focus(AS);}},_showMenu:function(AS){var Y=M(AS),AR=AS.get(S),AQ=AR.getXY();if(this.get(J)){AS.set(x,false);}if(q(Y)){AQ[1]=AQ[1]+AR.get(z);}else{AQ[0]=AQ[0]+AR.get(AC);}AS.setXY(AQ);if(m.ie<8){if(m.ie===6&&!AS.hasIFrameShim){AS.appendChild(D.Node.create(AK.SHIM_TEMPLATE));AS.hasIFrameShim=true;}AS.setStyles({height:Q,width:Q});AS.setStyles({height:(AS.get(z)+AN),width:(AS.get(AC)+AN)});}AS.previous().addClass(X);AS.removeClass(AF);},_hideMenu:function(AS,AQ){var AR=this,AT=AS.previous(),Y;AT.removeClass(X);if(AQ){AR._focusItem(AT);AR._setActiveItem(AT);}Y=AS.one((I+A));if(Y){Y.removeClass(A);}AS.setStyles({left:Q,top:Q});AS.addClass(AF);if(AR.get(J)){AS.set(x,true);}},_hideAllSubmenus:function(AQ){var Y=this;AQ.all(i).each(D.bind(function(AR){Y._hideMenu(AR);},Y));},_cancelShowSubmenuTimer:function(){var AQ=this,Y=AQ._showSubmenuTimer;if(Y){Y.cancel();AQ._showSubmenuTimer=null;}},_cancelHideSubmenuTimer:function(){var Y=this,AQ=Y._hideSubmenuTimer;if(AQ){AQ.cancel();Y._hideSubmenuTimer=null;}},_initFocusManager:function(){var AS=this,AU=AS._rootMenu,AQ=AS._activeMenu||AU,AT=AS._isRoot(AQ)?Q:("#"+AQ.get("id")),Y=AS._focusManager,AR,AV,AW;if(q(AQ)){AV=AT+AM+","+AT+O;AR={next:"down:39",previous:"down:37"};}else{AV=AT+AM;AR={next:"down:40",previous:"down:38"};}if(!Y){AU.plug(D.Plugin.NodeFocusManager,{descendants:AV,keys:AR,circular:true});Y=AU.focusManager;AW="#"+AU.get("id")+" .yui-menu a,"+AG;AU.all(AW).set("tabIndex",-1);Y.on(h,this._onActiveDescendantChange,Y,this);
Y.after(h,this._afterActiveDescendantChange,Y,this);AS._focusManager=Y;}else{Y.set(u,-1);Y.set(AD,AV);Y.set("keys",AR);}},_onActiveDescendantChange:function(AQ,Y){if(AQ.src===j&&Y._activeMenu&&!Y._movingToSubmenu){Y._hideAllSubmenus(Y._activeMenu);}},_afterActiveDescendantChange:function(AQ,Y){var AR;if(AQ.src===j){AR=B(this.get(AD).item(AQ.newVal),true);Y._setActiveItem(AR);}},_onDocFocus:function(AT){var AS=this,Y=AS._activeItem,AR=AT.target,AQ;if(AS._rootMenu.contains(AR)){if(AS._hasFocus){AQ=M(AR);if(!AS._activeMenu.compareTo(AQ)){AS._activeMenu=AQ;AS._initFocusManager();AS._focusManager.set(u,AR);AS._setActiveItem(B(AR,true));}}else{AS._hasFocus=true;Y=B(AR,true);if(Y){AS._setActiveItem(Y);}}}else{AS._clearActiveItem();AS._cancelShowSubmenuTimer();AS._hideAllSubmenus(AS._rootMenu);AS._activeMenu=AS._rootMenu;AS._initFocusManager();AS._focusManager.set(u,0);AS._hasFocus=false;}},_onMenuMouseOver:function(AS,AR){var AQ=this,Y=AQ._hideAllSubmenusTimer;if(Y){Y.cancel();AQ._hideAllSubmenusTimer=null;}AQ._cancelHideSubmenuTimer();if(AS&&!AS.compareTo(AQ._activeMenu)){AQ._activeMenu=AS;if(AQ._hasFocus){AQ._initFocusManager();}}if(AQ._movingToSubmenu&&q(AS)){AQ._movingToSubmenu=false;}},_hideAndFocusLabel:function(){var AR=this,AQ=AR._activeMenu,Y;AR._hideAllSubmenus(AR._rootMenu);if(AQ){Y=AR._getTopmostSubmenu(AQ);AR._focusItem(Y.previous());}},_onMenuMouseOut:function(AW,AU){var AT=this,AR=AT._activeMenu,AV=AU.relatedTarget,Y=AT._activeItem,AS,AQ;if(AR&&!AR.contains(AV)){AS=M(AR);if(AS&&!AS.contains(AV)){if(AT.get(T)>0){AT._cancelShowSubmenuTimer();AT._hideAllSubmenusTimer=t(AT.get(T),AT,AT._hideAndFocusLabel);}}else{if(Y){AQ=M(Y);if(!AT._isRoot(AQ)){AT._focusItem(AQ.previous());}}}}},_onMenuLabelMouseOver:function(AT,AV){var AU=this,AS=AU._activeMenu,Y=AU._isRoot(AS),AR=(AU.get(v)&&Y||!Y),AQ;AU._focusItem(AT);AU._setActiveItem(AT);if(AR&&!AU._movingToSubmenu){AU._cancelHideSubmenuTimer();AU._cancelShowSubmenuTimer();if(!n(AT)){AQ=AT.next();if(AQ){AU._hideAllSubmenus(AS);AU._showSubmenuTimer=t(AU.get("submenuShowDelay"),AU,AU._showMenu,AQ);}}}},_onMenuLabelMouseOut:function(AS,AU){var AT=this,Y=AT._isRoot(AT._activeMenu),AR=(AT.get(v)&&Y||!Y),AV=AU.relatedTarget,AQ=AS.next();AT._clearActiveItem();if(AR){if(AT._movingToSubmenu&&!AT._showSubmenuTimer&&AQ){AT._hideSubmenuTimer=t(AT.get("submenuHideDelay"),AT,AT._hideMenu,AQ);}else{if(!AT._movingToSubmenu&&AQ&&!AQ.contains(AV)&&!AV.compareTo(AQ)){AT._cancelShowSubmenuTimer();AT._hideMenu(AQ);}}}},_onMenuItemMouseOver:function(AS,AU){var AT=this,AR=AT._activeMenu,Y=AT._isRoot(AR),AQ=(AT.get(v)&&Y||!Y);AT._focusItem(AS);AT._setActiveItem(AS);if(AQ&&!AT._movingToSubmenu){AT._hideAllSubmenus(AR);}},_onMenuItemMouseOut:function(Y,AQ){this._clearActiveItem();},_onVerticalMenuKeyDown:function(Y){var AQ=this,AU=AQ._activeMenu,AZ=AQ._rootMenu,AR=Y.target,AT=false,AY=Y.keyCode,AW,AS,AV,AX;switch(AY){case 37:AS=M(AU);if(AS&&q(AS)){AQ._hideMenu(AU);AV=L(AU.get(S));AX=B(AV);if(AX){if(s(AX)){AW=AX.next();if(AW){AQ._showMenu(AW);AQ._focusItem(C(AW));AQ._setActiveItem(C(AW));}else{AQ._focusItem(AX);AQ._setActiveItem(AX);}}else{AQ._focusItem(AX);AQ._setActiveItem(AX);}}}else{if(!AQ._isRoot(AU)){AQ._hideMenu(AU,true);}}AT=true;break;case 39:if(s(AR)){AW=AR.next();if(AW){AQ._showMenu(AW);AQ._focusItem(C(AW));AQ._setActiveItem(C(AW));}}else{if(q(AZ)){AW=AQ._getTopmostSubmenu(AU);AV=b(AW.get(S));AX=B(AV);AQ._hideAllSubmenus(AZ);if(AX){if(s(AX)){AW=AX.next();if(AW){AQ._showMenu(AW);AQ._focusItem(C(AW));AQ._setActiveItem(C(AW));}else{AQ._focusItem(AX);AQ._setActiveItem(AX);}}else{AQ._focusItem(AX);AQ._setActiveItem(AX);}}}}AT=true;break;}if(AT){Y.preventDefault();}},_onHorizontalMenuKeyDown:function(AV){var AU=this,AS=AU._activeMenu,AQ=AV.target,Y=B(AQ,true),AT=false,AW=AV.keyCode,AR;if(AW===40){AU._hideAllSubmenus(AS);if(s(Y)){AR=Y.next();if(AR){AU._showMenu(AR);AU._focusItem(C(AR));AU._setActiveItem(C(AR));}AT=true;}}if(AT){AV.preventDefault();}},_onMouseMove:function(AQ){var Y=this;t(10,Y,function(){Y._currentMouseX=AQ.pageX;});},_onMouseOver:function(AT){var AS=this,AQ,Y,AV,AR,AU;if(AS._blockMouseEvent){AS._blockMouseEvent=false;}else{AQ=AT.target;Y=W(AQ,true);AV=o(AQ,true);AU=AE(AQ,true);if(e(Y,AQ)){AS._onMenuMouseOver(Y,AT);Y[r]=true;Y[E]=false;AR=M(Y);if(AR){AR[E]=true;AR[r]=false;}}if(e(AV,AQ)){AS._onMenuLabelMouseOver(AV,AT);AV[r]=true;AV[E]=false;}if(e(AU,AQ)){AS._onMenuItemMouseOver(AU,AT);AU[r]=true;AU[E]=false;}}},_onMouseOut:function(AQ){var AR=this,AT=AR._activeMenu,AY=false,AS,AU,AW,Y,AV,AX;AR._movingToSubmenu=(AT&&!q(AT)&&((AQ.pageX-5)>AR._currentMouseX));AS=AQ.target;AU=AQ.relatedTarget;AW=W(AS,true);Y=o(AS,true);AX=AE(AS,true);if(H(Y,AU)){AR._onMenuLabelMouseOut(Y,AQ);Y[E]=true;Y[r]=false;}if(H(AX,AU)){AR._onMenuItemMouseOut(AX,AQ);AX[E]=true;AX[r]=false;}if(Y){AV=Y.next();if(AV&&(AU.compareTo(AV)||AV.contains(AU))){AY=true;}}if(H(AW,AU)||AY){AR._onMenuMouseOut(AW,AQ);AW[E]=true;AW[r]=false;}},_toggleSubmenuDisplay:function(AR){var AS=this,AT=AR.target,AQ=o(AT,true),Y=AR.type,AX,AW,AV,AY,AZ,AU;if(AQ){AX=F(AT)?AT:AT.ancestor(F);if(AX){AV=AX.getAttribute("href",2);AY=AV.indexOf("#");AZ=AV.length;if(AY===0&&AZ>1){AU=AV.substr(1,AZ);AW=AQ.next();if(AW&&(AW.get(g)===AU)){if(Y===w||Y===AO){if((m.opera||m.gecko||m.ie)&&Y===AO&&!AS._preventClickHandle){AS._preventClickHandle=AS._rootMenu.on("click",function(Aa){Aa.preventDefault();AS._preventClickHandle.detach();AS._preventClickHandle=null;});}if(Y==w){AR.preventDefault();AR.stopImmediatePropagation();AS._hasFocus=true;}if(AS._isRoot(M(AT))){if(n(AQ)){AS._hideMenu(AW);AS._focusItem(AQ);AS._setActiveItem(AQ);}else{AS._hideAllSubmenus(AS._rootMenu);AS._showMenu(AW);AS._focusItem(C(AW));AS._setActiveItem(C(AW));}}else{if(AS._activeItem==AQ){AS._showMenu(AW);AS._focusItem(C(AW));AS._setActiveItem(C(AW));}else{if(!AQ._clickHandle){AQ._clickHandle=AQ.on("click",function(){AS._hideAllSubmenus(AS._rootMenu);AS._hasFocus=false;AS._clearActiveItem();AQ._clickHandle.detach();AQ._clickHandle=null;});}}}}if(Y===AB){AR.preventDefault();
}}}}}},_onKeyPress:function(Y){switch(Y.keyCode){case 37:case 38:case 39:case 40:Y.preventDefault();break;}},_onKeyDown:function(AU){var AT=this,Y=AT._activeItem,AQ=AU.target,AS=M(AQ),AR;if(AS){AT._activeMenu=AS;if(q(AS)){AT._onHorizontalMenuKeyDown(AU);}else{AT._onVerticalMenuKeyDown(AU);}if(AU.keyCode===27){if(!AT._isRoot(AS)){if(m.opera){t(0,AT,function(){AT._hideMenu(AS,true);});}else{AT._hideMenu(AS,true);}AU.stopPropagation();AT._blockMouseEvent=m.gecko?true:false;}else{if(Y){if(s(Y)&&n(Y)){AR=Y.next();if(AR){AT._hideMenu(AR);}}else{AT._focusManager.blur();AT._clearActiveItem();AT._hasFocus=false;}}}}}},_onDocMouseDown:function(AS){var AR=this,AQ=AR._rootMenu,Y=AS.target;if(!(AQ.compareTo(Y)||AQ.contains(Y))){AR._hideAllSubmenus(AQ);if(m.webkit){AR._hasFocus=false;AR._clearActiveItem();}}}});D.namespace("Plugin");D.Plugin.NodeMenuNav=AK;},"3.0.0",{requires:["node","classnamemanager","node-focusmanager"]});
// ../../../../lp/code/javascript/branch.bugspeclinks.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Code for handling links to branches from bugs and specs.
 *
 * @module BranchLinks
 * @requires base, lazr.anim, lazr.formoverlay
 */

YUI.add('lp.code.branch.bugspeclinks', function(Y) {

var namespace = Y.namespace('lp.code.branch.bugspeclinks');

var lp_client;          // The LP client

var link_bug_overlay;

var error_handler;

/*
 * Connect the links to the javascript events.
 */
namespace.connect_branchlinks = function() {

    error_handler = new LP.client.ErrorHandler();
    error_handler.clearProgressUI = function() {
        destroy_temporary_spinner();
    };
    error_handler.showError = function(error_message) {
        alert('An unexpected error has occurred.');
        Y.log(error_message);
    };

    link_bug_overlay = new Y.lazr.FormOverlay({
        headerContent: '<h2>Link to a bug</h2>',
        form_submit_button: Y.Node.create(
            '<button type="submit" name="buglink.actions.change" ' +
            'value="Change" class="lazr-pos lazr-btn">Ok</button>'),
        form_cancel_button: Y.Node.create(
            '<button type="button" name="buglink.actions.cancel" ' +
            'class="lazr-neg lazr-btn">Cancel</button>'),
        centered: true,
        form_submit_callback: link_bug_to_branch,
        visible: false
    });
    link_bug_overlay.render();
    link_bug_overlay.loadFormContentAndRender('+linkbug/++form++');
    var linkbug_handle = Y.one('#linkbug');
    linkbug_handle.addClass('js-action');
    linkbug_handle.on('click', function(e) {
        e.preventDefault();
        link_bug_overlay.show();
    });
    connect_remove_links();

};

/*
 * Connect the remove links of each bug link to the javascript functions to
 * remove the links.
 */
function connect_remove_links() {
    Y.on('click', function(e) {
        e.preventDefault();
        var bugnumber = get_bugnumber_from_id(e.currentTarget.get('id'));
        unlink_bug_from_branch(bugnumber);
    }, '.delete-buglink');
}

/*
 * Link a specified bug to the branch.
 */
function link_bug_to_branch(data) {
    link_bug_overlay.hide();

    create_temporary_spinner();

    var bugnumber = data['field.bug'];
    var existing = Y.one('#buglink-' + bugnumber);
    if (Y.Lang.isValue(existing)) {
        // Bug is already linked, don't do unneccessary requests.
        Y.lazr.anim.green_flash({node: existing}).run();
        return;
    }

    get_bug_from_bugnumber(bugnumber, function(bug) {

        config = {
            on: {
                success: function(entry) {
                    // XXX: rockstar - linkBug still is returning BugBranches.
                    // This means that I'll need to change this once I fix
                    // that.
                    var config = {
                        on: {
                            success: function(bugtasks) {
                                update_bug_links(bug);
                            }
                        }
                    };
                    bug.follow_link('bug_tasks', config);
                },
                failure: error_handler.getFailureHandler()
            },
            parameters: {
                bug: bug.get('self_link')
            }
        };
        set_up_lp_client();
        lp_client.named_post(
            LP.client.cache.context.self_link, 'linkBug', config);
    });
}

/*
 * Update the list of bug links.
 */
function update_bug_links(bug) {

    BUG_LINK_SNIPPET = '++bug-links';
    Y.io(BUG_LINK_SNIPPET, {
        on: {
            success: function(id, response) {
                destroy_temporary_spinner();
                Y.one('#linkbug').set(
                    'innerHTML', 'Link to another bug report');
                Y.one('#buglink-list').set('innerHTML', response.responseText);
                var new_buglink = Y.one('#buglink-' + bug.get('id'));
                var anim = Y.lazr.anim.green_flash({node: new_buglink});
                anim.on('end', connect_remove_links);
                anim.run();
            },
            failure: function(id, response) {
                // At least remove the "Linking..." text
                destroy_temporary_spinner();

                alert('Unable to update bug links.');
                Y.log(response);
            }
        }
    });

}

/*
 * Unlink a bug from the branch.
 */
function unlink_bug_from_branch(bugnumber) {
    link_bug_overlay.hide();

    Y.one('#delete-buglink-' + bugnumber).get('children').set(
        'src', '/@@/spinner');
    get_bug_from_bugnumber(bugnumber, function(bug) {

        config = {
            on: {
                success: function(updated_entry) {
                    var element = Y.one('#buglink-' + bugnumber);
                    var parent_element = element.get('parentNode');
                    anim = Y.lazr.anim.red_flash({node: element});
                    anim.on('end', function() {
                        parent_element.removeChild(element);

                        // Check to see if that was the only bug linked.
                        var buglinks = Y.all(".bug-branch-summary");
                        if (!buglinks.size()) {
                            Y.one('#linkbug').set('innerHTML',
                                'Link to a bug report');
                        }
                    });
                    anim.run();
                },
                failure: function(id, response) {
                    alert('An unexpected error has occurred.');
                    Y.one('#delete-buglink-' + bugnumber).get('children').set(
                        'src', '/@@/remove');
                    Y.log(response.responseText);
                }
            },
            parameters: {
                bug: bug.get('self_link')
            }
        };
        set_up_lp_client();
        lp_client.named_post(
            LP.client.cache.context.self_link, 'unlinkBug', config);
    });
}


/*
 * Get the bugnumber for the element id.
 *
 * Since we control the element id, we don't have to use crazy reqexes or
 * something.
 */
function get_bugnumber_from_id(id) {
    return id.substr('remove-buglink-'.length, id.length);
}

/*
 * Get the bug representation from the bugnumber.
 *
 * XXX: rockstar - There is a better way to do this, I'm sure.  I just need to
 * figure it out after everything else is done.
 */
function get_bug_from_bugnumber(bugnumber, callback) {
    var bug_uri = '/bugs/' + bugnumber;
    config = {
        on: {
            success: callback
        }
    };
    set_up_lp_client();
    lp_client.get(bug_uri, config);
}

/*
 * Set up the lp_client.
 *
 * This would probably be better served in a place where everyone could get to
 * it, or at least so everything in code could get to it.
 */
function set_up_lp_client() {
    if (lp_client === undefined) {
        lp_client = new LP.client.QuickBuild();
    }
}

/*
 * Show the temporary "Linking..." text
 */
function create_temporary_spinner() {
    var temp_spinner = Y.Node.create([
        '<div id="temp-spinner">',
        '<img src="/@@/spinner"/>Linking...',
        '</div>'].join(''));
    var buglinks = Y.one('#buglinks');
    var last = Y.one('#linkbug').get('parentNode');
    if (last) {
        buglinks.insertBefore(temp_spinner, last);
    }
}

/*
 * Destroy the temporary "Linking..." text
 */
function destroy_temporary_spinner() {

    var temp_spinner = Y.one('#temp-spinner');
    var spinner_parent = temp_spinner.get('parentNode');
    spinner_parent.removeChild(temp_spinner);

}

}, "0.1", {"requires": ["base", "lazr.anim", "lazr.formoverlay",
    "lp.client.plugins"]});

// ../../../../lp/code/javascript/branch.subscription.js
/*
   Copyright (c) 2009, Canonical Ltd. All rights reserved.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU Affero General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   GNU Affero General Public License for more details.

   You should have received a copy of the GNU Affero General Public License
   along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

YUI.add('lp.code.branch.subscription', function(Y) {

/*
 * Tools for working with branch subscriptions.
 *
 * @module lp.code.branch.subscription
 * @namespace lp.code.branch.subscription
 */

var namespace = Y.namespace('lp.code.branch.subscription');

var display_name,   // The logged in user's displayname.
    user_name,      // The logged in user's username.
    me;             // The logged in user's url.

/*
 * Set up the name vars that are used by the widget.
 *
 * @param client {object} An LPClient instance
 */
var setUpNames = function (client) {
    me = LP.client.links.me;
    user_name = me.substring(2);

    // There is no need to set display_name if it exists.
    if (Y.Lang.isValue(display_name)) {
        return;
    }

    var config = {
        on: {
            success: function(person) {
                display_name = person.lookup_value('display_name');
            }
        }
    };
    client.get(me, config);
};

/*
 * A widget for handling branch subscriptions.
 *
 * @attribute direct_subscribers {Y.Node} Wrapper div for the subscriber list.
 * @attribute self_subscribe {Y.Node} Container for "Subscribe" link.
 */
var SubscriptionWidget = function(config) {
    SubscriptionWidget.superclass.constructor.apply(this, arguments);
};

SubscriptionWidget.NAME = 'branch-subscription-widget';
SubscriptionWidget.ATTRS = {
    direct_subscribers: {},
    self_subscribe: {}
};
SubscriptionWidget.HTML_PARSER = {
    direct_subscribers: '.branch-subscribers-outer',
    self_subscribe: '.subscribe-self'
};

Y.extend(SubscriptionWidget, Y.Widget, {

    initializer: function () {

        this._lp_client = new LP.client.QuickBuild();
        this._branch_repr = LP.client.cache.context;
        setUpNames(this._lp_client);

        var form_url = this.get("self_subscribe").get("href") + '/++form++';
        var lp_client = this._lp_client;
        var form_overlay = new Y.lazr.FormOverlay({
            headerContent: "<h2>Subscribe to branch</h2>",
            form_submit_button: Y.Node.create(
                '<button type="submit" name="field.actions.subscribe" ' +
                'value="Subscribe" class="lazr-pos lazr-btn">Ok</button>'),
            form_cancel_button: Y.Node.create(
                '<button type="button" name="field.actions.cancel" ' +
                'class="lazr-neg lazr-btn">Cancel</button>'),
            centered: true,
            form_submit_callback: function(data ) {

                form_overlay.hide();

                var img_src = '/@@/persongray';
                var html = [
                    '<div id="temp-username">',
                    '  <img src="' + img_src + '" alt="" width="14" ',
                    'height="14" /> ',
                    display_name,
                    '  <img id="temp-name-spinner" src="/@@/spinner" alt="" ',
                    '    style="position:absolute;right:8px" /></div>'
                    ].join('');
                var link_node = Y.Node.create(html);

                var subscribers = Y.get('.branch-subscribers');
                var next = subscribers.query('div')[0];
                if (next) {
                    subscribers.insertBefore(link_node, next);
                } else {
                    // Handle the case of the displayed "None".
                    var none_subscribers = Y.get('#none-subscribers');
                    if (none_subscribers) {
                        var none_parent = none_subscribers.get('parentNode');
                        none_parent.removeChild(none_subscribers);
                    }
                    subscribers.appendChild(link_node);
                }

                /* XXX: rockstar - bug=389188 - Select boxes don't pass the
                 * data across the way the API is expecting it to come.  This
                 * basically means that the data passed into this function is
                 * worthless in this situation.
                 */
                var notification_level = document.getElementById(
                    'field.notification_level');
                var notification_level_update = notification_level.options[
                    notification_level.selectedIndex].text;
                var max_diff_lines = document.getElementById(
                    'field.max_diff_lines');
                var max_diff_lines_update = max_diff_lines.options[
                    max_diff_lines.selectedIndex].text;
                var review_level = document.getElementById(
                    'field.review_level');
                var review_level_update = review_level.options[
                    review_level.selectedIndex].text;

                config = {
                    on: {
                        success: function(updated_entry) {
                            Y.fire('branch:subscriber-list-stale');
                        },
                        failure: function(id, response) {
                            Y.log(response.responseText);
                            subscription_form_overlay.show();
                        }
                    },
                    parameters: {
                        person: LP.client.get_absolute_uri(me),
                        notification_level: notification_level_update,
                        max_diff_lines: max_diff_lines_update,
                        code_review_level: review_level_update
                    }
                };

                lp_client.named_post(LP.client.cache.context.self_link,
                    'subscribe', config);
            },
            visible: false
        });
        // We want to keep the handle to the form_overlay around.
        this._form_overlay = form_overlay;

        // loadFormContentAndRender doesn't actually render.
        this._form_overlay.loadFormContentAndRender(form_url);
        this._form_overlay.render();

        this._updateSubscribersList = function() {
            Y.io('+branch-portlet-subscriber-content', {
                on: {
                    success: function(id, response) {
                        Y.get('#branch-subscribers-outer').set(
                            'innerHTML', response.responseText);
                        var anim = Y.lazr.anim.green_flash({
                            node: Y.get('#subscriber-' + user_name)
                        });
                        anim.run();
                    },
                    failure: function(id, response) {
                        Y.get('#branch-subscribers-outer').set(
                            'innerHTML', 'A problem has occurred.');
                        var anim = Y.lazr.anim.red_flash({
                            node: Y.get('#branch-subscribers-outer')
                        });
                        anim.run();
                    }
                }});
        };
    },
    bindUI: function() {
        var form_overlay = this._form_overlay;
        this.get("self_subscribe").on('click', function(e) {
            // IE tables don't support innerHTML after render.
            if (Y.UA.ie) {
                return;
            }
            e.halt();
            form_overlay.show();
        });
        this.get("self_subscribe").addClass("js-action");

        Y.on(
            'branch:subscriber-list-stale',
            this._updateSubscribersList);
    }
});
namespace.SubscriptionWidget = SubscriptionWidget;

}, '0.1', {'requires': [
    'event',
    'io',
    'lazr.formoverlay',
    'node'
    ]});

// ../../../../lp/code/javascript/branchmergeproposal.reviewcomment.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Library for code review javascript.
 *
 * @module lp.code.branchmergeproposal.reviewcomment
 * @requires base, lazr.anim, lazr.formoverlay
 */

YUI.add('lp.code.branchmergeproposal.reviewcomment', function(Y) {

var namespace = Y.namespace('lp.code.branchmergeproposal.reviewcomment');

var reviewer_picker; // The "Request a review" overlay
var lp_client;

var window_scroll_anim = new Y.Anim({
        node: 'window',
        duration: 1,
        easing: Y.Easing.easeOut
    });

/*
 * Connect all the links to their given actions.
 */
namespace.connect_links = function() {

    var link = Y.one('#request-review');
    if (Y.Lang.isValue(link)) {
        link.addClass('js-action');
        /* XXX: salgado 2009-11-11 bug=497603
         * This will cause the picker to be recreated every time the
         * user clicks on the link.  Although that makes it unnecessary
         * to have the widget cleared, it makes it impossible to persist
         * the state of the picker between clicks on the link.  We
         * should probably have a policy to enforce that we just
         * hide/show widgets when a link is clicked more than once,
         * instead of recreating the widgets every time.
         */
        link.on('click', show_request_review_form);
    }

    link_multiline_editor('commit_message');
    link_multiline_editor('description');
    link_scroller('#proposal-summary a.diff-link', '#review-diff');
    link_scroller('.menu-link-add_comment', '#add-comment', function() {
            Y.one('#add-comment-form textarea').focus();
        });
};


function link_scroller(link_selector, node_selector, on_end) {
    var link = Y.one(link_selector);
    if (!Y.Lang.isValue(link)) {
        return;
    }

    link.addClass('js-action');
    link.on('click', function(e) {
        e.halt();
        // Stop any running scrolling.
        window_scroll_anim.stop();
        // Detach any on end handlers.
        window_scroll_anim.detach('anim:end');
        var node = Y.one(node_selector);
        window_scroll_anim.set('to', {scroll: [0, node.getY() - 5] });
        if (on_end) {
            window_scroll_anim.on('end', on_end);
        }
        window_scroll_anim.run();
    });
}


/*
 * Make the edit link a javascript link (green).
 * Link the listener to the save and cancel events of the multiline editor.
 */
function link_multiline_editor(name) {
  var link = Y.one('.menu-link-set_' + name);
  if (Y.Lang.isValue(link)) {
    link.addClass('js-action');
    link.on('click', function(e) {
        hide_link_show_multiline_edit(e, name);}
      );
    var parent = link.ancestor();
    if (parent.hasClass('unseen')) {
      link.addClass('unseen');
      parent.removeClass('unseen');
    }
  }
  if (Y.Lang.isValue(Y.lp.widgets)) {
    var widget = Y.lp.widgets['edit-' + name];
    if (Y.Lang.isValue(widget)) {
      widget.editor.on('save', function() {
          multiline_edit_message_listener(name, this.get('value'), true);
        });
      widget.editor.on('cancel', function() {
          multiline_edit_message_listener(name, this.get('value'), false);
        });
    }
  }
}


/*
 * Hide the editor if the value is empty.
 *
 * If the value is empty, we want to show the 'Set commit message' link again.
 * For consistency with page updates we want to flash this link so the user
 * can see what we are doing.  If the commit message was saved and is empty,
 * then we flash green as all is good.  If the user has cancelled the edit,
 * and the commit message is empty, then we flash the link red.
 */
function multiline_edit_message_listener(name, message, saved)
{
    if (message === '') {
        // Hide the multiline editor
        Y.one('#edit-' + name).addClass('unseen');
        // Show the link again
        var link = Y.one('.menu-link-set_' + name);
        link.removeClass('unseen');
        if (saved) {
            // Flash green.
            Y.lazr.anim.green_flash({node:link}).run();
        }
        else {
            // Flash red.
            Y.lazr.anim.red_flash({node:link}).run();
        }
    }
}

/*
 * Hide the link, show the multi-line editor, and set it to edit.
 */
function hide_link_show_multiline_edit(e, name) {
    // We are handling this click event.
    e.halt();
    // Make the edit button unseen.
    Y.one('#edit-' + name).removeClass('unseen');
    // Remove the unseen class from the commit message.
    Y.one('.menu-link-set_' + name).addClass('unseen');
    // Trigger the edit on the multiline editor.
    Y.lp.widgets['edit-' + name]._triggerEdit(e);
}

/*
 * Show the "Request a reviewer" overlay.
 */
function show_request_review_form(e) {

    e.preventDefault();
    var config = {
        header: 'Request a review',
        step_title: 'Search'
    };

    config.save = function(result) {
        var review_type = Y.one("[id=field.review_type]").get('value');
        request_reviewer(result, review_type);
    };
    reviewer_picker = Y.lp.picker.create('ValidPersonOrTeam', config);
    reviewer_picker.set('footer_slot', Y.Node.create([
        '<div>',
        '<div style="float: left; padding-right: 9px;">',
        '<label for="field.review_type">Review type:</label><br />',
        '<span class="fieldRequired">(Optional)</span>',
        '</div>',
        '<input class="textType" id="field.review_type" ',
        'name="field.review_type" size="14" type="text" value=""  /></div>'
        ].join(' ')));

    reviewer_picker.show();
}

/*
 * Actually perform the reviewer request.
 */
function request_reviewer(person, reviewtype) {

    // Add the temp "Requesting review..." text
    var table_row = Y.Node.create([
        '<tr><td colspan="4">',
        '<img src="/@@/spinner" />',
        'Requesting review...',
        '</td></tr>'].join(""));
    var last_element = Y.one('#email-review');
    var reviewer_table = last_element.get('parentNode');
    reviewer_table.insertBefore(table_row, last_element);


    var context = LP.client.cache.context;
    if (lp_client === undefined) {
        lp_client = new LP.client.QuickBuild();
    }

    var config = {
        parameters: {
            reviewer: LP.client.get_absolute_uri(person.api_uri),
            review_type: reviewtype
        },
        on: {
            success: function() {
                var username = person.api_uri.substr(
                    2, person.api_uri.length);
                add_reviewer_html(username);
            },
            failure: function(result) {
                // XXX: rockstar - The error handling story in LP is close to
                // non-existent.  Fix that, then fix this.
                alert('An error has occurred. Unable to request review.');
                Y.log(result);
            }
        }
    };
    lp_client.named_post(context.self_link,
        'nominateReviewer', config);
}


/*
 * Update the reviewers table.
 */
function add_reviewer_html(username) {

    var VOTES_TABLE_PATH = '+votes';
    Y.io(VOTES_TABLE_PATH, {
        on: {
            success: function(id, response) {
                var target = Y.one('#votes-target');
                target.set('innerHTML', response.responseText);

                namespace.connect_links();
                var new_reviewer = Y.one('#review-' + username);
                var anim = Y.lazr.anim.green_flash({node: new_reviewer});
                anim.run();
            },
            failure: function() {}
        }
    });
}


var NumberToggle = function () {
        NumberToggle.superclass.constructor.apply(this, arguments);
};


var update_nos = function(){
    var new_display = 'none';
    if (this.get('checked')) {
        new_display = 'block';
    }
    Y.all('td.line-no').setStyle('display', new_display);
};


NumberToggle.NAME = 'numbertoggle';

NumberToggle.ATTRS = {
};
Y.extend(NumberToggle, Y.Widget, {
    renderUI: function() {
        var ui = Y.Node.create('<li><label>' +
            '<input type="checkbox" checked="checked" id="show-no"/>' +
            '&nbsp;Show line numbers</label></li>');
        var ul = Y.one('#review-diff div div ul.horizontal');
        if (ul) {
            ul.appendChild(ui);
        }
    },
    bindUI: function() {
        var cb = Y.one('#show-no');
        if (cb) {
            cb.on('click', update_nos);
        }
    }
});

namespace.NumberToggle = NumberToggle;

}, "0.1", {"requires": ["base", "widget", "lazr.anim", "lazr.formoverlay", "lp.picker"]});

// ../../../../lp/code/javascript/productseries-setbranch.js
/* Copyright 2010 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Control enabling/disabling of complex form on the
 * productseries/+setbranch page.
 *
 * @module Y.lp.code.productseries_setbranch
 * @requires node, DOM
 */
YUI.add('lp.code.productseries_setbranch', function(Y) {
    Y.log('loading lp.code.productseries_setbranch');
    var module = Y.namespace('lp.code.productseries_setbranch');

    module._get_selected_rcs = function() {
       var rcs_types = module._rcs_types();
       var selected = 'None';
       for (var i = 0; i < rcs_types.length; i++) {
          if (rcs_types[i].checked) {
             selected = rcs_types[i].value;
             break;
          }
       }
       return selected;
    };


    module.__rcs_types = null;

    module._rcs_types = function() {
       if (module.__rcs_types === null) {
          module.__rcs_types = document.getElementsByName('field.rcs_type');
       }
       return module.__rcs_types;
    };

    module.set_enabled = function(field_id, is_enabled) {
       var field = Y.DOM.byId(field_id);
       field.disabled = !is_enabled;
    };

    module.onclick_rcs_type = function(e) {
       /* Which rcs type radio button has been selected? */
       // CVS
       var rcs_types = module._rcs_types();
       var selectedRCS = module._get_selected_rcs();
       module.set_enabled('field.cvs_module', selectedRCS == 'CVS');
    };

    module.onclick_branch_type = function(e) {
       /* Which branch type radio button was selected? */
       var selectedRCS = module._get_selected_rcs();
       var types = document.getElementsByName('field.branch_type');
       var type = 'None';
       for (var i = 0; i < types.length; i++) {
          if (types[i].checked) {
             type = types[i].value;
             break;
          }
       }
       // Linked
       module.set_enabled('field.branch_location', type == 'link-lp-bzr');
       module.set_enabled('field.branch_name', type != 'link-lp-bzr');
       module.set_enabled('field.branch_owner', type != 'link-lp-bzr');
       // New, empty branch.
       // Import
       var is_external = (type == 'import-external');
       module.set_enabled('field.repo_url', is_external);
       module.set_enabled('field.cvs_module',
                   (is_external & selectedRCS == 'CVS'));
       var rcs_types = module._rcs_types();
       for (var j = 0; j < rcs_types.length; j++) {
          rcs_types[j].disabled = !is_external;
       }
    };

    module.setup = function() {
       Y.all('input[name=field.rcs_type]').on(
          'click', module.onclick_rcs_type);
       Y.all('input[name=field.branch_type]').on(
          'click', module.onclick_branch_type);

       // Set the initial state.
       module.onclick_rcs_type();
       module.onclick_branch_type();
    };

   }, "0.1", {"requires": ["node", "DOM"]}
);

// ../../../../lp/code/javascript/branchmergeproposal.diff.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Code for handling the popup diffs in the pretty overlays.
 *
 * @module lp.code.branchmergeproposal.diff
 * @requires node
 */

YUI.add('lp.code.branchmergeproposal.diff', function(Y) {

// Grab the namespace in order to be able to expose the connect method.
var namespace = Y.namespace('lp.code.branchmergeproposal.diff');

// The launchpad js client used.
var lp_client;

/*
 * The DiffOverlay object inherits from the lazr-js PerttyOverlay.
 *
 * By sub-classing the DiffOverlay gets its own CSS class that is applied to
 * the various HTML objeccts that are created.  This allows styling of the
 * overlay in a different way to any other PrettyOverlays.
 */
var DiffOverlay = function() {
    DiffOverlay.superclass.constructor.apply(this, arguments);
};

Y.extend(DiffOverlay, Y.lazr.PrettyOverlay, {
        bindUI: function() {
            // call PrettyOverlay's bindUI
            this.constructor.superclass.bindUI.call(this);
        }
    });

// The NAME gets appended to 'yui-' to give the class name 'yui-diff-overlay'.
DiffOverlay.NAME = 'diff-overlay';

// A local page cache of the diff overlays that have been rendered.
// This makes subsequent views of an already loaded diff instantaneous.
var rendered_overlays = {};

/*
 * Display the diff for the specified api_url.
 *
 * If the specified api_url has already been rendered in an overlay, show it
 * again.  If it hasn't been loaded, show the spinner, and load the diff using
 * the LP API.
 *
 * If the diff fails to load, the user is taken to the librarian url just as
 * if Javascript was not enabled.
 */
function display_diff(node, api_url, librarian_url) {

    // Look to see if we have rendered one already.
    if (rendered_overlays[api_url] !== undefined) {
        rendered_overlays[api_url].show();
        return;
    }

    // Show a spinner.
    var html = [
        '<img src="/@@/spinner" alt="loading..." ',
        '     style="padding-left: 0.5em"/>'].join('');
    var spinner = Y.Node.create(html);
    node.appendChild(spinner);

    // Load the diff.
    var config = {
        on: {
            success: function(formatted_diff) {
                node.removeChild(spinner);
                var diff_overlay = new DiffOverlay({
                        bodyContent: Y.Node.create(formatted_diff),
                        align: {
                            points: [Y.WidgetPositionExt.CC,
                                     Y.WidgetPositionExt.CC]
                        },
                        progressbar: false
                    });
                rendered_overlays[api_url] = diff_overlay;
                diff_overlay.render();
            },
            failure: function() {
                node.removeChild(spinner);
                // Fail over to loading the librarian link.
                document.location = librarian_url;
            }
        },
        accept: LP.client.XHTML
    };
    lp_client.get(api_url, config);
}


/*
 * Link up the onclick handler for the a.diff-link in the node to the function
 * that will popup the diff in the pretty overlay.
 */
function link_popup_diff_onclick(node) {
    var a = node.query('a.diff-link');
    if (Y.Lang.isValue(a)) {
        a.addClass('js-action');
        var librarian_url = a.getAttribute('href');
        var api_url = node.query('a.api-ref').getAttribute('href');
        a.on('click', function(e) {
                e.preventDefault();
                display_diff(a, api_url, librarian_url);
            });
    }
}

/*
 * Connect the diff links to their pretty overlay function.
 */
namespace.connect_diff_links = function() {
    // IE doesn't like pretty overlays.
    if (Y.UA.ie) {
        return;
    }

    // Setup the LP client.
    lp_client = new LP.client.QuickBuild();

    // Listen for the branch-linked custom event.
    Y.on('lp:branch-linked', link_popup_diff_onclick);
    // var status_content = Y.get('#branch-details-status-value');
    var nl = Y.all('.popup-diff');
    if (nl) {
        nl.each(link_popup_diff_onclick);
    }
};

    }, '0.1', {requires: ['event', 'io', 'node', 'lazr.overlay', 'lp.client']});

// ../../../../lp/code/javascript/branchmergeproposal.status.js
/** Copyright (c) 2009, Canonical Ltd. All rights reserved.
 *
 * Code for handling the update of the branch merge proposals.
 *
 * @module lp.code.branchmergeproposal
 * @requires node, lazr.choiceedit, lp.client.plugins
 */

YUI.add('lp.code.branchmergeproposal.status', function(Y) {

var namespace = Y.namespace('lp.code.branchmergeproposal.status');

/*
 * Connect the branch status to the javascript events.
 */
namespace.connect_status = function(conf) {

    var status_content = Y.get('#branchmergeproposal-status-value');

    if (conf.user_can_edit_status) {
        var status_choice_edit = new Y.ChoiceSource({
            contentBox: status_content,
            value: conf.status_value,
            title: 'Change status to',
            items: conf.status_widget_items});
        status_choice_edit.showError = function(err) {
            display_error(null, err);
        };
        status_choice_edit.on('save', function(e) {
            config = {
                on: {
                    success: function(entry) {
                        var cb = status_choice_edit.get('contentBox');
                        Y.Array.each(conf.status_widget_items, function(item) {
                                if (item.value == status_choice_edit.get('value')) {
                                    cb.query('span').addClass(item.css_class);
                                } else {
                                    cb.query('span').removeClass(item.css_class);
                                }
                            });
                        update_summary();
                    },
                    end: function() {
                        status_content.one('img').set('src', '/@@/edit');
                    }
                },
                parameters: {
                    status: status_choice_edit.get('value'),
                    revid: conf.source_revid
                }
            };
            status_content.one('img').set('src', '/@@/spinner');
            lp_client = new LP.client.QuickBuild();
            lp_client.named_post(
                LP.client.cache.context.self_link, 'setStatus', config);

        });
        status_choice_edit.render();
    }
};

/*
 * Update the summary table for the merge proposal.
 *
 * An async request is made for the summary table, and the content is
 * inspected. We don't modify the status row as it is in the process of having
 * animations run on it.  Each of the table rows has an id that is strictly
 * alphabetical.  This ordering is used to determine if a row needs to be
 * added or removed to the table shown on the current page.  If the row
 * appears in both, the content is checked (except for diffs as that'll never
 * be the same due to the javascript added classes) and if it differs the
 * shown rows are updated.
 */
function update_summary() {
    var existing_summary = Y.one('#proposal-summary tbody');
    SUMMARY_SNIPPET = '+pagelet-summary';
    Y.io(SUMMARY_SNIPPET, {
            on: {
                success: function(id, response) {
                    var new_summary = Y.Node.create(response.responseText);
                    var new_rows = new_summary.all('tr');
                    var old_rows = existing_summary.all('tr');
                    // Skip over the status row (row 0).
                    var new_pos = 1;
                    var old_pos = 1;
                    var new_size = new_rows.size();
                    var old_size = old_rows.size();

                    while (new_pos < new_size && old_pos < old_size) {
                        var new_row = new_rows.item(new_pos);
                        var old_row = old_rows.item(old_pos);
                        var new_id = new_row.get('id');
                        var old_id = old_row.get('id');
                        if (new_id == old_id) {
                            if (new_id != 'summary-row-b-diff') {
                                // Don't mess with the diff.
                                if (new_row.get('innerHTML') !=
                                    old_row.get('innerHTML')) {
                                    existing_summary.insertBefore(new_row, old_row);
                                    old_row.remove();
                                }
                            }
                            ++new_pos;
                            ++old_pos;
                        } else if (new_id < old_id) {
                            ++new_pos;
                            existing_summary.insertBefore(new_row, old_row);
                        } else {
                            ++old_pos;
                            old_row.remove();
                        }
                    }
                    // Remove all left over old rows, and add all left over new rows.
                    while (old_pos < old_size) {
                        var old_row = old_rows.item(old_pos);
                        ++old_pos;
                        old_row.remove();
                    }
                    while (new_pos < new_size) {
                        var new_row = new_rows.item(new_pos);
                        ++new_pos;
                        if (new_row.get('id') != 'summary-row-b-diff') {
                            existing_summary.append(new_row);
                        }
                    }
                }
            }});
}

}, "0.1", {"requires": ["io", "node", "lazr.choiceedit", "lp.client.plugins"]});

// ../../../../lp/code/javascript/branch.status.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Code for handling the update of the branch status.
 *
 * @module lp.code.branchstatus
 * @requires node, lazr.choiceedit, lp.client.plugins
 */

YUI.add('lp.code.branch.status', function(Y) {

var namespace = Y.namespace('lp.code.branch.status');

/*
 * Connect the branch status to the javascript events.
 */
namespace.connect_status = function(conf) {

    var status_content = Y.one('#branch-details-status-value');

    if (conf.user_can_edit_status) {
        var status_choice_edit = new Y.ChoiceSource({
            contentBox: status_content,
            value: conf.status_value,
            title: 'Change status to',
            items: conf.status_widget_items});
        status_choice_edit.showError = function(err) {
            display_error(null, err);
        };
        status_choice_edit.on('save', function(e) {
            var cb = status_choice_edit.get('contentBox');
            Y.Array.each(conf.status_widget_items, function(item) {
                if (item.value == status_choice_edit.get('value')) {
                    cb.one('span').addClass(item.css_class);
                } else {
                    cb.one('span').removeClass(item.css_class);
                }
            });
        });
        status_choice_edit.plug({
            fn: Y.lp.client.plugins.PATCHPlugin,
            cfg: {
                patch: 'lifecycle_status',
                resource: conf.branch_path}});
        status_choice_edit.render();
    }
};

}, "0.1", {"requires": ["node", "lazr.choiceedit", "lp.client.plugins"]});

// ../../../../lp/registry/javascript/timeline.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * TimelineGraph widget.
 *
 * @module timeline
 */

YUI.add('lp.registry.timeline', function(Y) {

var module = Y.namespace('lp.registry.timeline');

var TIMELINE_GRAPH = 'timelinegraph';
var OBSOLETE_SERIES_STATUS = 'Obsolete';
var getCN = Y.ClassNameManager.getClassName;
var C_ZOOM_BOX = getCN(TIMELINE_GRAPH, 'zoom-box');
var C_ZOOM_IN = getCN(TIMELINE_GRAPH, 'zoom-in');
var C_ZOOM_OUT = getCN(TIMELINE_GRAPH, 'zoom-out');
var SECOND_MOUSE_BUTTON = 2;
// px spacing and sizes.
var MARGIN_LEFT = 20;
var MARGIN_TOP = 25;
var MARGIN_BOTTOM = 10;
var MILESTONE_RADIUS = 5;
var RELEASE_RADIUS = 5;
var ARROW_HEIGHT = 10;
var ARROW_WIDTH = 15;
// Defines angle of vertical timeline.
var ANGLE_DEGREES = 84;
var ANGLE_RADIANS = ANGLE_DEGREES / 180 * Math.PI;
var ANGLE_TANGENT = Math.tan(ANGLE_RADIANS);
// Font size in em's.
var FONT_SIZE = 1;
// Colors.
var LINE_COLOR = 'darkgreen';
var OBSOLETE_SERIES_COLOR = '#777777';
var MILESTONE_LINE_COLOR = 'darkgray';
var MILESTONE_FILL_COLOR = 'white';
var RELEASE_COLOR = 'black';
var ARROW_COLOR = LINE_COLOR;
// Zoom level (increase/decrease 10%)
var ZOOM_JUMPS = 1.1;

/**
 * Draw lines between a list of points.
 *
 * @method draw_line
 * @protected
 */
var draw_line = function(canvas_context, points, fill) {
    canvas_context.beginPath();
    canvas_context.moveTo(points[0].x, points[0].y);
    Y.each(points.slice(1), function(point, i) {
        canvas_context.lineTo(point.x, point.y);
    });
    // Draw!
    if (fill === true) {
        canvas_context.fill();
    } else {
        canvas_context.stroke();
    }
};

/**
 * A single x and y coordinate.
 *
 * @class Position
 * @constructor
 */
Position = function(x, y) {
    this.x = x;
    this.y = y;
};

Position.prototype = {
    copy: function() {
        return new Position(this.x, this.y);
    }
};

/**
 * These objects draw a horizontal line for the series
 * and place the text for each milestone and release on
 * the line.
 *
 * @class SeriesLine
 * @constructor
 */
SeriesLine = function(timeline_graph, series, start) {
    this.timeline_graph = timeline_graph;
    this.series = series;
    this.start = start;
    var tooltip = this.series.status + ' Series';
    if (this.series.is_development_focus) {
        tooltip = 'Development Focus Series';
    }

    this.labels = {};
    Y.each(this.series.landmarks, function(landmark, i) {
        var landmark_tooltip =
            landmark.type.charAt(0).toUpperCase() + landmark.type.substr(1);
        if (Y.Lang.isString(landmark.code_name)) {
            landmark_tooltip += ': ' + landmark.code_name;
        }

        var cfg = {id: landmark.name};
        if (Y.Lang.isString(this.timeline_graph.resize_frame)) {
            cfg.second_line = landmark.date;
        }
        this.labels[landmark.name] = this.timeline_graph.make_label(
            landmark.name, landmark_tooltip, landmark.uri, cfg);
    }, this);

    // If the frame is not going to be resized, the dates are
    // not displayed under the landmarks, so a single date
    // is displayed at the end of the series line where it
    // will not increase the vertical spacing.
    this.series_date_label = null;
    if (!Y.Lang.isString(this.timeline_graph.resize_frame)) {
        for (var i=0; i < this.series.landmarks.length; i++) {
            var landmark = this.series.landmarks[i];
            if (landmark.date !== null) {
                this.series_date_label = this.timeline_graph.make_label(
                    '', 'Last date in series', this.series.uri,
                    {second_line: landmark.date,
                    id: series.name + '-' + landmark.date});
                break;
            }
        }
    }

    // Center series label.
    var label_text = Y.Node.create('<strong/>');
    label_text.appendChild(document.createTextNode(series.name));
    this.center_series_label = this.timeline_graph.make_label(
        label_text, tooltip, this.series.uri,
        {id: series.name});
    // Left label.
    this.left_series_label = this.timeline_graph.make_label(
        '', tooltip, this.series.uri,
        {second_line: series.name, id: series.name});
    // Right label.
    this.right_series_label = this.timeline_graph.make_label(
        '', tooltip, this.series.uri,
        {second_line: series.name, id: series.name});
};

SeriesLine.prototype = {

    /**
     * Calculate the length of the horizontal line.
     *
     * @method get_length
     */
    get_length: function() {
        // No arrow at the end of obsolete series lines.
        var length = 0;
        if (this.series.status == OBSOLETE_SERIES_STATUS) {
            length = this.series.landmarks.length *
                     this.timeline_graph.landmark_spacing;
        } else {
            length = (this.series.landmarks.length + 1) *
                     this.timeline_graph.landmark_spacing;
        }
        // Display a line stub for series without any landmarks.
        return Math.max(length, this.timeline_graph.min_series_line_length);
    },

    /**
     * Calculate the vertical spacing of the horizontal lines based on twice
     * the height of the series name, plus the height of the landmark text,
     * which may or may not have a second line for the date.
     *
     * @method get_y_spacing()
     */
    get_y_spacing: function() {
        var max_y = 0;
        Y.each(this.series.landmarks, function(landmark, i) {
            var label = this.labels[landmark.name];
            max_y = Math.max(label.get('offsetHeight'));
        }, this);
        return max_y + (2 * RELEASE_RADIUS) +
               this.center_series_label.get('offsetHeight');
    },


    /**
     * The main method which is called by the ProjectLine.draw()
     * method for each series in the project.
     *
     * @method draw
     */
    draw: function() {
        // Horizontal line.
        var context = this.timeline_graph.canvas_context;
        var stop = new Position(
            this.start.x + this.get_length(),
            this.start.y);

        var thickness, offset;
        // Draw a line of various thicknesses as a rectangle.
        if (this.series.status == OBSOLETE_SERIES_STATUS) {
            thickness = 2;
            offset = -1;
            context.fillStyle = OBSOLETE_SERIES_COLOR;
        } else if (this.series.is_development_focus) {
            thickness = 4;
            offset = -2;
            context.fillStyle = LINE_COLOR;
        } else {
            thickness = 1;
            offset = 0;
            context.fillStyle = LINE_COLOR;
        }
        context.fillRect(
            this.start.x,
            this.start.y + offset,
            stop.x - this.start.x,
            stop.y - this.start.y + thickness);

        // Arrow at end of series line.
        if (this.series.status != OBSOLETE_SERIES_STATUS) {
            this.timeline_graph.make_landmark(stop, 'arrow');
        }

        // Center series label.
        var center_position = new Position(
            this.start.x + (this.get_length() / 2),
            this.start.y - RELEASE_RADIUS);
        this.timeline_graph.place_label(
            center_position, this.center_series_label, 'center', 'above');


        // Only show the left and right series labels if the
        // series line is wider than the viewport (iframe).
        var line_width = this.get_length() * this.timeline_graph.graph_scale;
        if (line_width < Y.DOM.winWidth()) {
            this.left_series_label.setStyle('display', 'none');
            this.right_series_label.setStyle('display', 'none');
        } else {
            this.left_series_label.setStyle('display', 'block');
            this.right_series_label.setStyle('display', 'block');

            // Left series label.
            var left_position = new Position(
                this.start.x + 10,
                this.start.y - RELEASE_RADIUS);
            this.timeline_graph.place_label(
                left_position, this.left_series_label, 'right', 'above');

            // Right series label.
            var right_position = new Position(
                this.start.x + this.get_length(),
                this.start.y - RELEASE_RADIUS);
            this.timeline_graph.place_label(
                right_position, this.right_series_label, 'left', 'above');
        }

        if (this.series_date_label !== null) {
            var label_position = new Position(
                stop.x + (ARROW_WIDTH / 2), this.start.y);
            this.timeline_graph.place_label(
                label_position, this.series_date_label, 'right', 'middle');
        }

        // Landmark labels.
        Y.each(this.series.landmarks, function(landmark, i) {
            // The newest milestones are at the beginning, and
            // they need to be placed at the end of the horizontal
            // line.
            var position_index = this.series.landmarks.length - i;
            var landmark_position = new Position(
                this.start.x +
                (position_index * this.timeline_graph.landmark_spacing),
                this.start.y);

            this.timeline_graph.make_landmark(
                landmark_position, landmark.type);
            // We use the RELEASE_RADIUS to space both the milestone and the
            // release labels, so that the labels line up.
            var landmark_label_position = new Position(
                landmark_position.x, landmark_position.y + RELEASE_RADIUS);
            this.timeline_graph.place_label(
                landmark_label_position, this.labels[landmark.name],
                'center', 'below');
        }, this);
    }
};

/**
 * Class which draws the slanted vertical line representing
 * the project timeline and which instantiates the SeriesLine
 * objects which draw the horizontal lines.
 *
 * @class ProjectLine
 * @constructor
 */
ProjectLine = function(timeline_graph, timeline) {
    if (timeline.length === 0) {
        throw new Error("The timeline array is empty.");
    }
    this.timeline_graph = timeline_graph;
    this.timeline = timeline;

    this.series_lines = [];
    this.initSeries();

    this.start = this.series_lines[0].start.copy();
    var last_series = this.series_lines[this.series_lines.length-1];
    this.stop = last_series.start.copy();
};

ProjectLine.prototype = {

    /**
     * Instantiate each SeriesLine object and place it at the
     * correct point on the slanted vertical line. The series aren't
     * actuall drawn yet, since we need to loop through these objects
     * to calculate the landmark_spacing.
     *
     * @method initSeries
     */
    initSeries: function() {
        var current = new Position(0, MARGIN_TOP);
        var reversed_timeline = this.timeline.slice().reverse();
        Y.each(reversed_timeline, function(series, i) {
            var series_line = new SeriesLine(
                this.timeline_graph, series, current.copy());
            this.series_lines.push(series_line);

            var height = series_line.get_y_spacing();
            current.x -= height / ANGLE_TANGENT;
            current.y += height;
        }, this);

        if (current.x < MARGIN_LEFT) {
            var shift_x = -current.x + MARGIN_LEFT;
            Y.each(this.series_lines, function(series_line, i) {
                series_line.start.x += shift_x;
            }, this);
        }
    },

    /**
     * Calculate the width based on the number of landmarks
     * and half the length of the label for the last landmark
     * on the right.
     *
     * @method get_width
     */
    get_width: function() {
        var max_x = 0;
        Y.each(this.series_lines, function(series_line, i) {
            var landmarks = series_line.series.landmarks;
            var text_beyond_last_landmark;
            if (landmarks.length === 0) {
                // Even a project with zero landmarks needs to have
                // its one empty series displayed.
                text_beyond_last_landmark = 0;
            } else {
                var landmark = landmarks[landmarks.length-1];
                var label = this.series_lines[i].labels[landmark.name];
                text_beyond_last_landmark = label.get('offsetWidth') / 2;
            }
            var series_width =
                this.series_lines[i].start.x +
                this.series_lines[i].get_length() +
                text_beyond_last_landmark;
            max_x = Math.max(max_x, series_width);
        }, this);
        return max_x;
    },

    /**
     * Calculate the height based on the stop.y value, which
     * is based on the number of series. It also adds the
     * distance for the labels below the bottom series line.
     *
     * @method get_height
     */
    get_height: function() {
        // Grab any landmark label to get its height.
        var bottom_label_height = 0;
        var last_series = this.series_lines[this.series_lines.length-1];
        for (var key in last_series.labels) {
            if (last_series.labels.hasOwnProperty(key)) {
                var label = last_series.labels[key];
                bottom_label_height = Math.max(
                    bottom_label_height, label.get('offsetHeight'));
            }
        }
        return this.stop.y + bottom_label_height + RELEASE_RADIUS;
    },

    /**
     * Draw the project line and have each SeriesLine object draw itself.
     *
     * @method draw
     */
    draw: function() {
        var context = this.timeline_graph.canvas_context;
        context.strokeStyle = LINE_COLOR;
        draw_line(context, [this.start, this.stop]);
        Y.each(this.series_lines, function(series_line, i) {
            series_line.draw();
        }, this);
    }
};

/**
 * The TimelineGraph widget will display an HTML5 canvas of a
 * project's series, milestones, and releases.
 *
 * @class TimelineGraph
 * @constructor
 * @extends Widget
 */
module.TimelineGraph = function() {
    module.TimelineGraph.superclass.constructor.apply(this, arguments);
};

module.TimelineGraph.NAME = TIMELINE_GRAPH;
module.TimelineGraph.ATTRS = {
    /**
     * JSON data describing the timeline of series, milestones, and releases.
     *
     * @attribute timeline
     * @type Array
     */
    timeline: { value: [] }
};

Y.extend(module.TimelineGraph, Y.Widget, {

    /**
     * Initialize the widget.
     *
     * @method initializer
     * @protected
     */
    initializer: function(cfg) {
        if (cfg === undefined || cfg.timeline === undefined) {
            throw new Error(
                "Missing timeline config argument for TimelineGraph.");
        }
        if (cfg !== undefined && cfg.resize_frame !== undefined) {
            if (!Y.Lang.isString(cfg.resize_frame)) {
                throw new Error(
                    "resize_frame config argument must be a string.");
            }
            if (Y.Lang.trim(cfg.resize_frame) === '') {
                throw new Error("resize_frame must not be empty.");
            }
            this.resize_frame = cfg.resize_frame;
        }
        this.graph_scale = 1;
    },

    /**
     * Increase the graph scale and redraw.
     *
     * @method zoom_in
     */
    zoom_in: function() {
        this.graph_scale *= ZOOM_JUMPS;
        this.syncUI();
    },

    /**
     * Decrease the graph scale and redraw.
     *
     * @method zoom_out
     */
    zoom_out: function() {
        this.graph_scale /= ZOOM_JUMPS;
        this.syncUI();
    },

    /**
     * The canvas has to be recreated each time with the new size, since
     * WebKit browsers do not handle resizing the canvas well.
     *
     * @method recreate_canvas
     */
    recreate_canvas: function() {
        var width = Math.ceil(
            this.graph_scale * (this.project_line.get_width() + MARGIN_LEFT));

        // The get_height() method already includes the MARGIN_TOP, so that
        // gets multiplied by the graph_scale. Alternatively, we could have
        // made changes elsewhere so that MARGIN_LEFT and MARGIN_TOP are
        // not scaled at all.
        var height = Math.ceil(
            (this.graph_scale * this.project_line.get_height()) +
            MARGIN_BOTTOM);

        if (this.canvas) {
            this.get('contentBox').removeChild(this.canvas);
        }
        this.canvas = Y.Node.create(
            '<canvas width="' + width + '" height="' + height + '"/>');
        this.get('contentBox').insertBefore(
            this.canvas, this.get('contentBox').get('children').item(0));
        if (Y.Lang.isString(this.resize_frame)) {
            var frame = parent.document.getElementById(this.resize_frame);
            if (frame === null) {
                Y.log('Frame not found: ' + this.resize_frame);
            }
            else {
                // Opera's offsetHeight and scrollHeight don't work as
                // expected, but the canvas height can be used since it is
                // the only element.
                frame.height = height;
            }
        }
    },

    /**
     * Set the timeline_graph.landmark_spacing attribute, which is
     * used by the SeriesLine objects and is based on the width
     * of the longest landmark label.
     *
     * @method calculate_landmark_spacing
     */
    calculate_landmark_spacing: function() {
        var max_label_width = 0;
        var series_max_label_width = 0;
        Y.each(this.project_line.series_lines, function(series_line, i) {
            series_max_label_width = Math.max(
                series_max_label_width,
                series_line.center_series_label.get('offsetWidth'));
            Y.each(series_line.labels, function(label, j) {
                // We have to set the font size here so that
                // offsetWidth will be correct.
                this.set_font_size(label);
                max_label_width = Math.max(
                    max_label_width, label.get('offsetWidth'));
            }, this);
        }, this);
        this.landmark_spacing = max_label_width + 5;
        this.min_series_line_length = series_max_label_width + 5;
    },

    /**
     * Set the font size.
     *
     * @method set_font_size
     */
    set_font_size: function(label) {
        label.setStyle(
            'fontSize',
            (FONT_SIZE * this.graph_scale) + 'em');
    },

    /**
     * This should show the most recent milestones or releases
     * on the development focus series.
     *
     * @method scroll_to_last_development_focus_landmark
     */
    scroll_to_last_development_focus_landmark: function(label) {
        var series_line = this.project_line.series_lines[0];
        var landmark = series_line.series.landmarks[0];
        if (landmark) {
            var landmark_label = series_line.labels[landmark.name];
            var date_label_width = 0;
            if (series_line.series_date_label !== null) {
                date_label_width =
                    series_line.series_date_label.get('offsetWidth');
            }
            var scroll_x =
                series_line.start.x + series_line.get_length() +
                ARROW_WIDTH + date_label_width -
                Y.DOM.winWidth();
            // scrollBy is relative, so adjust it by
            // the current scroll position.
            scroll_x -= window.scrollX;
            window.scrollBy(scroll_x, 0);
        }
    },

    /**
     * Draw items that do not get recreated for each zoom level.
     *
     * @method renderUI
     */
    renderUI: function() {
        // Opera needs the "&nbsp;" so that it doesn't collapse
        // the height of the <a> and push the background image
        // above the div.
        this.zoom_in_button = Y.Node.create(
            '<a class="bg-image"  ' +
            '   style="background-image: url(/@@/zoom-in);' +
            '          height: 14px">&nbsp;</a>');
        this.zoom_in_button.addClass(C_ZOOM_IN);
        this.zoom_out_button = Y.Node.create(
            '<a class="bg-image" ' +
            '   style="background-image: url(/@@/zoom-out);' +
            '          height: 14px"></a>');
        this.zoom_out_button.addClass(C_ZOOM_OUT);
        var zoom_box = Y.Node.create(
            '<div style="' +
            'background-color: white; position: fixed; ' +
            'top: 0px; left: 0px; padding-left: 2px; ' +
            'cursor: pointer; z-index: 100"/>');
        zoom_box.addClass(C_ZOOM_BOX);
        zoom_box.appendChild(this.zoom_in_button);
        zoom_box.appendChild(this.zoom_out_button);
        var contentBox = this.get('contentBox');
        contentBox.appendChild(zoom_box);
        this.project_line = new ProjectLine(this, this.get('timeline'));
    },

    /**
     * Hook up UI events.
     *
     * @method bindUI
     */
    bindUI: function() {
        this.zoom_in_button.on('click', function() {
            this.zoom_in();
        }, this);
        this.zoom_out_button.on('click', function() {
            this.zoom_out();
        }, this);
    },

    /**
     * Redraw everything that changes at each zoom level.
     *
     * @method syncUI
     */
    syncUI: function() {
        // Resizing the canvas requires destroying the old canvas and
        // creating a new one due to rendering issues in WebKit.
        this.calculate_landmark_spacing();
        var contentBox = this.get('contentBox');
        this.recreate_canvas();
        var dom_canvas = Y.Node.getDOMNode(this.canvas);
        this.canvas_context = dom_canvas.getContext('2d');

        // Zoom in or out.
        this.canvas_context.scale(this.graph_scale, this.graph_scale);

        this.project_line.draw();
    },

    /**
     * Create the label for each landmark, but don't place them yet,
     * since we need to calculate the spacing between landmarks based
     * on the width of the longest label text.
     *
     * @method make_label
     */
    make_label: function(text, tooltip, uri, cfg) {
        if (cfg === undefined) {
            cfg = {};
        }
        var label = Y.Node.create(
            '<div style="white-space: nowrap; text-align: center"/>');
        if (Y.Lang.isString(cfg.id)) {
            label.set('id', cfg.id);
        }
        var text_node;
        if (text instanceof Y.Node || text instanceof Text) {
            text_node = text;
        } else {
            text_node = document.createTextNode(text);
        }
        if (uri) {
            var link = Y.Node.create('<a/>');
            link.appendChild(text_node);
            link.on('click', function(e) {
                // Safari also fires the click event for the 2nd mouse button,
                // and we don't want to prevent that default action.
                if (e.which != SECOND_MOUSE_BUTTON) {
                    parent.location.href = uri;
                    e.preventDefault();
                }
            });
            // Middle-clicking to open a new tab still works if
            // the href is set.
            link.set('href', uri);
            label.appendChild(link);
        } else {
            var span = Y.Node.create('<span/>');
            span.appendChild(text_node);
            label.appendChild(span);
        }
        label.setStyle('position', 'absolute');
        if (tooltip) {
            label.set('title', tooltip);
        }
        if (Y.Lang.isString(cfg.second_line)) {
            var div = Y.Node.create(
                '<div style="color: #aaaaaa; font-size: 70%"/>');
            div.appendChild(document.createTextNode(cfg.second_line));
            label.appendChild(div);
        }
        this.get('contentBox').appendChild(label);
        return label;
    },

    /**
     * After this.landmark_spacing has been calculated,
     * we can place the label.
     *
     * @method place_label
     */
    place_label: function(position, label, x_align, y_align) {
        var graph_scale = this.graph_scale;
        var dom_canvas = Y.Node.getDOMNode(this.canvas);

        // Set the size here also, for any labels that are not
        // for landmarks, which are already set through
        // calculate_landmark_spacing.
        this.set_font_size(label);

        // Find where the canvas is placed on the page, and
        // center the text under the landmark.
        var label_height = label.get('offsetHeight');
        var y_align_offset;
        if (y_align == 'above') {
            y_align_offset = -label_height;
        } else if (y_align == 'below') {
            y_align_offset = 0;
        } else if (y_align == 'middle') {
            y_align_offset = -(label_height / 2);
        } else {
            throw "Invalid y_align argument: " + y_align;
        }

        var x_align_offset;
        if (x_align == 'left') {
            x_align_offset = -label.get('offsetWidth');
        } else if (x_align == 'center') {
            x_align_offset = -(label.get('offsetWidth') / 2);
        } else if (x_align == 'right') {
            x_align_offset = 0;
        } else {
            throw "Invalid x_align argument: " + x_align;
        }

        var scaled_position = new Position(
            position.x * graph_scale +
            dom_canvas.offsetLeft + x_align_offset,
            position.y * graph_scale +
            dom_canvas.offsetTop + y_align_offset);

        label.setStyle('left', scaled_position.x + "px");
        label.setStyle('top', scaled_position.y + "px");
    },

    /**
     * Draw a square for milestones and a circle for releases
     * on the series line. Also, place the name label
     * underneath the landmark.
     *
     * @method make_landmark
     */
    make_landmark: function(position, type) {
        var context = this.canvas_context;
        if (type == 'milestone') {
            // Fill circle first.
            context.fillStyle = MILESTONE_LINE_COLOR;
            context.beginPath();
            context.arc(
                position.x, position.y, MILESTONE_RADIUS, 0,
                (Math.PI*2), true);
            context.fill();
            // Overlay the fill color in the center.
            context.fillStyle = MILESTONE_FILL_COLOR;
            context.beginPath();
            context.arc(
                position.x, position.y, MILESTONE_RADIUS-2, 0,
                (Math.PI*2), true);
            context.fill();
        } else if (type == 'release') {
            context.fillStyle = RELEASE_COLOR;
            context.beginPath();
            context.arc(
                position.x, position.y, RELEASE_RADIUS, 0,
                (Math.PI*2), true);
            context.fill();
        } else if (type == 'arrow') {
            context.fillStyle = ARROW_COLOR;
            var point = position.copy();
            // Make sure the tip of the arrow isn't blunted by the
            // development focus series line.
            point.x += 3;
            var path = [point];

            point = point.copy();
            point.x -= ARROW_WIDTH / 2;
            point.y -= ARROW_HEIGHT / 2;
            path.push(point);

            point = point.copy();
            point.x += ARROW_WIDTH / 4;
            point.y += ARROW_HEIGHT / 2;
            path.push(point);

            point = point.copy();
            point.x -= ARROW_WIDTH / 4;
            point.y += ARROW_HEIGHT / 2;
            path.push(point);

            draw_line(context, path, true);
        }
        else {
            throw "Unknown landmark type: " + type;
        }
    }
});

}, "0.1", {"requires": ["oop", "node", "widget"]});

// ../../../../lp/registry/javascript/milestonetable.js
/* Copyright 2010 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * Dynamically add milestones to an HTML table.
 *
 * @module Y.lp.registry.milestonetable
 * @requires node, io-base, substitute, lazr.anim
 */
YUI.add('lp.registry.milestonetable', function(Y) {
    Y.log('loading lp.registry.milestonetable');
    var module = Y.namespace('lp.registry.milestonetable');

    // get_milestone_row() needs these when it is called. Other methods
    // should get this information passed as an argument.
    module._milestone_row_uri_template = null;
    module._tbody = null;

    module._prepend_node = function(parent_node, child_node) {
        // Add the child_node to the parent_node as the first item.
        var children = parent_node.get('children');
        if (children === null) {
            parent_node.appendChild(child_node);
        } else {
            parent_node.insertBefore(child_node, children.item(0));
            }
        };

    module._ensure_table_is_seen = function(tbody) {
        // Remove the 'unseen' class from the table to ensure it is visible.
        table = tbody.ancestor();
        table.removeClass('unseen');
        };

    module._clear_add_handlers = function(data) {
        // Detach the callback and errorback functions from the Y.io events.
        // The data has been used. If they are not detached, there will be
        // multiple adds for each use of the Create milestone link.
        data.success_handle.detach();
        data.failure_handle.detach();
        };

    module._on_add_success = function(id, response, data) {
        // Add the milestone to the milestone table on Y.io success.
        var row = Y.Node.create(Y.Lang.trim(response.responseText));
        module._ensure_table_is_seen(data.tbody);
        module._prepend_node(data.tbody, row);
        Y.lazr.anim.green_flash({node: row}).run();
        module._clear_add_handlers(data);
        };

    module._on_add_failure = function(id, response, data) {
        // Add the failure message to the milestone table on Y.io failure.
        var row = Y.Node.create(Y.substitute(
            '<tr><td colspan="0">' +
            'Could not retrieve milestone {name}</td></tr>', data));
        module._ensure_table_is_seen(data.tbody);
        module._prepend_node(data.tbody, row);
        Y.lazr.anim.red_flash({node: row}).run();
        module._clear_add_handlers(data);
        };

    module._setup_milestone_event_data = function(parameters, tbody) {
        // Attach the callback to the Y.io event and return their data
        var data = {
            name: parameters.name,
            tbody: tbody
            };
        data.success_handle = Y.on(
            'io:success', module._on_add_success, this, data);
        data.failure_handle = Y.on(
            'io:failure', module._on_add_failure, this, data);
        return data;
        };

    /**
      * The milestoneoverlay next_step to add the milestone to the page.
      *
      * This is the callback passed as 'next_step' in milestoneoverlay config.
      *
      * @method get_milestone_row
      * @param {Object} parameters Object literal of config name/value pairs.
      *     The form parameters that were submitted to create the milestone.
      */
    module.get_milestone_row = function(parameters) {
        module._setup_milestone_event_data(parameters, module._tbody);
        var milestone_row_uri = Y.substitute(
            module._milestone_row_uri_template, parameters);
        Y.io(milestone_row_uri);
        };

    /**
      * Setup the URL to get the milestone and the table it will be added too.
      *
      * @method setup
      * @param {Object} parameters Object literal of config name/value pairs.
      *     config.milestone_row_uri_template is the Y.substitute template
      *         that is used to create the URL to get the milestone row.
      *     config.milestone_rows_id is the id the the tbody that the
      *         milestone row will be added too.
      */
    module.setup =  function(config) {
        if (config === undefined) {
            throw new Error(
                "Missing setup config for milestonetable.");
            }
        if (config.milestone_row_uri_template === undefined ||
            config.milestone_rows_id === undefined ) {
            throw new Error(
                "Undefined properties in setup config for milestonetable.");
            }
        module._milestone_row_uri_template = config.milestone_row_uri_template;
        module._tbody = Y.one(config.milestone_rows_id);
        if (module._tbody === null) {
            throw new Error(
                Y.substitute("'{milestone_rows_id}' not in page.", config));
            }
        };

}, "0.1", {"requires": [
    "node", "io-base", "substitute", "lazr.anim"
    ]});

// ../../../../lp/registry/javascript/team.js
/** Copyright (c) 2009, Canonical Ltd. All rights reserved.
 *
 * Objects for subscription handling.
 *
 * @module lp.subscriber
 */

YUI.add('lp.registry.team', function(Y) {

var module = Y.namespace('lp.registry.team');

/*
 * Initialize click handler for the add member link
 *
 * @method setup_add_member_handler
 */
module.setup_add_member_handler = function() {
    if (Y.UA.ie) {
        return;
    }

    var config = {
        header: 'Add a member',
        step_title: 'Search',
        picker_activator: '.menu-link-add_member'
    };

    config.save = _add_member;
    Y.lp.picker.create('ValidTeamMember', config);
};

var _add_member = function(selected_person) {
    var box = Y.one('#membership');
    var spinner = box.query('#add-member-spinner');
    var addmember_link = box.query('.menu-link-add_member');
    addmember_link.addClass('unseen');
    spinner.removeClass('unseen');
    var disable_spinner = function() {
        addmember_link.removeClass('unseen');
        spinner.addClass('unseen');
    };
    lp_client = new LP.client.QuickBuild();

    var error_handler = new LP.client.ErrorHandler();
    error_handler.clearProgressUI = disable_spinner;
    error_handler.showError = function(error_msg) {
        Y.lp.display_error(addmember_link, error_msg);
    };

    addmember_config = {
        on: {
            success: function(change_and_status) {
                var did_status_change = change_and_status[0];
                var current_status = change_and_status[1];
                var members_section, members_ul, count_elem;
                if (did_status_change === false) {
                    disable_spinner();
                    Y.lp.display_info(
                        selected_person.title + ' is already ' +
                        current_status.toLowerCase() +
                        ' as a member of the team.');
                    return;
                }

                if (current_status == 'Invited') {
                    members_section = box.query('#recently-invited');
                    members_ul = box.query('#recently-invited-ul');
                    count_elem = box.query('#invited-member-count');
                } else if (current_status == 'Proposed') {
                    members_section = box.query('#recently-proposed');
                    members_ul = box.query('#recently-proposed-ul');
                    count_elem = box.query('#proposed-member-count');
                } else if (current_status == 'Approved') {
                    members_section = box.query('#recently-approved');
                    members_ul = box.query('#recently-approved-ul');
                    count_elem = box.query('#approved-member-count');
                } else {
                    Y.lp.display_error(
                        addmember_link,
                        'Unexpected status: ' + current_status);
                    return;
                }
                var first_node = members_ul.get('firstChild');

                var xhtml_person_handler = function(person_html) {
                    if (count_elem === null && current_status == 'Invited') {
                        count_elem = Y.Node.create(
                            '<strong id="invited-member-count">' +
                            '1</strong>');
                        var count_box = Y.one(
                            '#membership #membership-counts');
                        count_box.append(Y.Node.create(
                            '<span>, </span>'));
                        count_box.append(count_elem);
                        count_box.append(Y.Node.create(
                            '<span> <a href="/+members#invited">' +
                            'invited members</a></span>'));
                    } else {
                        var count = count_elem.get('innerHTML');
                        count = parseInt(count, 10) + 1;
                        count_elem.set('innerHTML', count);
                    }
                    person_repr = Y.Node.create(
                        '<li>' + person_html + '</li>');
                    members_section.removeClass('unseen');
                    members_ul.insertBefore(person_repr, first_node);
                    anim = Y.lazr.anim.green_flash({node: person_repr});
                    anim.run();
                    disable_spinner();
                };

                xhtml_person_config = {
                    on: {
                        success: xhtml_person_handler,
                        failure: error_handler.getFailureHandler()
                    },
                    accept: LP.client.XHTML
                };
                lp_client.get(selected_person.api_uri, xhtml_person_config);
            },
            failure: error_handler.getFailureHandler()
        },
        parameters: {
            // XXX: EdwinGrubbs 2009-12-16 bug=497602
            // Why do I always have to get absolute URIs out of the URIs
            // in the picker's result/client.links?
            reviewer: LP.client.get_absolute_uri(LP.client.links.me),
            person: LP.client.get_absolute_uri(selected_person.api_uri)
        }
    };

    lp_client.named_post(
        LP.client.cache.context.self_link, 'addMember', addmember_config);
};

}, '0.1', {requires: [
    'node', 'lazr.anim', 'lp.picker', 'lp.errors', 'lp.client.plugins']});

// ../../../../lp/registry/javascript/milestoneoverlay.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * A milestone form overlay that can create a milestone within any page.
 *
 * @module Y.lp.registry.milestoneoverlay
 * @requires  dom, node, io-base, lazr.anim, lazr.formoverlay
 */
YUI.add('lp.registry.milestoneoverlay', function(Y) {
    Y.log('loading lp.registry.milestoneoverlay');
    var module = Y.namespace('lp.registry.milestoneoverlay');

    var milestone_form;
    var milestone_form_uri;
    var series_uri;
    var next_step;

    var save_new_milestone = function(data) {

        var parameters = {
            name: data['field.name'][0].toLowerCase(),
            code_name: data['field.code_name'][0],
            summary: data['field.summary'][0]
        };

        var date_targeted = Y.Lang.trim(data['field.dateexpected'][0]);
        if (date_targeted !== '') {
            parameters.date_targeted = date_targeted;
        }

        var finish_new_milestone = function(ignore) {
            milestone_form.clearError();
            milestone_form.hide();
            // Reset the HTML form inside the widget.
            milestone_form.get('contentBox').one('form').reset();
            next_step(parameters);
        };

        var client = new LP.client.QuickBuild();
        client.named_post(series_uri, 'newMilestone', {
            parameters: parameters,
            on: {
                success: finish_new_milestone,
                failure: function (ignore, response, args) {
                    var error_box = Y.one('#milestone-error');
                    var error_message = '<strong>' + response.statusText +
                                        '</strong><p>' +
                                        response.responseText +
                                        '</p>';
                    milestone_form.showError(error_message);
                }
            }
        });
    };


    var setup_milestone_form = function () {
        var form_submit_button = Y.Node.create(
            '<input type="submit" name="field.actions.register" ' +
            'id="formoverlay-add-milestone" value="Create Milestone"/>');
        milestone_form = new Y.lazr.FormOverlay({
            headerContent: '<h2>Create Milestone</h2>',
            form_submit_button: form_submit_button,
            centered: true,
            form_submit_callback: save_new_milestone,
            visible: false
        });
        milestone_form.render();
        milestone_form.loadFormContentAndRender(milestone_form_uri);
        Y.lp.add_calendar_widgets();
        milestone_form.show();
    };

    show_milestone_form = function(e) {
        if (milestone_form) {
            milestone_form.show();
        } else {
            // This function call is asynchronous, so we can move
            // milestone_form.show() below it.
            setup_milestone_form();
        }
        e.preventDefault();
    };

    /**
      * Attaches a milestone form overlay widget to an element.
      *
      * @method attach_widget
      * @param {Object} config Object literal of config name/value pairs.
      *                        config.milestone_form_uri is the URI of the
      *                            milestone form to display.
      *                        config.series_uri is the URI to post the
      *                            form data to create the milestone.
      *                        activate_node is the node that shows the form
      *                            when it is clicked.
      *                        next_step is the function to be called after
      *                            the milestone is created.
      */
    module.attach_widget = function(config) {
        if (Y.UA.ie) {
            return;
        }
        if (config === undefined) {
            throw new Error(
                "Missing attach_widget config for milestoneoverlay.");
        }
        if (config.milestone_form_uri === undefined ||
            config.series_uri === undefined ||
            config.next_step === undefined) {
            throw new Error(
                "attach_widget config for milestoneoverlay has " +
                "undefined properties.");
        }
        milestone_form_uri = config.milestone_form_uri;
        series_uri = config.series_uri;
        next_step = config.next_step;
        config.activate_node.on('click', show_milestone_form);
    };

}, "0.1", {"requires": [
    "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.calendar"
    ]});

// ../../../../lp/translations/javascript/importqueue.js
/* Copyright 2009 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * @module lp.translations.importqueue
 * @requires oop, event, node, widget, plugin, overlay,lazr.choiceedit
 */

YUI.add('lp.translations.importqueue', function(Y) {

var namespace = Y.namespace('lp.translations.importqueue');

/**
 * HTML for the "this entry has error output" icon.  This does not include the
 * fold/unfold triangle shown next to it.
 */
var base_button = '<span class="info sprite"></span>';

/**
 * HTML for panel showing an entry's error output.  The spinner icon is
 * replaced by the actual error output as it comes in.
 */
var output_panel_html =
    '<tr class="discreet secondary output-panel"><td>' +
    '<div><img src="/@@/spinner" alt="loading..." /></div>' +
    '</td></tr>';

/**
 * Compose HTML for the error-output button: the basic button plus the
 * fold/unfold triangle.
 */
var compose_button = function(shown) {
    return base_button +
        (shown ?
            '<span class="treeExpanded sprite"></span>' :
            '<span class="treeCollapsed sprite"></span>');
};

/**
 * Replace given button (or initial placeholder, if the page is only just
 * rendering) with one in the given state.
 *
 * This removes the entire old button and replaces it with a new one.  That's
 * one sure-fire way of getting rid of the old one's click-event handler,
 * which is otherwise a brittle procedure and at the same time hard to test.
 */
var alter_button = function(button, shown) {
    var button_field = button.get('parentNode');
    var text =
        '<div class="new show-output">' +
        compose_button(shown) +
        '</div>';
    new_button = button_field.create(text);
    button_field.replaceChild(new_button, button);
    new_button.on('click', (shown ? hide_output : show_output));
    return button_field.get('parentNode');
};

/**
 * Remove the error-output panel pointed at by event.
 */
var hide_output = function(e) {
    var row = alter_button(e.currentTarget, false);
    var output_panel = row.next();
    if (output_panel.hasClass("output-panel")) {
        output_panel.get('parentNode').removeChild(output_panel);
    }
};

/**
 * Factory for error-output request (and response handlers) for a given
 * output panel.
 */
var output_loader = function(node) {
    return {
        on: {
            success: function(entry) {
                var output_block = entry.get('error_output');
                var error_pre = node.create('<pre></pre>');
                error_pre.appendChild(document.createTextNode(output_block));
                node.set('innerHTML', null);
                node.appendChild(error_pre);
            },
            failure: function(errcode) {
                node.set(
                    'innerHTML',
                    '<strong>ERROR: could not retrieve output.  ' +
                    'Please try again later.</strong>');
            }
        }
    };
};

/**
 * Button has been clicked.  Reveal output panel and request error output from
 * the QuickBuild web service.
 */
var show_output = function(e) {
    var row = alter_button(e.currentTarget, true);
    var table = row.get('parentNode');
    var entry_id = row.get('id');

    var output = table.create(output_panel_html);
    table.insertBefore(output, row.next());

    var entry_uri = '+imports/' + entry_id;
    var div = output.one('div');
    var lp = new LP.client.QuickBuild();
    lp.get(entry_uri, output_loader(div));
};

/**
 * Create a choice widget for a given status picker. The function's signature
 * is meant for it to be called from Node.each for each node that contains
 * a settable status.
 * The base configuration for the widget is taken from the choice_confs array
 * which is defined in a code fragment that is included in the page via TAL.
 */
var init_status_choice = function(content_box, index, list) {
    content_box.setStyle('display', '');
    var conf = choice_confs[index];
    conf.title = 'Change status to';
    conf.contentBox = content_box;
    var status_choice = new Y.ChoiceSource(conf);
    status_choice.showError = function(err) {
        display_error(null, err);
    };
    var entry_id = content_box.ancestor(function(node){
        return node.hasClass('import_entry_row');
    }).get('id');
    status_choice.on('save', function(e) {
        var value_box = content_box.query('.value');
        var new_status = status_choice.get('value');
        value_box.setContent(new_status);
        config = {
            on: {
                success: function(entry) {
                    Y.Array.each(conf.items, function(item) {
                        if (item.value == new_status) {
                            value_box.addClass(item.css_class);
                        } else {
                            value_box.removeClass(item.css_class);
                        }
                    });
                }
            },
            parameters: {
                new_status: new_status
            }
        };
        Y.log(config);
        lp_client = new LP.client.QuickBuild();
        var entry_uri = '+imports/' + entry_id;
        lp_client.named_post(entry_uri, 'setStatus', config);
    });
    status_choice.render();
};

/**
 * Replace placeholders for error-output buttons
 * with actual buttons, and make them functional.
 */
var init_error_output_buttons = function() {
    var button_markers = Y.all('.show-output');
    button_markers.set('innerHTML', compose_button(false));
    button_markers.on('click', show_output);
};

/**
 * Set up the import queue page.
 */
namespace.initialize_import_queue_page = function (Y) {
    // Show spinner while patching up the page, pre-fetchig the image.
    var spinner_loader = Y.all('#spinner-loader');
    spinner_loader.set('innerHTML', '<img src="/@@/spinner" alt="" />');

    // Set up error output buttons.
    init_error_output_buttons();

    // Set up status pickers.
    Y.all('.status-choice').each(init_status_choice);

    // Remove the spinner again.
    spinner_loader.set('innerHTML', '');
};

}, "0.1", {
    // "oop" and "event" are required to fix known bugs in YUI, which
    // are apparently fixed in a later version.
    "requires": ["oop", "event", "node", "widget", "plugin", "overlay",
               "lazr.choiceedit", "lp.client.plugins", "lp.errors"]});

// ../../../../lp/translations/javascript/languages.js
/* Copyright 2010 Canonical Ltd.  This software is licensed under the
 * GNU Affero General Public License version 3 (see the file LICENSE).
 *
 * @module lp.translations.languages
 * @requires node
 */

YUI.add('lp.translations.languages', function(Y) {

var namespace = Y.namespace('lp.translations.languages');

var toggle_node_visibility = function(node, index, list) {
  node.toggleClass('unseen');
  node.toggleClass('seen');
};

/**
 * Set up the initial visibility for languages in a serieslanguages table.
 */
namespace.initialize_languages_table = function(Y) {
    Y.all('.not-preferred-language').each(function(node, index, list) {
        node.addClass('unseen');
    });
    Y.all('.preferred-language').each(function(node, index, list) {
        node.addClass('seen');
    });
};


/**
 * Toggle visibility for languages in a serieslanguages table.
 */
namespace.toggle_languages_visibility = function(e) {
    e.preventDefault();
    Y.all('.not-preferred-language').each(toggle_node_visibility);
    var toggle_button = e.currentTarget;
    if (toggle_button.hasClass('all-languages-visible')) {
      toggle_button.setContent('View all languages');
      toggle_button.removeClass('all-languages-visible');
    } else {
      toggle_button.setContent('View only preferred languages');
      toggle_button.addClass('all-languages-visible');
    }
};


}, "0.1", {"requires": ["node"]});


// ../../../../lp/translations/javascript/pofile.js
/** Copyright (c) 2009, Canonical Ltd. All rights reserved.
 *
 * @module lp.translations.pofile
 * @requires anim, cookie, event-key, event, node
 */

YUI.add('lp.translations.pofile', function(Y) {

var namespace = Y.namespace('lp.translations.pofile');

var KEY_CODE_TAB = 9;
var KEY_CODE_ENTER = 13;
var KEY_CODE_LEFT = 37;
var KEY_CODE_UP = 38;
var KEY_CODE_RIGHT = 39;
var KEY_CODE_DOWN = 40;
var KEY_CODE_0 = 48;
var KEY_CODE_A = 65;
var KEY_CODE_B = 66;
var KEY_CODE_C = 67;
var KEY_CODE_D = 68;
var KEY_CODE_F = 70;
var KEY_CODE_J = 74;
var KEY_CODE_K = 75;
var KEY_CODE_L = 76;
var KEY_CODE_N = 78;
var KEY_CODE_P = 80;
var KEY_CODE_R = 82;
var KEY_CODE_S = 83;

/**
 * Function to disable/enable all suggestions as they are marked/unmarked
 * for dismission.
 */
var setupSuggestionDismissal = function(e) {
    all_dismiss_boxes = Y.all('.dismiss_action');
    if (all_dismiss_boxes !== null) {
        all_dismiss_boxes.each(function(checkbox) {
            var classbase = checkbox.get('id');
            var diverge_id = classbase.replace(/dismiss/, 'diverge');
            var current_class = classbase.replace(/dismiss/, 'current');
            var current_radios = Y.all('.' + current_class);
            var dismissables = Y.all('.' + classbase+'able');
            // The button and textarea cannot be fetched beforehand
            // because they are or may be created dynamically.
            var dismissable_inputs_class = [
                '.', classbase, 'able_button input, ',
                '.', classbase, 'able_button button, ',
                '.', classbase, 'able_button textarea'].join("");
            checkbox.on('click', function(e) {
                if (checkbox.get('checked')) {
                    dismissables.addClass('dismissed');
                    Y.all(dismissable_inputs_class).set('checked', false);
                    Y.all(dismissable_inputs_class).set('disabled', true);
                    Y.all('#' + diverge_id).set('disabled', false);
                    current_radios.set('checked', true);
                } else {
                    dismissables.removeClass('dismissed');
                    Y.all(dismissable_inputs_class).set('disabled', false);
                }
            });
        });
    }
};


var hide_notification = function(node) {
  var hide_anim = new Y.Anim({
      node: node,
      to: { height: 0,
            marginTop: 0, marginBottom: 0,
            paddingTop: 0, paddingBottom: 0 }
  });
  node.setStyle('border', 'none');
  hide_anim.set('duration', 0.4);
  hide_anim.on('end', function(e) {
      node.setStyle('display', 'none');
  });
  hide_anim.run();
};


var updateNotificationBox = function(e) {
  var notice = Y.one('.important-notice-container');
  if (notice === null) {
    // We have no notice container on this page, this is why there is
    // nothing more to be done by this function.
    return;
  }
  var balloon = notice.one('.important-notice-balloon');
  var dismiss_notice_cookie = ('translation-docs-for-' +
                               documentation_cookie);

  // Check the cookie to see if the user has already dismissed
  // the notification box for this session.
  var already_seen = Y.Cookie.get(dismiss_notice_cookie, Boolean);
  if (already_seen !== null) {
     notice.setStyle('display', 'none');
  }

  var cancel_button = notice.one(
      '.important-notice-cancel-button');
  // Cancel button starts out hidden.  If user has JavaScript,
  // then we want to show it.
  if (cancel_button === null) {
    // No cancel button was found to attach the action.
    return;
  }
  cancel_button.setStyle('visibility', 'visible');
  cancel_button.on('click', function(e) {
      e.halt();
      hide_notification(balloon);
      Y.Cookie.set(dismiss_notice_cookie, true);
  });
};

var WORKING_MODE_SWITCH_ID = "#translation-switch-working-mode";
var WORKING_MODE_CONTAINER_ID = "#translation-switch-working-mode-container";
var WORKING_MODE_COOKIE = "translation-working-mode";
var WORKING_MODE_REVIEWER = "reviewer";
var WORKING_MODE_TRANSLATOR = "translator";

/*
 * This function is sanitizing the WORKING_MODE_COOKIE and in case it contains
 * unknow values, we play it safe by returning WORKING_MODE_REVIEWER, which
 * is the default mode.
 */
var getWorkingMode = function () {
    var current_mode = Y.Cookie.get(WORKING_MODE_COOKIE);
    if (current_mode == WORKING_MODE_TRANSLATOR) {
        return WORKING_MODE_TRANSLATOR;
    } else {
        return WORKING_MODE_REVIEWER;
    }
};

var setWorkingMode = function (mode) {
    if(mode == WORKING_MODE_TRANSLATOR) {
        text = 'Translator&nbsp;mode';
    } else {
        text = 'Reviewer&nbsp;mode';
    }
    Y.one(WORKING_MODE_SWITCH_ID).set('innerHTML', text);
    Y.Cookie.set(WORKING_MODE_COOKIE, mode, {path: "/"});
};

var switchWorkingMode = function () {
    if (getWorkingMode() == WORKING_MODE_TRANSLATOR) {
        setWorkingMode(WORKING_MODE_REVIEWER);
    } else {
        setWorkingMode(WORKING_MODE_TRANSLATOR);
    }
};


/**
 * Initialize the current working mode and attach the node event for
 * switching between modes.
 */
var initializeWorkingMode = function () {

    var working_mode = Y.one(WORKING_MODE_CONTAINER_ID);
    if (working_mode !== null) {
        working_mode.removeClass('unseen');
        setWorkingMode(getWorkingMode());
        Y.on("click", switchWorkingMode, WORKING_MODE_SWITCH_ID);
    }
};


var setFocus = function(field) {
    // if there is nofield, do nothing
    if (Y.one('#' + field) !== null) {
        Y.one('#' + field).focus();
    }
};


var setNextFocus = function(e, field) {
    setFocus(field);
    // stopPropagation() and preventDefault()
    e.halt();
};


var setPreviousFocus = function(e, field, original) {

    // Original singular test is focused first to make sure
    // it is visible when scrolling up
    setFocus(original);
    setFocus(field);
    // stopPropagation() and preventDefault()
    e.halt();
};


var copyOriginalTextOne = function(from_id, to_id, select_id) {
    var from = Y.one('#' + from_id);
    var to = Y.one('#' + to_id);
    // The replacement regex strips all tags from the html.
    to.set('value', unescapeHTML(
        from.get('innerHTML').replace(/<\/?[^>]+>/gi, "")));
    selectWidgetByID(select_id);
};


var copyOriginalTextPlural = function (from_id,
                                              to_id_pattern, nplurals) {
    // skip when x is 0, as that is the singular
    for (var x = 1; x < nplurals; x++) {
        var to_id = to_id_pattern + x + "_new";
        var to_select = to_id_pattern + x + "_new_select";
        copyOriginalTextOne(from_id, to_id, to_select);
    }
};


var copyOriginalTextAll = function(e, msgset_id, translation_stem) {

    var original_singular = msgset_id + '_singular';
    var original_plural = msgset_id + '_plural';
    var singular_select = translation_stem + '_translation_0_new_select';
    var translation_singular = translation_stem + '_translation_0_new';
    var translation_plural = translation_stem + '_translation_';
    // Copy singular text
    copyOriginalTextOne(
        original_singular, translation_singular, singular_select);

    // Copy plural text if needed
    if (Y.one('#' + translation_plural + '1') !== null) {
        copyOriginalTextPlural(
            original_plural, translation_plural, plural_forms);
    }
    // stopPropagation() and preventDefault()
    e.halt();
};


var selectWidgetByID = function(widget) {
    var node = Y.one('#' + widget);
    if (node !== null) {
        node.set('checked', true);
    }
};


var toggleWidget = function(widget) {
    var node = Y.one('#' + widget);
    if (node !== null) {
        if (node.get('checked')) {
            node.set('checked', false);
        } else {
            node.set('checked', true);
        }
    }
};


var selectTranslation = function(e, field) {
    // Don't select when tabbing, navigating and simply pressing
    // enter to submit the form.
    // Also, don't select when using keyboard shortcuts (ie Alt+Shift+KEY)
    // Looks like this is not needed for Epiphany and Chromium
    if (e.keyCode == KEY_CODE_TAB || e.keyCode == KEY_CODE_ENTER ||
        e.keyCode == KEY_CODE_LEFT || e.keyCode == KEY_CODE_UP ||
        e.keyCode == KEY_CODE_RIGHT || e.keyCode == KEY_CODE_DOWN ||
        (e.shiftKey && e.altKey)) {
            return;
    }

    // translation_select_id has one of the following formats:
    //  * msgset_1_es_translation_0_new_select
    //  * msgset_2_pt_BR_translation_0_new_select
    var translation_select_id = field + '_select';
    selectWidgetByID(translation_select_id);

    var working_mode_switch = Y.one(WORKING_MODE_SWITCH_ID);
    // Autoselect the force suggestion checkbox only if working in translator
    // mode and the switch is on the page.
    if (working_mode_switch !== null &&
        getWorkingMode() == WORKING_MODE_TRANSLATOR) {
        var translation_field = Y.one('#' + field);
        if (translation_field !== null &&
            translation_field.get('value') === '') {
            var html_parts = field.split('_');
            var force_suggestion = (
                html_parts[0] + '_' + html_parts[1] +
                '_force_suggestion');
            selectWidgetByID(force_suggestion);
        }
    }

};


var initializeGlobalKeyBindings = function(fields) {

    Y.get('document').on("keyup", function(e) {
        var link;
        // Shift+Alt+S - Save form
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_S) {
            Y.one('#save_and_continue_button').invoke('click');
        }
        // Shift+Alt+F - Go to search field
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_F) {
            setFocus('search_box');
        }
        // Shift+Alt+B - Go to first translation field
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_B) {
            setFocus(fields[0]);
        }
        // Shift+Alt+N - Go to next page in batch
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_N) {
            link = Y.one('#batchnav_next');
            if (link !== null){
                window.location.assign(link.get('href'));
            }
        }
        // Shift+Alt+P - Go to previous page in batch
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_P) {
            link = Y.one('#batchnav_previous');
            if (link !== null){
                window.location.assign(link.get('href'));
            }
        }
        // Shift+Alt+A - Go to first page in batch
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_A) {
            link = Y.one('#batchnav_first');
            if (link !== null){
                window.location.assign(link.get('href'));
            }
        }
        // Shift+Alt+L - Go to last page in batch
        if (e.shiftKey && e.altKey && e.keyCode == KEY_CODE_L) {
            link = Y.one('#batchnav_last');
            if (link !== null){
                window.location.assign(link.get('href'));
            }
        }
    });
};


var initializeSuggestionsKeyBindings = function(stem) {

    suggestions = Y.all('.' + stem.replace(/_new/,"") + ' input');
    suggestions.each(function(node) {
        // Only add keybinding for the first 9 suggestions
        var index = suggestions.indexOf(node);
        if (index < 10) {
            // Shift+Alt+NUMBER - Mark suggestion NUMBER
            Y.on('key', function(e, id) {
                    selectWidgetByID(id);
                },
                '#' + stem, 'down:' + Number(index+49) + '+shift+alt',
                Y, node.get('id'));
        }
    });
};

/*
 * Adapter for calling functions from Y.on().
 * It is used for ignoring the `event` parameter that is passed to all
 * functions called by Y.on().
 */
var on_event_adapter = function(event, method, argument) {
    method(argument);
};

var initializeFieldsKeyBindings = function (fields) {
    for (var key = 0; key < fields.length; key++) {
        var next = key + 1;
        var previous = key - 1;

        // fields[key] has one of the following formats:
        //  * msgset_1_es_translation_0_new
        //  * msgset_2_pt_BR_translation_0_new
        // msgset_id is 'msgset_1' or 'msgset_2'
        // translation_stem has one of the following formats:
        //  * msgset_1_es
        //  * msgset_2_pt_BR
        var html_parts = fields[key].split('_');
        var msgset_id = html_parts[0] + '_' + html_parts[1];
        var translation_stem = fields[key].replace(
            /_translation_(\d)+_new/,"");

        Y.on(
            'change', selectTranslation,
            '#' + fields[key], Y, fields[key]);
        Y.on(
            'keypress', selectTranslation,
            '#' + fields[key], Y, fields[key]);

        // Set next field and copy text for all but last field
        // (last is Save & Continue button)
        if (key < fields.length - 1) {
            // Shift+Alt+J - Go to next translation
            Y.on(
                'key', setNextFocus, '#' + fields[key],
                'down:' + KEY_CODE_J + '+shift+alt', Y, fields[next]);
            // Shift+Alt+KEY_DOWN - Go to next translation
            Y.on(
                'key', setNextFocus, '#' + fields[key],
                'down:' + KEY_CODE_DOWN + '+shift+alt', Y, fields[next]);
            // Shift+Alt+C - Copy original text
            Y.on(
                'key', copyOriginalTextAll, '#' + fields[key],
                'down:' + KEY_CODE_C + '+shift+alt',
                Y, msgset_id, translation_stem);

            // Shift+Alt+R - Toggle someone should review
            Y.on(
                'key', on_event_adapter,
                '#' + fields[key], 'down:' + KEY_CODE_R + '+shift+alt', Y,
                toggleWidget, msgset_id + '_force_suggestion');

            // Shift+Alt+D - Toggle dismiss all translations
            Y.on(
                'key', on_event_adapter,
                '#' + fields[key], 'down:' + KEY_CODE_D + '+shift+alt', Y,
                toggleWidget, msgset_id + '_dismiss');

            // Shift+Alt+0 - Mark current translation
            Y.on(
                'key', on_event_adapter,
                '#' + fields[key], 'down:' + KEY_CODE_0 + '+shift+alt', Y,
                selectWidgetByID,
                fields[key].replace(/_new/, "_radiobutton"));


            initializeSuggestionsKeyBindings(fields[key]);
        }

        // Set previous field for all but first field
        if (key > 0) {
            var parts = fields[previous].split('_');
            var singular_copy_text = (
                parts[0] + '_' + parts[1] + '_singular_copy_text');
            // Shift+Alt+K - Go to previous translation
            Y.on(
                'key', setPreviousFocus, '#' + fields[key],
                'down:' + KEY_CODE_K + '+shift+alt', Y, fields[previous],
                singular_copy_text);
            // Shift+Alt+KEY_UP - Go to previous translation
            Y.on(
                'key', setPreviousFocus, '#' + fields[key],
                'down:' + KEY_CODE_UP + '+shift+alt', Y, fields[previous],
                singular_copy_text);
        }
    }
};


/**
 * Force suggestion and diverge translation checkboxes are mutually excluded.
 * Checking one of them will disable the other.
 * When the dismiss all suggestion checkbox is checked, uncheking the
 * diverte translation checkbox should keep the force suggestion disabled.
 */
var initializeReviewDivergeMutualExclusion = function (fields) {

    // Diverge message field format is 'msgset_ID_diverge'
    // Force suggestion field format is 'msgset_ID_force_suggestion'
    for (var key = 0; key < fields.length; key++) {
        var html_parts = fields[key].split('_');
        var msgset_id = html_parts[0] + '_' + html_parts[1];
        var diverge_id = msgset_id + '_diverge';
        var suggestion_id = msgset_id + '_force_suggestion';
        var diverge_checkbox = Y.one('#' + diverge_id);
        var suggestion_checkbox = Y.one('#' + suggestion_id);

        if (diverge_checkbox === null || suggestion_checkbox === null) {
            break;
        }

        Y.on(
            'click',
            function (e) {
                if (suggestion_checkbox.get('checked') === true) {
                    diverge_checkbox.set('disabled', true);
                } else {
                    diverge_checkbox.set('disabled', false);
                }
            },
            suggestion_checkbox);

        Y.on(
            'click',
            function (e) {
                if (diverge_checkbox.get('checked') === true) {
                    suggestion_checkbox.set('disabled', true);
                } else {
                    // Don't enable the force suggestion checkbox if dismiss
                    // all suggestions is enabled.
                    var dismiss_checkbox = Y.one(
                        '#' + msgset_id + '_dismiss');
                    if (dismiss_checkbox !== null &&
                        dismiss_checkbox.get('checked') === true) {
                        return;
                    }
                    suggestion_checkbox.set('disabled', false);
                }
            },
            diverge_checkbox);
    }
};


/**
 * Initialize event-key bindings such as moving to the next or previous
 * field, or copying original text
 */
var initializeKeyBindings = function(e) {
    if (translations_order.length < 1) {
        // If no translations fiels are displayed on the page
        // don't initialize the translations order
        return;
    }

    var fields = translations_order.split(' ');
    // The last field is Save & Continue button
    fields.push('save_and_continue_button');

    initializeGlobalKeyBindings(fields);
    initializeFieldsKeyBindings(fields);
};

/*
 * Controls the behavior for reseting current translations
 */
var resetTranslation = function (event, translation_id) {
    if (this === null) {
        // Don't do nothing if we don't have a context object.
        return;
    }
    if (this.get('checked') === true) {
        var new_translation_select = Y.one(
            '#' + translation_id + '_select');
        if (new_translation_select !== null) {
            new_translation_select.set('checked', true);
        }
    } else {
        var new_translation_field = Y.one('#' + translation_id);
        if (new_translation_field !== null &&
            new_translation_field.get('value') === '') {
           var current_select_id = translation_id.replace(
               /_new$/, '_radiobutton');
           var current_select = Y.one('#' + current_select_id);
           if (current_select !== null) {
               current_select.set('checked', true);
           }
        }
    }
};


/**
 * Translations can be reset by submitting an empty translations and ticking
 * the 'Someone should review this translation' checkbox.
 * Ticking the 'Someone should review this translation' will automatically
 * select the new empty translation.
 */
var initializeResetBehavior = function (fields) {
    for (var key = 0; key < fields.length; key++) {
        var html_parts = fields[key].split('_');
        var msgset_id = html_parts[0] + '_' + html_parts[1];
        var node = Y.one('#' + msgset_id + '_force_suggestion');
        if (node === null) {
            // If we don't have a force_suggestion checkbox associated with
            // this field, just continue to the next field.
            break;
        }
        Y.on('click', resetTranslation, node , node, fields[key]
        );
    }
};


/**
 * Initialize common Javascript code for POFile and TranslationMessage
 * +translate pages.
 *
 * This will add event-key bindings such as moving to the next or previous
 * field, or copying original text.
 * It will also initializing the reset checkbox behavior and will show the
 * error notifications.
 */
var initializeBaseTranslate = function () {
    try {
      setupSuggestionDismissal();
    } catch (setup_suggestion_dismissal_error) {
      Y.log(setup_suggestion_dismissal_error, "error");
    }

    try {
      initializeKeyBindings();
    } catch (initialize_key_bindings_error) {
      Y.log(initialize_key_bindings_error, "error");
    }

    try {
      var fields = translations_order.split(' ');
      initializeResetBehavior(fields);
    } catch (initialize_reset_behavior_error) {
      Y.log(initialize_reset_behavior_error, "error");
    }

    try {
    initializeWorkingMode();
    } catch (initialize_working_mode_errors) {
      Y.log(initialize_working_mode_errors, "error");
    }

    try {
      setFocus(autofocus_field);
    } catch (set_focus_error) {
      Y.log(set_focus_error, "error");
    }
};


/*
 * Initialize Javascript code for a POFile +translate page.
 */
namespace.initializePOFile = function(e) {
    try {
      updateNotificationBox();
    } catch (update_notification_box_error) {
      Y.log(update_notification_box_error, "error");
    }
    initializeBaseTranslate();
};


/*
 * Initialize Javascript code for a TranslationMessage +translate page.
 */
namespace.initializeTranslationMessage = function(e) {

    try {
        var fields = translations_order.split(' ');
        initializeReviewDivergeMutualExclusion(fields);
    } catch (initialize_review_diverge_mutual_exclusion_error) {
      Y.log(e, "error");
    }

    initializeBaseTranslate();
};

}, "0.1", {"requires": ["event", "event-key", "node", "cookie", "anim"]});

// ../lazr/build/lazr.js
// overlay/overlay-min.js

YUI.add('lazr.overlay',function(Y){var ESCAPE=27,CANCEL='cancel',BOUNDING_BOX='boundingBox',CONTENT_BOX='contentBox',BINDUI="bindUI";var PrettyOverlay=function(){if(arguments[0]&&arguments[0].zIndex===undefined){arguments[0].zIndex=1000;}
PrettyOverlay.superclass.constructor.apply(this,arguments);Y.after(this._bindUIPrettyOverlay,this,BINDUI);};PrettyOverlay.NAME='pretty-overlay';PrettyOverlay.ATTRS={progress:{value:100},progressbar:{value:true},steptitle:{value:null}};Y.extend(PrettyOverlay,Y.Overlay,{_blocking_div:null,_green_bar:null,initializer:function(){this._green_bar=Y.Node.create(['<div class="steps">','<div class="step-on" style="width:20%;">','</div></div>'].join(""));this._blocking_div=Y.Node.create('<div class="blocking-div"></div>');this.after("renderedChange",function(){var bounding_box=this.get(BOUNDING_BOX);var content_box=this.get(CONTENT_BOX);var content_box_container=bounding_box.query(".content_box_container");if(content_box_container){content_box_container.appendChild(content_box);}
this._setupCloseFacilities();});this.after('visibleChange',function(e){this._setupCloseFacilities();});this.publish(CANCEL,{defaultFn:this._defaultCancel});},_afterSteptitleChange:function(e){var progress_bar=this.get(BOUNDING_BOX).query(".steps");if(!progress_bar){return;}
var h2=progress_bar.query("h2");if(!h2){h2=Y.Node.create("<h2></h2>");progress_bar.appendChild(h2);progress_bar.addClass("contains-steptitle");}
while(h2.hasChildNodes()){h2.removeChild(h2.get("firstChild"));}
h2.appendChild(document.createTextNode(this.get("steptitle")));},_afterProgressChange:function(e){var width=parseInt(this.get("progress"),10);if(width<0){width=0;}
if(width>100){width=100;}
if(this.get("progressbar")&&this.get(CONTENT_BOX).query(".steps")){var progress_steps=this.get(CONTENT_BOX).query(".step-on");progress_steps.setStyle("width",width+"%");}},_setupCloseFacilities:function(){var self=this;var visible=this.get('visible');if(visible){Y.get('body').appendChild(this._blocking_div);this._doc_kp_handler=Y.on('key',function(){self.fire(CANCEL);},document,'down:27');}else{this._removeBlockingDiv();}},_removeBlockingDiv:function(){if(this._blocking_div){var blocking_div=Y.get(this._blocking_div);if(blocking_div){var parent=blocking_div.get('parentNode');if(parent){parent.removeChild(this._blocking_div);}}}},destructor:function(){this._removeBlockingDiv();},_bindUIPrettyOverlay:function(){var self=this;var close_button=this.get(BOUNDING_BOX).query('.close a');close_button.on('click',function(e){e.halt();self.fire(CANCEL);});this._blocking_div.on('click',function(e){e.halt();self.fire(CANCEL);});var bounding_box=this.get(BOUNDING_BOX);bounding_box.on('click',function(e){bounding_box.blur();});this.after('steptitleChange',this._afterSteptitleChange);this.after('progressChange',this._afterProgressChange);},_defaultCancel:function(e){this.hide();this._doc_kp_handler.detach();},_insertStdModSection:function(content_box,section,section_node){PrettyOverlay.superclass._insertStdModSection.apply(this,arguments);if(section===Y.WidgetStdMod.HEADER&&this.get("progressbar"))
{var nxt=section_node.next();if(nxt){content_box.insertBefore(this._green_bar,nxt);}else{content_box.appendChild(this._green_bar);}}
this._afterProgressChange();if(this.get('steptitle')){this._afterSteptitleChange();}}});PrettyOverlay.prototype.BOUNDING_TEMPLATE=['<table id="shadow" cellspacing="0" cellpadding="0">','<tbody>','<tr>','<td class="ne">','</td>','<td class="north">','</td>','<td class="nw">','</td>','</tr>','<tr>','<td class="east">','</td>','<td>','<div style="border: 1px solid white" id="yui-pretty-overlay-modal" ',' class="content_box_container">','<div class="close">','<a href="#" title="Close" class="close-button"></a>','<div class="clear"></div>','</div>','</div>','</td>','<td class="west">','</td>','</tr>','<tr>','<td class="se">','</td>','<td class="south">','</td>','<td class="sw">','</td>','</tr>','</tbody>','</table>'].join('');Y.namespace('lazr');Y.lazr.PrettyOverlay=PrettyOverlay;},"0.1",{"skinnable":true,"requires":["oop","overlay","event","widget","widget-stack","widget-position","widget-position-ext"]});
// picker/picker-min.js

YUI.add('lazr.picker',function(Y){var PICKER='picker',BOUNDING_BOX='boundingBox',CONTENT_BOX='contentBox',getCN=Y.ClassNameManager.getClassName,C_SEARCH=getCN(PICKER,'search'),C_SEARCH_BOX=getCN(PICKER,'search-box'),C_SEARCH_SLOT=getCN(PICKER,'search-slot'),C_FOOTER_SLOT=getCN(PICKER,'footer-slot'),C_SEARCH_MODE=getCN(PICKER,'search-mode'),C_RESULTS=getCN(PICKER,'results'),C_RESULT_TITLE=getCN(PICKER,'result-title'),C_RESULT_DESCRIPTION=getCN(PICKER,'result-description'),C_ERROR=getCN(PICKER,'error'),C_ERROR_MODE=getCN(PICKER,'error-mode'),C_NO_RESULTS=getCN(PICKER,'no-results'),C_BATCHES=getCN(PICKER,'batches'),C_SELECTED_BATCH=getCN(PICKER,'selected-batch'),SAVE='save',SEARCH='search',MIN_SEARCH_CHARS='min_search_chars',CURRENT_SEARCH_STRING='current_search_string',ERROR='error',RESULTS='results',BATCHES='batches',BATCH_COUNT='batch_count',SEARCH_SLOT='search_slot',FOOTER_SLOT='footer_slot',SELECTED_BATCH='selected_batch',SEARCH_MODE='search_mode',NO_RESULTS_SEARCH_MESSAGE='no_results_search_message',RENDERUI="renderUI",BINDUI="bindUI",SYNCUI="syncUI";var Picker=function(){Picker.superclass.constructor.apply(this,arguments);Y.after(this._renderUIPicker,this,RENDERUI);Y.after(this._bindUIPicker,this,BINDUI);Y.after(this._syncUIPicker,this,BINDUI);};Y.extend(Picker,Y.lazr.PrettyOverlay,{_search_input:null,_search_button:null,_results_box:null,_search_slot_box:null,_batches_box:null,_prev_button:null,_next_button:null,_error_box:null,initializer:function(cfg){this.publish(SEARCH,{defaultFn:this._defaultSearch});this.publish(SAVE,{defaultFn:this._defaultSave});this.subscribe('cancel',this._defaultCancel);if(this.get('picker_activator')){var element=Y.one(this.get('picker_activator'));element.on('click',function(e){e.halt();this.show();},this);element.addClass(this.get('picker_activator_css_class'));}},_syncSearchSlotUI:function(){var search_slot=this.get(SEARCH_SLOT);this._search_slot_box.set('innerHTML','');if(search_slot!==null){this._search_slot_box.appendChild(search_slot);}},_syncFooterSlotUI:function(){var footer_slot=this.get(FOOTER_SLOT);this._footer_slot_box.set('innerHTML','');if(footer_slot!==null){this._footer_slot_box.appendChild(footer_slot);}},_getBatches:function(){var batches=this.get(BATCHES);if(batches===null){var batch_count=this.get(BATCH_COUNT);if(batch_count===null){batches=[];}
else{batches=[];if(batch_count>1){for(var i=0;i<batch_count;i++){batches.push({value:i,name:i+1});}}}}
return batches;},_syncBatchesUI:function(){var batches=this._getBatches();Y.Event.purgeElement(this._batches_box,true);this._batches_box.set('innerHTML','');if(batches.length===0){this._prev_button=null;this._next_button=null;return;}
this._prev_button=Y.Node.create(Y.lazr.ui.PREVIOUS_BUTTON);this._prev_button.on('click',function(e){var selected=this.get(SELECTED_BATCH)-1;this.set(SELECTED_BATCH,selected);this.fire(SEARCH,this.get(CURRENT_SEARCH_STRING),batches[selected].value);},this);this._batches_box.appendChild(this._prev_button);Y.Array.each(batches,function(data,i){var batch_item=Y.Node.create('<span></span>');batch_item.appendChild(document.createTextNode(data.name));this._batches_box.appendChild(batch_item);batch_item.on('click',function(e){this.set(SELECTED_BATCH,i);this.fire(SEARCH,this.get(CURRENT_SEARCH_STRING),data.value);},this);},this);this._next_button=Y.Node.create(Y.lazr.ui.NEXT_BUTTON);this._batches_box.appendChild(this._next_button);this._next_button.on('click',function(e){var selected=this.get(SELECTED_BATCH)+1;this.set(SELECTED_BATCH,selected);this.fire(SEARCH,this.get(CURRENT_SEARCH_STRING),batches[selected].value);},this);},_syncSelectedBatchUI:function(){var idx=this.get(SELECTED_BATCH);var items=this._batches_box.queryAll('span');if(items.size()){this._prev_button.set('disabled',idx===0);items.removeClass(C_SELECTED_BATCH);items.item(idx).addClass(C_SELECTED_BATCH);this._next_button.set('disabled',idx+1===items.size());}},_syncResultsUI:function(){var results=this.get(RESULTS);Y.Event.purgeElement(this._results_box,true);this._results_box.set('innerHTML','');Y.Array.each(results,function(data,i){var li_title=Y.Node.create('<span></span>').addClass(C_RESULT_TITLE);li_title.appendChild(document.createTextNode(data.title));var li_desc=Y.Node.create('<div><br /></div>').addClass(C_RESULT_DESCRIPTION);if(data.description){li_desc.replaceChild(document.createTextNode(data.description),li_desc.query('br'));}
var li=Y.Node.create('<li></li>').addClass(i%2?Y.lazr.ui.CSS_ODD:Y.lazr.ui.CSS_EVEN);if(data.css){li.addClass(data.css);}
if(data.image){li.appendChild(Y.Node.create('<img />').set('src',data.image));}
li.appendChild(li_title);li.appendChild(li_desc);li.on('click',function(e,value){this.fire(SAVE,value);},this,data);this._results_box.appendChild(li);},this);if(this._search_input.get('value')&&!results.length){var msg=Y.Node.create('<li></li>');msg.appendChild(document.createTextNode(Y.substitute(this.get(NO_RESULTS_SEARCH_MESSAGE),{query:this._search_input.get('value')})));this._results_box.appendChild(msg);this._results_box.addClass(C_NO_RESULTS);}else{this._results_box.removeClass(C_NO_RESULTS);}
if(results.length){this.set('progress',100);}else{this.set('progress',50);}},_syncSearchModeUI:function(){var search_mode=this.get(SEARCH_MODE);this._search_input.set('disabled',search_mode);this._search_button.set('disabled',search_mode);if(search_mode){this.get(BOUNDING_BOX).addClass(C_SEARCH_MODE);}else{this.get(BOUNDING_BOX).removeClass(C_SEARCH_MODE);this._search_input.blur();this._search_input.focus();}},_syncErrorUI:function(){var error=this.get(ERROR);this._error_box.set('innerHTML','');if(error===null){this.get(BOUNDING_BOX).removeClass(C_ERROR_MODE);}else{this._error_box.appendChild(document.createTextNode(error));this.get(BOUNDING_BOX).addClass(C_ERROR_MODE);}},_renderUIPicker:function(){this._search_button=Y.Node.create(Y.lazr.ui.SEARCH_BUTTON);var search_box=Y.Node.create(['<div>','<input type="text" size="20" name="search" ','autocomplete="off"/>','<div></div></div>'].join(""));this._search_input=search_box.query('input');this._search_input.addClass(C_SEARCH);this._error_box=search_box.query('div');this._error_box.addClass(C_ERROR);search_box.insertBefore(this._search_button,this._search_input);search_box.addClass(C_SEARCH_BOX);this._search_slot_box=Y.Node.create('<div></div');this._search_slot_box.addClass(C_SEARCH_SLOT);search_box.appendChild(this._search_slot_box);this._results_box=Y.Node.create('<ul></ul>');this._results_box.addClass(C_RESULTS);this._batches_box=Y.Node.create('<div></div');this._batches_box.addClass(C_BATCHES);this._footer_slot_box=Y.Node.create('<div></div');this._footer_slot_box.addClass(C_FOOTER_SLOT);var body=Y.Node.create('<div></div>');body.appendChild(search_box);body.appendChild(this._batches_box);body.appendChild(this._results_box);body.appendChild(this._footer_slot_box);body.addClass('yui-widget-bd');this.setStdModContent(Y.WidgetStdMod.BODY,body,Y.WidgetStdMod.APPEND);},_bindUIPicker:function(){Y.on('click',this._defaultSearchUserAction,this._search_button,this);Y.on('key',this._defaultSearchUserAction,this._search_input,'down:13',this);this.after('visibleChange',function(e){var change=e.details[0];if(change.newVal===true&&change.prevVal===false){this.set('centered',true);this._search_input.focus();}},this);this.after('resultsChange',function(e){this._syncResultsUI();this.set(SEARCH_MODE,false);},this);this.after('search_slotChange',function(e){this._syncSearchSlotUI();},this);this.after('footer_slotChange',function(e){this._syncFooterSlotUI();},this);var doBatchesChange=function(e){this._syncBatchesUI();this._syncSelectedBatchUI();};this.after('batchesChange',doBatchesChange,this);this.after('resultsChange',doBatchesChange,this);this.after('selected_batchChange',function(e){this._syncSelectedBatchUI();},this);this.after('search_modeChange',function(e){this._syncSearchModeUI();},this);this.after('errorChange',function(e){this._syncErrorUI();});},_syncUIPicker:function(){this._syncResultsUI();this._syncSearchModeUI();this._syncBatchesUI();this._syncSelectedBatchUI();this._syncErrorUI();this._search_input.focus();},_clear:function(){this.set(CURRENT_SEARCH_STRING,'');this.set(ERROR,'');this.set(RESULTS,[{}]);this.set(BATCHES,null);this.set(BATCH_COUNT,null);this._search_input.set('value','');this._results_box.set('innerHTML','');},_defaultSearchUserAction:function(e){e.preventDefault();var search_string=Y.Lang.trim(this._search_input.get('value'));if(search_string.length<this.get(MIN_SEARCH_CHARS)){var msg=Y.substitute("Please enter at least {min} characters.",{min:this.get(MIN_SEARCH_CHARS)});this.set(ERROR,msg);}else{this.set(CURRENT_SEARCH_STRING,search_string);this.fire(SEARCH,search_string);}},_defaultSearch:function(e){this.set(ERROR,null);this.set(SEARCH_MODE,true);},_defaultCancel:function(e){Picker.superclass._defaultCancel.apply(this,arguments);if(this.get('clear_on_cancel')){this._clear();}},_defaultSave:function(e){this.hide();if(this.get('clear_on_save')){this._clear();}},_defaultSelectBatch:function(e){this.set(SEARCH_MODE,true);}});Picker.NAME=PICKER;Picker.SAVE_RESULT=0;Picker.SEARCH_STRING=0;Picker.SELECTED_BATCH_VALUE=1;Picker.ATTRS={clear_on_save:{value:true},clear_on_cancel:{value:false},picker_activator:{value:null},picker_activator_css_class:{value:'js-action'},min_search_chars:{value:3},current_search_string:{value:''},results:{value:[]},search_slot:{value:null},footer_slot:{value:null},batches:{value:null},batch_count:{value:null},selected_batch:{value:0,getter:function(value){return value||0;},validator:function(value){var batches=this._getBatches();return Y.Lang.isNumber(value)&&value>=0&&value<batches.length;}},search_mode:{value:false},error:{value:null},no_results_search_message:{value:'No items matched "{query}".'}};function TextFieldPickerPlugin(config){TextFieldPickerPlugin.superclass.constructor.apply(this,arguments);}
TextFieldPickerPlugin.NAME='TextFieldPickerPlugin';TextFieldPickerPlugin.NS='txtpicker';Y.extend(TextFieldPickerPlugin,Y.Plugin.Base,{initializer:function(config){var input=Y.Node.getDOMNode(Y.one(config.input_element));this.doAfter('save',function(e){result=e.details[Y.lazr.Picker.SAVE_RESULT];input.value=result.value;});this.doAfter('show',function(){if(input.value){this.get('host')._search_input.set('value',input.value);}});}});Y.lazr.Picker=Picker;Y.lazr.TextFieldPickerPlugin=TextFieldPickerPlugin;},"0.1",{"skinnable":true,"requires":["oop","event","event-focus","node","plugin","substitute","widget","widget-stdmod","lazr.overlay","lazr.anim","lazr.base"]});
// activator/activator-min.js

YUI.add('lazr.activator',function(Y){Y.log('loading lazr.activator');var ACTIVATOR='activator',getCN=Y.ClassNameManager.getClassName,MESSAGE_HEADER_TEMPLATE='<div></div>',MESSAGE_BODY_TEMPLATE='<div></div>',MESSAGE_CLOSE_BUTTON_TEMPLATE='<button>Close</button>',ACT='act',C_HIDDEN=getCN(ACTIVATOR,'hidden'),C_ACT=getCN(ACTIVATOR,'act'),C_DATA_BOX=getCN(ACTIVATOR,'data-box'),C_MESSAGE_BOX=getCN(ACTIVATOR,'message-box'),C_MESSAGE_CLOSE=getCN(ACTIVATOR,'message-close'),C_MESSAGE_HEADER=getCN(ACTIVATOR,'message-header'),C_MESSAGE_BODY=getCN(ACTIVATOR,'message-body'),C_PROCESSING=getCN(ACTIVATOR,'processing'),C_CANCEL=getCN(ACTIVATOR,'cancellation'),C_SUCCESS=getCN(ACTIVATOR,'success'),C_FAILURE=getCN(ACTIVATOR,'failure'),ALL_STATUSES=[C_SUCCESS,C_FAILURE,C_CANCEL,C_PROCESSING];var Activator=function(){Activator.superclass.constructor.apply(this,arguments);};Activator.NAME=ACTIVATOR;Activator.ATTRS={};Y.extend(Activator,Y.Widget,{message_box:null,data_box:null,action_element:null,_setStatusClass:function(css_class){Y.Array.each(ALL_STATUSES,function(old_class,i){this.get('contentBox').removeClass(old_class);},this);this.get('contentBox').addClass(css_class);},_renderMessage:function(title,message_node){this.message_box.set('innerHTML','');if(message_node===undefined){this.message_box.addClass(C_HIDDEN);}else{this.message_box.removeClass(C_HIDDEN);var message_close_button=Y.Node.create(MESSAGE_CLOSE_BUTTON_TEMPLATE);message_close_button.addClass(C_MESSAGE_CLOSE);message_close_button.addClass('lazr-btn');message_close_button.on('click',function(e){this.message_box.addClass(C_HIDDEN);},this);var message_header=Y.Node.create(MESSAGE_HEADER_TEMPLATE);message_header.appendChild(message_close_button);message_header.appendChild(Y.Node.create(title));message_header.addClass(C_MESSAGE_HEADER);var message_body=Y.Node.create(MESSAGE_BODY_TEMPLATE);message_body.appendChild(message_node);message_body.addClass(C_MESSAGE_BODY);this.message_box.appendChild(message_header);this.message_box.appendChild(message_body);}},renderSuccess:function(data_node,message_node){if(data_node!==undefined){this.data_box.set('innerHTML','');this.data_box.appendChild(data_node);}
this._setStatusClass(C_SUCCESS);this._renderMessage('Message',message_node);var anim=Y.lazr.anim.green_flash({node:this.get('contentBox')});anim.run();},renderFailure:function(message_node){this._renderMessage('Error',message_node);this._setStatusClass(C_FAILURE);var anim=Y.lazr.anim.red_flash({node:this.get('contentBox')});anim.run();},renderCancellation:function(message_node){this._renderMessage('Message',message_node);this._setStatusClass(C_CANCEL);var anim=Y.lazr.anim.red_flash({node:this.get('contentBox')});anim.run();},renderProcessing:function(message_node){this._renderMessage('Message',message_node);this._setStatusClass(C_PROCESSING);},initializer:function(cfg){this.publish(ACT);if(cfg===undefined||cfg.contentBox===undefined){throw new Error("Missing contentBox argument for Activator.");}
this.message_box=this.get('contentBox').query('.'+C_MESSAGE_BOX);if(this.message_box===null){throw new Error("Can't find element with CSS class "+
C_MESSAGE_BOX+".");}
this.data_box=this.get('contentBox').query('.'+C_DATA_BOX);if(this.data_box===null){throw new Error("Can't find element with CSS class "+
C_DATA_BOX+".");}
this.action_element=this.get('contentBox').query('.'+C_ACT);if(this.action_element===null){throw new Error("Can't find element with CSS class "+
C_ACT+".");}},renderUI:function(){this.action_element.removeClass(C_HIDDEN);this.get('contentBox').prepend('&thinsp;');},bindUI:function(){var activator=this;Y.on('click',function(e){activator.fire(ACT);e.preventDefault();},this.action_element);},syncUI:function(){}});Y.lazr.ui.disableTabIndex(Activator);Y.namespace('lazr.activator');Y.lazr.activator.Activator=Activator;},"0.1",{"skinnable":true,"requires":["oop","event","node","widget","lazr.anim","lazr.base"]});
// error/error-min.js

YUI.add('lazr.error',function(Y){Y.namespace('lazr.error');var BasicErrorWidget=function(){BasicErrorWidget.superclass.constructor.apply(this,arguments);};BasicErrorWidget.NAME='lazr-basic-error-widget';BasicErrorWidget.ERROR_LIST_TEMPLATE='<ul class="errors" />';Y.extend(BasicErrorWidget,Y.lazr.PrettyOverlay,{initializer:function(){this.error_list=[];this.content=null;this.publish('cancel',{defaultFn:function(){this.error_list=[];this._defaultCancel();}});},renderUI:function(){this.content=Y.Node.create('<p>The following errors were encountered:</p>');var error_list_node=Y.Node.create(BasicErrorWidget.ERROR_LIST_TEMPLATE);this.content.appendChild(error_list_node);var dismiss_button=Y.Node.create('<button class="dismiss">Dismiss</button>');this.content.appendChild(dismiss_button);this.setStdModContent(Y.WidgetStdMod.BODY,this.content,Y.WidgetStdMod.REPLACE);},bindUI:function(){var self=this;var dismiss_button=this.content.one('button.dismiss');dismiss_button.on('click',function(e){e.halt();self.fire('cancel');});},syncUI:function(){var new_error_list_node=Y.Node.create(BasicErrorWidget.ERROR_LIST_TEMPLATE);Y.each(this.error_list,function(error_msg){var error_list_item=Y.Node.create("<li />");error_list_item.appendChild(document.createTextNode(error_msg));new_error_list_node.appendChild(error_list_item);});var old_error_list_node=this.content.one('ul.errors');this.content.replaceChild(new_error_list_node,old_error_list_node);},showError:function(error_msg){this.error_list.push(error_msg);this.syncUI();this.show();}});var get_error_widget=function(){if(Y.lazr.error.widget===undefined){Y.lazr.error.widget=new BasicErrorWidget({headerContent:'<h2>Error</h2>',centered:true,visible:false});Y.lazr.error.widget.render();}};var maybe_red_flash=function(flash_node,callback)
{if(flash_node){var anim=Y.lazr.anim.red_flash({node:flash_node});anim.on('end',callback);anim.run();}else{callback();}};var display_error=function(msg,flash_node){get_error_widget();maybe_red_flash(flash_node,function(){Y.lazr.error.widget.showError(msg);});};Y.lazr.error.display_error=display_error;Y.namespace('lazr.error_widgets');Y.lazr.error_widgets.BasicErrorWidget=BasicErrorWidget;},"0.1",{"skinnable":true,"requires":["lazr.overlay"]});
// error/error-widget-minimal-min.js

YUI.add('lazr.error.minimal-error-widget',function(Y){Y.namespace('lazr.error.minimal_error_widget');var CLICK='click',CONTENT_BOX='contentBox',CURRENT='current',CURRENT_ERROR_INDEX='current_error_index',DISMISS_ALL='dismiss_all',NEXT='next',PREV='prev';var MinimalErrorWidget=function(){MinimalErrorWidget.superclass.constructor.apply(this,arguments);};MinimalErrorWidget.NAME='lazr-minimal-error-widget';MinimalErrorWidget.ERROR_LIST_TEMPLATE='<ul class="errors" />';MinimalErrorWidget.ATTRS={current_error_index:{value:0}};Y.extend(MinimalErrorWidget,Y.Widget,{initializer:function(){this.error_list=[];this.publish(DISMISS_ALL,{defaultFn:function(){this.error_list=[];this.set(CURRENT_ERROR_INDEX,0);this.hide();}});this.publish(NEXT,{defaultFn:function(){this._shift_current_error(1);}});this.publish(PREV,{defaultFn:function(){this._shift_current_error(-1);}});},_update_navigation:function(){var content_box=this.get(CONTENT_BOX);content_box.one('span.error-num').set('innerHTML',this.get(CURRENT_ERROR_INDEX)+1);content_box.one('span.error-count').set('innerHTML',this.error_list.length);},_shift_current_error:function(amount){var new_index=this._wrap_index(this.get(CURRENT_ERROR_INDEX)+amount);this.set(CURRENT_ERROR_INDEX,new_index);},_wrap_index:function(new_index){if(new_index>=this.error_list.length){return 0;}
if(new_index<0){return this.error_list.length-1;}
return new_index;},_update_displayed_error:function(){var content_box=this.get(CONTENT_BOX);var error_nodes=content_box.one('div.error-info ul.errors').get('children');error_nodes.removeClass(CURRENT);var error_index=0;var this_widget=this;var current_error_index=this_widget.get(CURRENT_ERROR_INDEX);error_nodes.each(function(error_node){if(error_index==current_error_index){error_node.addClass(CURRENT);}
error_index+=1;});},bindUI:function(){this.after(CURRENT_ERROR_INDEX+'Change',function(){this._update_displayed_error();this._update_navigation();});var self=this;var contentBox=this.get(CONTENT_BOX);contentBox.one('button.dismiss_all').on(CLICK,function(e){e.halt();self.fire(DISMISS_ALL);});contentBox.one('div.error-controls a.next').on(CLICK,function(e){e.halt();self.fire(NEXT);});contentBox.one('div.error-controls a.prev').on(CLICK,function(e){e.halt();self.fire(PREV);});},syncUI:function(){var new_error_list_node=Y.Node.create(MinimalErrorWidget.ERROR_LIST_TEMPLATE);var error_index=0;var this_widget=this;Y.each(this.error_list,function(error_msg){var error_list_item=Y.Node.create("<li />");error_list_item.appendChild(document.createTextNode(error_msg));if(error_index==this_widget.get(CURRENT_ERROR_INDEX)){error_list_item.addClass(CURRENT);}
new_error_list_node.appendChild(error_list_item);error_index+=1;});var content_box=this.get(CONTENT_BOX);var error_info=content_box.one('div.error-info');var old_error_list_node=error_info.one('ul.errors');error_info.replaceChild(new_error_list_node,old_error_list_node);this._update_navigation();},showError:function(error_msg){this.error_list.push(error_msg);this.syncUI();this.show();}});MinimalErrorWidget.prototype.CONTENT_TEMPLATE=['<div>','  <div class="error-controls">','    Viewing <span class="error-num">1</span> of ','    <span class="error-count">1</span>','    <a href="#" class="prev">Prev</a> ','    <a href="#" class="next">Next</a>','    <button class="dismiss_all">Dismiss</button>','  </div>','  <div class="error-info">','  '+MinimalErrorWidget.ERROR_LIST_TEMPLATE,'  </div>','</div>'].join('');Y.lazr.error.minimal_error_widget.MinimalErrorWidget=MinimalErrorWidget;},"0.1",{"skinnable":true,"requires":["oop","event","widget","lazr.error"]});
// autocomplete/autocomplete-min.js

YUI.add('lazr.autocomplete',function(Y){Y.namespace('lazr');var AUTOCOMP='autocomplete',BOUNDING_BOX='boundingBox',CONTENT_BOX='contentBox',INPUT='input',VALUE='value',QUERY='query',DATA='data',MATCHES='matches',RENDERED='rendered',DELIMITER='delimiter',TAB=9,RETURN=13,ESCAPE=27,ARROW_DOWN=40,getCN=Y.ClassNameManager.getClassName,C_LIST=getCN(AUTOCOMP,'list');var AutoCompleteBase=Y.Base.build("AutoCompleteBase",Y.Widget,[Y.WidgetStack]);function AutoComplete(){AutoComplete.superclass.constructor.apply(this,arguments);}
AutoComplete.NAME='autocomplete';AutoComplete.LIST_TEMPLATE='<ul></ul>';AutoComplete.ITEM_TEMPLATE='<li class="item yui-menuitem"></li>';AutoComplete.ITEM_CONTENT_TEMPLATE='<a href="#" class="yui-menuitem-content"></a>';AutoComplete.ATTRS={data:{valueFn:function(){return{};}},delimiter:{value:' '},matches:{valueFn:function(){return[];}},input:{value:null,setter:function(val){return this._setInput(val);}},query:{value:null}};Y.extend(AutoComplete,AutoCompleteBase,{_completions:null,_last_input_was_completed:false,initializer:function(){this.hide();if(Y.UA.opera||Y.UA.ie){this.disable();this.render=function(){};}},destructor:function(){var input=this.get('INPUT');if(input&&this.get(RENDERED)){input.detach('keydown',this._onInputKeydown);input.detach('keyup',this._onInputKeyup);}},renderUI:function(){var input=this.get(INPUT);var bounding_box=this.get(BOUNDING_BOX);bounding_box.addClass("yui-menu");Y.get('body').appendChild(bounding_box);this.get(CONTENT_BOX).setStyle('minWidth',input.get('offsetWidth')+"px").addClass('yui-menu-content');var iregion=input.get('region');bounding_box.setStyles({'left':iregion.left+'px','top':iregion.bottom+'px'});},_renderCompletions:function(query){var matches=this.get(MATCHES);if(!this.get(RENDERED)||!matches){return;}
var list=Y.Node.create(AutoComplete.LIST_TEMPLATE);list.addClass(C_LIST);var result;var item;var match;for(var idx=0;idx<matches.length;idx++){match=matches[idx];result=this.formatResult(match.text,query,match.offset);item=this._renderCompletion(result,idx);list.appendChild(item);}
var cbox=this.get(CONTENT_BOX);this.get(BOUNDING_BOX).unplug(Y.Plugin.NodeMenuNav);if(this._completions){cbox.replaceChild(list,this._completions);}else{cbox.appendChild(list);}
this.get(BOUNDING_BOX).plug(Y.Plugin.NodeMenuNav);this._selectItem(0,false);this._completions=list;},_renderCompletion:function(html_content,item_index){var item=Y.Node.create(AutoComplete.ITEM_TEMPLATE);item.setAttribute('id',this._makeItemID(item_index));var link=Y.Node.create(AutoComplete.ITEM_CONTENT_TEMPLATE);link.set('innerHTML',html_content);item.appendChild(link);return item;},_makeItemID:function(index){return'item'+index;},_indexForItem:function(item){var id=parseInt(item.getAttribute('id').replace('item',''),10);return Y.Lang.isNumber(id)?id:null;},bindUI:function(){var input=this.get(INPUT);input.on('keydown',this._onInputKeydown,this);input.on('keyup',this._onInputKeyup,this);this.get('contentBox').on('click',this._onListClick,this);},parseQuery:function(input,caret_pos){if(caret_pos<=0){return null;}
if(!Y.Lang.isNumber(caret_pos)||(caret_pos>input.length)){caret_pos=input.length;}
var delimiter=this.get(DELIMITER);var start=input.lastIndexOf(delimiter,caret_pos-1);var end=input.indexOf(delimiter,caret_pos-1);if((start==end)&&(start!=-1)){return null;}
if(start==-1){start=0;}else{start++;}
if(end==-1){end=input.length;}
while((input[start]==' '||input[start]=='\t')&&(start<=end))
{start++;}
if(start==end){return null;}
var query={text:input.substring(start,end),offset:start};return query;},findMatches:function(query){var matches=this.filterResults(this.get(DATA),query);this.set(MATCHES,matches);return matches;},filterResults:function(data,query){var midx;var match_key;var match_string;var start_indicies=[];var lowercase_query=query.toLowerCase();if(data){Y.Array.each(data,function(match_key){match_string=match_key.toString();midx=match_string.toLowerCase().indexOf(lowercase_query);if(midx>-1){if(!start_indicies[midx]){start_indicies[midx]=[];}
start_indicies[midx].push(match_string);}});}
var matches=[];var match_set;for(var index=0;index<start_indicies.length;index++){match_set=start_indicies[index];if(match_set){Y.Array.each(match_set,function(match){matches.push({text:match,offset:index});});}}
return matches;},formatResult:function(result,query,offset){return this.markMatchingText(result,query,offset);},markMatchingText:function(text,query,offset){var start=offset;if(start<0||!query){return text;}
var end=start+query.length;var before=text.substring(0,start);var match=text.substring(start,end);var after=text.substring(end);match='<span class="matching-text">'+match+'</span>';return before+match+after;},completeInput:function(){var active_item=this.getActiveItem();if(active_item){var item_index=this._indexForItem(active_item);if(item_index!==null){this.completeInputUsingItem(item_index);}}else{this.completeInputUsingItem(0);}
this.get(INPUT).focus();this._last_input_was_completed=true;},completeInputUsingItem:function(match_num){var matches=this.get(MATCHES);if(matches.length===0){return;}
if(match_num>=matches.length){Y.fail("Failed to complete item number "+match_num+" because there are only "+matches.length+" matches "+"available.");return;}
var completion_txt=matches[match_num].text;var query=this.get(QUERY);var delimiter=this.get(DELIMITER);var input=this.get(INPUT);var input_txt=input.get('value');var query_end=query.offset+query.text.length;var input_head=input_txt.substring(0,query.offset);var input_tail=input_txt.substring(query_end,input_txt.length);var tail_delimiter=delimiter;if(input_tail.charAt(input_tail.length-1)==delimiter){tail_delimiter='';}
var new_input=[input_head,completion_txt,input_tail,tail_delimiter].join('');input.set(VALUE,new_input);this.hide();},getActiveItem:function(){var menu=this.get(BOUNDING_BOX).menuNav;if(menu){return menu._activeItem?menu._activeItem:null;}
return null;},_selectItem:function(index,set_focus){var menu=this.get(BOUNDING_BOX).menuNav;var firstItem=menu._rootMenu.all('.yui-menuitem').item(0)
var item=menu?firstItem:null;if(!menu||!item){return null;}
for(var idx=0;idx<index;idx++){item=item.next();if(!item){return null;}}
if(set_focus){var anchor=item.query('a');menu._focusManager.set("activeDescendant",anchor);menu._focusItem(item);if(anchor){Y.later(5,anchor,anchor.focus);}}
menu._setActiveItem(item);return item;},_setInput:function(elem){var node=Y.get(elem);if(node===null){return null;}
Y.augment(node,Y.lazr.NodeCaretPos);return node;},_onInputKeyup:function(e){var input=this.get(INPUT);var caret_pos=null;if(input.getCaretPos!==undefined){caret_pos=input.getCaretPos();}
var query=this.parseQuery(input.get(VALUE),caret_pos);this.set(QUERY,query);if(e.keyCode===ESCAPE||e.keyCode===RETURN||e.keyCode===TAB||e.keyCode===ARROW_DOWN){return;}
if(query===null){this._last_input_was_completed=false;this.hide();return;}
if(this.findMatches(query.text).length!==0){this._renderCompletions(query.text);this._last_input_was_completed=false;this.show();}else{this.hide();}},_onInputKeydown:function(e){if(e.keyCode===TAB||e.keyCode===RETURN){if(this.get(QUERY)!==null&&!this._last_input_was_completed){this.completeInput();e.preventDefault();}}else if(e.keyCode===ESCAPE){this.hide();}else if(e.keyCode===ARROW_DOWN){this._selectItem(1,true);e.preventDefault();}},_onListClick:function(e){this.completeInput();e.preventDefault();}});Y.lazr.AutoComplete=AutoComplete;Y.lazr.NodeCaretPos=function(){};Y.lazr.NodeCaretPos.prototype.getCaretPos=function(){var elem=Y.Node.getDOMNode(this);if(Y.UA.ie){if(document.selection){var range=document.selection.createRange();range.moveToElementText(elem);return range.text.length;}}else if(typeof elem.selectionEnd!="undefined"){return elem.selectionEnd;}
return null;};},"0.1",{"skinnable":true,"requires":["oop","base","event","widget","widget-stack","node-menunav"]});
// effects/effects-min.js

YUI.add('lazr.effects',function(Y){Y.namespace('lazr.effects');var OPENED='lazr-opened';var CLOSED='lazr-closed';var slide_effect_defaults={easing:Y.Easing.easeOut,duration:0.4};Y.lazr.effects.slide_out=function(node,user_cfg){var cfg=Y.merge(slide_effect_defaults,user_cfg);if(typeof cfg.node=='undefined'){cfg.node=node;}
var node=Y.get(node);if(node===null){Y.fail("A valid node, HTMLElement, or CSS3 selector must be given "+"for the slide_out animation.");return null;}
var default_to_height=function(node){return node.get('scrollHeight');};cfg.from=cfg.from?cfg.from:{};cfg.from.height=cfg.from.height?cfg.from.height:0;cfg.to=cfg.to?cfg.to:{};cfg.to.height=cfg.to.height?cfg.to.height:default_to_height;node.setStyles({height:cfg.from.height,overflow:'hidden',display:'block'});var anim=new Y.Anim(cfg);anim.drawer_closed=true;add_slide_state_events(anim);node.addClass(CLOSED);return anim;};Y.lazr.effects.slide_in=function(node,user_cfg){var cfg=Y.merge(slide_effect_defaults,user_cfg);if(typeof cfg.node=='undefined'){cfg.node=node;}
var node=Y.get(node);if(node===null){Y.fail("A valid node, HTMLElement, or CSS3 selector must be given "+"for the slide_in animation.");return null;}
var default_from_height=node.get('clientHeight');cfg.from=cfg.from?cfg.from:{};cfg.from.height=cfg.from.height?cfg.from.height:default_from_height;cfg.to=cfg.to?cfg.to:{};cfg.to.height=cfg.to.height?cfg.to.height:0;var anim=new Y.Anim(cfg);anim.drawer_closed=false;add_slide_state_events(anim);node.addClass(OPENED);return anim;};function add_slide_state_events(anim){var node=anim.get('node');anim.on('start',function(){if(!this.drawer_closed){node.setStyle('overflow','hidden');}});anim.on('end',function(){if(this.drawer_closed){this.drawer_closed=false;node.setStyle('overflow','visible').addClass(OPENED).removeClass(CLOSED);}else{this.drawer_closed=true;node.addClass(CLOSED).removeClass(OPENED);}});}},null,{"skinnable":true,"requires":["anim","node"]});
// effects/effects-async-min.js

YUI.add('lazr.effects-async',function(Y){Y.namespace('lazr.effects');var effects=Y.lazr.effects;var ui=Y.lazr.ui;var FOLDED='lazr-folded';Y.lazr.effects.async_slideout=function(slider,trigger,uri,container){if(Y.UA.ie){return;}
slider=Y.get(slider);if(typeof slider.content_loaded=='undefined'){slider.content_loaded=false;}
if(typeof container=='undefined'||container===null){container=slider;}
trigger.addClass(FOLDED);trigger.addClass('lazr-trigger');slider.addClass(FOLDED);slider.addClass('lazr-content');trigger.on('click',function(e){e.halt();trigger.toggleClass(FOLDED);container.toggleClass(FOLDED);if(!container.content_loaded){fetch_and_reveal_content(slider,container,uri);container.content_loaded=true;}else{animate_drawer(slider);}});};function animate_drawer(slider){slider.fx.stop();slider.fx.set('reverse',!slider.fx.get("reverse"));slider.fx.run();}
function fetch_and_reveal_content(slider,container,uri){var cfg={on:{complete:function(){ui.clear_waiting(container);},success:function(id,response){container.set('innerHTML',response.responseText);slider.fx.stop();slider.fx=effects.slide_out(slider);slider.fx.run();},failure:function(id,response,args){slider.setStyles({height:'auto',overflow:'visible'});show_nice_error(id,response,args,container,run_io);Y.lazr.anim.red_flash({node:slider}).run();slider.fx.stop();slider.fx=effects.slide_in(slider);slider.fx.set('reverse',!slider.fx.get('reverse'));}}};function run_io(){ui.waiting(container);container.set('innerHTML','');slider.fx=effects.slide_out(slider,{to:{height:'20px'}});slider.fx.run();Y.io(uri,cfg);}
run_io();}
function show_nice_error(id,response,args,message_container,retry_callback){var status_msg='<span class="io-status">'+
response.status+' '+
response.statusText+'</span>';var msg_html=['<div class="lazr-io-error">','<p>Communication with the server failed</p>','<p>The server\'s response was: '+status_msg+'</p>','<button title="Try to contact the server again">Retry</button>','</div>'].join('');message_container.set('innerHTML',msg_html);message_container.query('button').on('click',function(e){e.halt();retry_callback();});}},null,{"requires":["node","event","io-base","lazr.base","lazr.effects","lazr.anim"]});
// actions/actions-min.js

YUI.add('lazr.actions',function(Y){Y.namespace('lazr.actions');var ACTION="action",ACTIONCLASS="Action",ACTIONS="actions",ACTIONS_HELPER="ActionsHelper",ACTIONS_ID="actionsId",ITEM="item",ITEMCLASSNAME="itemClassName",LABEL="label",LAZR_ACTION_DISABLED='lazr-action-disabled',LINK="link",LINKCLASSNAME="linkClassName",PERMISSION="permission",RUNNING="running",TITLE="title";var ActionsHelper=function(config){ActionsHelper.superclass.constructor.apply(this,arguments);};ActionsHelper.NAME=ACTIONS_HELPER;ActionsHelper.ATTRS={actions:{valueFn:function(){return[];}},actionsId:{valueFn:function(){return Y.guid();}},};Y.extend(ActionsHelper,Y.Base,{render:function(node){var doc=Y.config.doc;var actions=this.get(ACTIONS);var actionsId=this.get(ACTIONS_ID);var actionsContainer=Y.one("#"+actionsId);if(actionsContainer){actionsContainer.remove()}else{actionsContainer=new Y.Node.create("<ul id='"+actionsId+"' />");}
if(actions.length){for(var i=0;i<actions.length;i++){var action=actions[i];action.render(actionsContainer);}}
if(actionsContainer!==null){node.appendChild(Y.Node.getDOMNode(actionsContainer));}},});Y.lazr.actions.ActionsHelper=ActionsHelper;var Action=function(config){Action.superclass.constructor.apply(this,arguments);};Action.NAME=ACTIONCLASS;Action.ATTRS={action:{value:null},permission:{value:null},label:{value:null},title:{value:null},itemClassName:{value:null},linkClassName:{value:null},running:{value:false,setter:function(v){return this._updateRunState(v);},getter:function(v){return v;}},item:{valueFn:function(){return this._createItem();}},link:{valueFn:function(){return this._createLink();}}};Y.extend(Action,Y.Base,{_updateRunState:function(isRunning){if(this.get(LINKCLASSNAME)!==null){if(isRunning){this.get(LINK).replaceClass(this.get(LINKCLASSNAME),Y.lazr.ui.CSS_WAITING);}else{this.get(LINK).replaceClass(Y.lazr.ui.CSS_WAITING,this.get(LINKCLASSNAME));}}
return isRunning;},_createLink:function(){var label=this.get(LABEL);var title=this.get(TITLE);var linkClassName=this.get(LINKCLASSNAME);var link=Y.Node.create("<a href='#' alt='"+title+"' title='"+title+"'></a>");link.on("click",this.actionRunner,this);if(label!==null){link.append(Y.Node.create(label));}
if(linkClassName!==null){link.addClass(linkClassName);}
return link;},_createItem:function(){var itemClassName=this.get(ITEMCLASSNAME);var link=this.get(LINK);var item=Y.Node.create('<li/>');if(itemClassName!==null){item.addClass(itemClassName);}
item.append(link);return item;},render:function(node){var item=this.get(ITEM);var permission=this.get(PERMISSION);if(permission&&!permission()){item.addClass(LAZR_ACTION_DISABLED);}else{item.removeClass(LAZR_ACTION_DISABLED);}
node.append(item);},actionRunner:function(){if(!this.get(RUNNING)){this.get(ACTION)();}}});Y.lazr.actions.Action=Action;},"0.1.",{"requires":["oop","base","node","lazr.base"]});
// choiceedit/choiceedit-min.js

YUI.add('lazr.choiceedit',function(Y){var CHOICESOURCE='ichoicesource',CHOICELIST='ichoicelist',NULLCHOICESOURCE='inullchoicesource',C_EDITICON='editicon',C_VALUELOCATION='value',C_NULLTEXTLOCATION='nulltext',C_ADDICON='addicon',SAVE='save',LEFT_MOUSE_BUTTON=1,RENDERUI="renderUI",BINDUI="bindUI",SYNCUI="syncUI",NOTHING=new Object();var ChoiceSource=function(){ChoiceSource.superclass.constructor.apply(this,arguments);Y.after(this._bindUIChoiceSource,this,BINDUI);Y.after(this._syncUIChoiceSource,this,SYNCUI);};ChoiceSource.NAME=CHOICESOURCE;ChoiceSource.HTML_PARSER={value_location:'.'+C_VALUELOCATION,editicon:'.'+C_EDITICON};ChoiceSource.ATTRS={items:{value:[]},value:{value:null},title:{value:""},value_location:{value:null,setter:function(v){return Y.get(v);}},editicon:{value:null,setter:function(v){return Y.get(v);}},actionicon:{getter:function(){return this.get('editicon');}},elementToFlash:{value:null,setter:function(v){return Y.get(v);}},backgroundColor:{value:null},clickable_content:{value:true}};Y.extend(ChoiceSource,Y.Widget,{initializer:function(cfg){this.publish(SAVE);var editicon=this.get('editicon');editicon.original_src=editicon.get("src")},_bindUIChoiceSource:function(){var that=this;if(this.get('clickable_content')){var clickable_element=this.get('contentBox');}else{var clickable_element=this.get('editicon');}
clickable_element.on("click",this.onClick,this);this.after("valueChange",function(e){this.syncUI();this._showSucceeded();});},_syncUIChoiceSource:function(){var items=this.get("items");var value=this.get("value");var node=this.get("value_location");for(var i=0;i<items.length;i++){if(items[i].value==value){node.set("innerHTML",items[i].source_name||items[i].name);}}},_chosen_value:NOTHING,getInput:function(){if(this._chosen_value!==NOTHING){return this._chosen_value;}else{return this.get("value");}},onClick:function(e){if(e.button!=LEFT_MOUSE_BUTTON){return;}
this._choice_list=new Y.ChoiceList({value:this.get("value"),title:this.get("title"),items:this.get("items"),value_location:this.get("value_location"),progressbar:false});var that=this;this._choice_list.on("valueChosen",function(e){that._chosen_value=e.details[0];that._saveData(e.details[0]);});this._choice_list._mouseX=e.clientX+window.pageXOffset;this._choice_list._mouseY=e.clientY+window.pageYOffset;this._choice_list.render();e.halt();},_saveData:function(newvalue){this.set("value",newvalue);this.fire(SAVE);},_showSucceeded:function(){this._uiAnimateFlash(Y.lazr.anim.green_flash);},_showFailed:function(){this._uiAnimateFlash(Y.lazr.anim.red_flash);},_uiAnimateFlash:function(flash_fn){var node=this.get('elementToFlash');if(node===null){node=this.get('contentBox');}
var cfg={node:node};if(this.get('backgroundColor')!==null){cfg.to={backgroundColor:this.get('backgroundColor')};}
var anim=flash_fn(cfg);anim.run();},_uiSetWaiting:function(){var actionicon=this.get("actionicon");actionicon.original_src=actionicon.get("src");actionicon.set("src","https://launchpad.net/@@/spinner");},_uiClearWaiting:function(){var actionicon=this.get("actionicon");actionicon.set("src",actionicon.original_src);}});Y.ChoiceSource=ChoiceSource;var ChoiceList=function(){ChoiceList.superclass.constructor.apply(this,arguments);};ChoiceList.NAME=CHOICELIST;ChoiceList.ATTRS={items:{value:[]},value:{value:null},title:{value:""},value_location:{value:null},display_items_list:{value:null}};Y.extend(ChoiceList,Y.lazr.PrettyOverlay,{initializer:function(cfg){this.publish("valueChosen");this.after("renderedChange",this._positionCorrectly);Y.after(this._renderUIChoiceList,this,RENDERUI);Y.after(this._bindUIChoiceList,this,BINDUI);},_renderUIChoiceList:function(){this.set("align",{node:this.get("value_location"),points:[Y.WidgetPositionExt.TL,Y.WidgetPositionExt.TL]});this.set("headerContent","<h2>"+this.get("title")+"</h2>");this.set("display_items_list",Y.Node.create("<ul>"));var display_items_list=this.get("display_items_list");var items=this.get("items");var value=this.get("value");var li;for(var i=0;i<items.length;i++){if(items[i].disabled){li=Y.Node.create('<li><span class="disabled">'+
items[i].name+'</span></li>');}else if(items[i].value==value){li=Y.Node.create('<li><span class="current">'+
items[i].name+'</span></li>');}else{li=Y.Node.create('<li><a href="#'+items[i].value+'">'+items[i].name+'</a></li>');li.query('a')._value=items[i].value;}
if(items[i].css_class!==undefined){li.addClass(items[i].css_class);}else{li.addClass('unstyled');}
display_items_list.appendChild(li);}
this.setStdModContent(Y.WidgetStdMod.BODY,display_items_list,Y.WidgetStdMod.REPLACE);this.move(-10000,0);},_bindUIChoiceList:function(){var display_items_list=this.get("display_items_list");var that=this;Y.delegate("click",function(e){var target=e.currentTarget;var value=target._value;var items=that.get("items");for(var i=0;i<items.length;i++){if(items[i].value==value){that.fire("valueChosen",items[i].value);that.destroy();e.halt();break;}}},display_items_list,"li a");},destructor:function(){var bb=this.get("boundingBox");var parent=bb.get("parentNode");if(parent){parent.removeChild(bb);}},_positionCorrectly:function(e){var boundingBox=this.get('boundingBox');var selectedListItem=boundingBox.query('span.current');valueX=this._mouseX-(boundingBox.get('offsetWidth')/2);var valueY;if(Y.Lang.isValue(selectedListItem)){valueY=(this._mouseY-
this.get("headerContent").get('offsetHeight')-
selectedListItem.get('offsetTop')-
(selectedListItem.get('offsetHeight')/2));}else{valueY=this._mouseY-(boundingBox.get('offsetHeight')/2);}
if(valueX<0){valueX=0;}
if(valueY<0){valueY=0;}
this.move(valueX,valueY);var bb=this.get('boundingBox');bb.on('focus',function(e){bb.query('.close-button').focus();});bb.query('.close-button').focus();},_findPosition:function(obj){var curleft=0,curtop=0;if(obj.get("offsetParent")){do{curleft+=obj.get("offsetLeft");curtop+=obj.get("offsetTop");}while(obj=obj.get("offsetParent"));}
return[curleft,curtop];}});Y.augment(ChoiceList,Y.Event.Target);Y.ChoiceList=ChoiceList;var NullChoiceSource=function(){NullChoiceSource.superclass.constructor.apply(this,arguments);};NullChoiceSource.NAME=NULLCHOICESOURCE;NullChoiceSource.HTML_PARSER={value_location:'.'+C_VALUELOCATION,editicon:'.'+C_EDITICON,null_text_location:'.'+C_NULLTEXTLOCATION,addicon:'.'+C_ADDICON};NullChoiceSource.ATTRS={null_text_location:{},addicon:{},actionicon:{getter:function(){if(Y.Lang.isValue(this.get('value'))){return this.get('editicon');}else{return this.get('addicon');}}},items:{value:[],getter:function(v){if(!Y.Lang.isValue(this.get("value"))){v=Y.Array(v).filter(function(item){return(Y.Lang.isValue(item.value));});}
for(var i=0;i<v.length;i++){if(!Y.Lang.isValue(v[i].value)){v[i].name=['<img src="https://launchpad.net/@@/remove" ','     style="margin-right: 0.5em; border: none; ','            vertical-align: middle" />','<span style="text-decoration: underline; ','             display: inline;','             color: green;">',v[i].name,'</span>'].join('');}}
return v;},clone:"deep"}}
Y.extend(NullChoiceSource,ChoiceSource,{initializer:function(cfg){var addicon=this.get('addicon');addicon.original_src=addicon.get("src")
var old_uiClearWaiting=this._uiClearWaiting;this._uiClearWaiting=function(){old_uiClearWaiting.call(this);if(Y.Lang.isValue(this.get('value'))){this.get('null_text_location').setStyle('display','none');this.get('addicon').setStyle('display','none');this.get('value_location').setStyle('display','inline');this.get('editicon').setStyle('display','inline');}else{this.get('null_text_location').setStyle('display','inline');this.get('addicon').setStyle('display','inline');this.get('value_location').setStyle('display','none');this.get('editicon').setStyle('display','none');}}},});Y.NullChoiceSource=NullChoiceSource;},"0.2",{"skinnable":true,"requires":["oop","event","event-delegate","node","widget","widget-stdmod","overlay","lazr.overlay","lazr.anim","lazr.base"]});
// inlineedit/editor-min.js

YUI.add('lazr.editor',function(Y){var EDITOR='ieditor',BOUNDING_BOX='boundingBox',CONTENT_BOX='contentBox',INPUT_EL='input_field',ERROR_MSG='error_message',HIDDEN='hidden',VALUE='value',INITIAL_VALUE_OVERRIDE='initial_value_override',SIZE='size',IN_ERROR='in_error',RENDERED='rendered',CLICK='click',ACCEPT_EMPTY='accept_empty',MULTILINE='multiline',SCROLLBAR_LEGROOM=30,MULTILINE_MIN_LINES=2,TOP_BUTTONS='top_buttons',BOTTOM_BUTTONS='bottom_buttons',BUTTONS='buttons',B_TOP='top',B_BOTTOM='bottom',B_BOTH='both',LOADING='loading',createNode=Y.Node.create,getCN=Y.ClassNameManager.getClassName,C_INPUT=getCN(EDITOR,'input'),C_SUBMIT=getCN(EDITOR,'submit_button'),C_CANCEL=getCN(EDITOR,'cancel_button'),C_BTNBOX=getCN(EDITOR,'btns'),C_MULTILINE=getCN(EDITOR,'multiline'),C_SINGLELINE=getCN(EDITOR,'singleline'),C_WAITING=getCN(EDITOR,'waiting'),C_ERROR=getCN(EDITOR,'errors'),C_IN_ERROR=getCN(EDITOR,'in-error'),C_ERROR_HIDDEN=getCN(EDITOR,'errors',HIDDEN),SAVE='save',CANCEL='cancel',SHRINK='shrink',RESIZED='resized';var strip_px=/px$/;var InlineEditor=function(){InlineEditor.superclass.constructor.apply(this,arguments);};InlineEditor.NAME=EDITOR;InlineEditor.HTML_PARSER={error_message:'.'+C_ERROR};InlineEditor.SUBMIT_TEMPLATE=Y.lazr.ui.OK_BUTTON;InlineEditor.CANCEL_TEMPLATE=Y.lazr.ui.CANCEL_BUTTON;InlineEditor.INPUT_TEMPLATE="<textarea></textarea>";InlineEditor.ATTRS={accept_empty:{value:false},multiline:{value:false},input_field:{value:null},submit_button:{value:null,setter:function(v){return this._setNode(v);}},cancel_button:{value:null,setter:function(v){return this._setNode(v);}},top_buttons:{value:null,setter:function(v){return this._setNode(v);}},bottom_buttons:{value:null,setter:function(v){return this._setNode(v);}},error_message:{value:null,setter:function(v){return this._setNode(v);}},value:{value:'',validator:function(v){return v!==null;}},initial_value_override:{value:null},in_error:{value:false},size:{value:null,validator:function(v){return this._validateSize(v);}},buttons:{value:B_BOTH,validator:function(v){return(v==B_TOP||v==B_BOTTOM||v==B_BOTH);}}};Y.extend(InlineEditor,Y.Widget,{_setNode:function(v){return v?Y.get(v):null;},validate:function(val){if(!this.get(ACCEPT_EMPTY)&&val===''){this.showError("Empty input is unacceptable!");return false;}
if(this.get(ACCEPT_EMPTY)&&val===''){return true;}
return!!val;},save:function(){var input=Y.Lang.trim(this.getInput());if(this.validate(input)){this.clearErrors();this._saveData(input);}},_saveData:function(data){this.set(VALUE,data);this.fire(SAVE);},cancel:function(){this.fire(CANCEL);},_recordInitialSize:function(){if(this.alter_ego&&!this.initial_scroll_width){var text=this.alter_ego.get(VALUE);this.alter_ego.set(VALUE,'');var width=this.alter_ego.get('scrollWidth');if(width>0){this.initial_scroll_width=width;this.initial_scroll_height=this.alter_ego.get('scrollHeight');}
this.alter_ego.set(VALUE,text);}},_forgetInitialSize:function(){this.initial_scroll_width=undefined;this.initial_scroll_height=undefined;},_windowResize:function(e){if(this.get('visible')){this._forgetInitialSize();this.updateSize(false);}},_onChange:function(e){this.updateSize(true);},_resized:function(){this.fire(RESIZED);},_shrink:function(){var anim=new Y.Anim({node:this.get(INPUT_EL),to:{height:this._target_height},duration:0.1});anim.on('end',Y.bind(this._resized,this));anim.run();},_updateNow:function(){this.updateSize(false);},updateSize:function(animate){this._recordInitialSize();var input=this.get(INPUT_EL);this.alter_ego.set(VALUE,input.get(VALUE));var new_height=this.alter_ego.get('scrollHeight');if(new_height===0){return;}
if(input.get('scrollWidth')>this.initial_scroll_width){new_height+=SCROLLBAR_LEGROOM;input.setStyle('overflow','auto');}else{input.setStyle('overflow',HIDDEN);}
if(this.get(MULTILINE)){var min_height=this.initial_scroll_height*MULTILINE_MIN_LINES;if(new_height<min_height){new_height=min_height;}
var box_width=this.get(BOUNDING_BOX).get('offsetWidth');var new_width=box_width-25;input.setStyle('width',new_width+'px');}
this._target_height=new_height;current_height=input.getStyle('height').replace(strip_px,'');if(animate&&(new_height<current_height)){this._shrink();}else if(new_height!=current_height){input.setStyle('height',new_height+'px');this._resized();}},_defaultCancel:function(e){this.reset();},reset:function(){this.setInput(this.get(VALUE));this.clearErrors();},focus:function(){this.get(INPUT_EL).focus();},showError:function(msg){this.get(ERROR_MSG).set('innerHTML',msg);this.set(IN_ERROR,true);this.get(INPUT_EL).focus();},clearErrors:function(){this.set(IN_ERROR,false);},hasErrors:function(){return this.get(IN_ERROR);},initializer:function(cfg){this.publish(SAVE);this.publish(CANCEL,{defaultFn:this._defaultCancel});this.publish(RESIZED);},_removeElement:function(content_box,element){if(element){content_box.removeChild(element);}},destructor:function(){var box=this.get(CONTENT_BOX);this._removeElement(box,this.get(ERROR_MSG));this._removeElement(box,this.get(TOP_BUTTONS));this._removeElement(box,this.get(BOTTOM_BUTTONS));},_renderSingleLineButtons:function(parent){var button_box=createNode('<span></span>').addClass(C_BTNBOX);this._renderOKCancel(button_box);parent.appendChild(button_box);this.set(BOTTOM_BUTTONS,button_box);},_renderTopButtons:function(parent){var button_bar=createNode('<div></div>').addClass(C_BTNBOX);var label=button_bar.appendChild(createNode('<div class="bg-top-label">&nbsp;</div>'));this._renderOKCancel(label);parent.appendChild(button_bar);this.set(TOP_BUTTONS,button_bar);},_renderBottomButtons:function(parent){var button_bar=createNode('<div></div>').addClass(C_BTNBOX);var label=button_bar.appendChild(createNode('<div class="bg-bottom-label">&nbsp</div>'));this._renderOKCancel(label);parent.appendChild(button_bar);this.set(BOTTOM_BUTTONS,button_bar);},_renderOKCancel:function(parent){var ok=createNode(InlineEditor.SUBMIT_TEMPLATE).addClass(C_SUBMIT);var cancel=createNode(InlineEditor.CANCEL_TEMPLATE).addClass(C_CANCEL);parent.appendChild(cancel);parent.appendChild(ok);},renderUI:function(){var bounding_box=this.get(BOUNDING_BOX);var content=this.get(CONTENT_BOX);var multiline=this.get(MULTILINE);var buttons;if(multiline){buttons=this.get(BUTTONS);}
if(multiline){if(buttons==B_TOP||buttons==B_BOTH){this._renderTopButtons(content);}}
this._initInput();if(multiline){if(buttons==B_BOTTOM||buttons==B_BOTH){this._renderBottomButtons(content);}
bounding_box.addClass(C_MULTILINE);}else{this._renderSingleLineButtons(content);bounding_box.addClass(C_SINGLELINE);}
this._initErrorMsg();},_makeInputBox:function(){var box=createNode(InlineEditor.INPUT_TEMPLATE),size=this.get(SIZE);if(size){if(Y.Lang.isNumber(size)){size=size+'ex';}
box.setStyle('width',size);}
box.setStyle('height','1em');box.setStyle('overflow',HIDDEN);box.addClass(C_INPUT);this.get(CONTENT_BOX).appendChild(box);return box;},_initInput:function(){if(!this.get(INPUT_EL)){this.set(INPUT_EL,this._makeInputBox());this.alter_ego=this._makeInputBox();this.alter_ego.setStyles({'visibility':HIDDEN,'position':'absolute','left':'-1000px'});}},_initErrorMsg:function(){var cb=this.get(CONTENT_BOX),msg=this.get(ERROR_MSG);if(!msg){msg=cb.appendChild(createNode('<div/>'));this.set(ERROR_MSG,msg);}else if(!cb.contains(msg)){cb.appendChild(msg);}
msg.addClass(C_ERROR);msg.addClass(C_ERROR_HIDDEN);},bindUI:function(){this.after('in_errorChange',this._afterInErrorChange);this._bindButtons(C_SUBMIT,function(e){e.preventDefault();if(this.get(MULTILINE)){this.get(TOP_BUTTONS).query('.'+C_SUBMIT).setStyle('display','none');this.get(TOP_BUTTONS).query('.'+C_CANCEL).setStyle('display','none');var span=Y.Node.create('<span></span>');span.addClass(LOADING);e.target.get('parentNode').appendChild(span);}
this.save();});this._bindButtons(C_CANCEL,function(e){e.preventDefault();this.cancel();});if(!this.get(MULTILINE)){Y.on('key',this.save,this.get(INPUT_EL),'down:13',this);}
Y.on('key',this.cancel,this.get(INPUT_EL),'down:27',this);this.get(INPUT_EL).on('focus',Y.bind(this._updateNow,this));var change_handler=Y.bind(this._onChange,this);Y.on('keyup',change_handler,this.get(INPUT_EL),Y,this);Y.on('keypress',change_handler,this.get(INPUT_EL),Y,this);Y.on('cut',change_handler,this.get(INPUT_EL),Y,this);Y.on('paste',change_handler,this.get(INPUT_EL),Y,this);this._original_show=this.show;this.show=this._extendedShow;this._original_hide=this.hide;this.hide=this._extendedHide;},_bindButtons:function(button_class,method){var box=this.get(CONTENT_BOX);box.queryAll('.'+button_class).on(CLICK,Y.bind(method,this));},_extendedShow:function(){if(!this._resize_handler){this._resize_handler=Y.on('resize',Y.bind(this._windowResize,this),Y.get(window),Y);}
this._forgetInitialSize();return this._original_show.apply(this,arguments[0]);},_extendedHide:function(){if(this._resize_handler){this._resize_handler.detach();this._resize_handler=null;}
return this._original_hide.apply(this,arguments[0]);},syncUI:function(){var value=this.get(INITIAL_VALUE_OVERRIDE);if(value===null||value===undefined){value=this.get(VALUE);}
if(value!==null&&value!==undefined){this.setInput(value);}},getInput:function(){return this.get(INPUT_EL).get(VALUE);},setInput:function(value){this.get(INPUT_EL).set(VALUE,value);this.updateSize(false);},_afterInErrorChange:function(e){this._uiShowErrorMsg(e.newVal);},_uiShowErrorMsg:function(show){var emsg=this.get(ERROR_MSG),cb=this.get(CONTENT_BOX);if(show){emsg.removeClass(C_ERROR_HIDDEN);cb.addClass(C_IN_ERROR);}else{emsg.addClass(C_ERROR_HIDDEN);cb.removeClass(C_IN_ERROR);}},_uiSetWaiting:function(){this.get(INPUT_EL).set('disabled',true);this.get(BOUNDING_BOX).addClass(C_WAITING);},_uiClearWaiting:function(){this.get(INPUT_EL).set('disabled',false);this.get(BOUNDING_BOX).removeClass(C_WAITING);},_validateSize:function(val){if(Y.Lang.isNumber(val)){return(val>=0);}
return(val===null);}});Y.lazr.ui.disableTabIndex(InlineEditor);Y.InlineEditor=InlineEditor;var ETEXT='editable_text',TEXT='text',TRIGGER='trigger',C_TEXT=getCN(ETEXT,TEXT),C_TRIGGER=getCN(ETEXT,TRIGGER),C_EDIT_MODE=getCN(ETEXT,'edit_mode');var EditableText=function(){EditableText.superclass.constructor.apply(this,arguments);};EditableText.NAME=ETEXT;EditableText.ATTRS={trigger:{setter:function(node){if(this.get(RENDERED)){this._bindTrigger(node);}
return node;}},text:{setter:function(v){return Y.Node.get(v);},validator:function(v){return Y.Node.get(v);}},value:{getter:function(){var text_node=this.get(TEXT);var ptags=text_node.queryAll('p');if(Y.Lang.isValue(ptags)&&ptags.size()){var lines=[];ptags.each(function(ptag){lines=lines.concat([ptag.get('text'),'\n\n']);});return lines.join("");}else{return this.get(TEXT).get('text');}},readOnly:true},accept_empty:{value:false,getter:function(){if(this.editor){return this.editor.get(ACCEPT_EMPTY);}}}};EditableText.HTML_PARSER={trigger:'.'+C_TRIGGER,text:'.'+C_TEXT};Y.extend(EditableText,Y.Widget,{_click_handler:null,editor:null,_editor_bb:null,_triggerEdit:function(e){e.preventDefault();this.show_editor();var cancel=this._editor_bb.query('.yui-ieditor-cancel_button');var anim=new Y.Anim({node:cancel,easing:Y.Easing.easeOut,duration:0.2,from:{left:0},to:{left:-7}});var self=this;anim.on('end',function(e){self.editor.focus();});anim.run();},show_editor:function(){this.get(BOUNDING_BOX).addClass(C_EDIT_MODE);this.editor.set(VALUE,this.get(VALUE));this.editor.syncUI();this.editor.show();this.editor.focus();},hide_editor:function(){var box=this.get(BOUNDING_BOX);box.removeClass(C_EDIT_MODE);this.editor.hide();},_uiAnimateSave:function(){this._uiAnimateFlash(Y.lazr.anim.green_flash);},_uiAnimateCancel:function(){this._uiAnimateFlash(Y.lazr.anim.red_flash);},_uiAnimateFlash:function(flash_fn){var anim=flash_fn({node:this.get(TEXT)});anim.run();},initializer:function(cfg){this.editor=cfg.editor?cfg.editor:this._makeEditor(cfg);this.editor.hide();this.editor.render(this.get(CONTENT_BOX));this.editor.addTarget(this);this.after('accept_emptyChange',this._afterAcceptEmptyChange);this.on('render',this._onRender);},destructor:function(){var cb=this.get(CONTENT_BOX);if(this._click_handler){this._click_handler.detach();}
this.editor.destroy();if(this._editor_bb){cb.removeChild(this._editor_bb);}},_onRender:function(e){if(Y.UA.webkit===1){e.preventDefault();}
if(Y.UA.ie){e.preventDefault();}},_makeEditor:function(cfg){var editor_cfg=Y.merge(cfg,{value:this.get(VALUE)});delete editor_cfg.boundingBox;delete editor_cfg.contentBox;var editor=new InlineEditor(editor_cfg);this._editor_bb=editor.get(BOUNDING_BOX);return editor;},renderUI:function(){this.get(TEXT).addClass(C_TEXT);this.get(TRIGGER).addClass(C_TRIGGER);},bindUI:function(){this.editor.after('ieditor:save',this._afterSave,this);this.after('ieditor:cancel',this._afterCancel);this._bindTrigger(this.get(TRIGGER));if(this.editor.get(MULTILINE)){var trigger=this.get(TRIGGER);var edit_controls=trigger.get('parentNode');if(Y.Lang.isValue(edit_controls)){var edit_text=this.get(TEXT);var control_hover_class='edit-controls-hover';var text_hover_class=C_TEXT+'-hover';edit_controls.on('mouseover',function(e){edit_controls.addClass(control_hover_class);edit_text.addClass(text_hover_class);});edit_controls.on('mouseout',function(e){edit_controls.removeClass(control_hover_class);edit_text.removeClass(text_hover_class);});}}},syncUI:function(){if(this.get(RENDERED)){var text=this.get(TEXT),val=this.editor.get(VALUE);text.set('innerHTML','');if(this.editor.get(MULTILINE)){text.set('innerHTML',val);}else{text.appendChild(document.createTextNode(val));}}
this.fire('rendered');},_bindTrigger:function(node){if(this._click_handler){this._click_handler.detach();}
this._click_handler=node.on('click',this._triggerEdit,this);},_afterSave:function(e){if(this.editor.get(MULTILINE)){var spinner=this.editor.get(TOP_BUTTONS).query('.'+LOADING);var parent=spinner.get('parentNode');parent.removeChild(spinner);this.editor.get(TOP_BUTTONS).query('.'+C_SUBMIT).setStyle('display','inline');this.editor.get(TOP_BUTTONS).query('.'+C_CANCEL).setStyle('display','inline');}
this.syncUI();this.hide_editor();this._uiAnimateSave();this.editor.set(INITIAL_VALUE_OVERRIDE,null);},_afterCancel:function(e){this.hide_editor();this._uiAnimateCancel();},_afterAcceptEmptyChange:function(e){this.editor.set(ACCEPT_EMPTY,e.newVal);},renderer:function(){if(this.editor.get(MULTILINE)&&(Y.UA.ie||Y.UA.opera)){return;}
this.renderUI();this.bindUI();this.syncUI();}});Y.lazr.ui.disableTabIndex(EditableText);Y.EditableText=EditableText;},"0.2",{"skinnable":true,"requires":["oop","anim","event","node","widget","lazr.anim","lazr.base"]});
// formoverlay/formoverlay-min.js

YUI.add('lazr.formoverlay',function(Y){var getCN=Y.ClassNameManager.getClassName,NAME='lazr-formoverlay',CONTENT_BOX='contentBox',RENDERUI="renderUI",BINDUI="bindUI";function FormOverlay(config){FormOverlay.superclass.constructor.apply(this,arguments);Y.after(this._renderUIFormOverlay,this,RENDERUI);Y.after(this._bindUIFormOverlay,this,BINDUI);}
FormOverlay.NAME=NAME;FormOverlay.C_FORM_HEADER=getCN(NAME,'form-header');FormOverlay.C_FORM=getCN(NAME,'form');FormOverlay.C_CANCEL=getCN(NAME,'cancel');FormOverlay.C_ERRORS=getCN(NAME,'errors');FormOverlay.C_ACTIONS=getCN(NAME,'actions');FormOverlay.FORM_HEADER_TEMPLATE='<div class="'+FormOverlay.C_FORM_HEADER+'" />';FormOverlay.FORM_TEMPLATE='<form class="'+FormOverlay.C_FORM+'" />';FormOverlay.SUBMIT_TEMPLATE='<input type="submit" value="Submit" />';FormOverlay.CANCEL_TEMPLATE='<button type="button"'+'class="'+FormOverlay.C_CANCEL+'">Cancel</button>';FormOverlay.ERROR_TEMPLATE='<div class="'+FormOverlay.C_ERRORS+'" />';FormOverlay.ATTRS={form_header:{value:''},form_content:{value:''},form_submit_button:{value:null},form_cancel_button:{value:null},form_submit_callback:{value:null}};Y.extend(FormOverlay,Y.lazr.PrettyOverlay,{_renderUIFormOverlay:function(){this.form_header_node=Y.Node.create(FormOverlay.FORM_HEADER_TEMPLATE);this.form_node=Y.Node.create(FormOverlay.FORM_TEMPLATE);if(this.get("form_submit_button")===null){this.set("form_submit_button",Y.Node.create(FormOverlay.SUBMIT_TEMPLATE));}
if(this.get("form_cancel_button")===null){this.set("form_cancel_button",Y.Node.create(FormOverlay.CANCEL_TEMPLATE));}
this.error_node=Y.Node.create(FormOverlay.ERROR_TEMPLATE);this._setFormContent();},_bindUIFormOverlay:function(){Y.on("submit",Y.bind(this._onFormSubmit,this),this.form_node);Y.on("click",Y.bind(function(e){this.hide();},this),this.get("form_cancel_button"));this.on("visibleChange",function(e){if(e.newVal){if(this.get('centered')){this.centered();}
var form_elem=Y.Node.getDOMNode(this.form_node);if(form_elem.elements.length>0){Y.get(form_elem.elements[0]).focus();}}});},_setFormContent:function(){this.form_header_node.set('innerHTML',this.get('form_header'));var form_content=this.get('form_content');if(form_content instanceof Y.Node){this.form_node.appendChild(form_content);}else{this.form_node.set("innerHTML",form_content);}
this.form_node.appendChild(this.error_node);var wrapper_div=Y.Node.create('<div/>');wrapper_div.addClass(FormOverlay.C_ACTIONS);wrapper_div.appendChild(this.get("form_submit_button"));wrapper_div.appendChild(this.get("form_cancel_button"));this.form_node.appendChild(wrapper_div);var body_node=Y.Node.create('<div/>');body_node.appendChild(this.form_header_node);body_node.appendChild(this.form_node);this.setStdModContent(Y.WidgetStdMod.BODY,body_node,Y.WidgetStdMod.REPLACE);},_onFormSubmit:function(e){this.clearError();var submit_callback=this.get("form_submit_callback");if(submit_callback){e.halt(true);var data=this.getFormData();submit_callback(data);}},getFormData:function(){var data={};var addData=function(key,value){if(data[key]===undefined){data[key]=[value];}else{data[key].push(value);}};var getOptionValue=function(option){if(option.attributes.value&&option.attributes.value.specified){return option.value;}else{return option.text;}};var select_idx;var num_options;var option;var option_value;var form_elem=Y.Node.getDOMNode(this.form_node);var elem_idx;var num_elems;for(elem_idx=0,num_elems=form_elem.elements.length;elem_idx<num_elems;++elem_idx){var elem=form_elem.elements[elem_idx];if(elem.name&&!elem.disabled){switch(elem.type){case'select-one':if(elem.selectedIndex>-1){option=elem.options[elem.selectedIndex];addData(elem.name,getOptionValue(option));}
break;case'select-multiple':if(elem.selectedIndex>-1){for(select_idx=elem.selectedIndex,num_options=elem.options.length;select_idx<num_options;++select_idx){option=elem.options[select_idx];if(option.selected){addData(elem.name,getOptionValue(option));}}}
break;case'radio':case'checkbox':if(elem.checked){addData(elem.name,elem.value);}
break;case'file':case undefined:case'reset':case'button':break;case'submit':break;default:addData(elem.name,elem.value);}}}
return data;},showError:function(error_msgs){if(typeof(error_msgs)=="string"){error_msgs=[error_msgs];}
var error_html="The following errors were encountered: <ul>";Y.each(error_msgs,function(error_msg){error_html+="<li>"+error_msg.replace(/<([^>]+)>/g,'')+"</li>";});error_html+="</ul>";this.error_node.set('innerHTML',error_html);},clearError:function(){this.error_node.set('innerHTML','');},loadFormContentAndRender:function(url,io_provider){if(io_provider===undefined){io_provider=Y;}
function on_success(id,response,overlay){overlay.set('form_content',response.responseText);overlay.renderUI();overlay.bindUI();}
function on_failure(id,response,overlay){overlay.set('form_content',"Sorry, an error occurred while loading the form.");overlay.renderUI();}
var cfg={on:{success:on_success,failure:on_failure},arguments:this}
io_provider.io(url,cfg);}});Y.lazr.FormOverlay=FormOverlay;},"0.1",{"skinnable":true,"requires":["lazr.overlay"]});
// lazr/lazr-min.js

YUI.add('lazr.base',function(Y){var UI=Y.namespace('lazr.ui');var LAZR='lazr';var getCN=Y.ClassNameManager.getClassName;UI.OK_BUTTON='<button type="button" class="lazr-pos lazr-btn">Ok</button>';UI.CANCEL_BUTTON='<button type="button" class="lazr-neg lazr-btn">Cancel</button>';UI.SEARCH_BUTTON='<button type="button" class="lazr-search lazr-btn">Search</button>';UI.PREVIOUS_BUTTON='<button type="button" class="lazr-prev lazr-btn">Previous</button>';UI.NEXT_BUTTON='<button type="button" class="lazr-next lazr-btn">Next</button>';UI.CSS_EVEN=getCN(LAZR,'even');UI.CSS_ODD=getCN(LAZR,'odd');UI.disableTabIndex=function(widget_class){if(widget_class===undefined){throw"disableTabIndex() must be called after ATTRS "+"is set on the widget.";}
widget_class.ATTRS.tabIndex={readOnly:true,value:-1};};UI.CSS_WAITING='lazr-waiting';UI.waiting=function(node){node.addClass(UI.CSS_WAITING);};UI.clear_waiting=function(node){node.removeClass(UI.CSS_WAITING);};},"0.1",{"skinnable":true,"requires":["classnamemanager"]});
// anim/anim-min.js

YUI.add('lazr.anim',function(Y){Y.namespace('lazr.anim');Y.lazr.anim.flash_in=function(cfg){var acfg=Y.merge(Y.lazr.anim.flash_in.defaults,cfg);var anim=new Y.lazr.anim.Anim(acfg);return anim;};Y.lazr.anim.flash_in.defaults={duration:1,easing:Y.Easing.easeIn,from:{backgroundColor:'#FFFF00'},to:{backgroundColor:'#FFFFFF'}};Y.lazr.anim.green_flash=function(cfg){return Y.lazr.anim.flash_in(Y.merge(Y.lazr.anim.green_flash.defaults,cfg));};Y.lazr.anim.green_flash.defaults={from:{backgroundColor:'#90EE90'}};Y.lazr.anim.red_flash=function(cfg){return Y.lazr.anim.flash_in(Y.merge(Y.lazr.anim.red_flash.defaults,cfg));};Y.lazr.anim.red_flash.defaults={from:{backgroundColor:'#FF6666'}};var resolveNodeListFrom=function(protonode){if(typeof protonode==='string'){return Y.all(protonode);}else if(protonode._node!==undefined){return new Y.NodeList([protonode]);}else if(protonode._nodes!==undefined){return protonode;}
throw('Not a selector, Node, or NodeList');};Anim=function(cfg){var nodelist=resolveNodeListFrom(cfg.node);this._anims=[];var self=this;var config=cfg;Y.each(nodelist,function(n){var ncfg=Y.merge(config,{node:n});var anim=new Y.Anim(ncfg);var to=ncfg.to;if(to&&typeof to.backgroundColor==='function'){var bg=to.backgroundColor.call(anim,anim.get('node'));if(bg=='transparent'){Y.error("Can not animate to a 'transparent' background "+"in '"+anim+"'");}}
var original_bg=null;anim.on('start',function(){original_bg=anim.get('node').getStyle('backgroundColor');});anim.on('end',function(){anim.get('node').setStyle('backgroundColor',original_bg);});self._anims.push(anim);});};Anim.prototype={run:function(){Y.each(this._anims,function(n){n.run();});},on:function(){var args=arguments;Y.each(this._anims,function(n){n.on.apply(n,args);});}};Y.lazr.anim.Anim=Anim;Y.lazr.anim.resolveNodeListFrom=resolveNodeListFrom;},"0.1",{"requires":["base","node","anim"]});

// lp/lp-mochi-min.js

function getContentArea(){var node=document.getElementById('maincontent');if(!node){node=$('content');}
if(!node){node=$('mainarea');}
return node;}
function toggleCollapsible(e){var node=this;while(node.nodeName.toLowerCase()!='legend'){node=node.parentNode;if(!node){return false;}}
var icon=node.firstChild.firstChild;var legend=node;if(icon.getAttribute('src').indexOf('/@@/treeCollapsed')!=-1){icon.setAttribute('src','/@@/treeExpanded');swapElementClass(legend.parentNode.lastChild,'collapsed','expanded');swapElementClass(legend.parentNode.childNodes[1],'expanded','collapsed');}else{icon.setAttribute('src','/@@/treeCollapsed');swapElementClass(legend.parentNode.lastChild,'expanded','collapsed');swapElementClass(legend.parentNode.childNodes[1],'collapsed','expanded');}
return false;}
function activateCollapsibles(){if(!document.getElementsByTagName){return false;}
if(!document.getElementById){return false;}
var contentarea=getContentArea();if(!contentarea){return false;}
var collapsibles=contentarea.getElementsByTagName('fieldset');for(var i=0;i<collapsibles.length;i++){if(collapsibles[i].className.indexOf('collapsible')==-1){continue;}
var legends=collapsibles[i].getElementsByTagName('LEGEND');if(!legends.length){continue;}
var legend=legends[0];var anchor=document.createElement('a');anchor.href='#';anchor.onclick=toggleCollapsible;var icon=document.createElement('img');icon.setAttribute('src','/@@/treeExpanded');icon.setAttribute('class','collapseIcon');icon.setAttribute('height','14');icon.setAttribute('width','14');anchor.appendChild(icon);var span=document.createElement('span');while(legend.hasChildNodes()){var child=legend.firstChild;legend.removeChild(child);span.appendChild(child);}
anchor.appendChild(span);legend.appendChild(anchor);var hiderWrapper=document.createElement('div');hiderWrapper.setAttribute('class','collapseWrapper');var collapsedDescription=document.createElement('div');collapsedDescription.setAttribute('class','collapsedText');collapsedDescription.style.display='none';if(collapsibles[i].className.indexOf('collapsed')!=-1){icon.setAttribute('src','/@@/treeCollapsed');collapsedDescription.style.display='block';setElementClass(hiderWrapper,'collapsed');removeElementClass(collapsibles[i],'collapsed');}
var nl=collapsibles[i].childNodes.length;for(var j=0;j<nl;j++){var node=collapsibles[i].childNodes[0];if(node.nodeName=='LEGEND'){if(collapsibles[i].childNodes.length>1){hiderWrapper.appendChild(collapsibles[i].childNodes[1]);}}else{hiderWrapper.appendChild(collapsibles[i].childNodes[0]);}}
collapsibles[i].appendChild(hiderWrapper);collapsibles[i].insertBefore(collapsedDescription,hiderWrapper);}}
function toggleFoldable(e){var ELEMENT_NODE=1;var node=this;while(node.nextSibling){node=node.nextSibling;if(node.nodeType!=ELEMENT_NODE){continue;}
if(node.className.indexOf('foldable')==-1){continue;}
if(node.style.display=='none'){node.style.display='inline';}else{node.style.display='none';}}}
function activateFoldables(){var included=getElementsByTagAndClassName('span','foldable',document);var quoted=getElementsByTagAndClassName('span','foldable-quoted',document);var elements=concat(included,quoted);for(var i=0;i<elements.length;i++){var span=elements[i];if(span.className=='foldable-quoted'){var quoted_lines=span.getElementsByTagName('br');if(quoted_lines&&quoted_lines.length<=11){continue;}}
var ellipsis=document.createElement('a');ellipsis.style.textDecoration='underline';ellipsis.href=VOID_URL;ellipsis.onclick=toggleFoldable;ellipsis.appendChild(document.createTextNode('[...]'));span.parentNode.insertBefore(ellipsis,span);span.insertBefore(document.createElement('br'),span.firstChild);span.style.display='none';if(span.nextSibling){var br=document.createElement('br');span.parentNode.insertBefore(br,span.nextSibling);}}}
function convertTextInputToTextArea(text_input_id,rows){var current_text_input=getElement(text_input_id);var new_text_area=document.createElement("textarea");var attributes={'id':text_input_id,'rows':rows,'name':getNodeAttribute(current_text_input,'name'),'lang':getNodeAttribute(current_text_input,'lang'),'dir':getNodeAttribute(current_text_input,'dir')};updateNodeAttributes(new_text_area,attributes);new_text_area.setAttribute('onKeyPress',getNodeAttribute(current_text_input,'onkeypress'));new_text_area.setAttribute('onChange',getNodeAttribute(current_text_input,'onchange'));new_text_area.value=current_text_input.value;swapDOM(current_text_input,new_text_area);return new_text_area;}
function upgradeToTextAreaForTranslation(text_input_id){var rows=6;var current_text_input=$(text_input_id);var text_area=convertTextInputToTextArea(text_input_id,rows);text_area.focus();}
function insertExpansionButton(expandable_field){var button=createDOM('button',{'style':'padding: 0;','title':'Makes the field larger, so you can see more text.'});var icon=createDOM('img',{'alt':'Enlarge Field','src':'/+icing/translations-add-more-lines.gif'});appendChildNodes(button,icon);function buttonOnClick(e){upgradeToTextAreaForTranslation(expandable_field.id);e.preventDefault();removeElement(button);return false;}
connect(button,'onclick',buttonOnClick);insertSiblingNodesAfter(expandable_field,button);}
function insertAllExpansionButtons(){var expandable_fields=getElementsByTagAndClassName('input','expandable');forEach(expandable_fields,insertExpansionButton);}
function copyInnerHTMLById(from_id,to_id){var from=getElement(from_id);var to=getElement(to_id);to.value=unescapeHTML(from.innerHTML.replace(/<\/?[^>]+>/gi,""));}
function writeTextIntoPluralTranslationFields(from_id,to_id_pattern,nplurals){for(var x=1;x<nplurals;x++){var to_id=to_id_pattern+x+"_new";var to_select=to_id_pattern+x+"_new_select";copyInnerHTMLById(from_id,to_id);document.getElementById(to_select).checked=true;}}
function activateConstrainBugExpiration(){var bug_tracker_input=getElement('field.bugtracker.0');if(!bug_tracker_input){bug_tracker_input=getElement('field.official_malone');}
var bug_expiration_input=getElement('field.enable_bug_expiration');if(!bug_tracker_input||!bug_expiration_input){return;}
if(!bug_tracker_input.checked){bug_expiration_input.disabled=true;}
constraint=function(e){if(bug_tracker_input.checked){bug_expiration_input.disabled=false;bug_expiration_input.checked=true;}else{bug_expiration_input.checked=false;bug_expiration_input.disabled=true;}};var inputs=document.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].name=='field.bugtracker'||inputs[i].name=='field.official_malone'){inputs[i].onclick=constraint;}}}
function collapseRemoteCommentReply(comment_index){var prefix='remote_comment_reply_';$(prefix+'tree_icon_'+comment_index).src='/@@/treeCollapsed';$(prefix+'div_'+comment_index).style.display='none';}
function expandRemoteCommentReply(comment_index){var prefix='remote_comment_reply_';$(prefix+'tree_icon_'+comment_index).src='/@@/treeExpanded';$(prefix+'div_'+comment_index).style.display='block';}
function toggleRemoteCommentReply(comment_index){var imgname=$('remote_comment_reply_tree_icon_'+comment_index).src.split('/').pop();var expanded=(imgname=='treeExpanded');if(expanded){collapseRemoteCommentReply(comment_index);}else{expandRemoteCommentReply(comment_index);}}
function connectRemoteCommentReply(comment_index){YUI().use('event',function(Y){var toggleFunc=function(){toggleRemoteCommentReply(comment_index);return false;};var prefix='remote_comment_reply_expand_link_';Y.on('load',function(e){$(prefix+comment_index).onclick=toggleFunc;},window);});}
function unescapeHTML(unescaped_string){var div=document.createElement('div');div.innerHTML=unescaped_string;return div.childNodes[0]?div.childNodes[0].nodeValue:'';}
// lp/comment-min.js

YUI.add('lp.comment',function(Y){Y.lp=Y.namespace('lp');var Comment=function(){Comment.superclass.constructor.apply(this,arguments);};Comment.NAME='comment';Comment.ATTRS={};Y.extend(Comment,Y.Widget,{initializer:function(){this.submit_button=this.get_submit();this.comment_input=Y.one('[id="field.comment"]');this.lp_client=new LP.client.QuickBuild();this.error_handler=new LP.client.ErrorHandler();this.error_handler.clearProgressUI=bind(this.clearProgressUI,this);this.error_handler.showError=bind(function(error_msg){Y.lp.display_error(this.submit_button,error_msg);},this);this.progress_message=Y.Node.create('<span class="update-in-progress-message">Saving...</span>');},get_submit:function(){return Y.one('[id="field.actions.save"]');},renderUI:function(){this.submit_button.addClass('js-action');this.submit_button.setStyle('display','inline');},validate:function(){return trim(this.comment_input.get('value'))!=='';},set_disabled:function(disabled){this.comment_input.set('disabled',disabled);},add_comment:function(e){e.halt();if(!this.validate()){return;}
this.activateProgressUI('Saving...');this.post_comment(bind(function(message_entry){this.get_comment_HTML(message_entry,bind(this.insert_comment_HTML,this));this._add_comment_success();},this));},_add_comment_success:function(){},post_comment:function(callback){var config={on:{success:callback,failure:this.error_handler.getFailureHandler()},parameters:{content:this.comment_input.get('value')}};this.lp_client.named_post(LP.client.cache.bug.self_link,'newMessage',config);},get_comment_HTML:function(message_entry,callback){var config={on:{success:callback},accept:LP.client.XHTML};this.lp_client.get(message_entry.get('self_link'),config);},insert_comment_HTML:function(message_html){var fieldset=Y.one('#add-comment-form');var comment=Y.Node.create(message_html);fieldset.get('parentNode').insertBefore(comment,fieldset);this.reset_contents();Y.lazr.anim.green_flash({node:comment}).run();},reset_contents:function(){this.clearProgressUI();this.comment_input.set('value','');this.syncUI();},activateProgressUI:function(message){this.progress_message.set('innerHTML',message);this.set_disabled(true);this.submit_button.get('parentNode').replaceChild(this.progress_message,this.submit_button);},clearProgressUI:function(){this.progress_message.get('parentNode').replaceChild(this.submit_button,this.progress_message);this.set_disabled(false);},bindUI:function(){this.comment_input.on('keyup',bind(this.syncUI,this));this.comment_input.on('mouseup',bind(this.syncUI,this));this.submit_button.on('click',bind(this.add_comment,this));},syncUI:function(){this.submit_button.set('disabled',!this.validate());}});Y.lp.Comment=Comment;var CodeReviewComment=function(){CodeReviewComment.superclass.constructor.apply(this,arguments);};CodeReviewComment.NAME='codereviewcomment';Y.extend(CodeReviewComment,Comment,{initializer:function(){this.vote_input=Y.one('[id="field.vote"]');this.review_type=Y.one('[id="field.review_type"]');this.in_reply_to=null;},get_submit:function(){return Y.one('[id="field.actions.add"]');},get_vote:function(){var selected_idx=this.vote_input.get('selectedIndex');var selected=this.vote_input.get('options').item(selected_idx);if(selected.get('value')===''){return null;}
return selected.get('innerHTML');},validate:function(){if(this.get_vote()!==null){return true;}
return CodeReviewComment.superclass.validate.apply(this);},set_disabled:function(disabled){CodeReviewComment.superclass.set_disabled.call(this,disabled);this.vote_input.set('disabled',disabled);this.review_type.set('disabled',disabled);},post_comment:function(callback){var config={on:{success:callback,failure:this.error_handler.getFailureHandler()},parameters:{content:this.comment_input.get('value'),subject:'',review_type:this.review_type.get('value'),vote:this.get_vote()}};if(this.in_reply_to!==null){config.parameters.parent=this.in_reply_to.get('self_link');}
this.lp_client.named_post(LP.client.cache.context.self_link,'createComment',config);},get_comment_HTML:function(comment_entry,callback){fragment_url='comments/'+comment_entry.get('id')+'/+fragment';Y.io(fragment_url,{on:{success:function(id,response){callback(response.responseText);},failure:this.error_handler.getFailureHandler()}});},reply_clicked:function(e){e.halt();var reply_link=LP.client.normalize_uri(e.target.get('href'));var root_url=reply_link.substr(0,reply_link.length-'+reply'.length);var object_url='/api/devel'+root_url;this.activateProgressUI('Loading...');window.scrollTo(0,Y.one('#add-comment').getY());this.lp_client.get(object_url,{on:{success:bind(function(comment){this.set_in_reply_to(comment);this.clearProgressUI();this.syncUI();},this),failure:this.error_handler.getFailureHandler()}});},set_in_reply_to:function(comment){this.in_reply_to=comment;this.comment_input.set('value',comment.get('as_quoted_email'));},reset_contents:function(){this.review_type.set('value','');this.vote_input.set('selectedIndex',0);this.in_reply_to=null;CodeReviewComment.superclass.reset_contents.apply(this);},insert_comment_HTML:function(message_html){var conversation=Y.one('[id=conversation]');var comment=Y.Node.create(message_html);conversation.appendChild(comment);this.reset_contents();Y.lazr.anim.green_flash({node:comment}).run();},renderUI:function(){CodeReviewComment.superclass.renderUI.apply(this);},bindUI:function(){CodeReviewComment.superclass.bindUI.apply(this);this.vote_input.on('keyup',bind(this.syncUI,this));this.vote_input.on('mouseup',bind(this.syncUI,this));this.review_type.on('keyup',bind(this.syncUI,this));this.review_type.on('mouseup',bind(this.syncUI,this));Y.all('a.menu-link-reply').on('click',bind(this.reply_clicked,this));},syncUI:function(){CodeReviewComment.superclass.syncUI.apply(this);var review_type_disabled=(this.get_vote()===null);this.review_type.set('disabled',review_type_disabled);},_add_comment_success:function(){var VOTES_TABLE_PATH='+votes';Y.io(VOTES_TABLE_PATH,{on:{success:function(id,response){var target=Y.one('#votes-target');target.set('innerHTML',response.responseText);var username=LP.client.links.me.substring(2);var new_reviewer=Y.one('#review-'+username);if(Y.lang.isValue(new_reviewer)){var anim=Y.lazr.anim.green_flash({node:new_reviewer});anim.run();}},failure:function(){}}});}});Y.lp.CodeReviewComment=CodeReviewComment;},"0.1",{"requires":["oop","io","widget","node","lp.client.plugins","lp.errors"]});
// lp/dragscroll-min.js

YUI.add('lp.dragscroll',function(Y){var module=Y.namespace('lp.dragscroll');module.DragScrollEventHandler=function(){this.dragging=false;this.last_position=null;this.event_listeners=[];};module.DragScrollEventHandler.prototype={activate:function(){this._addEventListener("mousedown",this._startDragScroll);this._addEventListener("mouseup",this._stopDragScroll);this._addEventListener("mouseout",this._stopDragScroll);this._addEventListener("mousemove",this._dragScroll);this._setGrabCursor();},deactivate:function(){document.removeEventListener("mousedown",this._startDragScroll,false);this._removeEventListeners();this._unsetCursor();},_addEventListener:function(event_type,action){var self=this;var event_listener=function(e){action.call(self,e);};var event_args=[event_type,event_listener,false];this.event_listeners.push(event_args);document.addEventListener.apply(document,event_args);},_removeEventListeners:function(){for(var i=0;i<this.event_listeners.length;i++){var event_args=this.event_listeners[i];document.removeEventListener.apply(document,event_args);}},_unsetCursor:function(){document.body.style.cursor='';},_setGrabCursor:function(){document.body.style.cursor='move';document.body.style.cursor='grab';document.body.style.cursor='-moz-grab';document.body.style.cursor='-webkit-grab';},_setGrabbingCursor:function(){document.body.style.cursor='grabbing';document.body.style.cursor='-moz-grabbing';document.body.style.cursor='-webkit-grabbing';},_startDragScroll:function(e){if(e.button===0){this.dragging=true;this.last_position=e;this._setGrabbingCursor();}
e.preventDefault();e.stopPropagation();},_stopDragScroll:function(e){this.dragging=false;this._setGrabCursor();e.preventDefault();e.stopPropagation();},_dragScroll:function(e){if(this.dragging){window.scrollBy(this.last_position.clientX-e.clientX,this.last_position.clientY-e.clientY);this.last_position=e;e.preventDefault();e.stopPropagation();}}};},"0.1",{"requires":[]});
// lp/picker-min.js

YUI.add('lp.picker',function(Y){Y.log('loading lp.picker');var module=Y.namespace('lp.picker');var BATCH_SIZE=6;var MAX_BATCHES=20;module.addPickerPatcher=function(vocabulary,resource_uri,attribute_name,content_box_id,show_remove_button,show_assign_me_button,config){if(Y.UA.ie){return;}
if(config!==undefined){var remove_button_text='Remove';if(config.remove_button_text){remove_button_text=config.remove_button_text;}
var null_display_value='None';if(config.null_display_value){null_display_value=config.null_display_value;}}
var content_box=Y.one('#'+content_box_id);var activator=new Y.lazr.activator.Activator({contentBox:content_box});var failure_handler=function(xid,response,args){activator.renderFailure(Y.Node.create('<div>'+response.statusText+'<pre>'+response.responseText+'</pre>'+'</div>'));};var show_hide_buttons=function(){var link=content_box.one('.yui-activator-data-box a');if(remove_button){if(link===null||!show_remove_button){remove_button.addClass('yui-picker-hidden');}else{remove_button.removeClass('yui-picker-hidden');}}
if(assign_me_button){if(link!==null&&link.get('href').indexOf(LP.client.links.me+'/')!=-1){assign_me_button.addClass('yui-picker-hidden');}else{assign_me_button.removeClass('yui-picker-hidden');}}};var save=function(picker_result){activator.renderProcessing();var success_handler=function(entry){var success_message_node=null;var xhtml=Y.Node.create(entry);var current_field=null;xhtml.all('dl *').each(function(element){if(element.get('tagName')=='DT'){current_field=element.get('innerHTML');}else if(element.get('tagName')=='DD'){if(current_field==attribute_name){success_message_node=element.one('span');}else if(current_field=='self_link'){picker._resource_uri=element.get('innerHTML');}}});activator.renderSuccess(success_message_node);show_hide_buttons();};var patch_payload={};patch_payload[attribute_name]=LP.client.get_absolute_uri(picker_result.api_uri);var client=new LP.client.QuickBuild();client.patch(picker._resource_uri,patch_payload,{accept:'application/xhtml+xml',on:{success:success_handler,failure:failure_handler}});};var assign_me=function(){picker.hide();save({image:'/@@/person',title:'Me',api_uri:LP.client.links.me});};var remove=function(){picker.hide();activator.renderProcessing();var success_handler=function(entry){activator.renderSuccess(Y.Node.create(null_display_value));show_hide_buttons();};var patch_payload={};patch_payload[attribute_name]=null;var client=new LP.client.QuickBuild();client.patch(picker._resource_uri,patch_payload,{on:{success:success_handler,failure:failure_handler}});};config.save=save;var picker=module.create(vocabulary,config);picker._resource_uri=resource_uri;var extra_buttons=Y.Node.create('<div style="text-align: center; height: 3em; '+'white-space: nowrap"/>');var remove_button,assign_me_button;if(show_remove_button){remove_button=Y.Node.create('<a class="yui-picker-remove-button bg-image" '+'href="javascript:void(0)" '+'style="background-image: url(/@@/remove); padding-right: 1em">'+
remove_button_text+'</a>');remove_button.on('click',remove);extra_buttons.appendChild(remove_button);}
if(show_assign_me_button){assign_me_button=Y.Node.create('<a class="yui-picker-assign-me-button bg-image" '+'href="javascript:void(0)" '+'style="background-image: url(/@@/person)">'+'Assign Me</a>');assign_me_button.on('click',assign_me);extra_buttons.appendChild(assign_me_button);}
picker.set('footer_slot',extra_buttons);activator.subscribe('act',function(e){picker.show();});activator.render();show_hide_buttons();return picker;};module.create=function(vocabulary,config){if(Y.UA.ie){return;}
if(config!==undefined){var header='Choose an item.';if(config.header!==undefined){header=config.header;}
var step_title="Enter search terms";if(config.step_title!==undefined){step_title=config.step_title;}}
if(typeof vocabulary!='string'){throw new TypeError("vocabulary argument for Y.lp.picker.create() must be a "+"string: "+vocabulary);}
var new_config=Y.merge(config,{align:{points:[Y.WidgetPositionExt.CC,Y.WidgetPositionExt.CC]},progressbar:true,progress:100,headerContent:"<h2>"+header+"</h2>",steptitle:step_title,zIndex:1000,visible:false});var picker=new Y.lazr.Picker(new_config);picker.subscribe('save',function(e){Y.log('Got save event.');if(Y.Lang.isFunction(config.save)){config.save(e.details[Y.lazr.Picker.SAVE_RESULT]);}});picker.subscribe('cancel',function(e){Y.log('Got cancel event.');});var search_handler=function(e){Y.log('Got search event:'+Y.dump(e.details));var search_text=e.details[0];var selected_batch=e.details[1]||0;var start=BATCH_SIZE*selected_batch;var client=new LP.client.QuickBuild();var success_handler=function(ignore,response,args){var entry=Y.JSON.parse(response.responseText);var total_size=entry.total_size;var start=entry.start;var results=entry.entries;if(total_size>(MAX_BATCHES*BATCH_SIZE)){picker.set('error','Too many matches. Please try to narrow your search.');picker.set('results',[{}]);picker.set('batches',[]);}else{picker.set('results',results);if(e.details[1]===undefined){var batches=[];var stop=Math.ceil(total_size/BATCH_SIZE);if(stop>1){for(var i=0;i<stop;i++){batches.push({name:i+1,value:i});}}
picker.set('batches',batches);}}};var qs='';qs=LP.client.append_qs(qs,'name',vocabulary);qs=LP.client.append_qs(qs,'search_text',search_text);qs=LP.client.append_qs(qs,'batch',BATCH_SIZE);qs=LP.client.append_qs(qs,'start',start);var uri='@@+huge-vocabulary?'+qs;Y.io(uri,{headers:{'Accept':'application/json'},timeout:20000,on:{success:success_handler,failure:function(arg){picker.set('error','Loading results failed.');picker.set('search_mode',false);Y.log("Loading "+uri+" failed.");}}});};picker.after('search',search_handler);picker.render();picker.hide();return picker;};},"0.1",{"requires":["io","dom","dump","lazr.picker","lazr.activator","json-parse","lp.client.helpers"]});
// lp/mapping-min.js

YUI.add('lp.mapping',function(Y){var module=Y.namespace('lp.mapping');module.RETURN_FALSE=function(){return false;};module.RETURN_NULL=function(){return null;};var gBrowserIsCompatible=module.RETURN_FALSE;var gDownloadUrl=module.RETURN_NULL;module.has_gmaps=(typeof(GBrowserIsCompatible)=='function');if(module.has_gmaps){gBrowserIsCompatible=GBrowserIsCompatible;gDownloadUrl=GDownloadUrl;}
module.setMarkersInfoWindow=function(data,map,required_bounds,limit){var xml=GXml.parse(data);var markers=xml.documentElement.getElementsByTagName("participant");var participant=null;function attrToProp(attr){participant[attr.name]=attr.value;}
limit=typeof(limit)=='number'?limit:markers.length;if(markers.length<limit){limit=markers.length;}
for(var i=0;i<limit;i++){participant={};Y.Array.each(markers[i].attributes,attrToProp);var point=new GLatLng(parseFloat(participant.lat),parseFloat(participant.lng));if(required_bounds){required_bounds.extend(point);}
var marker=new GMarker(point);marker.bindInfoWindowHtml(Y.substitute(['<div style="text-align: center">','<a href="{url}">{displayname} ({name})</a><br />','{logo_html}<br />','Local time: {local_time}</div>'].join(""),participant));map.addOverlay(marker);}};module.setMarkersInfoWindowForSmallMap=function(data,map,limit){var required_bounds=new GLatLngBounds();module.setMarkersInfoWindow(data,map,required_bounds,limit);var zoom_level=map.getBoundsZoomLevel(required_bounds);zoom_level=Math.min(4,zoom_level-1);map.setZoom(zoom_level);};module.setLocation=function(lat,lng,geoname,tz_name,lat_name,lng_name){Y.one(Y.DOM.byId(lat_name)).set('value',lat);Y.one(Y.DOM.byId(lng_name)).set('value',lng);var spinner=Y.one('#tz_spinner');spinner.set('src','/@@/spinner');function succeeded(){if(request.readyState==4){if(request.responseText){var tz=request.responseJSON.timezoneId;Y.one(Y.DOM.byId(tz_name)).set('value',tz);spinner.set('src','/@@/nospin');}}}
var url='http://ba-ws.geonames.net/timezoneJSON'+'?username='+geoname+'&lat='+lat+'&lng='+lng;var request=new JSONScriptRequest();request.open("GET",url);request.onreadystatechange=succeeded;request.send(null);};module.toggleShowSmallMaps=function(checkbox){var is_shown=checkbox.get('checked');Y.lp.launchpad_views.set('small_maps',is_shown);var display=is_shown?'block':'none';var maps=Y.all('.small-map');maps.each(function(map){map.setStyle('display',display);});if(is_shown&&!module.has_gmaps){window.location.reload();}};module.setupShowSmallMapsControl=function(div_id){var show_small_maps=Y.lp.launchpad_views.get('small_maps');var checkbox=Y.Node.create('<input type="checkbox" name="show_small_maps" />');checkbox.set('checked',show_small_maps);checkbox.on('click',function(e){module.toggleShowSmallMaps(checkbox);});var label_text=Y.Node.create('Display map');var label=Y.Node.create('<label></label>');label.appendChild(checkbox);label.appendChild(label_text);var action_div=Y.one(div_id);action_div.appendChild(label);if(!show_small_maps){module.toggleShowSmallMaps(checkbox);}};module.getSmallMap=function(div_id,center_lat,center_lng){var mapdiv=Y.DOM.byId(div_id);mapdiv.style.width='400px';var map=new GMap2(mapdiv);var center=new GLatLng(center_lat,center_lng);map.setCenter(center,1);map.setMapType(G_NORMAL_MAP);return map;};module.renderPersonMapSmall=function(center_lat,center_lng){module.setupShowSmallMapsControl('#person_map_actions');if(!gBrowserIsCompatible()){return;}
var map=module.getSmallMap('person_map_div',center_lat,center_lng);map.addControl(new GSmallZoomControl());var center=new GLatLng(center_lat,center_lng);var marker=new GMarker(center);map.addOverlay(marker);};module.renderTeamMapSmall=function(center_lat,center_lng){module.setupShowSmallMapsControl('#team_map_actions');if(!gBrowserIsCompatible()){return;}
var team_map=module.getSmallMap('team_map_div',center_lat,center_lng);gDownloadUrl("+mapdataltd",function(data){module.setMarkersInfoWindowForSmallMap(data,team_map);});};module.getLargeMap=function(div_id){var mapdiv=Y.DOM.byId(div_id);var mapheight=(parseInt(mapdiv.offsetWidth,10)/16*9);mapheight=Math.min(mapheight,Y.DOM.winHeight()-180);mapheight=Math.max(mapheight,400);mapdiv.style.height=mapheight+'px';var map=new GMap2(mapdiv);map.setMapType(G_HYBRID_MAP);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());map.enableScrollWheelZoom();var overview_control=new GOverviewMapControl();map.addControl(overview_control);GEvent.addListener(map,'zoomend',function(old,current){try{if(current<3){overview_control.hide();}else{overview_control.show();}}catch(e){}});return map;};module.renderTeamMap=function(min_lat,max_lat,min_lng,max_lng,center_lat,center_lng){if(!gBrowserIsCompatible()){return;}
var team_map=module.getLargeMap("team_map_div");var center=new GLatLng(center_lat,center_lng);team_map.setCenter(center,0);var sw=new GLatLng(min_lat,min_lng);var ne=new GLatLng(max_lat,max_lng);var required_bounds=new GLatLngBounds(sw,ne);var zoom_level=team_map.getBoundsZoomLevel(required_bounds);zoom_level=Math.min(G_HYBRID_MAP.getMaximumResolution(),zoom_level-1);team_map.setZoom(zoom_level);gDownloadUrl("+mapdata",function(data){module.setMarkersInfoWindow(data,team_map);});};module.renderPersonMap=function(center_lat,center_lng,displayname,name,logo_html,geoname,lat_name,lng_name,tz_name,zoom,show_marker){if(!gBrowserIsCompatible()){return;}
var map=module.getLargeMap('map_div');var center=new GLatLng(center_lat,center_lng);map.setCenter(center,zoom);var marker=new GMarker(center,{draggable:true});marker.bindInfoWindowHtml(Y.substitute('<div style="text-align: center">'+'<strong>{displayname}</strong><br />'+'{logo_html}<br />({name})</div>',{displayname:displayname,logo_html:logo_html,name:name}),{maxWidth:120});GEvent.addListener(marker,"dragend",function(){var point=marker.getLatLng();module.setLocation(point.lat(),point.lng(),geoname,tz_name,lat_name,lng_name);});GEvent.addListener(marker,"dragstart",function(){marker.closeInfoWindow();});map.addOverlay(marker);if(!show_marker){marker.hide();}
GEvent.addListener(map,"zoomend",function(){marker.closeInfoWindow();});GEvent.addListener(map,"click",function(overlay,point){marker.setPoint(point);if(marker.isHidden()){marker.show();map.panTo(point);}
module.setLocation(point.lat(),point.lng(),geoname,tz_name,lat_name,lng_name);});};},"0.1",{"requires":["node","dom","substitute","lp"]});
// lp/calendar-min.js

YUI.add('lp.calendar',function(Y){var lp=Y.namespace('lp');var pad_with_zero=function(num){num_as_string=String(num);if(num_as_string.length==1){num_as_string="0"+num_as_string;}
return num_as_string;};var get_initial_value_for_input=function(date_input_node){var date_match=(/(\d{4})-(\d{1,2})-(\d{2})/g).exec(date_input_node.get('value'));var time_match=(/(\d{2}):(\d{2})/g).exec(date_input_node.get('value'));var initial_value=new Date();if(date_match!==null){initial_value.setFullYear(date_match[1]);initial_value.setMonth(parseInt(date_match[2],10)-1);initial_value.setDate(date_match[3]);if(time_match){initial_value.setHours(time_match[1]);initial_value.setMinutes(time_match[2]);}}
return initial_value;};var create_time_selector_node=function(selected_time){if(selected_time===null){selected_time=new Date();}
var inner_html=['<div style="margin-top:1em;text-align:center">Time ','  <input class="hours" maxlength="2" size="2"','    value="'+pad_with_zero(selected_time.getHours())+'"/>','  : ','  <input class="minutes" maxlength="2" size="2" ','    value="'+pad_with_zero(selected_time.getMinutes())+'"/>','  <button class="lazr-pos lazr-btn" type="button">OK</button>','  </a>','</div>'].join("\n");return Y.Node.create(inner_html);};var create_calendar_widget_for_input=function(date_input_node,containing_div_node){var initial_value=get_initial_value_for_input(date_input_node);var calendar_widget=new YAHOO.widget.Calendar("calendar_widget",containing_div_node.get('id'),{title:"Select a date",close:true,pagedate:initial_value,selected:[initial_value.getMonth()+1,initial_value.getDate(),initial_value.getFullYear()].join("/")});var is_datetime_widget=date_input_node.hasClass('withtime');var time_selector_node=null;if(is_datetime_widget){calendar_widget.renderEvent.subscribe(function(type,args,obj){time_selector_node=create_time_selector_node(initial_value);containing_div_node.appendChild(time_selector_node);var ok_button=time_selector_node.one('.lazr-btn');Y.on("click",function(e){calendar_widget.selectEvent.fire();calendar_widget.hide();},ok_button);});}
calendar_widget.selectEvent.subscribe(function(type,args,obj){if(!is_datetime_widget){calendar_widget.hide();}
var selected_dates=calendar_widget.getSelectedDates();var selected_date=selected_dates[0];var value_string=[selected_date.getFullYear(),pad_with_zero(selected_date.getMonth()+1),pad_with_zero(selected_date.getDate())].join("-");if(is_datetime_widget){hours=pad_with_zero(time_selector_node.one('.hours').get('value'));minutes=pad_with_zero(time_selector_node.one('.minutes').get('value'));value_string+=" "+hours+":"+minutes;}
date_input_node.set('value',value_string);},calendar_widget,true);calendar_widget.render();return calendar_widget;};lp.add_calendar_widgets=function(){var date_inputs=Y.all('input.yui2-calendar');if(date_inputs===null){return;}
date_inputs.each(function(date_input){if(date_input.hasClass('calendar-added')){return;}
var parent_node=date_input.ancestor();var choose_link=Y.Node.create('<span>(<a class="js-action" href="#">'+'Choose...</a>)</span>');parent_node.insertBefore(choose_link,date_input.next());var containing_div_id="calendar_container-"+
date_input.get('id');var containing_div_node=Y.Node.create('<div id="'+containing_div_id+'" style="position:absolute"></div>');parent_node.insertBefore(containing_div_node,choose_link.next());date_input.addClass('calendar-added');var calendar_widget=null;Y.on("click",function(e){e.preventDefault();if(calendar_widget===null){calendar_widget=create_calendar_widget_for_input(date_input,containing_div_node);}
calendar_widget.show();},choose_link);});};lp.setup_calendar_widgets=function(){Y.on("domready",lp.add_calendar_widgets);};},"0.1",{"requires":["node"]});
// lp/lp-min.js

YUI.add('lp',function(Y){var lp=Y.namespace('lp');lp.launchpad_views={set:function(key,value){var domain=document.location.hostname.replace(/.*(launchpad.*)/,'$1');var future=new Date();future.setYear(future.getFullYear()+1);var config={path:'/',domain:domain,secure:true,expires:future};Y.Cookie.setSub('launchpad_views',key,value,config);},get:function(key){return(Y.Cookie.getSub('launchpad_views',key)!='false');}};Y.lp.toggle_collapsible=function(collapsible){var icon=collapsible.one('.collapseIcon');var wrapper_div=collapsible.one('.collapseWrapper');if(wrapper_div===null){Y.fail("Collapsible has no wrapper div.");}
if(icon===null){Y.fail("Collapsible has no icon.");}
var target_icon;var target_anim;if(wrapper_div.hasClass('lazr-closed')){target_anim=Y.lazr.effects.slide_out(wrapper_div);target_icon="/@@/treeExpanded";}else{target_anim=Y.lazr.effects.slide_in(wrapper_div);target_icon="/@@/treeCollapsed";}
target_anim.run();icon.set('src',target_icon);};Y.lp.activate_collapsibles=function(){Y.all('.collapsible').each(function(collapsible){var legend=collapsible.one('legend');if(legend===null||legend.one('.collapseIcon')!==null){return;}
var icon=Y.Node.create('<img src="/@@/treeExpanded" class="collapseIcon" />');var anchor=Y.Node.create('<a href="javascript:void(0);"></a>');anchor.appendChild(icon);var span=Y.Node.create('<span></span>');var legend_children=legend.get('children');var len;if(Y.Lang.isValue(legend_children)){len=legend_children.size?legend_children.size():legend_children.length;}else{len=0;}
if(len>0){Y.each(legend_children,function(child_node){if(child_node.get('tagName')=='A'){new_node=Y.Node.create(child_node.get('innerHTML'));span.appendChild(new_node);legend.removeChild(child_node);}else{span.appendChild(child_node);}});}else{span.set('innerHTML',legend.get('innerHTML'));legend.set('innerHTML','');}
anchor.appendChild(span);legend.appendChild(anchor);var wrapper_div=Y.Node.create('<div class="collapseWrapper" />');collapsible.removeChild(legend);var first_child=collapsible.one(':first-child');while(Y.Lang.isValue(first_child)){wrapper_div.appendChild(first_child);first_child=collapsible.one(':first-child');}
collapsible.appendChild(legend);collapsible.appendChild(wrapper_div);if(collapsible.hasClass('collapsed')){collapsible.removeClass('collapsed');var slide_in=Y.lazr.effects.slide_in(wrapper_div);slide_in.run();icon.set('src','/@@/treeCollapsed');}
anchor.on('click',function(e){Y.lp.toggle_collapsible(collapsible);});});};},"0.1",{"requires":["cookie","lazr.effects"]});var VOID_URL='_:void(0);'.replace('_','javascript');function registerQuickBuildFunction(func){YUI().use('node',function(Y){Y.on('load',function(e){func();},window);});}
function toggleExpandableTableRow(element_id){var row=document.getElementById(element_id);var view_icon=document.getElementById(element_id+"-arrow");if(row.style.display=="table-row"){row.style.display="none";view_icon.setAttribute("src","/@@/treeCollapsed");}else{row.style.display="table-row";view_icon.setAttribute("src","/@@/treeExpanded");}
return false;}
function toggleExpandableTableRows(class_name){var view_icon=document.getElementById(class_name+"-arrow");var all_page_tags=document.getElementsByTagName("*");for(i=0;i<all_page_tags.length;i++){row=all_page_tags[i];if(row.className==class_name){if(row.style.display=="table-row"){row.style.display="none";view_icon.setAttribute("src","/@@/treeCollapsed");}else{row.style.display="table-row";view_icon.setAttribute("src","/@@/treeExpanded");}}}
return false;}
function setBetaRedirect(enable){var expire=new Date();if(enable){expire.setTime(expire.getTime()+1000);document.cookie=('inhibit_beta_redirect=0; Expires='+
expire.toGMTString()+cookie_scope);alert('Redirection to the beta site has been enabled');}else{expire.setTime(expire.getTime()+2*60*60*1000);document.cookie=('inhibit_beta_redirect=1; Expires='+
expire.toGMTString()+cookie_scope);alert('You will not be redirected to the beta site for 2 hours');}
return false;}
function setFocusByName(name){var nodes=document.getElementsByName(name);for(var i=0;i<nodes.length;i++){var node=nodes[i];if(node.focus){try{if(node.offsetHeight!==0){node.focus();}}catch(e){YUI().use('console',function(Y){Y.log('In setFocusByName(<'+
node.tagName+' type='+node.type+'>): '+e);});}
break;}}}
function popup_window(url,name,width,height){var iframe=document.getElementById('popup_iframe_'+name);if(!iframe.src||iframe.src==VOID_URL){iframe.style.width=width+'px';iframe.style.height=height+'px';iframe.style.position='absolute';iframe.style.background='white';iframe.src=url;}
iframe.style.display='inline';}
function selectWidget(widget_name,event){if(event&&(event.keyCode==9||event.keyCode==13)){return;}
document.getElementById(widget_name).checked=true;}
function switchBugBranchFormAndWhiteboard(id){var div=document.getElementById('bugbranch'+id);var wb=document.getElementById('bugbranch'+id+'-wb');if(div.style.display=="none"){if(wb!==null){wb.style.display="none";}
div.style.display="block";document.getElementById('field'+id+'.actions.update').focus();document.getElementById('field'+id+'.whiteboard').focus();}else{if(wb!==null){wb.style.display="block";}
div.style.display="none";}
return false;}
function switchSpecBranchFormAndSummary(id){var div=document.getElementById('specbranch'+id);var wb=document.getElementById('specbranch'+id+'-summary');if(div.style.display=="none"){if(wb!==null){wb.style.display="none";}
div.style.display="block";document.getElementById('field'+id+'.actions.change').focus();document.getElementById('field'+id+'.summary').focus();}else{if(wb!==null){wb.style.display="block";}
div.style.display="none";}
return false;}
function updateField(field,enabled)
{field.disabled=!enabled;}
// lp/errors-min.js

YUI.add('lp.errors',function(Y){Y.lp=Y.namespace('lp');var cancel_form_button=function(){var button=Y.Node.create('<button>OK</button>');button.on('click',function(e){e.preventDefault();error_overlay.hide();});return button;};var error_overlay;var create_error_overlay=function(){if(error_overlay===undefined){error_overlay=new Y.lazr.FormOverlay({headerContent:'<h2>Error</h2>',form_header:'',form_content:'',form_submit_button:Y.Node.create('<button style="display:none"></button>'),form_cancel_button:cancel_form_button(),centered:true,visible:false});error_overlay.render();}};var maybe_red_flash=function(flash_node,callback)
{if(flash_node){var anim=Y.lazr.anim.red_flash({node:flash_node});anim.on('end',callback);anim.run();}else{callback();}};Y.lp.display_error=function(flash_node,msg){create_error_overlay();maybe_red_flash(flash_node,function(){error_overlay.showError(msg);error_overlay.show();});};var info_overlay;Y.lp.display_info=function(msg){if(info_overlay===undefined){info_overlay=new Y.lazr.PrettyOverlay({centered:true,visible:false});info_overlay.render();}
var content=Y.Node.create('<div style="background: url(/@@/info-large) no-repeat; '+'min-height: 32px; padding-left: 40px; padding-top: 16px"/></div>');content.appendChild(Y.Node.create(msg));var button_div=Y.Node.create('<div style="text-align: right"></div>');var ok_button=Y.Node.create('<button>OK</button>');ok_button.on('click',function(e){info_overlay.fire('cancel');});button_div.appendChild(ok_button);content.appendChild(button_div);info_overlay.set('bodyContent',content);info_overlay.show();};},"0.1",{"requires":["lazr.formoverlay","lazr.overlay"]});
// worlddata/languages-min.js

YUI.add('languages',function(Y){var languages=Y.namespace('languages');var all_languages;var hide_and_show=function(searchstring){searchstring=searchstring.toLowerCase();var count_matches=0;all_languages.each(function(element,index,list){var href=element.get('href');var code=href.substr(href.lastIndexOf("/")+1);var english_name=element.get('text').toLowerCase();var comment_start=english_name.indexOf(' (');if(comment_start!=-1){english_name=english_name.substring(0,comment_start);}
if(code.indexOf(searchstring)==-1&&english_name.indexOf(searchstring)==-1){element.ancestor('li').addClass('unseen');}
else{count_matches=count_matches+1;element.ancestor('li').removeClass('unseen');}});var no_filter_matches=Y.get('#no_filter_matches');if(count_matches==0){no_filter_matches.removeClass('unseen');}
else{no_filter_matches.addClass('unseen');}};var init_filter_form=function(){var heading=Y.get('.searchform h2');heading.setContent('Filter languages in QuickBuild');var button=Y.get('.searchform input.submit');var inputfind=Y.get('.searchform input.textType');button.set('value','Filter languages');all_languages=Y.all('#all-languages li a');button.on('click',function(e){e.preventDefault();hide_and_show(inputfind.get('value'));});};languages.initialize_languages_page=function(Y){init_filter_form();};},"0.1",{"requires":["oop","event","node"]});
// soyuz/base-min.js

YUI.add('soyuz-base',function(Y){var soyuz=Y.namespace('soyuz');soyuz.makeFailureNode=function(text,handler){var failure_message=Y.Node.create('<p>');failure_message.addClass('update-failure-message');var message=Y.Node.create('<span>');message.set('innerHTML',text);failure_message.appendChild(message);var retry_link=Y.Node.create('<a>');retry_link.addClass('update-retry');retry_link.set('href','');retry_link.set('innerHTML','Retry');retry_link.on('click',handler);failure_message.appendChild(retry_link);return failure_message;};soyuz.makeInProgressNode=function(text){var in_progress_message=Y.Node.create('<p>');var message=Y.Node.create('<span>');message.set('innerHTML',text);in_progress_message.addClass('update-in-progress-message');in_progress_message.appendChild(message);return in_progress_message;};},"0.1",{"requires":["node"]});
// soyuz/lp_dynamic_dom_updater-min.js

YUI.add('soyuz.dynamic_dom_updater',function(Y){var lp=Y.namespace('lp');var DomUpdater=function(config){DomUpdater.superclass.constructor.apply(this,arguments);};DomUpdater.NAME='domupdater';DomUpdater.NS='updater';DomUpdater.ATTRS={domUpdateFunction:{value:null}};Y.extend(DomUpdater,Y.Plugin.Base,{update:function(update_data){Y.log("Updating Dom subtree for "+this.get("host"),"info","DomUpdater");var domUpdateFunction=this.get("domUpdateFunction");if(domUpdateFunction!==null){domUpdateFunction(this.get("host"),update_data);}}});Y.lp.DomUpdater=DomUpdater;DynamicDomUpdater=function(config){DynamicDomUpdater.superclass.constructor.apply(this,arguments);};DynamicDomUpdater.NAME='dynamicdomupdater';DynamicDomUpdater.NS='updater';DynamicDomUpdater.ATTRS={uri:{value:null},lp_client:{value:null},api_method_name:{value:null},parameterEvaluatorFunction:{value:null},interval:{value:60000},stopUpdatesCheckFunction:{value:function(data){return false;}},long_processing_time:{value:5000},short_processing_time:{value:1000}};Y.extend(DynamicDomUpdater,DomUpdater,{initializer:function(){Y.log("Initializing updater for "+this.get("host")+" with an interval of "+this.get("interval")+"ms.","info","LPDynamicDomUpdater");this._lp_api_config={on:{success:Y.bind(this._handleSuccess,this),failure:Y.bind(this._handleFailure,this)}};this._actual_interval=this.get('interval');if(null===this.get("lp_client")){this.set("lp_client",new LP.client.QuickBuild());}
setTimeout(Y.bind(this.dynamicUpdate,this),this._actual_interval);},dynamicUpdate:function(){Y.log("Starting update for "+this.get("host"),"info","LP.DynamicDomUpdater");var uri=this.get("uri");var api_method_name=this.get("api_method_name");if(this.get("stopUpdatesCheckFunction")(this.get("host"))){Y.log("Cancelling updates for "+this.get("host")+"after stopUpdatesCheckFunction returned true.","info","LP DynamicDomUpdater");return;}
var parameterEvaluatorFunction=this.get("parameterEvaluatorFunction");if(parameterEvaluatorFunction!==null){this._lp_api_config.parameters=parameterEvaluatorFunction(this.get("host"));}
if(uri){if(api_method_name){this.get("lp_client").named_get(uri,api_method_name,this._lp_api_config);}
else{this.get("lp_client").get(uri,this._lp_api_config);}}
this._request_start=new Date().getTime();},_handleSuccess:function(data){var elapsed_time=new Date().getTime()-this._request_start;Y.log(["Data received for ",this.get("host")," after ",elapsed_time,"ms."].join(""),"info","LP.DynamicDomUpdater");this.update(data);var actual_interval_updated=false;if(elapsed_time>this.get('long_processing_time')){this._actual_interval*=2;actual_interval_updated=true;}else if(elapsed_time<this.get('short_processing_time')){var new_actual_interval=this._actual_interval/2;var config_interval=this.get('interval');if(new_actual_interval>=config_interval){this._actual_interval=new_actual_interval;actual_interval_updated=true;}else if(this._actual_interval>config_interval){this._actual_interval=config_interval;actual_interval_updated=true;}}
if(actual_interval_updated){Y.log("Actual poll interval updated to "+
this._actual_interval+"ms.");}
setTimeout(Y.bind(this.dynamicUpdate,this),this._actual_interval);},_handleFailure:function(id,request){Y.fail("LP.DynamicDomUpdater for "+this.get("host")+" failed to get dynamic data.");}});Y.lp.DynamicDomUpdater=DynamicDomUpdater;},"0.1",{"requires":["node","plugin"]});
// soyuz/update_archive_build_statuses-min.js

YUI.add('soyuz.update_archive_build_statuses',function(Y){var lp_client=new LP.client.QuickBuild();var build_summary_portlet_dynamic_update_config={uri:null,api_method_name:'getBuildCounters',lp_client:lp_client,domUpdateFunction:function(portlet_node,data_object){portlet_node.all('.build-count').each(function(node){Y.each(data_object,function(data_value,data_name){if(node.hasClass(data_name)){var previous_value=node.get("innerHTML");node.set("innerHTML",data_value);if(previous_value!=data_value.toString()){var anim=Y.lazr.anim.green_flash({node:node.get("parentNode")});anim.run();}}});});},stopUpdatesCheckFunction:function(portlet_node){var pending_elem=portlet_node.one(".pending");if(pending_elem===null){return true;}
var pending_val=pending_elem.get("innerHTML");return pending_val=="0";}};Y.on("domready",function(){var portlet=Y.one('div#build-status-summary');build_summary_portlet_dynamic_update_config.uri=LP.client.cache.context.self_link;portlet.plug(Y.lp.DynamicDomUpdater,build_summary_portlet_dynamic_update_config);});var source_package_table_dynamic_update_config={uri:null,api_method_name:'getBuildSummariesForSourceIds',lp_client:lp_client,domUpdateFunction:function(table_node,data_object){Y.each(data_object,function(build_summary,source_id){var td_elem=Y.one("#pubstatus"+source_id);if(td_elem===null){return;}
var td_ui_changed=false;var img_node=td_elem.one('img');if(!td_elem.hasClass(build_summary.status)){td_ui_changed=true;td_elem.setAttribute("class","build_status");td_elem.addClass(build_summary.status);td_elem.set("innerHTML",'');if(img_node!==null){td_elem.appendChild(img_node);var new_src=null;var new_title='';switch(build_summary.status){case'BUILDING':new_src='/@@/processing';new_title='There are some builds currently '+'building.';break;case'NEEDSBUILD':new_src='/@@/build-needed';new_title='There are some builds waiting to '+'be built.';break;case'FAILEDTOBUILD':new_src='/@@/no';new_title='There were build failures.';break;case'FULLYBUILT_PENDING':new_src='/@@/build-success-publishing';new_title='All builds were built successfully'+' but have not yet been published.';break;default:new_src='/@@/yes';new_title='All builds were built successfully.';}
img_node.setAttribute("src",new_src);img_node.setAttribute("title",new_title);img_node.setAttribute("alt",new_title);}}
var current_build_links=td_elem.getElementsByTagName('a');if(current_build_links===null){num_current_links=0;}else{num_current_links=current_build_links.size();}
if(build_summary.builds.length!=num_current_links){td_ui_changed=true;td_elem.set("innerHTML",'');if(img_node!==null){td_elem.appendChild(img_node);}
if(build_summary.status!="FULLYBUILT"){Y.each(build_summary.builds,function(build){var build_href=build.self_link.replace(/\/api\/[^\/]*\//,'/');var new_link=Y.Node.create("<a>"+build.arch_tag+"</a>");new_link.setAttribute("href",build_href);new_link.setAttribute("title",build.title);td_elem.appendChild(new_link);});}}
if(td_ui_changed){var anim=Y.lazr.anim.green_flash({node:td_elem});anim.run();}});},parameterEvaluatorFunction:function(table_node){var td_list=table_node.all('td.build_status');var tds_needsbuild=td_list.filter(".NEEDSBUILD");var tds_building=td_list.filter(".BUILDING");var tds_fullybuilt_pending=td_list.filter(".FULLYBUILT_PENDING");if(tds_needsbuild.size()===0&&tds_building.size()===0&&tds_fullybuilt_pending.size()===0){return null;}
var source_ids=[];var appendSourceIdForTD=function(node){var elem_id=node.get('id');var source_id=elem_id.replace('pubstatus','');source_ids.push(source_id);};Y.each(tds_needsbuild,appendSourceIdForTD);Y.each(tds_building,appendSourceIdForTD);Y.each(tds_fullybuilt_pending,appendSourceIdForTD);if(source_ids.length===0){return null;}else{return{source_ids:"["+source_ids.join(',')+"]"};}},stopUpdatesCheckFunction:function(table_node){var td_list=table_node.all('td.build_status');return(td_list.filter(".NEEDSBUILD").size()===0&&td_list.filter(".BUILDING").size()===0&&td_list.filter(".FULLYBUILT_PENDING").size()===0);}};Y.on("domready",function(){var table=Y.one('table#packages_list');if(table!==null){source_package_table_dynamic_update_config.uri=LP.client.cache.context.self_link;table.plug(Y.lp.DynamicDomUpdater,source_package_table_dynamic_update_config);}});},"0.1",{"requires":["node","lazr.anim","anim","soyuz.dynamic_dom_updater"]});
// soyuz/archivesubscribers_index-min.js

YUI.add('soyuz.archivesubscribers_index',function(Y){var soyuz=Y.namespace('soyuz');Y.soyuz.setup_archivesubscribers_index=function(){if(Y.Lang.isNull(Y.one('p.error.message'))){var add_subscriber_row=Y.one('#archive-subscribers .add-subscriber');add_subscriber_row.setStyle('display','none');var subscribers=Y.one('#subscribers');if(Y.Lang.isObject(Y.one('#no-subscribers'))){subscribers.setStyle('display','none');}}
var placeholder=Y.one('#add-subscriber-placeholder');placeholder.set('innerHTML','<a class="js-action sprite add" href="#">Add access</a>');function show_add_subscriber(e){e.preventDefault();subscribers.setStyle('display','block');add_subscriber_row.setStyle('display','table-row');}
Y.on('click',show_add_subscriber,'#add-subscriber-placeholder a');};},"0.1",{"requires":["oop","node","event"]});
// bugs/offical_bug_tags-min.js

YUI.add('bugs.official_bug_tag_management',function(Y){var bugs=Y.namespace('bugs');var official_tags;var other_tags;var valid_name_re=new RegExp(valid_name_pattern);var filter_array=function(arr,fn){var new_array=[];Y.each(arr,function(item){if(fn(item)){new_array.push(item);}});return new_array;};var sort_tags=function(tags){tags.sort(function(x,y){if(x.tag==y.tag){return 0;}else if(x.tag>y.tag){return 1;}else{return-1;}});};var get_official_bug_tags=function(official_bug_tags){var tags=[];Y.each(official_bug_tags,function(item){var count=used_bug_tags[item];if(count===null){count=0;}
tags.push({tag:item,count:count});});sort_tags(tags);return tags;};var get_other_bug_tags=function(used_bug_tags){var tags=[];Y.each(used_bug_tags,function(value,key,obj){if(official_bug_tags.indexOf(key)<0){tags.push({tag:key,count:value});}});sort_tags(tags);return tags;};var enable_arrows=function(){var official_cbs=Y.all('#official-tags-list input');var other_cbs=Y.all('#other-tags-list input');var official_cbs_checked=false;if(official_cbs!==null){official_cbs.each(function(cb){official_cbs_checked=official_cbs_checked||cb.get('checked');});}
var other_cbs_checked=false;if(other_cbs!==null){other_cbs.each(function(cb){other_cbs_checked=other_cbs_checked||cb.get('checked');});}
Y.one('#remove-official-tags').set('disabled',!official_cbs_checked);Y.one('#add-official-tags').set('disabled',!other_cbs_checked);};var re_alphanum=new RegExp('[a-zA-Z0-9-]');var mangle_id=function(value){var chars=value.split('');chars=Y.Array(chars).map(function(ch){if(ch.match(re_alphanum)){return ch;}else{return'__'+ch.charCodeAt(0)+'__';}});return chars.join('');};var make_tag_li=function(item){if(item.count===0){item.count='';}
item._tag_id=mangle_id(item.tag);var li_html=Y.Lang.substitute(['<li id="tag-{_tag_id}">','  <input type="checkbox" id="tag-checkbox-{_tag_id}" />','  <label for="tag-checkbox-{_tag_id}">','    <span>{tag}</span> ','    <span class="tag-used-count">{count}</span>','  </label>','</li>'].join(''),item);var li_node=Y.Node.create(li_html);li_node._tag=item;li_node.one('input').on('click',function(e){enable_arrows();var cb_node=li_node.one('input');if(cb_node.get('checked')){li_node.addClass('selected');}else{li_node.removeClass('selected');}});return li_node;};var render_tag_lists=function(){var official_tags_ul=Y.one('#official-tags-list');var other_tags_ul=Y.one('#other-tags-list');official_tags_ul.set('innerHTML','');other_tags_ul.set('innerHTML','');Y.each(official_tags,function(item){official_tags_ul.appendChild(make_tag_li(item));});Y.each(other_tags,function(item){other_tags_ul.appendChild(make_tag_li(item));});};var save_tags=function(){var tags=[];Y.each(official_tags,function(item){tags.push(item.tag);});Y.one('#field-official_bug_tags').set('value',tags.join(' '));Y.one('#save-form').submit();};var get_selected_tags=function(tags_ul){var selected_tags=[];tags_ul.all('li').each(function(li){if(li.one('input').get('checked')){selected_tags.push(li._tag);}});return selected_tags;};var copy_array=function(arr){var new_array=[];Y.each(arr,function(item){new_array.push(item);});return new_array;};var get_updated_tags=function(from_tags_ul,from_tags,to_tags){var new_from_tags=copy_array(from_tags);var new_to_tags=copy_array(to_tags);var selected_tags=get_selected_tags(from_tags_ul);Y.each(selected_tags,function(item){new_to_tags.push(item);});new_from_tags=filter_array(from_tags,function(item){return(selected_tags.indexOf(item)<0);});sort_tags(new_from_tags);sort_tags(new_to_tags);return{from_tags:new_from_tags,to_tags:new_to_tags};};var on_new_tag_add=function(){var new_tag=Y.Lang.trim(Y.one('#new-tag-text').get('value'));var new_tag_already_official=false;Y.each(official_tags,function(item){new_tag_already_official=(new_tag_already_official||(item.tag==new_tag));});var new_tag_already_used=false;Y.each(other_tags,function(item){new_tag_already_used=(new_tag_already_used||(item.tag==new_tag));});if(new_tag_already_used){Y.each(other_tags,function(item){if(item.tag==new_tag){official_tags.push(item);}});other_tags=filter_array(other_tags,function(item){return item.tag!=new_tag;});}
if(!new_tag_already_official&&!new_tag_already_used){if(valid_name_re.test(new_tag)){var count=used_bug_tags[new_tag];if(count===null){count=0;}
official_tags.push({tag:new_tag,count:0});sort_tags(official_tags);Y.one('#new-tag-text').set('value','');Y.one('#new-tag-add').set('disabled',true);Y.one('#save-button').set('disabled',false);}else{display_error();}}
render_tag_lists();};var ERROR_MSG=['<div class="official-tag-error-message">','<span class="official-tag-error-message-value">','{new_tag}</span>','is not a valid tag name.','Tags must start with a letter or number and be lowercase.','The characters "+", "-" and "." are also allowed after the','first character.','</div>'].join(' ');var display_error=function(){var new_tag=Y.one('#new-tag-text').get('value').replace(new RegExp('<','g'),'&lt;');var overlay=new Y.lazr.PrettyOverlay({headerContent:'<span class="official-tag-error-message-header">'+'<img src="/@@/error" />&nbsp;Invalid Tag</span>',bodyContent:Y.Lang.substitute(ERROR_MSG,{new_tag:new_tag}),align:{points:[Y.WidgetPositionExt.CC,Y.WidgetPositionExt.CC]},progressbar:false,progress:0});overlay.render();};bugs.setup_official_bug_tag_management=function(){official_tags=get_official_bug_tags(official_bug_tags);other_tags=get_other_bug_tags(used_bug_tags);var layout_table=Y.one('#layout-table');layout_table.setStyle('display','block');var official_tags_ul=Y.one('#official-tags-list');var other_tags_ul=Y.one('#other-tags-list');render_tag_lists();Y.one('#add-official-tags').on('click',function(e){var updated_tags=get_updated_tags(other_tags_ul,other_tags,official_tags);other_tags=updated_tags.from_tags;official_tags=updated_tags.to_tags;render_tag_lists();enable_arrows();Y.one('#save-button').set('disabled',false);});Y.one('#remove-official-tags').on('click',function(e){var updated_tags=get_updated_tags(official_tags_ul,official_tags,other_tags);official_tags=updated_tags.from_tags;other_tags=updated_tags.to_tags;render_tag_lists();enable_arrows();Y.one('#save-button').set('disabled',false);});Y.one('#new-tag-add').on('click',function(e){on_new_tag_add();});Y.one('#new-tag-text').on('keypress',function(e){var new_value=Y.Lang.trim(Y.one('#new-tag-text').get('value'));Y.one('#new-tag-add').set('disabled',new_value==='');if(e.keyCode==13){on_new_tag_add();}});Y.one('#save-button').on('click',function(e){e.halt();save_tags();});};},"0.1",{"requires":["node","substitute","base","widget-position-ext","collection","lazr.base","lazr.overlay"]});
// bugs/subscriber-min.js

YUI.add('lp.subscriber',function(Y){Y.namespace('lp');function Subscription(config){Subscription.superclass.constructor.apply(this,arguments);}
Subscription.ATTRS={'link':{value:null},'can_be_unsubscribed':{value:false},'is_direct':{value:true},'has_dupes':{value:false},'person':{value:null},'is_team':{value:false},'subscriber':{value:null},'spinner':{vallue:null}};Y.extend(Subscription,Y.Base,{'is_node':function(){return this.get('link')instanceof Y.Node;},'is_already_subscribed':function(){var display_name=this.get('person').get('full_display_name');var already_subscribed=false;Y.all('#subscribers-links div').each(function(link){var name=link.one('a').getAttribute('name');if(name==display_name){already_subscribed=true;}});return already_subscribed;},'can_be_unsubscribed_by_user':function(){return this.get('can_be_unsubscribed');},'is_current_user_subscribing':function(){return(this.get('subscriber').get('name')==this.get('person').get('name'));},'is_direct_subscription':function(){return this.get('is_direct');},'has_duplicate_subscriptions':function(){return this.get('has_dupes');},'is_team':function(){return this.get('is_team');},'enable_spinner':function(text){if(Y.Lang.isValue(text)){this.get('spinner').set('innerHTML',text);}
this.get('link').setStyle('display','none');this.get('spinner').setStyle('display','block');},'disable_spinner':function(text){if(Y.Lang.isValue(text)){var link=this.get('link');link.set('innerHTML',text);if(text=='Subscribe'){link.removeClass('modify remove');link.addClass('add');}else{link.removeClass('add');link.addClass('modify remove');}}
this.get('spinner').setStyle('display','none');this.get('link').setStyle('display','inline');}});Y.lp.Subscription=Subscription;function Subscriber(config){Subscriber.superclass.constructor.apply(this,arguments);}
Subscriber.NAME='Subscriber';Subscriber.ATTRS={uri:{value:''},name:{value:''},css_name:{value:''},escaped_uri:{value:''},user_node:{value:null},display_name:{value:''},full_display_name:{value:''},subscriber_ids:{value:null}};Y.extend(Subscriber,Y.Base,{initializer:function(config){if(this.get('uri')!==''){this.set('name',this.get('uri').substring(2));var name=this.get('name');var subscriber_ids=this.get('subscriber_ids');if(Y.Lang.isValue(subscriber_ids)){var css_name=this.get('subscriber_ids')[name];if(Y.Lang.isValue(css_name)){this.set('css_name',css_name);}else{css_name='subscriber-'+Y.guid();subscriber_ids[name]=css_name;this.set('subscriber_ids',subscriber_ids);this.set('css_name',css_name);}}
var escaped_uri;if(name.indexOf('+')>0){escaped_uri=name.replace('+','%2B');}else{escaped_uri=name;}
this.set('escaped_uri','/~'+escaped_uri);}
this.set_display_name();this.set_truncated_display_name();},get_display_name_from_api:function(client){var self=this;var cfg={on:{success:function(person){self.set('display_name',person.lookup_value('display_name'));self.set_truncated_display_name();self.fire('displaynameload');}}};client.get(this.get('escaped_uri'),cfg);},get_display_name_from_node:function(){var user_node;if(Y.Lang.isValue(this.get('user_node'))){user_node=this.get('user_node');}else{user_node=Y.one('.subscriber-'+this.get('name'));}
if(Y.Lang.isValue(user_node)){this.set('user_node',user_node);var anchor=this.get('user_node').one('a');var display_name=anchor.get('name');return display_name;}else{return'';}},set_display_name:function(){var display_name=this.get_display_name_from_node();if(display_name!==''){this.set('display_name',display_name);this.set_truncated_display_name();this.fire('displaynameload');}else{if(window.LP!==undefined&&window.LP.client.links.me!==undefined){var client=new LP.client.QuickBuild();this.get_display_name_from_api(client);}}},set_truncated_display_name:function(){var display_name=this.get('display_name');if(display_name!==''){var truncated_name;if(display_name.length>20){truncated_name=display_name.substring(0,17)+'...';}else{truncated_name=display_name;}
this.set('display_name',truncated_name);this.set('full_display_name',display_name);}}});Y.lp.Subscriber=Subscriber;},"0.1",{"requires":["base","node"]});
// bugs/bugtask-index-min.js

YUI.add('bugs.bugtask_index',function(Y){var bugs=Y.namespace('bugs');var duplicate_form_overlay;var privacy_form_overlay;var update_dupe_url;var lp_client;var lp_bug_entry;var bug_repr;var error_overlay;var submit_button_html='<button type="submit" name="field.actions.change" '+'value="Change" class="lazr-pos lazr-btn" >OK</button>';var cancel_button_html='<button type="button" name="field.actions.cancel" '+'class="lazr-neg lazr-btn" >Cancel</button>';var privacy_link;var privacy_spinner;var link_branch_link;var subscriber_ids;var PortletTarget=function(){};Y.augment(PortletTarget,Y.Event.Target);Y.bugs.portlet=new PortletTarget();Y.bugs.portlet.subscribe('bugs:portletloaded',function(){load_subscriber_ids();});Y.bugs.portlet.subscribe('bugs:dupeportletloaded',function(){setup_unsubscribe_icon_handlers();});Y.bugs.portlet.subscribe('bugs:portletloadfailed',function(handlers){if(Y.Lang.isArray(handlers)){var click_handler=handlers[0];click_handler.detach();}});Y.bugs.portlet.subscribe('bugs:dupeportletloadfailed',function(handlers){setup_unsubscribe_icon_handlers();});Y.bugs.portlet.subscribe('bugs:portletsubscriberidsloaded',function(){setup_subscription_link_handlers();load_subscribers_from_duplicates();});Y.bugs.portlet.subscribe('bugs:portletsubscriberidsfailed',function(){load_subscribers_from_duplicates();});Y.bugs.portlet.subscribe('bugs:nameloaded',function(subscription){var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){var temp_link=Y.one('#temp-username');if(temp_link){var temp_parent=temp_link.get('parentNode');temp_parent.removeChild(temp_link);}};error_handler.showError=function(error_msg){Y.lp.display_error(Y.one('.menu-link-addsubscriber'),error_msg);};var config={on:{success:function(){var temp_link=Y.one('#temp-username');var temp_spinner=Y.one('#temp-name-spinner');temp_link.removeChild(temp_spinner);var anim=Y.lazr.anim.green_flash({node:temp_link});anim.on('end',function(){add_user_name_link(subscription);var temp_parent=temp_link.get('parentNode');temp_parent.removeChild(temp_link);});anim.run();},failure:error_handler.getFailureHandler()},parameters:{person:LP.client.get_absolute_uri(subscription.get('person').get('escaped_uri')),suppress_notify:false}};lp_client.named_post(bug_repr.self_link,'subscribe',config);});Y.bugs.setup_bugtask_index=function(){Y.on('load',function(){if(Y.UA.ie){return;}
if(LP.client.links.me===undefined){return;}
setup_client_and_bug();var update_dupe_link=Y.one('.menu-link-mark-dupe, #change_duplicate_bug');if(update_dupe_link){update_dupe_url=update_dupe_link.get('href');var mark_dupe_form_url=update_dupe_url+'/++form++';duplicate_form_overlay=new Y.lazr.FormOverlay({headerContent:'<h2>Mark bug report as duplicate</h2>',form_header:'Marking the bug as a duplicate will, by default, '+'hide it from search results listings.',form_submit_button:Y.Node.create(submit_button_html),form_cancel_button:Y.Node.create(cancel_button_html),centered:true,form_submit_callback:update_bug_duplicate,visible:false});duplicate_form_overlay.render('#duplicate-form-container');duplicate_form_overlay.loadFormContentAndRender(mark_dupe_form_url);update_dupe_link.on('click',function(e){if(duplicate_form_overlay){e.preventDefault();duplicate_form_overlay.show();}});update_dupe_link.addClass('js-action');}
privacy_link=Y.one('#privacy-link');if(privacy_link){var privacy_link_url=privacy_link.getAttribute('href')+'/++form++';var privacy_div=Y.one('#privacy-text');var privacy_html=privacy_link.get('innerHTML')+' ';privacy_div.set('innerHTML',privacy_html);var privacy_text=Y.one('#privacy-text');privacy_link=Y.Node.create('<a id="privacy-link" class="sprite edit" title="[edit]">'+'<span class="invisible-link">edit</span>&nbsp;</a>');privacy_link.set('href',privacy_link_url);privacy_text.appendChild(privacy_link);privacy_spinner=Y.Node.create('<img src="/@@/spinner" style="display: none" />');privacy_text.appendChild(privacy_spinner);privacy_form_overlay=new Y.lazr.FormOverlay({headerContent:'<h2>Change privacy settings</h2>',form_submit_button:Y.Node.create(submit_button_html),form_cancel_button:Y.Node.create(cancel_button_html),centered:true,form_submit_callback:update_privacy_settings,visible:false});privacy_form_overlay.render('#privacy-form-container');privacy_form_overlay.loadFormContentAndRender(privacy_link_url);privacy_link.on('click',function(e){if(privacy_form_overlay){e.preventDefault();privacy_form_overlay.show();document.getElementById('field.private').focus();}});privacy_link.addClass('js-action');}
setup_add_attachment();setup_link_branch_picker();},window);};function setup_subscribe_someone_else_handler(subscription){var config={header:'Subscribe someone else',step_title:'Search',picker_activator:'.menu-link-addsubscriber'};config.save=function(result){subscribe_someone_else(result,subscription);};var picker=Y.lp.picker.create('ValidPersonOrTeam',config);}
function setup_subscription_link_handlers(){if(LP.client.links.me===undefined){return;}
setup_client_and_bug();var subscription=new Y.lp.Subscription({link:Y.one('.menu-link-subscription'),spinner:Y.one('#sub-unsub-spinner'),subscriber:new Y.lp.Subscriber({uri:LP.client.links.me,subscriber_ids:subscriber_ids})});var is_direct=subscription.get('link').get('parentNode').hasClass('subscribed-true');var has_dupes=subscription.get('link').get('parentNode').hasClass('dup-subscribed-true');subscription.set('is_direct',is_direct);subscription.set('has_dupes',has_dupes);if(subscription.is_node()){subscription.get('link').on('click',function(e){e.halt();subscription.set('can_be_unsubscribed',true);subscription.set('person',subscription.get('subscriber'));subscription.set('is_team',false);var parent=e.target.get('parentNode');if(parent.hasClass('subscribed-false')&&parent.hasClass('dup-subscribed-false')){subscribe_current_user(subscription);}
else{unsubscribe_current_user(subscription);}});subscription.get('link').addClass('js-action');}
setup_subscribe_someone_else_handler(subscription);}
function setup_unsubscribe_icon_handlers(){var subscription=new Y.lp.Subscription({link:Y.get('.menu-link-subscription'),spinner:Y.get('#sub-unsub-spinner'),subscriber:new Y.lp.Subscriber({uri:LP.client.links.me,subscriber_ids:subscriber_ids})});Y.on('click',function(e){e.halt();unsubscribe_user_via_icon(e.target,subscription);},'.unsub-icon');}
function setup_client_and_bug(){lp_client=new LP.client.QuickBuild();if(bug_repr===undefined){bug_repr=LP.client.cache.bug;lp_bug_entry=new LP.client.Entry(lp_client,bug_repr,bug_repr.self_link);}}
function update_bug_duplicate(data){lp_bug_entry.removeAttr('http_etag');duplicate_form_overlay.hide();var dupe_span=Y.one('#mark-duplicate-text');dupe_span.addClass('update-in-progress-message');var new_dup_url=null;var new_dup_id=Y.Lang.trim(data['field.duplicateof'][0]);if(new_dup_id!==''){var self_link=lp_bug_entry.get('self_link');var last_slash_index=self_link.lastIndexOf('/');new_dup_url=self_link.slice(0,last_slash_index+1)+new_dup_id;}
var old_dup_url=lp_bug_entry.get('duplicate_of_link');lp_bug_entry.set('duplicate_of_link',new_dup_url);config={on:{success:function(updated_entry){dupe_span.removeClass('update-in-progress-message');lp_bug_entry=updated_entry;if(new_dup_url!==null){dupe_span.set('innerHTML',['Duplicate of <a>bug #</a> ','<a class="menu-link-mark-dupe js-action sprite edit">','<span class="invisible-link">edit</span></a>'].join(""));dupe_span.all('a').item(0).set('href','/bugs/'+new_dup_id).appendChild(document.createTextNode(new_dup_id));dupe_span.all('a').item(1).set('href',update_dupe_url);show_comment_on_duplicate_warning();}else{dupe_span.set('innerHTML',['<a class="menu-link-mark-dupe js-action ','sprite bug-dupe">Mark as duplicate</a>'].join(""));dupe_span.one('a').set('href',update_dupe_url);hide_comment_on_duplicate_warning();}
Y.lazr.anim.green_flash({node:dupe_span}).run();dupe_span.one('a.menu-link-mark-dupe').on('click',function(e){e.preventDefault();duplicate_form_overlay.show();});},failure:function(id,request){dupe_span.removeClass('update-in-progress-message');if(request.status==400){duplicate_form_overlay.showError(new_dup_id+' is not a valid bug number or'+' nickname.');}else{duplicate_form_overlay.showError(request.responseText);}
duplicate_form_overlay.show();lp_bug_entry.set('duplicate_of_link',old_dup_url);}}};lp_bug_entry.lp_save(config);}
var show_comment_on_duplicate_warning=function(){var duplicate_warning=Y.one('#warning-comment-on-duplicate');if(duplicate_warning===null){var container=Y.one('#add-comment-form');var first_node=container.get('firstChild');duplicate_warning=Y.Node.create(['<div class="warning message" id="warning-comment-on-duplicate">','Remember, this bug report is a duplicate. ','Comment here only if you think the duplicate status is wrong.','</div>'].join(''));container.insertBefore(duplicate_warning,first_node);}};var hide_comment_on_duplicate_warning=function(){var duplicate_warning=Y.one('#warning-comment-on-duplicate');if(duplicate_warning!==null){duplicate_warning.ancestor().removeChild(duplicate_warning);}};var update_privacy_settings=function(data){lp_bug_entry.removeAttr('http_etag');privacy_form_overlay.hide();var privacy_text=Y.one('#privacy-text');var privacy_div=Y.one('#privacy');privacy_link.setStyle('display','none');privacy_spinner.setStyle('display','inline');if(lp_client===undefined){lp_client=new LP.client.QuickBuild();}
if(lp_bug_entry===undefined){var bug_repr=LP.client.cache.bug;lp_bug_entry=new LP.client.Entry(lp_client,bug_repr,bug_repr.self_link);}
var private=data['field.private']!==undefined;var security_related=data['field.security_related']!==undefined;lp_bug_entry.set('private',private);lp_bug_entry.set('security_related',security_related);var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){privacy_spinner.setStyle('display','none');privacy_link.setStyle('display','inline');};error_handler.showError=function(error_msg){Y.lazr.anim.red_flash({node:privacy_div}).run();privacy_form_overlay.showError(error_msg);privacy_form_overlay.show();};var config={on:{success:function(updated_entry){privacy_spinner.setStyle('display','none');privacy_link.setStyle('display','inline');lp_bug_entry=updated_entry;if(private){Y.one('body').replaceClass('public','private');privacy_div.replaceClass('public','private');privacy_text.set('innerHTML','This report is <strong>private</strong> ');}else{Y.one('body').replaceClass('private','public');privacy_div.replaceClass('private','public');privacy_text.set('innerHTML','This report is public ');}
privacy_text.appendChild(privacy_link);privacy_text.appendChild(privacy_spinner);var security_message=Y.one('#security-message');if(security_related){if(security_message===null){var security_message_html=['<div style="','    margin-top: 0.5em;','    padding-right: 18px;','    center right no-repeat;"','    class="sprite security"','    id="security-message"','>Security vulnerability</div>'].join('');security_message=Y.Node.create(security_message_html);privacy_div.appendChild(security_message);}}else{if(security_message!==null){privacy_div.removeChild(security_message);}}
Y.lazr.anim.green_flash({node:privacy_div}).run();},failure:error_handler.getFailureHandler()}};lp_bug_entry.lp_save(config);};function setup_link_branch_picker(){setup_client_and_bug();var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){link_branch_link.toggleClass('update-in-progress-message');};error_handler.showError=function(error_msg){display_error(Y.one('.menu-link-addsubscriber'),error_msg);};function get_branch_and_link_to_bug(data){var branch_url=data.api_uri;config={on:{success:link_branch_to_bug,failure:error_handler.getFailureHandler()}};link_branch_link.toggleClass('update-in-progress-message');lp_client.get(branch_url,config);}
link_branch_link=Y.one('.menu-link-addbranch');if(Y.Lang.isValue(link_branch_link)){var config={header:'Link a related branch',step_title:'Search',picker_activator:'.menu-link-addbranch'};config.save=get_branch_and_link_to_bug;var picker=Y.lp.picker.create('Branch',config);}}
function link_branch_to_bug(branch){var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){link_branch_link.toggleClass('update-in-progress-message');};error_handler.showError=function(error_msg){display_error(Y.one('.menu-link-addsubscriber'),error_msg);};config={on:{success:function(bug_branch_entry){link_branch_link.toggleClass('update-in-progress-message');config={on:{success:function(branch_html){add_branch_to_linked_branches(branch_html);}},accept:LP.client.XHTML};lp_client.get(bug_branch_entry.get('self_link'),config);},failure:error_handler.getFailureHandler()},parameters:{branch:branch.get('self_link')}};lp_client.named_post(lp_bug_entry.get('self_link'),'linkBranch',config);}
function add_branch_to_linked_branches(branch_html){var anim;var bug_branch_node=Y.Node.create(branch_html);var bug_branch_list=Y.one('#bug-branches');if(!Y.Lang.isValue(bug_branch_list)){bug_branch_list=Y.Node.create('<div id="bug-branches">'+'  <h2>Related branches</h2>'+'</div>');var bug_branch_container=Y.one('#bug-branches-container');bug_branch_container.appendChild(bug_branch_list);anim=Y.lazr.anim.green_flash({node:bug_branch_list});}else{anim=Y.lazr.anim.green_flash({node:bug_branch_node});}
var existing_bug_branch_node=bug_branch_list.one('#'+bug_branch_node.getAttribute('id'));if(!Y.Lang.isValue(existing_bug_branch_node)){bug_branch_list.appendChild(bug_branch_node);}else{anim=Y.lazr.anim.green_flash({node:existing_bug_branch_node});}
anim.run();Y.fire('lp:branch-linked',bug_branch_node);}
function get_user_uri_from_icon(icon){var parent_div=icon.get('parentNode').get('parentNode');var user_uri=parent_div.one('a').getAttribute('href');var host_start=user_uri.indexOf('//');if(host_start!=-1){var host_end=user_uri.indexOf('/',host_start+2);return user_uri.substring(host_end,user_uri.length);}
return user_uri;}
function build_user_link_html(subscription){var name=subscription.get('person').get('name');var css_name=subscription.get('person').get('css_name');var full_name=subscription.get('person').get('full_display_name');if(subscription.get('person').get('display_name')===''){subscription.get('person').set_display_name();}
var display_name=subscription.get('person').get('display_name');var terms={name:name,css_name:css_name,display_name:display_name,full_name:full_name};if(subscription.is_current_user_subscribing()){terms.subscribed_by='themselves';}else{terms.subscribed_by='by '+full_name;}
var html=Y.Node.create('<div><a></a></div>');html.addClass(terms.css_name);if(subscription.is_direct_subscription()){html.set('id','direct-'+terms.css_name);}else{html.set('id','dupe-'+terms.css_name);}
html.one('a').set('href','/~'+terms.name).set('name',terms.full_name).set('title','Subscribed '+terms.subscribed_by);var span;if(subscription.is_team()){span='<span class="sprite team"></span>';}else{span='<span class="sprite person"></span>';}
html.one('a').appendChild(Y.Node.create(span)).appendChild(document.createTextNode(terms.display_name));if(subscription.can_be_unsubscribed_by_user()){var icon_html=Y.Node.create('<a href="+subscribe">'+'<img class="unsub-icon" src="/@@/remove" /></a>');icon_html.set('id','unsubscribe-'+terms.css_name).set('title','Unsubscribe '+terms.full_name);icon_html.one('img').set('id','unsubscribe-icon-'+terms.css_name);html.appendChild(icon_html);}
return html;}
function remove_user_name_link(user_node){var parent=user_node.get('parentNode');parent.removeChild(user_node);}
function get_next_subscriber_node(subscription){var full_name=subscription.get('person').get('full_display_name');var can_be_unsubscribed=subscription.can_be_unsubscribed_by_user();var nodes_by_name={};var unsubscribables=[];var not_unsubscribables=[];var all_subscribers=Y.all('#subscribers-links div');if(all_subscribers.size()>0){all_subscribers.each(function(sub_link){if(sub_link.getAttribute('id')!='temp-username'){var sub_link_name=sub_link.one('a').getAttribute('name');nodes_by_name[sub_link_name]=sub_link;if(sub_link.one('img.unsub-icon')){unsubscribables.push(sub_link_name);}else{not_unsubscribables.push(sub_link_name);}}});if(can_be_unsubscribed){unsubscribables.push(full_name);}else{not_unsubscribables.push(full_name);}
unsubscribables.sort();not_unsubscribables.sort();}else{return;}
var i;if((!unsubscribables&&!not_unsubscribables)||(!can_be_unsubscribed&&!not_unsubscribables)||(can_be_unsubscribed&&unsubscribables&&!not_unsubscribables)){return;}else if(can_be_unsubscribed&&!unsubscribables&&not_unsubscribables){return nodes_by_name[not_unsubscribables[0]];}else if(can_be_unsubscribed){for(i=0;i<unsubscribables.length;i++){if(unsubscribables[i]==full_name){if(i+1<unsubscribables.length){return nodes_by_name[unsubscribables[i+1]];}else if(i+1>=unsubscribables.length){return nodes_by_name[not_unsubscribables[0]];}}}}else if(!can_be_unsubscribed){for(i=0;i<not_unsubscribables.length;i++){if(not_unsubscribables[i]==full_name){if(i+1<not_unsubscribables.length){return nodes_by_name[not_unsubscribables[i+1]];}else{return;}}}}}
function add_user_name_link(subscription){var person=subscription.get('person');var link_node=build_user_link_html(subscription);var subscribers=Y.one('#subscribers-links');if(subscription.is_current_user_subscribing()){subscribers.insertBefore(link_node,subscribers.get('firstChild'));}else{var next=get_next_subscriber_node(subscription);if(next){subscribers.insertBefore(link_node,next);}else{var none_subscribers=Y.one('#none-subscribers');if(none_subscribers){var none_parent=none_subscribers.get('parentNode');none_parent.removeChild(none_subscribers);}
subscribers.appendChild(link_node);}}
if(subscription.can_be_unsubscribed_by_user()){var remove_icon=Y.one('#unsubscribe-icon-'+person.get('css_name'));remove_icon.on('click',function(e){e.halt();unsubscribe_user_via_icon(e.target,subscription);});}}
function add_temp_user_name(subscription){if(subscription.get('person').get('display_name')===''){subscription.get('person').set_display_name();}
var display_name=subscription.get('person').get('display_name');var img_src;if(subscription.is_team()){img_src='/@@/teamgray';}else{img_src='/@@/persongray';}
var link_node=Y.Node.create(['<div id="temp-username"> ','  <img alt="" width="14" height="14" />','  <span>Other Display Name</span>','  <img id="temp-name-spinner" src="/@@/spinner" alt="" ','       style="position:absolute;right:8px" /></div>'].join(''));link_node.one('img').set('src',img_src);link_node.replaceChild(document.createTextNode(display_name),link_node.one('span'));var subscribers=Y.one('#subscribers-links');var next=get_next_subscriber_node(subscription);if(next){subscribers.insertBefore(link_node,next);}else{var none_subscribers=Y.one('#none-subscribers');if(none_subscribers){var none_parent=none_subscribers.get('parentNode');none_parent.removeChild(none_subscribers);}
subscribers.appendChild(link_node);}
Y.bugs.portlet.fire('bugs:nameloaded',subscription);}
function set_none_for_empty_subscribers(){var subscriber_list=Y.one('#subscribers-links');if(!Y.Lang.isValue(subscriber_list.one('div'))&&!Y.Lang.isValue(Y.one('#none-subscribers'))){var none_div=Y.Node.create('<div id="none-subscribers">None</div>');subscriber_list.appendChild(none_div);}
var dup_list=Y.one('#subscribers-from-duplicates');if(Y.Lang.isValue(dup_list)&&!Y.Lang.isValue(dup_list.one('div'))){var parent=dup_list.get('parentNode');parent.removeChild(dup_list);}}
function set_subscription_link_parent_class(user_link,subscribed,dupe_subscribed){var parent=user_link.get('parentNode');if(subscribed){parent.removeClass('subscribed-false');parent.addClass('subscribed-true');}else{parent.removeClass('subscribed-true');parent.addClass('subscribed-false');}
if(dupe_subscribed){parent.removeClass('dup-subscribed-false');parent.addClass('dup-subscribed-true');}else{parent.removeClass('dup-subscribed-true');parent.addClass('dup-subscribed-false');}}
function unsubscribe_user_via_icon(icon,subscription){icon.set('src','/@@/spinner');var icon_parent=icon.get('parentNode');var user_uri=get_user_uri_from_icon(icon);var person=new Y.lp.Subscriber({uri:user_uri,subscriber_ids:subscriber_ids});subscription.set('person',person);var is_dupe;var icon_parent_div=icon_parent.get('parentNode');var dupe_id='dupe-'+person.get('css_name');if(icon_parent_div.get('id')==dupe_id){is_dupe=true;}else{is_dupe=false;}
var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){icon.set('src','/@@/remove');var unsubscribe_icon=Y.one('#unsubscribe-icon-'+person.get('css_name'));unsubscribe_icon.on('click',function(e){e.halt();unsubscribe_user_via_icon(e.target,subscription);});};error_handler.showError=function(error_msg){var flash_node=Y.one('.'+person.get('css_name'));Y.lp.display_error(flash_node,error_msg);};var subscription_link=subscription.get('link');var config={on:{success:function(client){icon_parent.removeChild(icon);var anim=Y.lazr.anim.green_flash({node:icon_parent_div});anim.on('end',function(e){remove_user_name_link(icon_parent_div);set_none_for_empty_subscribers();var person_link=Y.one('.'+person.get('css_name'));if(Y.Lang.isNull(person_link)&&subscription.is_current_user_subscribing()){subscription.disable_spinner('Subscribe');set_subscription_link_parent_class(subscription_link,false,false);subscription.set('is_direct',false);subscription.set('has_dupes',false);}else{if(is_dupe){set_subscription_link_parent_class(subscription_link,true,false);subscription.set('is_direct',true);subscription.set('has_dupes',false);}else{set_subscription_link_parent_class(subscription_link,false,true);subscription.set('is_direct',false);subscription.set('has_dupes',true);}}});anim.run();},failure:error_handler.getFailureHandler()}};if(!subscription.is_current_user_subscribing()){config.parameters={person:LP.client.get_absolute_uri(user_uri)};}
if(is_dupe){lp_client.named_post(bug_repr.self_link,'unsubscribeFromDupes',config);}else{lp_client.named_post(bug_repr.self_link,'unsubscribe',config);}}
function subscribe_current_user(subscription){subscription.enable_spinner('Subscribing...');var subscription_link=subscription.get('link');var subscriber=subscription.get('subscriber');var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){subscription.disable_spinner();};error_handler.showError=function(error_msg){Y.lp.display_error(subscription_link,error_msg);};var config={on:{success:function(client){subscription.disable_spinner('Unsubscribe');if(subscription.has_duplicate_subscriptions()){set_subscription_link_parent_class(subscription_link,true,true);}else{set_subscription_link_parent_class(subscription_link,true,false);}
var empty_subscribers=Y.one("#none-subscribers");if(empty_subscribers){var parent=empty_subscribers.get('parentNode');parent.removeChild(empty_subscribers);}
add_user_name_link(subscription);var flash_node=Y.one('.'+subscriber.get('css_name'));var anim=Y.lazr.anim.green_flash({node:flash_node});anim.run();},failure:error_handler.getFailureHandler()},parameters:{person:LP.client.get_absolute_uri(subscriber.get('escaped_uri')),suppress_notify:false}};lp_client.named_post(bug_repr.self_link,'subscribe',config);}
function unsubscribe_current_user(subscription){subscription.enable_spinner('Unsubscribing...');var subscription_link=subscription.get('link');var subscriber=subscription.get('subscriber');var error_handler=new LP.client.ErrorHandler();error_handler.clearProgressUI=function(){subscription.disable_spinner();};error_handler.showError=function(error_msg){Y.lp.display_error(subscription_link,error_msg);};var config={on:{success:function(client){if(subscription.is_direct_subscription()&&subscription.has_duplicate_subscriptions()){subscription.disable_spinner();set_subscription_link_parent_class(subscription_link,false,true);subscription.set('is_direct',false);}else if(subscription.is_direct_subscription()&&!subscription.has_duplicate_subscriptions()){subscription.disable_spinner('Subscribe');set_subscription_link_parent_class(subscription_link,false,false);subscription.set('is_direct',false);}else{subscription.disable_spinner('Subscribe');set_subscription_link_parent_class(subscription_link,false,false);subscription.set('has_dupes',false);}
var flash_node=Y.one('.'+subscriber.get('css_name'));var anim=Y.lazr.anim.green_flash({node:flash_node});anim.on('end',function(e){remove_user_name_link(flash_node);set_none_for_empty_subscribers();});anim.run();},failure:error_handler.getFailureHandler()}};if(subscription.is_direct_subscription()){lp_client.named_post(bug_repr.self_link,'unsubscribe',config);}else{lp_client.named_post(bug_repr.self_link,'unsubscribeFromDupes',config);}}
bugs.setup_bugtask_row=function(conf){if(Y.UA.ie){return;}
var tr=Y.one('#'+conf.row_id);var bugtarget_content=Y.one('#bugtarget-picker-'+conf.row_id);var status_content=tr.one('.status-content');var importance_content=tr.one('.importance-content');var assignee_content=Y.one('#assignee-picker-'+conf.row_id);var milestone_content=tr.one('.milestone-content');if(status_content===null){return;}
if(Y.Lang.isValue(LP.client.cache.bug)&&Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)){status_content.on('click',function(e){e.halt();});importance_content.on('click',function(e){e.halt();});return;}
if((LP.client.links.me!==undefined)&&(LP.client.links.me!==null)){if(Y.Lang.isValue(bugtarget_content)){if(conf.target_is_product){if(Y.UA.webkit){bugtarget_content.replaceChild(Y.DOM.create('<a href="+editstatus" '+'   class="sprite edit yui-activator-act" />'),bugtarget_content.one('.yui-activator-act'));}else{var bugtarget_picker=Y.lp.picker.addPickerPatcher('Product',conf.bugtask_path,"target_link",bugtarget_content.get('id'),false,false,{"step_title":"Search products","header":"Change product"});}}}
if(conf.user_can_edit_status){var status_choice_edit=new Y.ChoiceSource({contentBox:status_content,value:conf.status_value,title:'Change status to',items:conf.status_widget_items,elementToFlash:status_content.get('parentNode'),backgroundColor:tr.hasClass('highlight')?'#FFFF99':'#FFFFFF'});status_choice_edit.showError=function(err){Y.lp.display_error(null,err);};status_choice_edit.on('save',function(e){var cb=status_choice_edit.get('contentBox');Y.Array.each(conf.status_widget_items,function(item){if(item.value==status_choice_edit.get('value')){cb.addClass(item.css_class);}else{cb.removeClass(item.css_class);}});Y.one(document.getElementById(conf.prefix+'.status')).set('value',status_choice_edit.get('value'));});status_choice_edit.plug({fn:Y.lp.client.plugins.PATCHPlugin,cfg:{patch:'status',resource:conf.bugtask_path}});status_choice_edit.render();}
if(conf.user_can_edit_importance){var importance_choice_edit=new Y.ChoiceSource({contentBox:importance_content,value:conf.importance_value,title:'Change importance to',items:conf.importance_widget_items,elementToFlash:importance_content.get('parentNode'),backgroundColor:tr.hasClass('highlight')?'#FFFF99':'#FFFFFF'});importance_choice_edit.showError=function(err){Y.lp.display_error(null,err);};importance_choice_edit.on('save',function(e){var cb=importance_choice_edit.get('contentBox');Y.Array.each(conf.importance_widget_items,function(item){if(item.value==importance_choice_edit.get('value')){cb.addClass(item.css_class);}else{cb.removeClass(item.css_class);}});Y.one(document.getElementById(conf.prefix+'.importance')).set('value',importance_choice_edit.get('value'));});importance_choice_edit.plug({fn:Y.lp.client.plugins.PATCHPlugin,cfg:{patch:'importance',resource:conf.bugtask_path}});importance_choice_edit.render();}}
if(Y.Lang.isValue(milestone_content)&&conf.user_can_edit_milestone){var milestone_choice_edit=new Y.NullChoiceSource({contentBox:milestone_content,value:conf.milestone_value,title:'Target to milestone',items:conf.milestone_widget_items,elementToFlash:milestone_content.get('parentNode'),backgroundColor:tr.hasClass('highlight')?'#FFFF99':'#FFFFFF',clickable_content:false});milestone_choice_edit.showError=function(err){Y.lp.display_error(null,err);};milestone_choice_edit.plug({fn:Y.lp.client.plugins.PATCHPlugin,cfg:{patch:'milestone_link',resource:conf.bugtask_path}});milestone_choice_edit.after('save',function(){var new_value=milestone_choice_edit.get('value');if(Y.Lang.isValue(new_value)){milestone_content.one('.value').setAttribute('href',new_value.replace('/api/devel',''));}
var inline_combo=Y.one(document.getElementById(conf.prefix+'.milestone'));if(Y.Lang.isValue(inline_combo)){inline_combo.set('value',null);Y.Array.each(milestone_choice_edit.get('items'),function(item){if(item.value==milestone_choice_edit.get('value')){inline_combo.all('option').each(function(opt){if(opt.get('innerHTML')==item.name){opt.set('selected',true);}});}});}
milestone_choice_edit._uiClearWaiting();});milestone_content.one('.nulltext').on('click',milestone_choice_edit.onClick,milestone_choice_edit);milestone_choice_edit.render();}
if(Y.Lang.isValue(assignee_content)){var step_title=(conf.assignee_vocabulary=='ValidAssignee')?"Search for people or teams":"Select a team of which you are a member";var assignee_picker=Y.lp.picker.addPickerPatcher(conf.assignee_vocabulary,conf.bugtask_path,"assignee_link",assignee_content.get('id'),conf.user_can_unassign,true,{"step_title":step_title,"header":"Change assignee","remove_button_text":"Remove assignee","null_display_value":"Unassigned"});if(conf.hide_assignee_team_selection){content_box=assignee_picker.get('contentBox');search_box=content_box.one('.yui-picker-search-box');search_box.setStyle('display','none');step_title=content_box.one('.contains-steptitle');step_title.setStyle('display','none');}
assignee_picker.render();}};bugs.setup_me_too=function(user_is_affected,others_affected_count){if(Y.UA.ie){return;}
var me_too_content=Y.one('#affectsmetoo');var me_too_edit=new MeTooChoiceSource({contentBox:me_too_content,value:user_is_affected,elementToFlash:me_too_content,editicon:".dynamic img.editicon",others_affected_count:others_affected_count});me_too_edit.render();};function MeTooChoiceSource(){MeTooChoiceSource.superclass.constructor.apply(this,arguments);}
MeTooChoiceSource.NAME='metoocs';MeTooChoiceSource.NS='metoocs';MeTooChoiceSource.ATTRS={title:{value:'Does this bug affect you?'},items:{value:[{name:'Yes, it affects me',value:true,disabled:false},{name:"No, it doesn't affect me",value:false,disabled:false}]},others_affected_count:{value:null}};bugs._MeTooChoiceSource=MeTooChoiceSource;Y.extend(MeTooChoiceSource,Y.ChoiceSource,{initializer:function(){var widget=this;this.error_handler=new LP.client.ErrorHandler();this.error_handler.clearProgressUI=function(){widget._uiClearWaiting();};this.error_handler.showError=function(error_msg){widget.showError(error_msg);};var others_affected_count=this.get('others_affected_count');var source_names=this._getSourceNames(others_affected_count);Y.each(this.get('items'),function(item){if(item.value in source_names){item.source_name=source_names[item.value];}});},_getSourceNames:function(others_affected_count){var source_names={};if(others_affected_count==1){source_names[true]=('This bug affects you and 1 other person');}
else if(others_affected_count>1){source_names[true]=('This bug affects you and '+
others_affected_count+' other people');}
else{source_names[true]='This bug affects you';}
if(others_affected_count==1){source_names[false]=('This bug affects 1 person, but not you');}
else if(others_affected_count>1){source_names[false]=('This bug affects '+others_affected_count+' people, but not you');}
else{source_names[false]="This bug doesn't affect you";}
return source_names;},showError:function(err){Y.lp.display_error(null,err);},render:function(){MeTooChoiceSource.superclass.render.apply(this,arguments);this.get('boundingBox').setStyle('display','inline');this.get('contentBox').one('.static').addClass('unseen');this.get('contentBox').one('.dynamic').removeClass('unseen');},_saveData:function(){this._uiSetWaiting();var value=this.getInput();var client=new LP.client.QuickBuild();var widget=this;var config={on:{success:function(entry){widget._uiClearWaiting();MeTooChoiceSource.superclass._saveData.call(widget,value);},failure:this.error_handler.getFailureHandler()},parameters:{affected:value}};client.named_post(LP.client.cache.bug.self_link,'markUserAffected',config);}});function check_can_be_unsubscribed(subscription){var error_handler=new LP.client.ErrorHandler();error_handler.showError=function(error_msg){Y.lp.display_error(Y.one('.menu-link-addsubscriber'),error_msg);};var config={on:{success:function(result){var is_team=result.get('is_team');subscription.set('is_team',is_team);var final_config={on:{success:function(result){var team_member=false;for(var i=0;i<result.entries.length;i++){if(result.entries[i].member_link==LP.client.get_absolute_uri(subscription.get('subscriber').get('uri'))){team_member=true;}}
if(team_member){subscription.set('can_be_unsubscribed',true);add_temp_user_name(subscription);}else{subscription.set('can_be_unsubscribed',false);add_temp_user_name(subscription);}},failure:error_handler.getFailureHandler()}};if(is_team){var members=result.get('members_details_collection_link');lp_client.get(members,final_config);}else{subscription.set('can_be_unsubscribed',false);add_temp_user_name(subscription);}},failure:error_handler.getFailureHandler()}};lp_client.get(LP.client.get_absolute_uri(subscription.get('person').get('escaped_uri')),config);}
function subscribe_someone_else(result,subscription){var person=new Y.lp.Subscriber({uri:result.api_uri,display_name:result.title,subscriber_ids:subscriber_ids});subscription.set('person',person);var error_handler=new LP.client.ErrorHandler();error_handler.showError=function(error_msg){Y.lp.display_error(Y.one('.menu-link-addsubscriber'),error_msg);};if(subscription.is_already_subscribed()){error_handler.showError(subscription.get('person').get('full_display_name')+' has already been subscribed');}else{check_can_be_unsubscribed(subscription);}}
function setup_add_attachment(){var attachment_link=Y.all('.menu-link-addcomment');attachment_link.on('click',function(e){var comment_input=Y.one('[id="field.comment"]');if(comment_input.get('value')!==''){var current_url=attachment_link.getAttribute('href');var attachment_url=current_url+'?field.comment='+
encodeURIComponent(comment_input.get('value'));attachment_link.setAttribute('href',attachment_url);}});}
function load_subscribers_from_duplicates(){if(Y.UA.ie){return null;}
Y.get('#subscribers-portlet-dupe-spinner').setStyle('display','block');function hide_spinner(){Y.get('#subscribers-portlet-dupe-spinner').setStyle('display','none');Y.bugs.portlet.fire('bugs:dupeportletloadfailed');}
function on_success(transactionid,response,args){hide_spinner();var dupe_subscribers_container=Y.get('#subscribers-from-duplicates-container');dupe_subscribers_container.set('innerHTML',dupe_subscribers_container.get('innerHTML')+
response.responseText);Y.bugs.portlet.fire('bugs:dupeportletloaded');}
var config={on:{success:on_success,failure:hide_spinner}};var url=Y.get('#subscribers-from-dupes-content-link').getAttribute('href').replace('bugs.','');Y.io(url,config);}
Y.bugs.load_subscribers_portlet=function(subscription_link,subscription_link_handler){if(Y.UA.ie){return null;}
Y.one('#subscribers-portlet-spinner').setStyle('display','block');function hide_spinner(){Y.one('#subscribers-portlet-spinner').setStyle('display','none');if(Y.bugs){Y.bugs.portlet.fire('bugs:portletloadfailed',subscription_link_handler);}}
function setup_portlet(transactionid,response,args){hide_spinner();var portlet=Y.one('#portlet-subscribers');portlet.set('innerHTML',portlet.get('innerHTML')+response.responseText);Y.bugs.portlet.fire('bugs:portletloaded');}
var config={on:{success:setup_portlet,failure:hide_spinner}};var url=Y.one('#subscribers-content-link').getAttribute('href').replace('bugs.','');Y.io(url,config);};function load_subscriber_ids(){function on_success(transactionid,response,args){try{subscriber_ids=Y.JSON.parse(response.responseText);Y.log("Loaded subscriber IDs.");Y.bugs.portlet.fire('bugs:portletsubscriberidsloaded');}catch(e){Y.log("Unable to load subscriber ids.","error");Y.bugs.portlet.fire('bugs:portletsubscriberidsfailed');}}
function on_failure(){Y.bugs.portlet.fire('bugs:portletsubscriberidsfailed');}
var config={on:{success:on_success,failure:on_failure}};var url=Y.get('#subscribers-ids-link').getAttribute('href');Y.io(url,config);}},"0.1",{"requires":["base","oop","node","event","io-base","json-parse","substitute","widget-position-ext","lazr.formoverlay","lazr.anim","lazr.base","lazr.overlay","lazr.choiceedit","lp.picker","lp.client.plugins","lp.subscriber","lp.errors"]});
// bugs/bug_tags_entry-min.js

YUI.add('bugs.bug_tags_entry',function(Y){var bugs=Y.namespace('bugs');var bug_tags_div;var edit_tags_trigger;var add_tags_trigger;var tag_list_span;var tag_input;var ok_button;var cancel_button;var tags_edit_spinner;var tags_form;var available_tags;var autocomplete;var DISPLAY='display',NONE='none',INLINE='inline',A='a',VALUE='value',BUG='bug',INNER_HTML='innerHTML',ESCAPE=27,TAGS_SHOW='tags-show',TAGS_HIDE='tags-hide';var populate_tags_input=function(){var tags=[];tag_list_span.all(A).each(function(anchor){tags.push(anchor.get(INNER_HTML));});tag_input.set(VALUE,tags.join(' ')+' ');};var base_url=window.location.href.split('/+bug')[0]+'/+bugs?field.tag=';var save_tags=function(){var lp_client=new LP.client.QuickBuild();var tags=Y.Array(Y.Lang.trim(tag_input.get(VALUE)).split(new RegExp('\\s+'))).filter(function(elem){return elem!='';});var bug=new LP.client.Entry(lp_client,LP.client.cache[BUG],LP.client.cache[BUG].self_link);bug.removeAttr('http_etag');bug.set('tags',tags);tags_edit_spinner.setStyle(DISPLAY,INLINE);ok_button.setStyle(DISPLAY,NONE);cancel_button.setStyle(DISPLAY,NONE);bug.lp_save({on:{success:function(updated_entry){var official_tags=[];var unofficial_tags=[];Y.each(updated_entry.get('tags'),function(tag){if(available_tags.indexOf(tag)>-1){official_tags.push(tag);}else{unofficial_tags.push(tag);}});official_tags.sort();unofficial_tags.sort();var tags_html=Y.Array(official_tags).map(function(tag){return Y.Lang.substitute('<a href="{tag_url}" class="official-tag">{tag}</a>',{tag_url:base_url+tag,tag:tag});}).join(' ')+' '+Y.Array(unofficial_tags).map(function(tag){return Y.Lang.substitute('<a href="{tag_url}" class="unofficial-tag">{tag}</a>',{tag_url:base_url+tag,tag:tag});}).join(' ');tag_list_span.set(INNER_HTML,tags_html);tag_input.setStyle(DISPLAY,NONE);tag_list_span.setStyle(DISPLAY,INLINE);ok_button.setStyle(DISPLAY,NONE);cancel_button.setStyle(DISPLAY,NONE);edit_tags_trigger.setStyle(DISPLAY,INLINE);tags_edit_spinner.setStyle(DISPLAY,NONE);Y.lazr.anim.green_flash({node:tag_list_span}).run();if(Y.Lang.trim(tags_html)==''){Y.one('#bug-tags').removeClass(TAGS_SHOW);Y.one('#bug-tags').addClass(TAGS_HIDE);Y.one('#add-bug-tags').removeClass(TAGS_HIDE);Y.one('#add-bug-tags').addClass(TAGS_SHOW);}},failure:function(id,request){tags_edit_spinner.setStyle(DISPLAY,NONE);Y.lazr.anim.green_flash({node:tag_list_span}).run();}}});};var cancel=function(){tag_input.setStyle(DISPLAY,NONE);tag_list_span.setStyle(DISPLAY,INLINE);ok_button.setStyle(DISPLAY,NONE);cancel_button.setStyle(DISPLAY,NONE);edit_tags_trigger.setStyle(DISPLAY,INLINE);tags_edit_spinner.setStyle(DISPLAY,NONE);autocomplete.hide()
Y.lazr.anim.red_flash({node:tag_list_span}).run();if(Y.Lang.trim(tag_list_span.get('innerHTML'))==''){Y.one('#bug-tags').removeClass(TAGS_SHOW);Y.one('#bug-tags').addClass(TAGS_HIDE);Y.one('#add-bug-tags').removeClass(TAGS_HIDE);Y.one('#add-bug-tags').addClass(TAGS_SHOW);}};var edit=function(){populate_tags_input();tag_list_span.setStyle(DISPLAY,NONE);tag_input.setStyle(DISPLAY,INLINE);tag_input.focus();edit_tags_trigger.setStyle(DISPLAY,NONE);ok_button.setStyle(DISPLAY,INLINE);cancel_button.setStyle(DISPLAY,INLINE);autocomplete.render();};bugs.setup_tag_entry=function(available_official_tags){if(LP.client.links['me']===undefined){return;}
available_tags=Y.Array(available_official_tags);bug_tags_div=Y.one('#bug-tags');edit_tags_trigger=bug_tags_div.one('#edit-tags-trigger');add_tags_trigger=Y.one('#add-tags-trigger');tag_list_span=bug_tags_div.one('#tag-list');tag_input=bug_tags_div.one('#tag-input');ok_button=bug_tags_div.one('#edit-tags-ok');cancel_button=bug_tags_div.one('#edit-tags-cancel');tags_edit_spinner=bug_tags_div.one('#tags-edit-spinner');tags_form=bug_tags_div.one('#tags-form');edit_tags_trigger.on('click',function(e){e.halt();edit();});add_tags_trigger.on('click',function(e){e.halt();Y.one('#bug-tags').removeClass(TAGS_HIDE);Y.one('#bug-tags').addClass(TAGS_SHOW);Y.one('#add-bug-tags').removeClass(TAGS_SHOW);Y.one('#add-bug-tags').addClass(TAGS_HIDE);edit();});cancel_button.on('click',function(e){e.halt();cancel();});ok_button.on('click',function(e){e.halt();save_tags();});tag_input.on('keydown',function(e){if(e.keyCode==ESCAPE){e.halt();cancel();}});tags_form.on('submit',function(e){e.halt();save_tags();});add_tags_trigger.addClass('js-action');edit_tags_trigger.addClass('js-action')
autocomplete=new Y.lazr.AutoComplete({input:'#tag-input',data:available_official_tags,boundingBox:'#tags-autocomplete',contentBox:'#tags-autocomplete-content'});autocomplete.on('queryChange',function(e){var val="null";if(e.newVal!=null){val="'"+e.newVal.text+"', "+e.newVal.offset;}});};},"0.1",{"requires":["base","io-base","node","substitute","node-menunav","lazr.base","lazr.anim","lazr.autocomplete"]});
// bugs/filebug-dupefinder-min.js

YUI.add('bugs.dupe_finder',function(Y){var BLOCK='block',DISPLAY='display',EXPANDER_COLLAPSED='/@@/treeCollapsed',EXPANDER_EXPANDED='/@@/treeExpanded',INLINE='inline',INNER_HTML='innerHTML',LAZR_CLOSED='lazr-closed',NONE='none',SRC='src',UNSEEN='unseen';var bugs=Y.namespace('bugs');var bug_already_reported_expanders;var search_field;var search_button;var search_url_base;var filebug_base_url;var filebug_form_url;var submit_button_html='<button type="submit" name="field.actions.this_is_my_bug" '+'value="Yes, this is the bug I\'m trying to report"'+'class="lazr-pos lazr-btn" >OK</button>';var cancel_button_html='<button type="button" name="field.actions.cancel" '+'class="lazr-neg lazr-btn" >Cancel</button>';function get_details_div(expander){var details_div=expander.get('parentNode').get('parentNode').one('.duplicate-details');if(!Y.Lang.isValue(details_div)){Y.fail("Unable to find details div for expander "+expander.get('id'));}else{return details_div;}}
function collapse_bug_details(expander){var bug_details_div=get_details_div(expander);var anim=Y.lazr.effects.slide_in(bug_details_div);anim.run();expander.set(SRC,EXPANDER_COLLAPSED);}
function show_bug_reporting_form(e){var filebug_form_container=Y.one('#filebug-form-container');if(Y.Lang.isValue(filebug_form_container)){filebug_form_container.setStyle(DISPLAY,BLOCK);}
var bug_reporting_form=Y.one('#bug_reporting_form');bug_reporting_form.setStyle(DISPLAY,BLOCK);Y.one(Y.DOM.byId('field.actions.submit_bug')).focus();var bugtarget_package_btn=Y.one(Y.DOM.byId('field.bugtarget.option.package'));if(Y.Lang.isValue(bugtarget_package_btn)){Y.one(Y.DOM.byId('field.bugtarget.package')).focus();}else{Y.one(Y.DOM.byId('field.comment')).focus();}}
function search_for_and_display_dupes(){function show_failure_message(transaction_id,response,args){var error_message='';if(response.status==503){error_message="Searching for your bug in QuickBuild took too long. "+"Try reducing the number of words in the summary "+"field and click \"Check again\" to retry your search. "+"Alternatively, you can enter the details of your bug "+"below.";}else{error_message="An error occured whilst trying to find bugs matching "+"the summary you entered. Click \"Check again\" to retry "+"your search. Alternatively, you can enter the "+"details of your bug below.";}
var error_node=Y.Node.create('<p></p>');error_node.set('text',error_message);Y.one('#possible-duplicates').appendChild(error_node);Y.one('#spinner').addClass(UNSEEN);show_bug_reporting_form();Y.one(Y.DOM.byId('field.title')).set('value',search_field.get('value'));search_button.set('value','Check again');search_button.removeClass(UNSEEN);}
function on_success(transaction_id,response,args){Y.one('#spinner').addClass(UNSEEN);var duplicate_div=Y.one('#possible-duplicates');duplicate_div.set(INNER_HTML,response.responseText);bug_already_reported_expanders=Y.all('img.bug-already-reported-expander');if(bug_already_reported_expanders.size()>0){Y.bugs.setup_dupes();}else{show_bug_reporting_form();}
Y.one('#bug_reporting_form input[name=field.title]').set('value',search_field.get('value'));search_button.set('value','Check again');search_button.removeClass(UNSEEN);}
var search_term=encodeURI(search_field.get('value'));var search_url=search_url_base+'?title='+search_term;search_button.addClass(UNSEEN);Y.one('#spinner').removeClass(UNSEEN);Y.one('#possible-duplicates').set(INNER_HTML,'');Y.one('#bug_reporting_form').setStyle(DISPLAY,NONE);config={on:{success:on_success,failure:show_failure_message}};Y.io(search_url,config);}
function create_subscribe_overlay(form){var bug_id=form.one('input.bug-already-reported-as').get('value');var bug_title=Y.one('#bug-'+bug_id+'-title').get(INNER_HTML);if(bug_title.length>35){bug_title=bug_title.substring(0,35)+'...';}
var subscribe_form_body='<div style="width: 320px">'+'    <p style="width: 100%">#'+bug_id+' "'+bug_title+'"'+'    <br /><br /></p>'+'    <p style="font-weight: bold;">'+'       <input type="hidden" name="field.bug_already_reported_as" '+'           value="'+bug_id+'" /> '+'       <input type="radio" name="field.subscribe_to_existing_bug" '+'           id="dont-subscribe-to-bug-'+bug_id+'" value="no" '+'           class="subscribe-option" checked="true" /> '+'       <label for="dont-subscribe-to-bug-'+bug_id+'"> '+'         Just mark the bug as affecting me'+'       </label>'+'    </p>'+'    <p>'+'       <input type="radio" name="field.subscribe_to_existing_bug" '+'           id="subscribe-to-bug-'+bug_id+'" value="yes" '+'           class="subscribe-option" />'+'       <label for="subscribe-to-bug-'+bug_id+'"> '+'         Subscribe me as well'+'       </label>'+'    </p>'+'</div>';subscribe_form_overlay=new Y.lazr.FormOverlay({headerContent:'<h2>I am affected by this bug</h2>',form_content:subscribe_form_body,form_submit_button:Y.Node.create(submit_button_html),form_cancel_button:Y.Node.create(cancel_button_html),centered:true,visible:false});subscribe_form_overlay.render('#duplicate-overlay-bug-'+bug_id);form_node=subscribe_form_overlay.form_node;form_node.set('action',form.get('action'));form_node.set('method','post');var radio_buttons=form.queryAll('input.subscribe-option');Y.each(radio_buttons,function(radio_button){var weight=radio_button.get('checked')?'bold':'normal';radio_button.get('parentNode').setStyle('fontWeight',weight);});return subscribe_form_overlay;}
function reload_filebug_form(){var config={on:{success:function(transaction_id,response,args){var filebug_form_container=Y.one('#filebug-form-container');filebug_form_container.setStyle(DISPLAY,NONE);Y.log(filebug_form_container);Y.one('#possible-duplicates').set(INNER_HTML,'');set_up_filebug_form(response.responseText);search_button.set('value','Next');}}};var product_field=Y.one(Y.DOM.byId('field.product'));if(Y.Lang.isValue(product_field)){var product=product_field.get('value');filebug_form_url=filebug_base_url+product+'/+filebug-inline-form';search_url_base=filebug_base_url+product+'/+filebug-show-similar';}
Y.io(filebug_form_url,config);}
function set_up_filebug_form(form_contents){var filebug_form_container=Y.one('#filebug-form-container');filebug_form_container.set(INNER_HTML,form_contents);var bug_reporting_form=Y.one('#bug_reporting_form');if(Y.Lang.isValue(bug_reporting_form)){activateCollapsibles();}}
function set_up_dupe_finder(transaction_id,response,args){filebug_base_url=Y.one('#filebug-base-url').getAttribute('href');set_up_filebug_form(response.responseText);search_url_base=Y.one('#duplicate-search-url').getAttribute('href');search_field=Y.one(Y.DOM.byId('field.title'));search_field.set('name','field.search');search_field.set('id','field.search');var product_field=Y.one(Y.DOM.byId('field.product'));if(Y.Lang.isValue(product_field)){Y.log(product_field);product_field.on('change',reload_filebug_form);}
search_button=Y.one(Y.DOM.byId('field.actions.search'));search_button.set('value','Next');search_form=Y.one('#filebug-search-form');search_form.on('submit',function(e){e.halt();search_for_and_display_dupes();});}
Y.bugs.setup_dupes=function(){bug_already_reported_expanders=Y.all('img.bug-already-reported-expander');bug_reporting_form=Y.one('#bug_reporting_form');if(bug_already_reported_expanders.size()>0){Y.each(Y.all('div.duplicate-details'),function(div){collapse_bug_details(div);});Y.each(Y.all('.similar-bug'),function(row){var bug_details_div=row.query('div.duplicate-details');var image=row.query('img.bug-already-reported-expander');var bug_title_link=row.query('.duplicate-bug-link');var view_bug_link=row.query('.view-bug-link');bug_title_link.addClass('js-action');bug_title_link.on('click',function(e){e.preventDefault();});view_bug_link.on('click',function(e){e.stopPropagation();});bug_details_div.on('click',function(e){e.stopPropagation();});bug_title_link.on('focus',function(e){if(!bug_details_div.hasClass('lazr-opened')){var anim=Y.lazr.effects.slide_out(bug_details_div);anim.run();image.set(SRC,EXPANDER_EXPANDED);if(bug_reporting_form.getStyle(DISPLAY)==BLOCK){bug_reporting_form.addClass(UNSEEN);}}});row.on('click',function(e){if(bug_details_div.hasClass('lazr-opened')){collapse_bug_details(image);}else{var anim=Y.lazr.effects.slide_out(bug_details_div);anim.run();image.set(SRC,EXPANDER_EXPANDED);}});});bug_reporting_form.addClass(UNSEEN);}
bug_not_reported_button=Y.one('#bug-not-already-reported');if(Y.Lang.isValue(bug_not_reported_button)){bug_not_reported_button.on('click',show_bug_reporting_form);}
var this_is_my_bug_forms=Y.all('form.this-is-my-bug-form');Y.each(this_is_my_bug_forms,function(form){var subscribe_form_overlay=create_subscribe_overlay(form);form.on('submit',function(e){e.halt();subscribe_form_overlay.show();});});};Y.bugs.setup_dupe_finder=function(){Y.log("In setup_dupe_finder");Y.on('domready',function(){config={on:{success:set_up_dupe_finder,failure:function(){}}};var filebug_form_url_element=Y.one('#filebug-form-url');if(Y.Lang.isValue(filebug_form_url_element)){filebug_form_url=filebug_form_url_element.getAttribute('href');Y.io(filebug_form_url,config);}});};},"0.1",{"requires":["base","io","oop","node","event","lazr.formoverlay","lazr.effects"]});
// sorttable/sorttable-min.js

var SORT_COLUMN_INDEX;var arrowUp="/@@/arrowUp";var arrowDown="/@@/arrowDown";var arrowBlank="/@@/arrowBlank";function trim(str){return str.replace(/^\s*|\s*$/g,"");}
function sortables_init(){if(!document.getElementsByTagName)return;tbls=document.getElementsByTagName("table");for(ti=0;ti<tbls.length;ti++){thisTbl=tbls[ti];if(((' '+thisTbl.className+' ').indexOf(" sortable ")!=-1)&&(thisTbl.id)){ts_makeSortable(thisTbl);}}}
function ts_makeSortable(table){if(table.tHead&&table.tHead.rows&&table.tHead.rows.length>0){var firstRow=table.tHead.rows[0];}else if(table.rows&&table.rows.length>0){var firstRow=table.rows[0];}
if(!firstRow)return;for(var i=0;i<firstRow.cells.length;i++){var cell=firstRow.cells[i];var txt=ts_getInnerText(cell);cell.innerHTML='<a href="#" class="sortheader" onclick="ts_resortTable(this); return false;">'
+txt+'<img class="sortarrow" src="'+arrowBlank+'" height="6" width="9"></a>';}
for(var i=0;i<firstRow.cells.length;i++){var cell=firstRow.cells[i];var lnk=ts_firstChildByName(cell,'A');var img=ts_firstChildByName(lnk,'IMG')
if((' '+cell.className+' ').indexOf(" default-sort ")!=-1){ts_arrowDown(img);}
if((' '+cell.className+' ').indexOf(" default-revsort ")!=-1){ts_arrowUp(img);}
if((' '+cell.className+' ').indexOf(" initial-sort ")!=-1){ts_resortTable(lnk);}}}
function ts_getInnerText(el){if(typeof el=="string")return el;if(typeof el=="undefined"){return el};if(el.innerText)return el.innerText;var str="";var cs=el.childNodes;var l=cs.length;for(var i=0;i<l;i++){node=cs[i];switch(node.nodeType){case 1:if(node.className=="sortkey"){return ts_getInnerText(node);}else if(node.className=="revsortkey"){return"-"+ts_getInnerText(node);}else{str+=ts_getInnerText(node);break;}
case 3:str+=node.nodeValue;break;}}
return str;}
function ts_firstChildByName(el,name){for(var ci=0;ci<el.childNodes.length;ci++){if(el.childNodes[ci].tagName&&el.childNodes[ci].tagName.toLowerCase()==name.toLowerCase())
return el.childNodes[ci];}}
function ts_arrowUp(img){img.setAttribute('sortdir','up');img.src=arrowUp;}
function ts_arrowDown(img){img.setAttribute('sortdir','down');img.src=arrowDown;}
function ts_resortTable(lnk){var img=ts_firstChildByName(lnk,'IMG')
var td=lnk.parentNode;var column=td.cellIndex;var table=getParent(td,'TABLE');if(table.rows.length<=1)return;SORT_COLUMN_INDEX=column;while(td.previousSibling!=null){td=td.previousSibling;if(td.nodeType!=1){continue}
colspan=td.getAttribute("colspan");if(colspan){SORT_COLUMN_INDEX+=parseInt(colspan)-1;}}
var itm=ts_getInnerText(table.rows[1].cells[SORT_COLUMN_INDEX]);itm=trim(itm);sortfn=ts_sort_caseinsensitive;if(itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/))sortfn=ts_sort_date;if(itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/))sortfn=ts_sort_date;if(itm.match(/^[£$]/))sortfn=ts_sort_currency;if(itm.match(/^-?[\d\.]+$/))sortfn=ts_sort_numeric;var firstRow=new Array();var newRows=new Array();for(i=0;i<table.rows[0].length;i++){firstRow[i]=table.rows[0][i];}
for(j=1;j<table.rows.length;j++){newRows[j-1]=table.rows[j];newRows[j-1].oldPosition=j-1;}
newRows.sort(ts_stableSort(sortfn));if(img.getAttribute("sortdir")=='down'){newRows.reverse();ts_arrowUp(img);}else{ts_arrowDown(img);}
for(i=0;i<newRows.length;i++){if(!newRows[i].className||(newRows[i].className&&(newRows[i].className.indexOf('sortbottom')==-1)))
table.tBodies[0].appendChild(newRows[i]);}
for(i=0;i<newRows.length;i++){if(newRows[i].className&&(newRows[i].className.indexOf('sortbottom')!=-1))
table.tBodies[0].appendChild(newRows[i]);}
var allimgs=document.getElementsByTagName("img");for(var ci=0;ci<allimgs.length;ci++){var one_img=allimgs[ci];if(one_img!=img&&one_img.className=='sortarrow'&&getParent(one_img,"table")==getParent(lnk,"table")){one_img.src=arrowBlank;one_img.setAttribute('sortdir','');}}}
function getParent(el,pTagName){if(el==null)
return null;else if(el.nodeType==1&&el.tagName.toLowerCase()==pTagName.toLowerCase())
return el;else
return getParent(el.parentNode,pTagName);}
function ts_stableSort(sortfn){function stableSort(a,b){var cmp=sortfn(a,b);if(cmp!=0){return cmp;}else{return a.oldPosition-b.oldPosition;}}
return stableSort;}
function ts_sort_date(a,b){aa=trim(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));bb=trim(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));if(aa.length==10){dt1=aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);}else{yr=aa.substr(6,2);if(parseInt(yr)<50){yr='20'+yr;}else{yr='19'+yr;}
dt1=yr+aa.substr(3,2)+aa.substr(0,2);}
if(bb.length==10){dt2=bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);}else{yr=bb.substr(6,2);if(parseInt(yr)<50){yr='20'+yr;}else{yr='19'+yr;}
dt2=yr+bb.substr(3,2)+bb.substr(0,2);}
if(dt1==dt2)return 0;if(dt1<dt2)return-1;return 1;}
function ts_sort_currency(a,b){aa=ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');bb=ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');return parseFloat(aa)-parseFloat(bb);}
function ts_sort_numeric(a,b){aa=parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));if(isNaN(aa))aa=0;bb=parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));if(isNaN(bb))bb=0;return aa-bb;}
function ts_sort_caseinsensitive(a,b){aa=ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();bb=ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();if(aa==bb)return 0;if(aa<bb)return-1;return 1;}
function ts_sort_default(a,b){aa=ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);bb=ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);if(aa==bb)return 0;if(aa<bb)return-1;return 1;}
function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r;}else{alert("Handler could not be removed");}}
// inlinehelp/inlinehelp-min.js

function initInlineHelp(){$('help-close').innerHTML='<button id="help-close-btn">Close</button>';forEach(findHelpLinks(),setupHelpTrigger);initHelpPane();}
function findHelpLinks(){has_help_target=function(elem){return getNodeAttribute(elem,'target')=='help';};return filter(has_help_target,currentDocument().getElementsByTagName('a'));}
function setupHelpTrigger(elem){addElementClass(elem,'help');connect(elem,'onclick',handleClickOnHelp);}
var last_help_trigger=null;function initHelpPane(){connect('help-close-btn','onclick',handleClickOnClose);dismissHelp();}
function showHelpFor(trigger){makeInvisible('help-pane-content');$('help-pane-content').onload=handleHelpLoaded;setNodeAttribute('help-pane-content','src',trigger.href);var help_pane=$('help-pane');var viewport_dim=getViewportDimensions();var help_pane_dim=elementDimensions('help-pane');var pos_x=Math.round(viewport_dim.w/2)-(help_pane_dim.w/2);var pos_y=Math.round(viewport_dim.h/2)-(help_pane_dim.h/2);var viewport_pos=getViewportPosition();pos_y+=viewport_pos.y;setElementPosition(help_pane,new Coordinates(pos_x,pos_y));makeVisible(help_pane);setStyle(help_pane,{'display':''});}
function dismissHelp(){makeInvisible('help-pane');}
function handleClickOnHelp(event){event.stop();var trigger=event.src();if(!isVisible('help-pane')){showHelpFor(trigger);}else if(trigger==last_help_trigger){dismissHelp();}else{dismissHelp();showHelpFor(trigger);}
last_help_trigger=trigger;}
function handleClickOnClose(event){event.stop();dismissHelp();}
function handleHelpLoaded(event){makeVisible('help-pane-content');}
function handleClickOnPage(event){var help=$('help-pane');if(isVisible(help)&&!isInside(event.mouse().page,help)){dismissHelp();}}
function toggleVisible(elem){toggleElementClass("invisible",elem);}
function makeVisible(elem){removeElementClass(elem,"invisible");}
function makeInvisible(elem){addElementClass(elem,"invisible");}
function isVisible(elem){return!hasElementClass(elem,"invisible");}
function isInside(point,element){return intersect(point,getElementPosition(element),getElementDimensions(element));}
function intersect(point,dim_point,dimensions){return((point.x>dim_point.x)&&(point.x<dim_point.x+dimensions.w)&&(point.y>dim_point.y)&&(point.y<dim_point.y+dimensions.h));}
// client/client-min.js

LP=(typeof(LP)!="undefined")?LP:{};LP.client=(typeof LP.client!="undefined")?LP.client:{};LP.client.links=(typeof LP.links!=="undefined")?LP.client.links:{};LP.client.cache=(typeof LP.objects!=="undefined")?LP.client.cache:{};YUI().use("attribute","io-base","json-parse","json-stringify",function(Y){LP.client.HTTP_CREATED=201;LP.client.HTTP_SEE_ALSO=303;LP.client.HTTP_NOT_FOUND=404;LP.client.XHTML='application/xhtml+xml';LP.log_object=function(o,name){var result;var format=function(value){if(typeof value=='string'){value=value.substring(0,200);return'"'+value+'"';}else if(typeof value=='function'){return String(value).split(" {")[0];}else if(value instanceof Array){return'Array of length '+value.length;}else{return String(value);}};var introspect=function(collection){var items=[];var keys=[];var key;for(key in collection){if(collection.hasOwnProperty(key)){keys.push(key);}}
keys.sort();for(var index in keys){if(keys.hasOwnProperty(index)){key=keys[index];var value;try{value=format(collection[key]);}catch(e){value=e.message;}
items.push(key+'='+value);}}
return items.join(',\n  ');};if(o===null||typeof o=='string'||typeof o=='function'){result=format(o);}else{result='(direct-attributes)\n  '+introspect(o);if(o.getAttrs!==undefined){result+='\n(get()-attributes)\n  '+introspect(o.getAttrs());}}
if(name!==undefined){result=name+': '+result;}
Y.log(result);};LP.client.append_qs=function(qs,key,value){if(qs===undefined){qs="";}
if(qs.length>0){qs+='&';}
qs+=encodeURIComponent(key)+"="+encodeURIComponent(value);return qs;};LP.client.normalize_uri=function(uri){var host_start=uri.indexOf('//');if(host_start!=-1){var host_end=uri.indexOf('/',host_start+2);return uri.substring(host_end,uri.length);}
var base="/api/devel";if(uri.indexOf(base.substring(1,base.length))===0){return'/'+uri;}
if(uri.indexOf(base)!==0){if(uri.indexOf('/')!==0){uri=base+'/'+uri;}else{uri=base+uri;}}
return uri;};LP.client.get_absolute_uri=function(uri){var location=document.location;uri=LP.client.normalize_uri(uri);return location.protocol+'//'+location.host+uri;};LP.client.get_field_uri=function(base_uri,field_name){base_uri=LP.client.normalize_uri(base_uri);field_name=escape(field_name);if(base_uri.charAt(base_uri.length-1)=='/'){return base_uri+field_name;}else{return base_uri+'/'+field_name;}};LP.client.add_accept=function(config,headers){if(headers===undefined){headers={};}
var accept=config.accept||'application/json';headers.Accept=accept;return headers;};LP.client.start_and_size=function(data,start,size){if(start!==undefined){data=LP.client.append_qs(data,"ws.start",start);}
if(size!==undefined){data=LP.client.append_qs(data,"ws.size",size);}
return data;};LP.client.wrap_resource_on_success=function(ignore,response,args){var client=args[0];var uri=args[1];var old_on_success=args[2];var representation,wrapped;if(old_on_success){var media_type=response.getResponseHeader('Content-Type');if(media_type=='application/json'){representation=Y.JSON.parse(response.responseText);wrapped=client.wrap_resource(uri,representation);return old_on_success(wrapped);}else{return old_on_success(response.responseText);}}};LP.client.HostedFile=function(client,uri,content_type,contents){this.lp_client=client;this.uri=uri;this.content_type=content_type;this.contents=contents;};LP.client.HostedFile.prototype={'lp_save':function(config){var on=config.on;var disposition='attachment; filename="'+this.filename+'"';var hosted_file=this;var args=hosted_file;var y_config={method:"PUT",'on':on,'headers':{"Content-Type":hosted_file.content_type,"Content-Disposition":disposition},'arguments':args,'data':hosted_file.contents};Y.io(LP.client.normalize_uri(hosted_file.uri),y_config);},'lp_delete':function(config){var on=config.on;var hosted_file=this;var args=hosted_file;var y_config={method:"DELETE",on:on,'arguments':args};Y.io(hosted_file.uri,y_config);}};LP.client.Resource=function(){};LP.client.Resource.prototype={'init':function(client,representation,uri){this.lp_client=client;this.lp_original_uri=uri;for(key in representation){if(representation.hasOwnProperty(key)){this[key]=representation[key];}}},'lookup_value':function(key){return this[key];},'follow_link':function(link_name,config){var on=config.on;var uri=this.lookup_value(link_name+'_link');if(uri===undefined){uri=this.lookup_value(link_name+'_collection_link');}
if(uri===undefined){throw new Error("No such link: "+link_name);}
var on_success=on.success;var old_on_failure=on.failure;on.failure=function(ignore,response,args){var client=args[0];var original_url=args[1];if(response.status==LP.client.HTTP_NOT_FOUND||response.status==LP.client.HTTP_SEE_ALSO){var file=new LP.client.HostedFile(client,original_url);return on_success(file);}else if(old_on_failure!==undefined){return old_on_failure(ignore,response,args);}};this.lp_client.get(uri,{on:on});},'named_get':function(operation_name,config){return this.lp_client.named_get(this.lp_original_uri,operation_name,config);},'named_post':function(operation_name,config){return this.lp_client.named_post(this.lp_original_uri,operation_name,config);}};LP.client.Root=function(client,representation,uri){this.init(client,representation,uri);};LP.client.Root.prototype=new LP.client.Resource();LP.client.Collection=function(client,representation,uri){this.init(client,representation,uri);};LP.client.Collection.prototype=new LP.client.Resource();LP.client.Collection.prototype.lp_slice=function(on,start,size){return this.lp_client.get(this.lp_original_uri,{on:on,start:start,size:size});};LP.client.Entry=function(client,representation,uri){this.lp_client=client;this.lp_original_uri=uri;this.dirty_attributes=[];var entry=this;for(key in representation){if(representation.hasOwnProperty(key)){this.addAttr(key,{value:representation[key]});this.on(key+"Change",this.mark_as_dirty);}}};LP.client.Entry.prototype=new LP.client.Resource();Y.augment(LP.client.Entry,Y.Attribute);LP.client.Entry.prototype.mark_as_dirty=function(event){if(event.newVal!=event.prevVal){this.dirty_attributes.push(event.attrName);}};LP.client.Entry.prototype.lp_save=function(config){var on=config.on;var representation={};var entry=this;Y.each(this.dirty_attributes,function(attribute,key){representation[attribute]=entry.get(attribute);});var headers={};if(this.get('http_etag')!==undefined){headers['If-Match']=this.get('http_etag');}
var uri=LP.client.normalize_uri(this.get('self_link'));this.lp_client.patch(uri,representation,config,headers);this.dirty_attributes=[];};LP.client.Entry.prototype.lookup_value=function(key){return this.get(key);};LP.client.QuickBuild=function(){};LP.client.QuickBuild.prototype={'get':function(uri,config){var on=Y.merge(config.on);var start=config.start;var size=config.size;var data=config.data;var headers=LP.client.add_accept(config);uri=LP.client.normalize_uri(uri);if(data===undefined){data="";}
if(start!==undefined||size!==undefined){data=LP.client.start_and_size(data,start,size);}
var old_on_success=on.success;on.success=LP.client.wrap_resource_on_success;var client=this;var y_config={on:on,'arguments':[client,uri,old_on_success],'headers':headers,data:data};Y.io(uri,y_config);},'named_get':function(uri,operation_name,config){var parameters=config.parameters;var data=LP.client.append_qs("","ws.op",operation_name);for(name in parameters){if(parameters.hasOwnProperty(name)){data=LP.client.append_qs(data,name,parameters[name]);}}
config.data=data;return this.get(uri,config);},'named_post':function(uri,operation_name,config){var on=Y.merge(config.on);var parameters=config.parameters;uri=LP.client.normalize_uri(uri);var data=LP.client.append_qs(data,"ws.op",operation_name);for(name in parameters){if(parameters.hasOwnProperty(name)){data=LP.client.append_qs(data,name,parameters[name]);}}
var old_on_success=on.success;on.success=function(unknown,response,args){if(response.status==LP.client.HTTP_CREATED){var new_location=response.getResponseHeader("Location");return client.get(new_location,{on:{success:old_on_success,failure:on.failure}});}
return LP.client.wrap_resource_on_success(undefined,response,args);};var client=this;var y_config={method:"POST",on:on,'arguments':[client,uri,old_on_success],data:data};Y.io(uri,y_config);},'patch':function(uri,representation,config,headers){var on=config.on;var data=Y.JSON.stringify(representation);uri=LP.client.normalize_uri(uri);var old_on_success=on.success;on.success=LP.client.wrap_resource_on_success;args=[this,uri,old_on_success];var extra_headers={"X-HTTP-Method-Override":"PATCH","Content-Type":"application/json","X-Content-Type-Override":"application/json"};if(headers!==undefined){for(name in headers){if(headers.hasOwnProperty(name)){extra_headers[name]=headers[name];}}}
extra_headers=LP.client.add_accept(config,extra_headers);var y_config={'method':"POST",'on':on,'headers':extra_headers,'arguments':args,'data':data};Y.io(uri,y_config);},'wrap_resource':function(uri,representation){if(representation===null||representation===undefined){return representation;}
if(representation.lp_redirect_location!==undefined){uri=representation.lp_redirect_location;}
if(representation.resource_type_link===undefined){if(representation.total_size!==undefined){return new LP.client.Collection(this,representation,uri);}else{return representation;}}else if(representation.resource_type_link.search(/\/#service-root$/)!==-1){return new LP.client.Root(this,representation,uri);}else if(representation.total_size===undefined){return new LP.client.Entry(this,representation,uri);}else{return new LP.client.Collection(this,representation,uri);}}};});YUI().add('lp.client.plugins',function(Y){function PATCHPlugin(){PATCHPlugin.superclass.constructor.apply(this,arguments);}
Y.mix(PATCHPlugin,{NAME:'PATCHPlugin',NS:'patcher',ATTRS:{patch:{},resource:{},patch_field:false,formatter:{valueFn:function(){return this._defaultFormatter;}}}});LP.client.ErrorHandler=function(){};LP.client.ErrorHandler.prototype={clearProgressUI:function(){},showError:function(error_msg){},getFailureHandler:function(){var self=this;return function(ioId,o){self.clearProgressUI();if(o.status==503){self.showError('Timeout error, please try again in a few minutes.');}else if(o.status>=500){var server_error='Server error, please contact an administrator.';if(o.getResponseHeader('X-Lazr-OopsId')){server_error=server_error+' OOPS ID:'+o.getResponseHeader('X-Lazr-OOPSid');}
self.showError(server_error);}else{self.showError(o.responseText);}};}};Y.extend(PATCHPlugin,Y.Plugin.Base,{extra_config:null,initializer:function(config){if(!Y.Lang.isString(config.patch)){Y.fail("missing config: 'patch' containing the attribute name");}
if(!Y.Lang.isString(config.resource)){Y.fail("missing config: 'resource' containing the URL to patch");}
this.extra_config=config||{};this.original_save=config.host._saveData;this.doBefore("_saveData",this.doPATCH);var self=this;this.error_handler=new LP.client.ErrorHandler();this.error_handler.clearProgressUI=function(){config.host._uiClearWaiting();};this.error_handler.showError=function(error_msg){config.host.showError(error_msg);};},doPATCH:function(){var owner=this.get("host"),original_save=this.original_save;owner._uiSetWaiting();var client=new LP.client.QuickBuild();var formatter=Y.bind(this.get('formatter'),this);var attribute=this.get('patch');var patch_payload;var val=owner.getInput();if(this.get('patch_field')){patch_payload=val;}else{patch_payload={};patch_payload[attribute]=val;}
var callbacks={on:{success:function(entry){owner._uiClearWaiting();var new_value=formatter(entry,attribute);original_save.apply(owner,[new_value]);},failure:this.error_handler.getFailureHandler()}};var cfg=Y.merge(callbacks,this.extra_config);client.patch(this.get('resource'),patch_payload,cfg);return new Y.Do.Halt();},_defaultFormatter:function(result,attribute){if(Y.Lang.isString(result)){return result;}else{return result.get(attribute);}}});Y.namespace('lp.client.plugins');Y.lp.client.plugins.PATCHPlugin=PATCHPlugin;},"0.1",{"requires":["plugin","dump","lazr.editor"]});

