code: function(event, allowDefault) {
          
          if (!allowDefault) { 
              OpenLayers.Event.preventDefault(event);
          }
                  
          if (event.stopPropagation) {
              event.stopPropagation();
          } else {
              event.cancelBubble = true;
          }
      }
docs: Method: stop
  Stops an event from propagating.
  
  Parameters:
  event - {Event}
  allowDefault - {Boolean} If true, we stop the event chain but
  still allow the default browser behaviour (text selection,
  radio-button clicking, etc).  Default is false.