code: function(resolution) {
          var distance = Number.POSITIVE_INFINITY;
          resolution = resolution || this.map.getResolution();
          if(this.serverResolutions &&
             OpenLayers.Util.indexOf(this.serverResolutions, resolution) === -1) {
              var i, newDistance, newResolution, serverResolution;
              for(i=this.serverResolutions.length-1; i>= 0; i--) {
                  newResolution = this.serverResolutions[i];
                  newDistance = Math.abs(newResolution - resolution);
                  if (newDistance > distance) {
                      break;
                  }
                  distance = newDistance;
                  serverResolution = newResolution;
              }
              resolution = serverResolution;
          }
          return resolution;
      }
docs: Method: getServerResolution
  Return the closest server-supported resolution.
  
  Parameters:
  resolution - {Number} The base resolution. If undefined the
  map resolution is used.
  
  Returns:
  {Number} The closest server resolution value.