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