code: function addHandler(element, type, handler) {
          if (element.addEventListener) {
              element.addEventListener(type, handler, false)
          } else if (element.attachEvent) {
              element.attachEvent("on" + type, handler)
          } else {
              element["on" + type] = handler
          }
      }
docs: See http://stackoverflow.com/questions/12949590/how-to-detach-event-in-ie-6-7-8-9-using-javascript