code: function(el, e, callback, capture)
      {
          if (hasEventListeners) {
              el.addEventListener(e, callback, !!capture);
          } else {
              el.attachEvent('on' + e, callback);
          }
      }
docs: feature detection and helper functions