code: function() {
          // check for OpenLayers.Event before checking for observers, because
          // OpenLayers.Event may be undefined in IE if no map instance was
          // created
          if (OpenLayers.Event && OpenLayers.Event.observers) {
              for (var cacheID in OpenLayers.Event.observers) {
                  var elementObservers = OpenLayers.Event.observers[cacheID];
                  OpenLayers.Event._removeElementObservers.apply(this, 
                                                             [elementObservers]);
              }
              OpenLayers.Event.observers = false;
          }
      }
docs: Method: unloadCache
  Cycle through all the element entries in the events cache and call
  stopObservingElement on each.