
/*
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
*/
if (typeof YUI === "undefined"|| !YUI || YUI.version !== '3.0.0') {
	(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.add("get",function(A){(function(){var C=A.UA,B=A.Lang,E="text/javascript",F="text/css",D="stylesheet";A.Get=function(){var M={},K=0,U=false,W=function(a,X,b){var Y=b||A.config.win,c=Y.document,e=c.createElement(a),Z;for(Z in X){if(X[Z]&&X.hasOwnProperty(Z)){e.setAttribute(Z,X[Z]);}}return e;},T=function(Y,Z,X){var a={id:A.guid(),type:F,rel:D,href:Y};if(X){A.mix(a,X);}return W("link",a,Z);},S=function(Y,Z,X){var a={id:A.guid(),type:E,src:Y};if(X){A.mix(a,X);}return W("script",a,Z);},N=function(c){var X=M[c],Y,a,g,e,j,b,Z,f;if(X){Y=X.nodes;a=Y.length;g=X.win.document;e=g.getElementsByTagName("head")[0];if(X.insertBefore){j=L(X.insertBefore,c);if(j){e=j.parentNode;}}for(b=0;b<a;b=b+1){Z=Y[b];if(Z.clearAttributes){Z.clearAttributes();}else{for(f in Z){delete Z[f];}}e.removeChild(Z);}}X.nodes=[];},P=function(Y,Z,X){return{tId:Y.tId,win:Y.win,data:Y.data,nodes:Y.nodes,msg:Z,statusText:X,purge:function(){N(this.tId);}};},O=function(b,a,X){var Y=M[b],Z;if(Y&&Y.onEnd){Z=Y.context||Y;Y.onEnd.call(Z,P(Y,a,X));}},V=function(a,Z){var X=M[a],Y;if(X.timer){clearTimeout(X.timer);}if(X.onFailure){Y=X.context||X;X.onFailure.call(Y,P(X,Z));}O(a,Z,"failure");},L=function(X,a){var Y=M[a],Z=(B.isString(X))?Y.win.document.getElementById(X):X;if(!Z){V(a,"target node not found: "+X);}return Z;},I=function(a){var X=M[a],Z,Y;if(X.timer){clearTimeout(X.timer);}X.finished=true;if(X.aborted){Z="transaction "+a+" was aborted";V(a,Z);return;}if(X.onSuccess){Y=X.context||X;X.onSuccess.call(Y,P(X));}O(a,Z,"OK");},Q=function(Z){var X=M[Z],Y;if(X.onTimeout){Y=X.context||X;X.onTimeout.call(Y,P(X));
}O(Z,"timeout","timeout");},H=function(Z,c){var Y=M[Z],b,g,f,e,a,X,i;if(Y.timer){clearTimeout(Y.timer);}if(Y.aborted){b="transaction "+Z+" was aborted";V(Z,b);return;}if(c){Y.url.shift();if(Y.varName){Y.varName.shift();}}else{Y.url=(B.isString(Y.url))?[Y.url]:Y.url;if(Y.varName){Y.varName=(B.isString(Y.varName))?[Y.varName]:Y.varName;}}g=Y.win;f=g.document;e=f.getElementsByTagName("head")[0];if(Y.url.length===0){I(Z);return;}X=Y.url[0];if(!X){Y.url.shift();return H(Z);}if(Y.timeout){Y.timer=setTimeout(function(){Q(Z);},Y.timeout);}if(Y.type==="script"){a=S(X,g,Y.attributes);}else{a=T(X,g,Y.attributes);}J(Y.type,a,Z,X,g,Y.url.length);Y.nodes.push(a);if(Y.insertBefore){i=L(Y.insertBefore,Z);if(i){i.parentNode.insertBefore(a,i);}}else{e.appendChild(a);}if((C.webkit||C.gecko)&&Y.type==="css"){H(Z,X);}},G=function(){if(U){return;}U=true;var X,Y;for(X in M){if(M.hasOwnProperty(X)){Y=M[X];if(Y.autopurge&&Y.finished){N(Y.tId);delete M[X];}}}U=false;},R=function(Y,X,Z){Z=Z||{};var c="q"+(K++),a,b=Z.purgethreshold||A.Get.PURGE_THRESH;if(K%b===0){G();}M[c]=A.merge(Z,{tId:c,type:Y,url:X,finished:false,nodes:[]});a=M[c];a.win=a.win||A.config.win;a.context=a.context||a;a.autopurge=("autopurge" in a)?a.autopurge:(Y==="script")?true:false;if(Z.charset){a.attributes=a.attributes||{};a.attributes.charset=Z.charset;}setTimeout(function(){H(c);},0);return{tId:c};},J=function(Z,e,d,Y,c,b,X){var a=X||H;if(C.ie){e.onreadystatechange=function(){var f=this.readyState;if("loaded"===f||"complete"===f){e.onreadystatechange=null;a(d,Y);}};}else{if(C.webkit){if(Z==="script"){e.addEventListener("load",function(){a(d,Y);});}}else{e.onload=function(){a(d,Y);};e.onerror=function(f){V(d,f+": "+Y);};}}};return{PURGE_THRESH:20,_finalize:function(X){setTimeout(function(){I(X);},0);},abort:function(Y){var Z=(B.isString(Y))?Y:Y.tId,X=M[Z];if(X){X.aborted=true;}},script:function(X,Y){return R("script",X,Y);},css:function(X,Y){return R("css",X,Y);}};}();})();},"3.0.0");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.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.add("yui",function(A){},"3.0.0",{use:["yui-base","get","yui-log","yui-later"]});

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.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.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"]});

(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.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.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"]});

/*
Copyright (c) 2009, adMarketplace.com. All rights reserved.
 */

(function () {
    var p, k;

	// reduce to one or the other
	if (typeof AMP === 'undefined' || !AMP) {

		/**
		 * The AMP global namespace object. If AMP is already defined, the existing
		 * AMP object will not be overwritten so that defined namespaces are
		 * preserved.
		 * 
		 * @class AMP
		 * @constructor
		 * @global
		 * @param o  Optional configuration object. This object is stored in AMP.config.
		 */

		// global AMP
		// Make a function, disallow direct instantiation
		AMP = function(o) {
			var A = this;

			// Allow instantiation without the new operator
			if (!(A instanceof AMP)) {
				return new AMP(o);
			} else {
				// set up the core environment
				A.init(o);
				return A;
			}
		};
	}

	// The prototype contains functions that are required to allow the external
	// modules to be registered and for the instance to be initialized.
	AMP.prototype = {

		// Initialize this A instance
		// @param o is the config options
		init : function(o) {
			var A = this, v = '2.0';

			o = o || {};
			o.win = o.win || window || {};
			o.win = o.win.contentWindow || o.win;
			o.doc = o.win.document;
			o.debug = o.debug ? o.debug : false;
			o.throwfail = typeof o.throwfail !== 'undefined' ? o.throwfail
					: true;
			o.browserUrl = document.location && document.location.href ?  document.location.href : "";

			A.config = o;
			if (v.indexOf('@') > -1) {
				v = 'test';
			}

			A.version = v;
			A.constructor = AMP;
		},

		 
		// Register a module
		// @param name {string} module name
		// @param fn {Function} entry point into the module that is used to bind module to the AMP instance
		// @return {AMP} the AMP instance 
		add: function(name, fn) {
			try {
				if (typeof fn !== 'function') {
					throw {message:'Second parameter has to be a function!'};
				}	
				if (typeof name !== 'string' || name === '' ) {
					throw {message:'First parameter has to be a non empty string!'};
				}
				switch (name) {
				case 'flashWidget':
					AMP.prototype[name] = fn;
					break;
				case 'jsWidget':
					AMP.prototype[name] = fn;
					break;
				case 'actionMonitor':
					AMP.prototype[name] = fn;
					break;
				case 'userInfo':
					AMP.prototype[name] = fn.apply(AMP); // call userInfo function to get an object
					break;
				case 'iframe':
					AMP.prototype[name] = fn;
					break;
				}
				return this; // chain support
			 
			} catch(e) {
				this.error('.add:' + e.message);
			}
		 },
		
		 
		// attache functions to a module
		// @param mName {string}  module name
		// @param fName {string} function name
		// @param fn {function}
		// @return {AMP} the AMP instance
		attacheTo: function(mName, fName, fn) {
			 try {
				 if (typeof mName !== 'string' || mName === '') {
					 throw {message:'Module name has to be a non empty string!'};
				 }
				 if (typeof fName !== 'string' || fName === '') {
					 throw {message:'Function name has to be a non empty string!'};
				 }
				 if (typeof fn !== 'function') {
					 throw {message:'Last(3) parameter has to be a function!'};
				 }
				 AMP.prototype[mName].prototype[fName] = fn;
			 
				 //keep all the attached modules under the attached name
				 AMP.prototype[mName].attached = AMP.prototype[mName].prototype;
				 return this; // chain support
			} catch(e) {
				this.error('.attacheTo:' + e.message);
			}
		},

		
		// Set to use a module; Verifies that the module exist
		// @param name {string} module name
		// @param fn {Function}
		// @return {AMP} the AMP instance
		use : function() {
			var i;
			try {
				if (arguments.length < 2) {
					throw {message:'Not enought parameter!'};
				}
				for (i = 0; i < arguments.length - 1; i += 1) {
					if (this[arguments[i]] === undefined) {
						throw {message:'The assigned ' + arguments[i] + ' module name does not exists!'};
					}
				}

				if (typeof arguments[arguments.length - 1] !== 'function') {
					throw {message:'The last argument is not a function!'};
				}

				arguments[arguments.length - 1](this);
				return this; // chain support
			} catch(e) {
				this.error('.use:' + e.message);
			}
		},


		// Report an error. The reporting mechanism is controled by the 'throwfail'
		// configuration attribute. If throwfail is false, the message is
		// written to the Logger, otherwise a JS error is thrown
		// @param msg {string} the error message
		// @param e {Error} Optional JS error that was caught. If supplied and throwfail is specified, this error will be re-thrown.
		// @return {AMP} this AMP instance
		error : function(msg, e) {
			msg = msg ? 'AMP.' + msg : msg; //add 'AMP:' to the error message
			if (this.config.throwfail) {
				throw (e || msg);
			} else {
				if (!this.config.url && !this.config.url.error) {
					this.config.throwfail = true;
					this.error('AMP.error: Error log url missing!');
					return null;
				}

				if (e) { // if is an error object log the error message
					this.log(this.config.url.error, '&msg=' + e.message);
				} else {
					this.log(this.config.url.error, '&msg=' + msg);
				}
			}
			return this; // chain support
		},


		// Log a message.
		// @param logUrl {string} the log url
		// @param msg {string} the message; optional
		// @return {AMP} this AMP instance
		log : function(logUrl, paramList) {

			if (!logUrl) {
				this.error('AMP.log: Missing log url!');
				return null;
			}

			var img, that = this,

			// Checks if the page is https.
			isHttps = function() {
				return that.config.browserUrl.indexOf('https') === 0;
			};

			logUrl = this.addCacheBuster(logUrl, false); 
			
			if (paramList) {
				logUrl = logUrl + paramList;
			}
			
			// if the page url is https set log url to https
			logUrl = isHttps() ? 'https' + logUrl.substr(4) : logUrl;    
			img = new Image();
			img.onload = function() {
			};
			img.onerror = function() {
				// because we don't return am img this doesn't work
				//that.error('AMP.log: Log delivery error! (logUrl:' + logUrl + ')');
			};
			img.src = logUrl;

			return this;
		},


		// Add cachebuster to the url.
		// @param url {string}
		// @param encode {boolean}
		// @return {string} chachebusted url
		addCacheBuster : function(url, encode) {
			var aorq, cachebuster, d, t;
			try {
				if (url === undefined) {
					return url;
				}
				d = new Date();
				t = d.getTime();
				aorq = !encode && url.indexOf('?') === -1 ? '?' : '&';    //and or questionmark
				cachebuster = encode ? encodeURIComponent(aorq + 'cachebuster=' + t)
					: aorq + 'cachebuster=' + t;
				return url && url + cachebuster;
			} catch(e) {
				this.error('.addCacheBuster:' + e.message);
			}
		},


		// Create a length length random sring.
		// param length {integer}
		// @return {string} rand string
		randString : function(length) {
			var chars = "abcdefghijklmnopqrstuvwxyz1234567890", randstr = "", i, c;
			try {
				for (i = 0; i < length; i += 1) {
					c = Math.floor(Math.random() * 36);
					randstr += chars.charAt(c);
				}
				return randstr;
			} catch(e) {
				this.error('.randString:' + e.message);
			}
		},
				
		
		// Create a new object which prototype is o
		// @param object
		// @return {object}
		object : function(o) {
			function F() {};
            F.prototype = typeof o === 'object' && o ? o : Object.prototype;
            return new F();
		},
		
		
		// ampEncode (xor and double urlencode)
		// @param string
		// @param string
		// @return {string} encoded string
		encode : function(s, key) {
			var i, j, res = ''; 
			try {
				for(i = 0, j = 0; i < s.length; i++, j++) {
					if (j >= key.length ) {
						j = 0;
					}
					res += String.fromCharCode(key.charCodeAt(j)^s.charCodeAt(i));
				}
				return encodeURIComponent(encodeURIComponent(res)); 
			} catch(e) {
				this.error('.randString:' + e.message);
			}
		}
	};

	// Give the AMP global the same properties as an instance.
	p = AMP.prototype;

	// inheritance utilities are not available yet
	for (k in p) {
		if (true) {
			AMP[k] = p[k];
		}
	}

	// set up the environment
	AMP.init();

})();


// userInfo module
AMP.add('userInfo', function() {

	var A = this,
	that = A.object(),
	isFrame, siteUrl, docReferrer, userAgent, vendor, platform, os, historyLength, isCookieEnabled, userLanguage, isOnline, isWindowInFocus, winWidth, winHeight, winX, winY, docWidth, docHeight, docScrollX, docScrollY, screenWidth, screenHeight, colorDepth, isJavaEnabled, 
	myYui,
	windowFocusOn = true;	
	
	
	if (typeof YUI !== 'undefined') {
	
		YUI().use("node", function(Y) {
			Y.on('focus', function() { windowFocusOn = true; }, window);
			Y.on('blur', function() { windowFocusOn = false;}, window); 
			
			if (document.hasFocus && !document.hasFocus()) {
				windowFocusOn = false;
			}
			myYui = Y;
		});
	}
	
	
	
	// return is frame {1/0}  **VERIFIED**
	isFrame = function () {
		return self !== top ? 1 : 0;
	};
	
	
	
	// Return site url  **VERIFIED**
	// @return {String}
	siteUrl = function() {
		var url = '';
		if (typeof document.location.href !== 'undefined') {
		url = document.location.href;
		} else if(typeof self.location.href !== 'undefined') {
			url = self.location.href;
		} else if(typeof document.url !== 'undefined') {
			url = document.url;
		} else if(typeof document.location.hostname !== 'undefined') {
			url = document.location.hostname;
		} else if(typeof document.domain !== 'undefined') {
			url = document.domain;
		} else if(typeof document.documentURI !== 'undefined') {
			url = document.documentURI;
		} else if(typeof document.baseURI !== 'undefined') {
			url = document.baseURI;
		}
		return url;
	};
	
	
	
	// Return doc referrer url  **VERIFIED**
	// @return {String}
	docReferrer = function() {
		return document.referrer ? document.referrer : '';
	};
	
	
	// User agent  **VERIFIED**
	// return {string}
	userAgent = function() {
		return navigator.userAgent ? navigator.userAgent : '';
	};
	
	
	
	// Name of the browser vendor for the current browser  **VERIFIED--**
	// return {string}
	vendor = function() {
		return navigator.vendor ? navigator.vendor : '';
	};
	
	
	
	// User platform  **VERIFIED**
	// @return {string}
	platform = function() {
		return navigator.platform ? navigator.platform : '';
	};
	
	
	
	// Operating system  **VERIFIED--**
	// return {string}
	os = function() {
		return navigator.oscpu ? navigator.oscpu : '';
	};
	
	
	
	// History length  **VERIFIED**
	// @return {integer}
	historyLength = function() {
		return window.history.length ? window.history.length : '';
	};
	
	
	
	// User cookie enabled  **VERIFIED**
	// @return {1/0/''}
	isCookieEnabled = function() {
		return typeof navigator.cookieEnabled !== 'undefined' ?  (navigator.cookieEnabled ? 1 : 0) : '';
	};
	
	
	
	// Java enabled  **VERIFIED**
	// @return {1/0/''}
	isJavaEnabled = function() {
		return typeof navigator.javaEnabled === 'function' ?  (navigator.javaEnabled() ? 1 : 0) : '';
	};
	
	
	
	// User language  **VERIFIED**
	// @return {string}
	userLanguage = function() {
		return navigator.language ? navigator.language : (navigator.browserLanguage ? navigator.browserLanguage : '');
	};
	
	
	
	// Indicating whether the browser is online or not  **VERIFIED**
	// @return {string}
	isOnline = function() {
		return typeof navigator.onLine !== 'undefined' ? (navigator.onLine === true ?  1 : 0) : '';
	} ;
	
	
	
	// Is window in focus or not 
	// @return {1/0}
	isWindowInFocus = function() {
		if (myYui !== 'undefined') {
			return windowFocusOn === true ? 1 : 0;
		} else {
			A.error('userInfo: YUI is not defined');
		}
	};
	
	
	
	// Window x position
	// @return {integer}
	winX = function() {
		return typeof window.screenLeft === 'number' ? window.screenLeft : (window.screenX !== undefined ? window.screenX : '');
	};
	
	
	
	// Window y position
	// @return {integer}
	winY = function() {
		return typeof window.screenTop === 'number' ? window.screenTop : (window.screenY !== undefined ? window.screenY : '');
	};
	
	
	
	// Document width  **VERIFIED**
	// @return {integer}
	docWidth = function() {
		var doc = window.document;
		if (typeof window.innerWidth === 'number') {
			return window.innerWidth;
		} else if (doc.documentElement !== undefined && doc.documentElement.clientWidth !== undefined && doc.documentElement.clientWidth !== 0) {
			return doc.documentElement.clientWidth;
		} else if (doc.body !== undefined && doc.body.clientWidth !== undefined) {
			return doc.body.clientWidth; 
		} else {
			return '';
		}
	};
	
	
	
	// Document height **VERIFIED**
	// @return {integer}
	docHeight = function(e) {
		var doc = window.document;
		if (typeof window.innerHeight === 'number') {
			return window.innerHeight;
		}  else if (doc.documentElement !== undefined && doc.documentElement.clientHeight !== undefined && doc.documentElement.clientWidth !== 0) {
			return doc.documentElement.clientHeight;
		} else if (doc.body !== undefined && doc.body.clientHeight !== undefined) {
			return doc.body.clientHeight;
		} else {
			return '';
		}
	};
	
	
	
	// Amount page has been scroll horizontally  **VERIFIED**
	// @return {integer}
	docScrollX = function() {
		var doc = window.document;
		if(typeof(window.pageXOffset) === 'number') {
			return window.pageXOffset;
		} else if(doc.body !== undefined && doc.body.scrollLeft !== undefined && doc.body.scrollLeft !== 0) {
		    return doc.body.scrollLeft;
		} else if(doc.documentElement !== undefined && doc.documentElement.scrollLeft !== undefined) {
		    return doc.documentElement.scrollLeft;
		} else {
			return '';
		}
	};
	
	
	
	// Amount page has been scroll vertically  **VERIFIED**
	// @return {integer}
	docScrollY = function() {
		var doc = window.document;
		if(typeof(window.pageYOffset) === 'number') {
			return window.pageYOffset;
		} else if(doc.body !== undefined && doc.body.scrollTop !== undefined && doc.body.scrollTop !== 0) {
		    return doc.body.scrollTop;
		} else if(doc.documentElement !== undefined && doc.documentElement.scrollTop !== undefined) {
		    return doc.documentElement.scrollTop;
		} else {
			return '';
		}
	};
	
	
	
	// Screen width  **VERIFIED**
	// @return {integer}
	screenWidth = function() {
		if (window.screen !== undefined) {
			return window.screen.width;
		} else if (window.java !== undefined) {
			return java.awt.Toolkit.getDefaultToolkit().getScreenSize().screen.width;
		} else {
			return '';
		}
	};
	
	
	
	// Screen height  **VERIFIED**
	// @return {integer}
	screenHeight = function() {
		if (window.screen !== undefined) {
			return window.screen.height;
		} else if (window.java !== undefined) {
			return java.awt.Toolkit.getDefaultToolkit().getScreenSize().screen.height;
		} else {
			return '';
		}
	};
	
	
	
	// colorDepth  **VERIFIED**
	// @return {integer}
	colorDepth = function() {
		return window.screen !== undefined ? window.screen.colorDepth : '';
	};
	
	
	
	// set function from global use
	that.isFrame = isFrame;
	that.siteUrl = siteUrl;
	that.docReferrer = docReferrer;
	that.userAgent = userAgent;
	that.vendor = vendor;
	that.platform = platform;
	that.os = os;
	that.historyLength = historyLength;
	that.isCookieEnabled = isCookieEnabled;
	that.isJavaEnabled = isJavaEnabled;
	that. userLanguage = userLanguage;
	that.isOnline = isOnline;
	that.isWindowInFocus = isWindowInFocus;
	that.winX = winX;
	that.winY = winY;
	that.docWidth = docWidth;
	that.docHeight = docHeight;
	that.docScrollX = docScrollX;
	that.docScrollY = docScrollY;
	that.screenWidth = screenWidth;
	that.screenHeight = screenHeight;
	that.colorDepth = colorDepth;
	
	return that;
	
});

/* Copyright (c) 2009, adMarketplace.com. All rights reserved. */

// actionMonitor module
AMP.add('actionMonitor', function(config) {
	var A = this,
	that = A.object(),
	myYui, rand,
	init, start, log, xhrLog, crossDomainLog, arbitrage, createUrlParameters, urlSettingOk = false, availableElements;
	
	if (!config) {
		A.error('.actionMonitor: config object missing!');
		return;
	}
	

	if (!config.urls || !config.logtype || (!config.logtype.crossdomain && !config.logtype.xhr)) {
		A.error('.actionMonitor: required config parameter missing!');
		return;
	}

	
	if (config.urls.actionlog && config.urls.actionlog.url) {
		urlSettingOk = true;
	} else if (config.urls.pagerenderlog && config.urls.pagerenderlog.url) {
		urlSettingOk = true;
	} else if (config.urls.pageunloadlog && config.urls.pageunloadlog.url) {
		urlSettingOk = true;
	} else if (config.urls.popunderlog && config.urls.popunderlog.url) {
		urlSettingOk = true;
	}
	
	
	if (!urlSettingOk) {
		A.error('.actionMonitor: log url missing!');
		return;
	}
	
	
	
	//set default values
	config.id = config.id ? config.id : {};
	config.id.click = config.id.click ? config.id.click : 'document';
	config.id.mousemovement = config.id.mousemovement ? config.id.mousemovement : 'document';
	config.id.keypress = config.id.keypress ? config.id.keypress : 'document';
	
	rand = A.randString(6);
	availableElements = [];
	
	
	//set the availableElements array
	if (config.id && config.id.click) {
		availableElements[availableElements.length] = config.id.click;
	}
	if (config.id && config.id.mousemovement) {
		availableElements[availableElements.length] = config.id.mousemovement;
	}
	if (config.id && config.id.keypress) {
		availableElements[availableElements.length] = config.id.keypress;
	}
	
	
	
	// Initialize action monitor
	init = function() {
		YUI().use("node", function(Y) {
			Y.on('available', function() {  
				
				myYui = Y;
				//page render
				if (config.urls.pagerenderlog && config.urls.pagerenderlog.url) {
	 				log(config.urls.pagerenderlog.url, createUrlParameters(config.urls.pagerenderlog.paramconfig));
		    	}
				
				//page unload
				if (config.urls.pageunloadlog && config.urls.pageunloadlog.url) {
			    	Y.Event.nativeAdd(window, "unload", function(e) {
			    		log(cconfig.urls.pageunloadlog.url, createUrlParameters(config.urls.pageunloadlog.paramconfig));
					});
				}
				
				//popunder log
				if (config.urls.popunderlog && config.urls.popunderlog.url) {
			        Y.on('blur', function() {
			        	log(config.urls.popunderlog.url, createUrlParameters(config.urls.popunderlog.paramconfig));
			    	}, window); 
					
					if (document.hasFocus && !document.hasFocus()) {
						log(config.urls.popunderlog.url, createUrlParameters(config.urls.popunderlog.paramconfig));;
					}
				}
				
								
				//regular action log
				if (config.urls.actionlog && config.urls.actionlog.url) {
					//set all the actions
					if (config.id && config.id.click) {
						Y.on('amp_action_monitor_' + rand + '|click', arbitrage.check, config.id.click); 
					}
				
					if (config.id && config.id.mousemovement) {
						Y.on('amp_action_monitor_' + rand + '|mousemove', arbitrage.check, config.id.mousemovement); 
					}
				
					if (config.id && config.id.keypress) {
						Y.on('amp_action_monitor_' + rand + '|keypress', arbitrage.check, config.id.keypress); 
					}
				}
				
			}, availableElements)
		});
	};
	
	
	
	// Action arbitrage
	arbitrage = (function() {
		var x, y, mouseMovementCount = 0, actionCount = 0, actionType = '', actionXy = '',
			value = false;
		return {
			check: function(e) {
				try {
				 	if(e.type === 'mousemove') {
				 		//browser generates mousemove when page loads; check the coordinates
				 		if (mouseMovementCount === 0) {  
				 			x = e.pageX;
				 			y = e.pageY;
					 		mouseMovementCount++;
						 	actionCount++;
				 		} else if (value === false && (mouseMovementCount > 0) && (x !== e.pageX || y !== e.pageY)) {
				 			value = true;
				 			myYui.detach('amp_action_monitor_' + rand + '|click');
				 			myYui.detach('amp_action_monitor_' + rand + '|mousemove');
				 			myYui.detach('amp_action_monitor_' + rand + '|keypress');
					 		mouseMovementCount++;
						 	actionCount++;
				 		}else if(value === false && x === e.pageX && y === e.pageY) {
							mouseMovementCount++;
						 	actionCount++;
						}
				 	} else {
			 			myYui.detach('amp_action_monitor_' + rand + '|click');
			 			myYui.detach('amp_action_monitor_' + rand + '|mousemove');
			 			myYui.detach('amp_action_monitor_' + rand + '|keypress');
				 		value = true;
					 	actionCount++;
				 	}
				 	
				 	if (value === true) {
				 		actionType = e.type;
				 		if (actionType === 'mousemove' || actionType === 'click') {
				 			actionXy = 	x + ':' + y;
				 		} else if (actionType === 'keypress') {
				 			actionXy = 	e.keyCode + ':' + e.keyCode;
				 		}
				 		
				 		if (config.urls.actionlog && config.urls.actionlog.url) {
			 				log(config.urls.actionlog.url, createUrlParameters(config.urls.actionlog.paramconfig));
				 		}
				 			
				 	}
				} catch(e) {
					A.error('.actionMonitor.arbitrage:' + e.message);
				}
			},
			getValue: function() {
				return value;
			},
			getActionCount: function() {
				return actionCount;
			},
			getActionType: function() {
				return actionType;
			},
			getActionXy : function() {
				return actionXy;
			}
		}
	})();
		
	
	// Create url parameter list 
	// @param paramConfig {object}
	// @return {string}
	createUrlParameters = function(paramConfig) {
		try {
			var paramList = '';
			if (!paramConfig || paramConfig.none) {
				return paramList;
			} else if( typeof A.userInfo !== 'object') {
				throw {message:'userInfo module missing!'};
			}
		
			paramList  += paramConfig.all || paramConfig.at ? '&at=' + arbitrage.getActionType() : '';
			paramList  += paramConfig.all || paramConfig.ac ? '&ac=' + arbitrage.getActionCount() : '';
			paramList  += paramConfig.all || paramConfig.xy ? '&xy=' + arbitrage.getActionXy() : '';
			paramList  += paramConfig.all || paramConfig.url ? '&url=' + encodeURIComponent(A.userInfo.siteUrl()) : '';
			paramList  += paramConfig.all || paramConfig.ua ? '&ua=' + A.userInfo.userAgent() : '';
			paramList  += paramConfig.all || paramConfig['if'] ? '&if=' + A.userInfo.isFrame() : '';
			paramList  += paramConfig.all || paramConfig.ifo ? '&ifo=' + A.userInfo.isWindowInFocus() : '';
			paramList  += paramConfig.all || paramConfig.hl ? '&hl=' + A.userInfo.historyLength() : '';
			paramList  += paramConfig.all || paramConfig.ce ? '&ce=' + A.userInfo.isCookieEnabled() : '';
			paramList  += paramConfig.all || paramConfig.ul ? '&ul=' + A.userInfo.userLanguage() : '';
			paramList  += paramConfig.all || paramConfig.p ? '&p=' + A.userInfo.platform() : '';
			paramList  += paramConfig.all || paramConfig.v ? '&v=' + A.userInfo.vendor() : '';
			paramList  += paramConfig.all || paramConfig.os ? '&os=' + A.userInfo.os() : '';
			paramList  += paramConfig.all || paramConfig.io ? '&io=' + A.userInfo.isOnline() : '';
			paramList  += paramConfig.all || paramConfig.wx ? '&wx=' + A.userInfo.winX() : '';
			paramList  += paramConfig.all || paramConfig.wy ? '&wy=' + A.userInfo.winY() : '';
			paramList  += paramConfig.all || paramConfig.dw ? '&dw=' + A.userInfo.docWidth() : '';
			paramList  += paramConfig.all || paramConfig.dh ? '&dh=' + A.userInfo.docHeight() : '';
			paramList  += paramConfig.all || paramConfig.dsx ? '&dsx=' + A.userInfo.docScrollX() : '';
			paramList  += paramConfig.all || paramConfig.dsh ? '&dsh=' + A.userInfo.docScrollY() : '';
			paramList  += paramConfig.all || paramConfig.sw ? '&sw=' + A.userInfo.screenWidth() : '';
			paramList  += paramConfig.all || paramConfig.sh ? '&sh=' + A.userInfo.screenHeight() : '';
			paramList  += paramConfig.all || paramConfig.cd ? '&cd=' + A.userInfo.colorDepth() : '';
			return paramList;
		} catch(e) {
			A.error('.actionMonitor.createUrlParameters:' + e.message);
		}
	};
	
	
	// Action monitor general log
	// @param url {string}
	// @param paramList {string}
	log = function(url, paramList) {
		var isHttps;
		try {
			if (!url) {
				throw {message:'Missing log url!'};
			}
			
			//check if the page is https.
			isHttps = function() {
				return A.config.browserUrl.indexOf('https') === 0;
			};
			
			url = A.addCacheBuster(url, false);
			url += paramList ? paramList : '';
			
			//if the page url is https set log url to https
			url = isHttps() ? 'https' + url.substr(4) : url;  
			
			
			if(config.logtype && config.logtype.crossdomain) {
	 			crossDomainLog(url);
	 		} else if (config.url.logtype && config.url.logtype.xhr) {
	 			xhrLog(url);
	 		}
		} catch(e) {
			A.error('.actionMonitor.log:' + e.message);
		}
		
	};
	
	
	// Log with new image
	// @param url {string}
	crossDomainLog = function(url) {
		var img = new Image();
		img.onload = function() {
		};
		img.onerror = function() {
			//because we don't return am img this doesn't work
			//that.error('AMP.log: Log delivery error! (logUrl:' + logUrl + ')');
		};
		img.src = url;
	};
	
	
	// Log with XMLHttpRequest
	// @param url {string}
	xhrLog = function(url) {
		YUI().use("io", 
				function(Y) { 
					var gH = {
						start:function(){},
						write:function(){}, 
						complete:function(){},
						success:function(){},   
						failure:function(){}
					};
			
					Y.on('io:start', gH.start); 
					Y.on('io:complete', gH.complete); 
					Y.on('io:success', gH.success); 
					Y.on('io:failure', gH.failure); 
					
					Y.io(url); 
			});
	};
	
	
	// Start action monitor
	start = function() {
		init();
	};
	
	
	that.start = start;
	
	return that;
});

/*
Copyright (c) 2009, adMarketplace.com. All rights reserved.
*/

// jsWidget module
// @param config {object}
AMP.add('jsWidget', function(config) {
	var A = this,
	that = A.object(A.jsWidget.attached),   //attached contains the functions which we attache seperatly (not in this module)
	myYui,
	skip = 0,
	isNext = true,
	setQueryId = true,
	FRONTEND_FILTER_ADD_URL_PARAMETER_NAME = '&dp=',
	createContainer, prevAds, nextAds, loadingSign, loadStyle, loadFeedData, setEct, urlCutHttp, urlCutLength, frontendFilter, adFrontendFilterValueToUrl, getQueryId, createDynamicParameter, init;
	
	that.adData = {};
	if (!config) {
		A.error('jsWidget: config object missing!');
		return;
	}
	
	// Create widget container
	createContainer = function() {
		var id = config.id, 
			serverUrl = config.url.server,
			searchBoxLocation = config.searchboxlocation,
			searchBoxTopHtml = '',
			searchBoxBottomHtml = '',
			searchBoxHtml,
			popupBox = '',
			// it depends on the iframe
			onSubmitValue = A.userInfo.isFrame() ? 'true' : 'false';
		
		if (searchBoxLocation !== 0) {
			searchBoxHtml = 				
				'<div id="amp_w_s_' + id + '" style="">' +
					'<form id="amp_search_' + id + '" style="" onSubmit="return ' + onSubmitValue + ';">' +
						'<input type="text" id="amp_form_input_' + id + '" style="" name="kw" />' +
						'<input id="amp_form_submit_' + id + '" type="submit" value="Search">' +
					'</form>' +
				'</div>';
		
			popupBox = 
				'<div id="amp_w_n_b_' + id + '" style="visibility:hidden" class="amp_w_n_b_hidden_' + id + '">' +
					'<div id="amp_w_n_b_h_' + id + '" style="background: url(' + serverUrl + '/images/background_gradient.gif) repeat-x;">' +
						'<div id="amp_w_n_b_h_l_' + id + '" style=""><img src="' + serverUrl + '/images/logo.gif" width="300" height="33" border=0></div>' +
						'<div id="amp_w_n_b_h_r_' + id + '" style=""><img border="0" width="22" height="22" src="' + serverUrl + '/images/close_x.gif"></div>' +
					'</div>' +
					'<div id="amp_w_n_b_s_' + id + '" style="">' +
						'<div id="search_div_' + id + '" style="">' +
							'<form action="#" id="new_amp_search_' + id + '" onSubmit="return false;">' +
								'<p id="amp_search_text_' + id + '"> Search This Site & The Web</p>' +
								'<input id="amp_form_searchpopup_input_' + id + '" type="text">' +
								'<input id="amp_form_new_button_' + id + '" type="image" src="' + serverUrl + '/images/search.gif" width="75" height="22" name="submit" value="Search">' +
							'</form>' +
						'</div>' +
						'<div id="amp_search_tabs_' + id + '">' +
							'<ul>' +
								'<li id="web_results_button_' + id + '" class="active_button" >Web results</li>' +
								'<li id="site_results_button_' + id + '" class="inactive_button">Site results</li>' +
							'</ul>' +
						'</div>' +
					'</div>' +
					'<div id="amp_w_n_c_' + id + '" style="">' +
						'<table>' +
							'<tr>' +
								'<td id="amp_top_ads_' + id + '" valign="top"></td>' +
								'<td id="amp_right_ads_' + id + '" style="" rowspan=2 valign="top"></td>' +
							'</tr>' +
							'<tr>' +
								'<td id="amp_middle_ads_' + id + '" style="width:780px" valign="top"></td>' +
							'</tr>' +
						'</table>' +
					'</div>' +
					'<div id="amp_w_n_b_np_' + id + '">' +
						'<span id="amp_w_n_b_p_' + id + '">&lt;&lt;&nbsp; Previous</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + 
						'<span id="amp_w_n_b_n_' + id + '">Next &nbsp;&gt;&gt;</span>' +
					'</div>' +
					'<div id="amp_w_n_b_b_' + id + '"></div>' +
				'</div>';
		
			if (searchBoxLocation === 1) {
				searchBoxTopHtml = searchBoxHtml;
			} else if (searchBoxLocation === 2) {
				searchBoxBottomHtml = searchBoxHtml;
			}
		}
	
		document.write(
			'<div id="amp_w_' + id + '" style="">' +
				'<div id="amp_ad_popup_' + id + '" style="display:none; z-index:10000"></div>' +
				'<div id="amp_link_popup_' + id + '" style="display: none; z-index:10000"></div>' +
				searchBoxTopHtml +
				'<div id="amp_w_spacer_top_' + id + '" style="display:none;"></div>' +
				'<div id="amp_w_c_' + id + '" style=""></div>' +
				'<div id="amp_w_spacer_bottom_' + id + '" style="display:none;"></div>' +
				'<div id="amp_w_np_' + id + '" style="display: none;">' +
					'<a id="amp_prev_ads_' + id + '" style="">&lt;&lt; Previous &nbsp;</a>' +
					'<a id="amp_next_ads_' + id + '" style=""> Next &gt;&gt;</a>' +
				'</div>' +
				searchBoxBottomHtml +
				'<div id="amp_w_b_' + id + '" style=""></div>' +
			'</div>' +
			popupBox
		);
	};

	
	// Previous navigation handler (it spports just widget type 4)
	prevAds = function() {
		if (skip > 0) {
			skip -= 1;
			that.skip = skip;
			if (config.searchboxlocation !== 0) {
				that.newSearch_4();
			}
		}
	};


	// Next navigation handler (it supports just widget type 4)
	nextAds = function () {
		if (isNext) {
			skip += 1;
			that.skip = skip;
			if (config.searchboxlocation !== 0) {
				that.newSearch_4();
			}
		}
	};

	
	// Show the loading sign (im the that period when we call wdg)
	// @param searchBoxSearch {boolean}
	loadingSign = function(searchBoxSearch) {
		//search from search box
		if (searchBoxSearch) {
			myYui.get('#amp_top_ads_' + config.id).set('innerHTML', '<div style="text-align: center"><img src="' + config.url.server + '/images/busy.gif" border=0/></div>');
			myYui.get('#amp_right_ads_' + config.id).set('innerHTML', '<div style="text-align: center"><img src="' + config.url.server + '/images/busy.gif" border=0/></div>');
			myYui.get('#amp_middle_ads_' + config.id).set('innerHTML','<div style="text-align: center"><img src="' + config.url.server + '/images/busy.gif" border=0/></div>');
		}
		else {
			myYui.get('#amp_w_c_' + config.id).set('innerHTML','<div style="text-align: center"><img src="' + config.url.server + '/images/busy.gif" border=0/></div>');
		}
	};
		
		
	// Load the widget css(style); create a new style which contains the css
	// @param tid {integer}
	loadStyle = function(tid) {
		myYui.Get.css(config.url.css,
				{
					onSuccess: function(o) {
						switch (tid) {
							case 1:
								loadFeedData();
								break;
							case 2:
								loadFeedData();
								break;
							case 3:
								loadFeedData();
								break;
							case 4:
								break;
						}
				
				},
				onFailure: function(o) {}
			});
	};
		
		
	// Load feed server data to the page with a callback function
	// @param callbackFn {string}
	// @param kw {string}
	// @param searchType {string}
	// @param isYahooBoss {boolean}
	loadFeedData = function(callbackFn, kw, searchType, isYahooBoss) {
		var siteUrl, url, start;
		try {
			setQueryId = true;
			
			if (callbackFn === undefined) {
				callbackFn = 'showData_' + config.tid
			}
				
			// show loading sign
			kw ? loadingSign(true) : loadingSign();
				
			if (!isYahooBoss) {
				url = config.url.wdg;
					
				if (kw) {
					url += '&kw=' + kw;
				}
	
				if (skip > 0) {
					url += '&skip='+ skip; 
				}
				
				url += '&fname=' + callbackFn;
				
				siteUrl = A.userInfo.siteUrl();
				url += '&url=' + encodeURIComponent(siteUrl);
					
			} else {    //YAHOO BOSS CALL
				url = config.url.yahooboss;
				start = 6*skip;
				if (searchType === 'site') {
					if (A.userInfo.isFrame()) {
						if (config.url && config.url.site) {
							siteUrl = config.url.site.indexOf('www.') === 0 ? config.url.site.substr(4): config.url.site;
						} else {
							siteUrl = '';
						}
					} else {
						siteUrl = window.location.hostname;
						siteUrl = siteUrl && siteUrl.indexOf('www.') === 0 ? siteUrl.substr(4) : siteUrl;
					}
					kw += ' site:' + siteUrl;
				}
				url += callbackFn;
				
				// replace the keyword and start macros
				url = url.replace(/{KEYWORD}/, kw);
				url = url.replace(/{START}/, start);
			}
				
			myYui.Get.script(A.addCacheBuster(url),
				{
					onSuccess: function(o) {
			 				o.purge(); // removes the script node immediately after executing
						if (!isYahooBoss) {
							A.log('http://log.ampxchange.com/al/v1?en=3&id=' + config.id + '&lst=9&ua=' + encodeURIComponent(A.userInfo.userAgent()) + '&v=2-html&msg=JSON%20loaded&url=' + encodeURIComponent(A.userInfo.siteUrl()));
						}
								},
					onFailure: function(o) {
									//log it
								}
				});
		} catch(e) {
			A.error('.actionMonitor.loadFeedData:' + e.message);
		}
	};
	
	
	
	// Set clickurl to go to external click tracker
	// @param clickurl {string}
	// @retun {string}
	setEct = function (clickurl) {
		return config.url && config.url.ect && config.url.ect !== '' ? config.url.ect + encodeURIComponent(clickurl) : clickurl;
	};
		
	
	// Format url - cut http
	// @param url {string}
	// @return {string}
	urlCutHttp = function (url) {
		url = url.toLowerCase();
		if (url.indexOf('http://') === 0) {
			url = url.substring(7);
		}
		return url;
	};
		
	
	// Format url - cut length
	// @param url {string}
	// @param l {integer}
	// @return {string}
	urlCutLength = function (url, l) {
		if (url.length > l) {
			url = url.substring(0,l-3) + '...';
		}
		return url;
	};
		
		
	// Fronend filter handler
	frontendFilter = (function() {
		var x, y, mouseMovementCount = 0,
			value = false;
		return {
			check: function(e) {
				try {
					if (mouseMovementCount === 0) {
						x = e.pageX;
						y = e.pageY;
						mouseMovementCount++;
					}else if (value === false && (mouseMovementCount > 0) && (x !== e.pageX || y !== e.pageY)) {
						value = true;
						myYui.detach('frontendFilter_'+ config.id + '|mousemove');
						if (typeof that.adData['tid' + config.tid] === 'undefined') {
							myYui.on('amp_w_' + config.id + '_dataloaded', adFrontendFilterValueToUrl);
						} else {
							adFrontendFilterValueToUrl();
						}
						
						// if they make a new search
						if (config.searchboxlocation !== 0) {
							myYui.on('amp_w_' + config.id + '_new_search_data_loaded', adFrontendFilterValueToUrl, that, true);
							if (typeof that.wt4AdDataLoaded !== 'undefined' && that.wt4AdDataLoaded === true) {
								adFrontendFilterValueToUrl(true);
							}
						}
						mouseMovementCount++;
					} else if(value === false && x === e.pageX && y === e.pageY) {
						mouseMovementCount++;
					}
				} catch(e) {
					A.error('.jsWidget.frontendFilter.check:' + e.message);
				}
			},
			getValue: function() {
				return value;
			}
		}
	})();
		
		
	// Ad fronendfilter value to the url
	// @param isSearchBoxSearch {boolean}
	adFrontendFilterValueToUrl = function(isSearchBoxSearch) {
		var allLinks, adData, adDataNr, i, id, node, forntendAddUrlValue, dynamicParametValue,href, pos, clickurl;
		try {
			if (isSearchBoxSearch) {
				clickurl = that.adData['tid4'][0].clickurl;
			} else {
				clickurl = that.adData['tid' + config.tid][0].clickurl;
			}
			
			forntendAddUrlValue = createDynamicParameter(1, clickurl);
				
			if(isSearchBoxSearch === true) {
				//there are 7 amp ads in the search box popup
				// if is ect have to encode the frontend filter value
				forntendAddUrlValue = config.url && config.url.ect ? encodeURIComponent(forntendAddUrlValue) : forntendAddUrlValue;
				for(i = 0; i < 7; i++) {
					id = '#amp_w_4_' + config.tid + '_' + config.id + '_link_' + i;
					node = myYui.get(id);
					if (node) {
						
						//remove dp value; set that when data loaded
						href =  node.get('href');
						pos = href ? href.search(/&dp=/) : -1;
						if (pos !== -1) {
							href = href.substr(0, pos);
						}
							
						node.set('href', href + forntendAddUrlValue);
					}
				}
			} else {
					//if the widget is a cloud
				if (config.tid === 1) {
					//update all link in the data array (for ad popup)
					adData = that.adData['tid' + config.tid];
					adDataNr = adData.length;
					for(i=0; i<adDataNr; i++) {
						href = adData[i].clickurl;
						
						// remove dp value; set that when data loaded
						pos = href ? href.search(/&dp=/) : -1;
						if (pos !== -1) {
							href = href.substr(0, pos);
						}
						
						adData[i].clickurl = href + forntendAddUrlValue;
					}
				}
			
				//update all ad link on the widget box
				forntendAddUrlValue = config.url && config.url.ect ? encodeURIComponent(forntendAddUrlValue) : forntendAddUrlValue;
				allLinks = '#amp_w_c_' + config.id;
				myYui.all('#amp_w_c_' + config.id + ' a').each(function(node) {
					href = node.get('href');
						
					// remove dp value; set that when data loaded
					if (config.url && config.url.ect) {
						pos = href ? href.lastIndexOf("%26dp%3D") : -1;
					} else {
						pos = href ? href.lastIndexOf("&dp=") : -1;
					}
					
					if (pos !== -1) {
						href = href.substr(0, pos);
					}
					
					node.set('href', href + forntendAddUrlValue);
				});
			}
		} catch(e) {
			A.error('.jsWidget.adFrontendFilterValueToUrl:' + e.message);
		}
	};
		
	
	// Get reverse query id from url
	// @param url {string}
	// return {string}
	getQueryId = function(url) {
		var fromV1, fromV2, queryId;
		fromV1 = url.match(/[&?]queryid=(\d+)/);
		fromV1 = fromV1 && fromV1[1] && fromV1[1] !== "0" ? fromV1[1] : null;
			
			
		if(!fromV1) {
			fromV2 = url.match(/[&?]key=(\d+).(\d+)/);
			fromV2 = fromV2 && fromV2[1] && fromV2[1] !== "0"  ? fromV2[1] : null;
		}
		
		queryId = fromV1 || fromV2;
		
		// reverse queryId
		if (queryId) {
			queryId  = queryId.split('').reverse().join('');
		} else {
			//if there is no query id set to " " (one space)
			queryId = ' ';
		}
		
		return queryId;
	};
		
		
	// Creates dynamic parameter
	// return {string}
	createDynamicParameter = (function() {
		var queryId;
		return function(mmValue, url) {
			var dynamicParameterValue;
			
			// need this for encoding
			if (setQueryId === true || queryId === undefined || !queryId || queryId === " ") {
				setQueryId = false;
				queryId = getQueryId(url);
			}
						
			// we can add more values to dynamic parameter here
			dynamicParameterValue = 'mm=' + mmValue;
			
			return FRONTEND_FILTER_ADD_URL_PARAMETER_NAME + A.encode(dynamicParameterValue, queryId);
		}
	})();
	
	
	// EXTEND 'that' OBJECT
	// Initialize and create widget container; impressions logging
	that.create = function() { 
		try {
			//if impression log url is set
			if (config.url && config.url.impression) {
				A.log(config.url.impression);    // log impressions
			}
			createContainer();
			init();    // initialize
				
		} catch (e) {
			A.error('.jsWidget.create:' + e.message);
			return null;
		}
	};
	
	
	// Initialize the widget
	init =  function() {
		var ye,
		id = config.id,
		tid = config.tid,
		bottomHtml = '<a id ="amp_link_' +  id + '" href="http://www.admarketplace.com" target="_blank">ads by adMarketplace</a>';
		
		
		// Set functions to global use
		that.setEct = setEct;
		that.isFrame = A.userInfo.isFrame;
		that.loadFeedData = loadFeedData;
		that.isNext = isNext;
		that.skip = skip;
		that.urlCutHttp = urlCutHttp;
		that.urlCutLength = urlCutLength;
		that.prevAds = prevAds;
		that.nextAds = nextAds;
		that.createDynamicParameter = createDynamicParameter;
		
		YUI().use("node", function(Y) {
			Y.on('available', function() {  
				//initialize next/prev button actions
				// Y.on("click", prevAds, '#amp_prev_ads_' + id);
				// Y.on("click", nextAds, '#amp_next_ads_' + id);
		
				// initialize adMarketplace link action (-1 means amp link)
				if (config.usefrontendfilter && config.usefrontendfilter === true) {
					//initialize frontendfilter action 
					Y.on('frontendFilter_' + id + '|mousemove', frontendFilter.check, document);
				}
	
	
				//set myYui for global use
				that.myYui = myYui = Y;
		
				// initialize different widget types
				switch (tid) {
				case 1:
					that.init_1();
					loadStyle(tid);
					break;
				case 2:
					that.init_2();
					loadStyle(tid);
					break;
				case 3:
					that.init_3();
					loadStyle(tid);
					break;
				case 4:
					that.init_4();
					loadStyle();
					bottomHtml = '<a target="_blank" href="http://www.pubmarketplace.com" id="amp_link_' + config.id + '">powered by pubMarketplace</a>';
					break;
				}
		
				Y.get('#amp_w_b_' + id).set('innerHTML',bottomHtml);
				ye = Y.get('#amp_link_' + id);
				ye.on("mouseover", that.adPopup.mouseOver, that, '#amp_link_popup_' + config.id ,-1);
				ye.on("mouseout", that.adPopup.mouseOut, that, '#amp_link_popup_' + config.id);
				ye = Y.get('#amp_link_popup_' + id);
				ye.on("mouseover", that.adPopup.mouseOverPopup);
				ye.on("mouseout", that.adPopup.mouseOutPopup, that, '#amp_link_popup_' + config.id);
		
		
			}, '#amp_w_' + id)
		});
		
	};
	

	// Amp link and ad popup box
	that.adPopup = (function() {
		var currNr = -2, //(default; -1 is amp ad)
		mouseInAdPopup = false;
		return {
			mouseOver: function(e, id, nr) {
				currNr = nr;
				that.adPopup.show(e, id, nr);
			},
			mouseOut: function(e, id) {
				currNr = -2;
				setTimeout(function(){
					that.adPopup.hide(e,id);
				},500);
			},
			show: function(e, id, nr) {
				var x = e.pageX,
					y = e.pageY,
					element = myYui.get(id),
					winWidth, winHeight, widgetWidth, widgetHeight, 
					widget, adPopupWidth, widgetXY, allWidth, allHeight,
					howMuchUp;
				try {
					setTimeout(function() {
						if (nr === currNr) {
							that.adPopup.generate(element, nr);
	
							if (!A.userInfo.isFrame() && config.confinedplacement === false) {
								winWidth = element.get('winWidth');
								if (x + 300 > winWidth) {
									x -= x+300-winWidth+50;
								}
							} else {   	// if has to show the popup box inside in the widget box
								widget = myYui.get('#amp_w_' + config.id);
								widgetWidth = parseInt(widget.getStyle('width'), 10);
								widgetHeight = parseInt(widget.getStyle('height'), 10);
								
								if (widgetWidth >= 300) {
									adPopupWidth = 248;
									element.setStyle('width',adPopupWidth + 'px'); 
								} else if (widgetWidth <= 300) {
									adPopupWidth = widgetWidth-15;
									element.setStyle('width',adPopupWidth + 'px'); 
								}
								
								widgetXY = widget.getXY();
								
								allWidth = widgetXY[0] + widgetWidth;
								if (x+adPopupWidth+24 >= allWidth) {
									x -= x+adPopupWidth-allWidth+6;
								}
								
								allHeight = widgetXY[1] + widgetHeight;
								howMuchUp = 80;
								if (widgetWidth < 200)
									howMuchUp = 130;
								if (y+howMuchUp >= allHeight) {
									y -= y+howMuchUp-allHeight;
								}
							}
							element.setStyle('display', 'block');
							element.setXY([x,y]);
						}
					}, 500);
				
				} catch (e) {
					A.error('.jsWidget.adPopup.show:' + e.message);
					return null;
				}
			},
			hide: function(e, id) {
				var element = myYui.get(id);
				if (!mouseInAdPopup) {
					element.set('innerHTML', '').setStyle('display', 'none');
				}
			},
			generate: function(element, nr) {
				var html='', ad, title, description, clickurl, displayurl, id, kw, img;  ;
				
				// amp ad
				if (nr === -1) {
					html = '<a href="http://www.pubmarketplace.com" target="_blank"><div class="amp_ad"><div class="amp_ad_title">Monetize Your Website</div><div class="amp_ad_desc">High CPC\'s & Exclusive Advertisers<br/>Huge Revenue Opportunity.</div><div class="amp_ad_url">www.adMarketplace.com</div></div></a>';
					element.set('innerHTML', html);
					return null;
				}
				
				id = 'amp_w_1_' + config.tid + '_' + config.id + '_link_c';
				
				ad = that.adData['tid' + config.tid][nr];  // set that.adData['tid' + config.tid] in showData
				title = ad.title;
				description = ad.description;
				clickurl = that.setEct(ad.clickurl);  // if ect is set then
														// set the clickurl to
														// go to ect
				displayurl = urlCutHttp(ad.displayurl);
				displayurl = that.urlCutLength(displayurl, 35);
				
				// original type id, widget type id, widget id

				html += '<a id="' + id + '" href="' + clickurl + '" target="_blank">';
				html += '<div class="amp_ad">';
				html += '<div class="amp_ad_title">' + title + '</div>';
				html += '<div class="amp_ad_desc">' + description + '</div>';
				html += '<div class="amp_ad_url">' + displayurl + '</div>';
				html += '</div></a>';
				
				element.set('innerHTML', html);
				
				// log ad box open
				if (config.url.adboxopenlog) {
					kw = ad.kw;
					clickurl = encodeURIComponent(ad.clickurl);
					A.log(config.url.adboxopenlog , '&kw='+kw+'&clickurl='+clickurl);
				}
			},
			mouseOverPopup: function(e) {
				mouseInAdPopup = true;
			},
			mouseOutPopup: function(e, id) {
				if(!myYui.get(id).contains(e.relatedTarget)) {
					mouseInAdPopup = false;
					that.adPopup.hide(e, id);
				}
			}
		}
	})();
	
	
	// Return widget id
	// @return {integer}
	that.getConfigId = function(){
		return config.id;
	};
	
	
	// Return widget search box location
	// @return {integer}
	that.getConfigSearchboxlocation = function() {
		return config.searchboxlocation;
	};
	
	
	// Return widget type id
	// @return {integer}
	that.getConfigTid = function() {
		return config.tid;
	};
	
	
	// Return widget security code
	// @return {string}
	that.getConfigSc = function() {
		return config.sc;
	};
	
	
	// Return external click tracker url
	// @return {string}
	that.getConfigUrlEct = function() {
		if (config.url && config.url.ect && config.url.ect !== '') {
			return  config.url.ect;
		} else {
			return false;
		}
	};

	
	// Return publisher affiliate id
	// @return {string}
	that.getConfigAid = function() {
		return config.aid || 'unknown';
	};
	
	
	// Return static content server url
	// @return {string|undefined}
	that.getConfigUrlServer = function() {
		return  config.url && config.url.server;
	};
	
	
	// Return search page (search.php) url
	// @return {string}
	that.getConfigUrlSearchpage = function() {
		return  (config.url && config.url.searchpage) || 'http://pmp.ampxchange.com/v3';
	};
	
	
	// Return skip
	// @return {integer}
	that.getSkip = function() {
		return skip;
	};
	
	
	// Return search type for search box
	// @return {string}
	that.getSearchType = function() {
		var webTab, siteTab;
		webTab = myYui.get('#web_results_button_' + config.id);
		siteTab = myYui.get('#site_results_button_' + config.id);
		 if (webTab.get('className') === 'active_button') {
			 return 'web';
		 } else if (siteTab.get('className') === 'active_button') {
			 return 'site';
		 } else return false;
	};
	
	
	// Return usefrontendfilter setting
	// @return {boolean}
	that.getUfef = function() {
		return config.usefrontendfilter;
	};
	
	
	// Return wdg url
	// @return {string}
	that.getWdgurl = function() {
		return config.url && config.url.wdg;
	};
	
	
	// Return yahoo boss feed url
	// @return {string}
	that.getYbfurl = function() {
		return config.url && config.url.yahooboss;
	};
	

	// Return site url (which is in the database)
	// @return {string}
	that.getSiteurl = function() {
		return config.url && config.url.site;
	};
	
	
	// Log an error from the attached function; Helps protecting the AMP class
	that.error = function(msg, e) {
		A.error(msg, e);
	};

	return that;
});

// wt2 attached functions 
// wt2 initializer
AMP.attacheTo('jsWidget', 'init_2', function() {
	
});


// wt2 show data
// @param jsonData {object}
AMP.attacheTo('jsWidget','showData_2', function(jsonData) {
	var that, id, tid,
		i, j,
		result, adData, adNr, rows, columns, showkw, ad, adTitle, showKw, 
		html, clickurl, displayurl, linkId, 
		widgetContent,
		tdWidth;
	
	that = this;
	id = that.getConfigId();
	tid = that.getConfigTid();
	
	try {
		
		//verify jsonData results, if something wrong throw an error
		if (!jsonData || !jsonData.result) {
			throw {message:'Error(1011): no response data'};
		}
		
		if (jsonData.result.ads === undefined  || (jsonData.result.ads && jsonData.result.ads.adlistings && jsonData.result.ads.adlistings.length === 0)) {
			if (jsonData.result.error.message === '') {
				throw {name:'errorToDisplay', message:'No results!'};
			} else {
				throw {name:'errorToDisplay', message:'Error(' + jsonData.result.error.code + '): ' +jsonData.result.error.message};
			}
		}
		
		result = jsonData.result;
		adData = result.ads.adlistings;
		adNr = adData.length;
		
		rows = result.extraparameter.rows;
		columns = result.extraparameter.columns;
		showKw = result.extraparameter && result.extraparameter.showkw ? result.extraparameter.showkw : false;    // shows keyword instead title
		
		//set isnext
		if (result.isnext === true) {
			that.isNext = true;
		}
		
		
		//add dynamic parameter to click url
		for(i=0; i< adData.length; i++) {
			adData[i].clickurl += that.createDynamicParameter(0,adData[i].clickurl);
		}
		
		
		widgetContent = that.myYui.get('#amp_w_c_' + id);
		tdWidth = parseInt(100/columns);
		
		html = '';
		linkId = 'amp_w_2_' + tid + '_' + id + '_link_';
		for(i = 0; i < adNr; i++) {
			ad = adData[i];
			clickurl = that.setEct(ad.clickurl);
			displayurl = that.urlCutHttp(ad.displayurl);
			displayurl = that.urlCutLength(displayurl, 35);
			
			if (columns > 1) {
				html += '<td  width="' + tdWidth + '%" valign="top">';
			}
			
			if (showKw && ad.kw) {
				adTitle = ad.kw;
			} else {
				adTitle = ad.title;
			}
			
			// original type id, widget type id, widget id
			html += '<a id="' + linkId + i + '" class="amp_w_ad_link_' + id + '" href="' + clickurl + '" target="_blank">';
			html += '<div class="amp_ad">';
			html += '<div class="amp_ad_title">' + adTitle + '</div>';
			html += '<div class="amp_ad_desc">' + ad.description + '</div>';
			html += '<div class="amp_ad_url">' + displayurl + '</div>';
			html += '</div></a>';
			
			
			if (columns > 1) {
				html += '</td>';
			}
			
			if(columns > 1 && ((i+1) % columns == 0) || i+1 === adNr) {
				html += '</tr>';
			}
			
			if(columns > 1 && ((i+1) % columns == 0) && i+1 < adNr) {
				html += '<tr>';
			}
		}
		
		if (columns > 1) {
			widgetContent.set('innerHTML','<table cellpadding="1" cellspacing ="2" ><tr>' + html + '</tr></table>');
		}
		else {
			widgetContent.set('innerHTML', html);
		}
		
		that.adData['tid2'] = adData;
		that.myYui.fire('amp_w_' + id + '_dataloaded');
		
	} catch(e) {
		if (e.name && e.name === 'errorToDisplay') {
			that.myYui.get('#amp_w_c_' + id).set('innerHTML', '<p style="text-align:center;font-size:9pt; padding:0px; margin: 0px">' + e.message + '</p>');
			that.myYui.get('#amp_w_b_' + id).set('innerHTML', '');
		} else {
			that.error('.jsWidget.showData_2:' + e.message);
		}
	}
});


// wt2 new search
AMP.attacheTo('jsWidget','newSearch_2', function() {
	this.loadFeedData();
});

var ampWidget_1924; AMP().use('jsWidget', 'actionMonitor','userInfo', function (A) { ampWidget_1924 = A.jsWidget({"id":1924,"usefrontendfilter":true,"sc":"6760295766490594632","confinedplacement":false,"aid":"unknown","tid":2,"searchboxlocation":0,"url":{"wdg":"http://pmpt.ampxchange.com/xmlamp/wdg/v2?id=1924&tid=2&sc=6760295766490594632&aid=unknown","adboxopenlog":"http://log.ampxchange.com/al/v1?en=2&id=1924&aid=unknown","impression":"http://impr.ampxchange.com/xmlamp/imp/v1?wid=1924&aid=unknown","server":"http://static.ampxchange.com/text/v1","css":"http://pmpt.ampxchange.com/xmlamp/css/v2?id=1924&tid=2&sc=6760295766490594632"}}); ampWidget_1924.create(); A.actionMonitor({"id":{"keypress":"#amp_w_1924","click":"#amp_w_1924","mousemovement":"#amp_w_1924"},"urls":{"actionlog":{"paramconfig":{"ul":true,"if":true,"p":true,"ifo":true,"ac":true,"at":true,"ua":true,"ce":true,"hl":true,"url":true,"xy":true},"url":"http://log.ampxchange.com/al/v1?en=1&id=1924&aid=unknown"}},"logtype":{"crossdomain":true}}).start(); });