code: function(extent, closest) {
          var viewSize = this.map.getSize();
          var idealResolution = Math.max( extent.getWidth()  / viewSize.w,
                                          extent.getHeight() / viewSize.h );
  
          return this.getZoomForResolution(idealResolution, closest);
      }
docs: APIMethod: getZoomForExtent
  
  Parameters:
  extent - {<OpenLayers.Bounds>}
  closest - {Boolean} Find the zoom level that most closely fits the
  specified bounds. Note that this may result in a zoom that does
  not exactly contain the entire extent.
  Default is false.
  
  Returns:
  {Integer} The index of the zoomLevel (entry in the resolutions array)
  for the passed-in extent. We do this by calculating the ideal
  resolution for the given extent (based on the map size) and then
  calling getZoomForResolution(), passing along the 'closest'
  parameter.