text: YUI.add("event-base",function(p,e){p.publish("domready",{fireOnce:!0,"async":!0}),YUI.Env.DOMReady?p.fire("domready"):p.Do.before(function(){p.fire("domready")},YUI.Env,"_ready");var i=p.UA,a={},l={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},o=function(e){if(!e)return e;try{e&&3==e.nodeType&&(e=e.parentNode)}catch(t){return null}return p.one(e)},t=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||a,this.init()};p.extend(t,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,n=e.pageX,a=e.pageY,r=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=n,this.pageY=a,t=e.keyCode||e.charCode,i.webkit&&t in l&&(t=l[t]),this.keyCode=t,this.charCode=t,this.which=e.which||e.charCode||t,this.button=this.which,this.target=o(e.target),this.currentTarget=o(r),this.relatedTarget=o(e.relatedTarget),"mousewheel"!=e.type&&"DOMMouseScroll"!=e.type||(this.wheelDelta=e.detail?-1*e.detail:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1)),this._touch&&this._touch(e,r,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),e&&(t.returnValue=e),this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),t.resolve=o,p.DOM2EventFacade=t,p.DOMEventFacade=t,p.Env.evt.dom_wrappers={},p.Env.evt.dom_map={};var c,u,d,s,h,v=p.Env.evt,t=p.config,f=t.win,y=YUI.Env.add,r=YUI.Env.remove,n=function(){YUI.Env.windowLoaded=!0,p.Event._load(),r(f,"load",n)},g=function(){p.Event._unload()},_="domready",m="~yui|2|compat~",E=function(e){try{return e&&"string"!=typeof e&&p.Lang.isNumber(e.length)&&!e.tagName&&!p.DOM.isWindow(e)}catch(t){return!1}},b=p.CustomEvent.prototype._delete,w=function(e){var t=b.apply(this,arguments);return this.hasSubs()||p.Event._clean(this),t},I=(c=!1,u=0,d=[],s=v.dom_wrappers,h=v.dom_map,{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){I._interval||(I._interval=setInterval(I._poll,I.POLL_INTERVAL))},onAvailable:function(e,t,n,a,r,i){for(var l,o=p.Array(e),c=0;c<o.length;c+=1)d.push({id:o[c],fn:t,obj:n,override:a,checkReady:r,compat:i});return u=this.POLL_RETRYS,setTimeout(I._poll,0),l=new p.EventHandle({_delete:function(){if(l.handle)l.handle.detach();else for(var e,t=0;t<o.length;t++)for(e=0;e<d.length;e++)o[t]===d[e].id&&d.splice(e,1)}})},onContentReady:function(e,t,n,a,r){return I.onAvailable(e,t,n,a,!0,r)},attach:function(e,t,n,a){return I._attach(p.Array(arguments,0,!0))},_createWrapper:function(t,e,n,a,r){var i,l=p.stamp(t),o="event:"+l+e;return!1===r&&(o+="native"),n&&(o+="capture"),(i=s[o])||((i=p.publish(o,{silent:!0,bubbles:!1,emitFacade:!1,contextFn:function(){return a?i.el:(i.nodeRef=i.nodeRef||p.one(i.el),i.nodeRef)}})).overrides={},i.el=t,i.key=o,i.domkey=l,i.type=e,i.fn=function(e){i.fire(I.getEvent(e,t,a||!1===r))},i.capture=n,t==f&&"load"==e&&(i.fireOnce=!0,0),i._delete=w,s[o]=i,h[l]=h[l]||{},h[l][o]=i,y(t,e,i.fn,n)),i},_attach:function(n,a){var e,r,t,i,l=!1,o=n[0],c=n[1],u=n[2]||f,d=a&&a.facade,s=a&&a.capture,h=a&&a.overrides;if(n[n.length-1]===m&&(e=!0),!c||!c.call)return!1;if(E(u))return r=[],p.each(u,function(e,t){n[2]=e,r.push(I._attach(n.slice(),a))}),new p.EventHandle(r);if(p.Lang.isString(u)){if(e)t=p.DOM.byId(u);else switch((t=p.Selector.query(u)).length){case 0:t=null;break;case 1:t=t[0];break;default:return n[2]=t,I._attach(n,a)}if(!t)return i=I.onAvailable(u,function(){i.handle=I._attach(n,a)},I,!0,!1,e);u=t}return!!u&&(p.Node&&p.instanceOf(u,p.Node)&&(u=p.Node.getDOMNode(u)),s=I._createWrapper(u,o,s,e,d),h&&p.mix(s.overrides,h),u==f&&"load"==o&&YUI.Env.windowLoaded&&(l=!0),e&&n.pop(),d=n[3],i=s._on(c,d,4<n.length?n.slice(4):null),l&&s.fire(),i)},detach:function(e,t,n,a){var r,i,l,o,c=p.Array(arguments,0,!0);if(c[c.length-1]===m&&(o=!0),e&&e.detach)return e.detach();if("string"==typeof n&&(o?n=p.DOM.byId(n):(r=(n=p.Selector.query(n)).length)<1?n=null:1==r&&(n=n[0])),!n)return!1;if(n.detach)return c.splice(2,1),n.detach.apply(n,c);if(E(n)){for(i=!0,l=0,r=n.length;l<r;++l)c[2]=n[l],i=p.Event.detach.apply(p.Event,c)&&i;return i}return e&&t&&t.call?(o="event:"+p.stamp(n)+e,!!(o=s[o])&&o.detach(t)):I.purgeElement(n,!1,e)},getEvent:function(e,t,n){var a=e||f.event;return n?a:new p.DOMEventFacade(a,t,s["event:"+p.stamp(t)+e.type])},generateId:function(e){return p.DOM.generateID(e)},_isValidCollection:E,_load:function(e){c||(c=!0,p.fire&&p.fire(_),I._poll())},_poll:function(){if(!I.locked)if(p.UA.ie&&!YUI.Env.DOMReady)I.startInterval();else{I.locked=!0;for(var e,t,n=(n=!c)||0<u,a=[],r=function(e,t){var n,a=t.override;try{t.compat?(n=t.override?!0===a?t.obj:a:e,t.fn.call(n,t.obj)):(n=t.obj||p.one(e),t.fn.apply(n,p.Lang.isArray(a)?a:[]))}catch(r){}},i=0,l=d.length;i<l;++i)(e=d[i])&&!e.checkReady&&((t=e.compat?p.DOM.byId(e.id):p.Selector.query(e.id,null,!0))?(r(t,e),d[i]=null):a.push(e));for(i=0,l=d.length;i<l;++i)(e=d[i])&&e.checkReady&&((t=e.compat?p.DOM.byId(e.id):p.Selector.query(e.id,null,!0))?(c||t.get&&t.get("nextSibling")||t.nextSibling)&&(r(t,e),d[i]=null):a.push(e));u=0===a.length?0:u-1,n?I.startInterval():(clearInterval(I._interval),I._interval=null),I.locked=!1}},purgeElement:function(e,t,n){var a,r,i,l,e=p.Lang.isString(e)?p.Selector.query(e,null,!0):e,o=I.getListeners(e,n);if(t&&e)for(o=o||[],r=(i=p.Selector.query("*",e)).length,a=0;a<r;++a)(l=I.getListeners(i[a],n))&&(o=o.concat(l));if(o)for(a=0,r=o.length;a<r;++a)o[a].detachAll()},_clean:function(e){var t=e.key,n=e.domkey;r(e.el,e.type,e.fn,e.capture),delete s[t],
  delete p._yuievt.events[t],h[n]&&(delete h[n][t],p.Object.size(h[n])||delete h[n])},getListeners:function(e,t){var e=p.stamp(e,!0),n=h[e],a=[],e=t?"event:"+e+t:null,r=v.plugins;return n?(e?(r[t]&&r[t].eventDef&&(e+="_synth"),n[e]&&a.push(n[e]),n[e+="native"]&&a.push(n[e])):p.each(n,function(e,t){a.push(e)}),a.length?a:null):null},_unload:function(n){p.each(s,function(e,t){"unload"==e.type&&e.fire(n),e.detachAll()}),r(f,"unload",g)},nativeAdd:y,nativeRemove:r});if(p.Event=I,t.injected||YUI.Env.windowLoaded?n():y(f,"load",n),p.UA.ie&&(p.on(_,I._poll),p.UA.ie<7))try{y(f,"unload",g)}catch(O){}I.Custom=p.CustomEvent,I.Subscriber=p.Subscriber,I.Target=p.EventTarget,I.Handle=p.EventHandle,I.Facade=p.EventFacade,I._poll(),p.Env.evt.plugins.available={on:function(e,t,n,a){var r=4<arguments.length?p.Array(arguments,4,!0):null;return p.Event.onAvailable.call(p.Event,n,t,a,r)}},p.Env.evt.plugins.contentready={on:function(e,t,n,a){var r=4<arguments.length?p.Array(arguments,4,!0):null;return p.Event.onContentReady.call(p.Event,n,t,a,r)}}},"@VERSION@",{requires:["event-custom-base"]});