code: function(el, eventName, data)
      {
          var ev;
  
          if (document.createEvent) {
              ev = document.createEvent('HTMLEvents');
              ev.initEvent(eventName, true, false);
              ev = extend(ev, data);
              el.dispatchEvent(ev);
          } else if (document.createEventObject) {
              ev = document.createEventObject();
              ev = extend(ev, data);
              el.fireEvent('on' + eventName, ev);
          }
      }
docs: feature detection and helper functions