code: function(position) {
          if (position instanceof OpenLayers.Bounds) {
              var minXY = this.map.getLonLatFromPixel({
                  x: position.left,
                  y: position.bottom
              });
              var maxXY = this.map.getLonLatFromPixel({
                  x: position.right,
                  y: position.top
              });
              var bounds = new OpenLayers.Bounds(
                  minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
              );
              
              // if multiple is false, first deselect currently selected features
              if (!this.multipleSelect()) {
                  this.unselectAll();
              }
              
              // because we're using a box, we consider we want multiple selection
              var prevMultiple = this.multiple;
              this.multiple = true;
              var layers = this.layers || [this.layer];
              this.events.triggerEvent("boxselectionstart", {layers: layers}); 
              var layer;
              for(var l=0; l<layers.length; ++l) {
                  layer = layers[l];
                  for(var i=0, len = layer.features.length; i<len; ++i) {
                      var feature = layer.features[i];
                      // check if the feature is displayed
                      if (!feature.getVisibility()) {
                          continue;
                      }
  
                      if (this.geometryTypes == null || OpenLayers.Util.indexOf(
                              this.geometryTypes, feature.geometry.CLASS_NAME) > -1) {
                          if (bounds.toGeometry().intersects(feature.geometry)) {
                              if (OpenLayers.Util.indexOf(layer.selectedFeatures, feature) == -1) {
                                  this.select(feature);
                              }
                          }
                      }
                  }
              }
              this.multiple = prevMultiple;
              this.events.triggerEvent("boxselectionend", {layers: layers}); 
          }
      }
docs: Method: selectBox
  Callback from the handlers.box set up when <box> selection is true
  on.
  
  Parameters:
  position - {<OpenLayers.Bounds> || <OpenLayers.Pixel> }