code: function connect(node, type, handler, disconnect) {
      if (typeof node.addEventListener == "function") {
        node.addEventListener(type, handler, false);
        if (disconnect) return function() {node.removeEventListener(type, handler, false);};
      } else {
        var wrapHandler = function(event) {handler(event || window.event);};
        node.attachEvent("on" + type, wrapHandler);
        if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);};
      }
    }
docs: Event handler registration. If disconnect is true, it'll return a function that unregisters the handler.