/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ var GLOBAL_ENV=YUI.Env;if(!GLOBAL_ENV._ready){GLOBAL_ENV._ready=function(){GLOBAL_ENV.DOMReady=true;GLOBAL_ENV.remove(YUI.config.doc,'DOMContentLoaded',GLOBAL_ENV._ready);};GLOBAL_ENV.add(YUI.config.doc,'DOMContentLoaded',GLOBAL_ENV._ready);} YUI.add('event-base',function(Y){Y.publish('domready',{fireOnce:true,async:true});if(GLOBAL_ENV.DOMReady){Y.fire('domready');}else{Y.Do.before(function(){Y.fire('domready');},YUI.Env,'_ready');} var ua=Y.UA,EMPTY={},webkitKeymap={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},resolve=function(n){if(!n){return n;} try{if(n&&3==n.nodeType){n=n.parentNode;}}catch(e){return null;} return Y.one(n);},DOMEventFacade=function(ev,currentTarget,wrapper){this._event=ev;this._currentTarget=currentTarget;this._wrapper=wrapper||EMPTY;this.init();};Y.extend(DOMEventFacade,Object,{init:function(){var e=this._event,overrides=this._wrapper.overrides,x=e.pageX,y=e.pageY,c,currentTarget=this._currentTarget;this.altKey=e.altKey;this.ctrlKey=e.ctrlKey;this.metaKey=e.metaKey;this.shiftKey=e.shiftKey;this.type=(overrides&&overrides.type)||e.type;this.clientX=e.clientX;this.clientY=e.clientY;this.pageX=x;this.pageY=y;c=e.keyCode||e.charCode;if(ua.webkit&&(c in webkitKeymap)){c=webkitKeymap[c];} this.keyCode=c;this.charCode=c;this.which=e.which||e.charCode||c;this.button=this.which;this.target=resolve(e.target);this.currentTarget=resolve(currentTarget);this.relatedTarget=resolve(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll"){this.wheelDelta=(e.detail)?(e.detail*-1):Math.round(e.wheelDelta / 80)||((e.wheelDelta<0)?-1:1);} if(this._touch){this._touch(e,currentTarget,this._wrapper);}},stopPropagation:function(){this._event.stopPropagation();this._wrapper.stopped=1;this.stopped=1;},stopImmediatePropagation:function(){var e=this._event;if(e.stopImmediatePropagation){e.stopImmediatePropagation();}else{this.stopPropagation();} this._wrapper.stopped=2;this.stopped=2;},preventDefault:function(returnValue){var e=this._event;e.preventDefault();e.returnValue=returnValue||false;this._wrapper.prevented=1;this.prevented=1;},halt:function(immediate){if(immediate){this.stopImmediatePropagation();}else{this.stopPropagation();} this.preventDefault();}});DOMEventFacade.resolve=resolve;Y.DOM2EventFacade=DOMEventFacade;Y.DOMEventFacade=DOMEventFacade;(function(){Y.Env.evt.dom_wrappers={};Y.Env.evt.dom_map={};var _eventenv=Y.Env.evt,config=Y.config,win=config.win,add=YUI.Env.add,remove=YUI.Env.remove,onLoad=function(){YUI.Env.windowLoaded=true;Y.Event._load();remove(win,"load",onLoad);},onUnload=function(){Y.Event._unload();},EVENT_READY='domready',COMPAT_ARG='~yui|2|compat~',shouldIterate=function(o){try{return(o&&typeof o!=="string"&&Y.Lang.isNumber(o.length)&&!o.tagName&&!o.alert);}catch(ex){return false;}},Event=function(){var _loadComplete=false,_retryCount=0,_avail=[],_wrappers=_eventenv.dom_wrappers,_windowLoadKey=null,_el_events=_eventenv.dom_map;return{POLL_RETRYS:1000,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!Event._interval){Event._interval=setInterval(Event._poll,Event.POLL_INTERVAL);}},onAvailable:function(id,fn,p_obj,p_override,checkContent,compat){var a=Y.Array(id),i,availHandle;for(i=0;i4)?args.slice(4):null);if(fireNow){cewrapper.fire();} return ret;},detach:function(type,fn,el,obj){var args=Y.Array(arguments,0,true),compat,l,ok,i,id,ce;if(args[args.length-1]===COMPAT_ARG){compat=true;} if(type&&type.detach){return type.detach();} if(typeof el=="string"){if(compat){el=Y.DOM.byId(el);}else{el=Y.Selector.query(el);l=el.length;if(l<1){el=null;}else if(l==1){el=el[0];}}} if(!el){return false;} if(el.detach){args.splice(2,1);return el.detach.apply(el,args);}else if(shouldIterate(el)){ok=true;for(i=0,l=el.length;i0);} notAvail=[];executeItem=function(el,item){var context,ov=item.override;if(item.compat){if(item.override){if(ov===true){context=item.obj;}else{context=ov;}}else{context=el;} item.fn.call(context,item.obj);}else{context=item.obj||Y.one(el);item.fn.apply(context,(Y.Lang.isArray(ov))?ov:[]);}};for(i=0,len=_avail.length;i4?Y.Array(arguments,4,true):null;return Y.Event.onAvailable.call(Y.Event,id,fn,o,a);}};Y.Env.evt.plugins.contentready={on:function(type,fn,id,o){var a=arguments.length>4?Y.Array(arguments,4,true):null;return Y.Event.onContentReady.call(Y.Event,id,fn,o,a);}};},'3.3.0',{requires:['event-custom-base']});