docs: function(props) {
  
          var viewSize, wRes, hRes;
  
          // determine maxResolution
          var maxResolution = props.maxResolution;
          if(props.minScale != null) {
              maxResolution =
                  OpenLayers.Util.getResolutionFromScale(props.minScale,
                                                         this.units);
          } else if(maxResolution == "auto" && this.maxExtent != null) {
              viewSize = this.map.getSize();
              wRes = this.maxExtent.getWidth() / viewSize.w;
              hRes = this.maxExtent.getHeight() / viewSize.h;
              maxResolution = Math.max(wRes, hRes);
          }
  
          // determine minResolution
          var minResolution = props.minResolution;
          if(props.maxScale != null) {
              minResolution =
                  OpenLayers.Util.getResolutionFromScale(props.maxScale,
                                                         this.units);
          } else if(props.minResolution == "auto" && this.minExtent != null) {
              viewSize = this.map.getSize();
              wRes = this.minExtent.getWidth() / viewSize.w;
              hRes = this.minExtent.getHeight()/ viewSize.h;
              minResolution = Math.max(wRes, hRes);
          }
  
          if(typeof maxResolution !== "number" &&
             typeof minResolution !== "number" &&
             this.maxExtent != null) {
              // maxResolution for default grid sets assumes that at zoom
              // level zero, the whole world fits on one tile.
              var tileSize = this.map.getTileSize();
              maxResolution = Math.max(
                  this.maxExtent.getWidth() / tileSize.w,
                  this.maxExtent.getHeight() / tileSize.h
              );
          }
  
          // determine numZoomLevels
          var maxZoomLevel = props.maxZoomLevel;
          var numZoomLevels = props.numZoomLevels;
          if(typeof minResolution === "number" &&
             typeof maxResolution === "number" && numZoomLevels === undefined) {
              var ratio = maxResolution / minResolution;
              numZoomLevels = Math.floor(Math.log(ratio) / Math.log(2)) + 1;
          } else if(numZoomLevels === undefined && maxZoomLevel != null) {
              numZoomLevels = maxZoomLevel + 1;
          }
  
          // are we able to calculate resolutions?
          if(typeof numZoomLevels !== "number" || numZoomLevels <= 0 ||
             (typeof maxResolution !== "number" &&
                  typeof minResolution !== "number")) {
              return;
          }
  
          // now we have numZoomLevels and at least one of maxResolution
          // or minResolution, we can populate the resolutions array
  
          var resolutions = new Array(numZoomLevels);
          var base = 2;
          if(typeof minResolution == "number" &&
             typeof maxResolution == "number") {
              // if maxResolution and minResolution are set, we calculate
              // the base for exponential scaling that starts at
              // maxResolution and ends at minResolution in numZoomLevels
              // steps.
              base = Math.pow(
                      (maxResolution / minResolution),
                  (1 / (numZoomLevels - 1))
              );
          }
  
          var i;
          if(typeof maxResolution === "number") {
              for(i=0; i<numZoomLevels; i++) {
                  resolutions[i] = maxResolution / Math.pow(base, i);
              }
          } else {
              for(i=0; i<numZoomLevels; i++) {
                  resolutions[numZoomLevels - 1 - i] =
                      minResolution * Math.pow(base, i);
              }
          }
  
          return resolutions;
      }