title: Replace addEventListener
body: <p>I have a lot of code that use <code>addEventListener</code> in minified libraries, files ..., but I need to make work this code in <strong>IE8</strong>, so replacing <code>addEventListener</code> with <code>addEvent</code>:</p>
  
  <pre><code> /*
    * Register the specified handler function to handle events of the specified
    * type on the specified target. Ensure that the handler will always be
    * invoked as a method of the target.
    */
   function addEvent(type, handler) {
       if (this.addEventListener)
           this.addEventListener(type, handler, false);
       else {
           this.attachEvent("on" + type,
               function(event) {
                   return handler.call(this, event);
               });
       }
   }
  </code></pre>
  
  <p>I can "override" <code>window.addEventListener</code>, but how can I override this method in the other objects?</p>
  
  <p>Thanks in advance
  Regards</p>