Ладно, уговорили.
delegate: function(type, selector, callback) {
this.event(type, function(event) {
var target = event && event.target || w.event.srcElement;
while(target != this) {
if(matches.call(target, selector)) {
callback.call(target, event);
break;
}
target = target.parentNode;
}
});
return this;
},
event: function(type, callback) {
var self = this;
if('addEventListener' in self) self.addEventListener(type, callback, false);
else self.attachEvent('on' + type, function(event) {
callback.call(self, event);
});
return this;
},