code: function (obj) {
          
          if (obj == null) {
              obj = new OpenLayers.Layer(this.name, this.getOptions());
          }
          
          // catch any randomly tagged-on properties
          OpenLayers.Util.applyDefaults(obj, this);
          
          // a cloned layer should never have its map property set
          //  because it has not been added to a map yet. 
          obj.map = null;
          
          return obj;
      }
docs: Method: clone
  
  Parameters:
  obj - {<OpenLayers.Layer>} The layer to be cloned
  
  Returns:
  {<OpenLayers.Layer>} An exact clone of this <OpenLayers.Layer>