// Base event registration object // by Lost Boys - www.lostboys.nl var EventListener = { listeners:[], bSafari:/safari/i.test(navigator.userAgent), addEvents:function(els, type, func, scope) { for(var i=0; i 1)? target.parentNode:target; } }, getEvents:function(el, type) { var result = []; for(var item,i=0; (item = this.listeners[i++]);) { if(item.element == el && (!type || type == item.type)) { result.push(item); } } return result; }, cancelEvent:function(e) { this.preventDefault(e); this.stopPropagation(e); return false; }, preventDefault:function(e) { try { e.preventDefault(); } catch (exception) { e.returnValue = false; } if(this.bSafari) { var target = this.getTarget(e); if (/^a$/i.test(target.nodeName)) { target.onclick = function() { return false; }; } } return false; }, stopPropagation:function(e) { try { e.stopPropagation(); } catch (exception) { e.cancelBubble = true; } return false; }, delegate:function(func, scope) { return function() { func.apply(scope, arguments); } } }