public/javascripts/yui/element/element.js
function(type, fn, obj, scope) {

        scope = scope || this;

        var Event = YAHOO.util.Event,
			el = this.get('element') || this.get('id'),
        	self = this;


		if (specialTypes[type] && !Event._createMouseDelegate) {
	        return false;	
		}


        if (!this._events[type]) { // create on the fly

            if (el && this.DOM_EVENTS[type]) {
				Event.on(el, type, function(e, matchedEl) {

					// Supplement IE with target, currentTarget relatedTarget

	                if (e.srcElement && !e.target) { 
	                    e.target = e.srcElement;
	                }

					if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) {
						e.relatedTarget = Event.getRelatedTarget(e);
					}
					
					if (!e.currentTarget) {
						e.currentTarget = el;
					}

					//	Note: matchedEl el is passed back for delegated listeners
		            self.fireEvent(type, e, matchedEl);

		        }, obj, scope);
            }
            this.createEvent(type, {scope: this});
        }
        
        return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
    }
function(type, fn, obj, scope) {

        scope = scope || this;

        var Event = YAHOO.util.Event,
			el = this.get('element') || this.get('id'),
        	self = this;


		if (specialTypes[type] && !Event._createMouseDelegate) {
	        return false;	
		}


        if (!this._events[type]) { // create on the fly

            if (el && this.DOM_EVENTS[type]) {
				Event.on(el, type, function(e, matchedEl) {

					// Supplement IE with target, currentTarget relatedTarget

	                if (e.srcElement && !e.target) { 
	                    e.target = e.srcElement;
	                }

					if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) {
						e.relatedTarget = Event.getRelatedTarget(e);
					}
					
					if (!e.currentTarget) {
						e.currentTarget = el;
					}

					//	Note: matchedEl el is passed back for delegated listeners
		            self.fireEvent(type, e, matchedEl);

		        }, obj, scope);
            }
            this.createEvent(type, {scope: this});
        }
        
        return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
    }
function ( type , fn , obj , scope ) { scope = scope || this ; var Event = YAHOO . util . Event , el = this . get ( 'element' ) || this . get ( 'id' ) , self = this ; if ( specialTypes [ type ] && ! Event . _createMouseDelegate ) { return false ; } if ( ! this . _events [ type ] ) { // create on the fly if ( el && this . DOM_EVENTS [ type ] ) { Event . on ( el , type , function ( e , matchedEl ) { // Supplement IE with target, currentTarget relatedTarget if ( e . srcElement && ! e . target ) { e . target = e . srcElement ; } if ( ( e . toElement && ! e . relatedTarget ) || ( e . fromElement && ! e . relatedTarget ) ) { e . relatedTarget = Event . getRelatedTarget ( e ) ; } if ( ! e . currentTarget ) { e . currentTarget = el ; } //	Note: matchedEl el is passed back for delegated listeners self . fireEvent ( type , e , matchedEl ) ; } , obj , scope ) ; } this . createEvent ( type , { scope : this } ) ; } return YAHOO . util . EventProvider . prototype . subscribe . apply ( this , arguments ) ; // notify via customEvent }
Adds a listener for the given event.  These may be DOM or
customEvent listeners.  Any event that is fired via fireEvent
can be listened for.  All handlers receive an event object.
@method addListener
@param {String} type The name of the event to listen for
@param {Function} fn The handler to call when the event fires
@param {Any} obj A variable to pass to the handler
@param {Object} scope The object to use for the scope of the handler
Adds a listener for the given event . These may be DOM or customEvent listeners . Any event that is fired via fireEvent can be listened for . All handlers receive an event object .