code: function(newBaseLayer) {
          
          if (newBaseLayer != this.baseLayer) {
            
              // ensure newBaseLayer is already loaded
              if (OpenLayers.Util.indexOf(this.layers, newBaseLayer) != -1) {
  
                  // preserve center and scale when changing base layers
                  var center = this.getCachedCenter();
                  var newResolution = OpenLayers.Util.getResolutionFromScale(
                      this.getScale(), newBaseLayer.units
                  );
  
                  // make the old base layer invisible 
                  if (this.baseLayer != null && !this.allOverlays) {
                      this.baseLayer.setVisibility(false);
                  }
  
                  // set new baselayer
                  this.baseLayer = newBaseLayer;
                  
                  if(!this.allOverlays || this.baseLayer.visibility) {
                      this.baseLayer.setVisibility(true);
                      // Layer may previously have been visible but not in range.
                      // In this case we need to redraw it to make it visible.
                      if (this.baseLayer.inRange === false) {
                          this.baseLayer.redraw();
                      }
                  }
  
                  // recenter the map
                  if (center != null) {
                      // new zoom level derived from old scale
                      var newZoom = this.getZoomForResolution(
                          newResolution || this.resolution, true
                      );
                      // zoom and force zoom change
                      this.setCenter(center, newZoom, false, true);
                  }
  
                  this.events.triggerEvent("changebaselayer", {
                      layer: this.baseLayer
                  });
              }        
          }
      }
docs: APIMethod: setBaseLayer
  Allows user to specify one of the currently-loaded layers as the Map's
  new base layer.
  
  Parameters:
  newBaseLayer - {<OpenLayers.Layer>}