code: function (obj) {
          
          if (obj == null) {
              obj = new OpenLayers.Layer.Grid(this.name,
                                              this.url,
                                              this.params,
                                              this.getOptions());
          }
  
          //get all additions from superclasses
          obj = OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [obj]);
  
          // copy/set any non-init, non-simple values here
          if (this.tileSize != null) {
              obj.tileSize = this.tileSize.clone();
          }
          
          // we do not want to copy reference to grid, so we make a new array
          obj.grid = [];
          obj.gridResolution = null;
          // same for backbuffer
          obj.backBuffer = null;
          obj.backBufferTimerId = null;
          obj.loading = false;
          obj.numLoadingTiles = 0;
  
          return obj;
      }
docs: APIMethod: clone
  Create a clone of this layer
  
  Parameters:
  obj - {Object} Is this ever used?
  
  Returns:
  {<OpenLayers.Layer.Grid>} An exact clone of this OpenLayers.Layer.Grid