code: function(layer) {
          // in the event of a WMS layer bundling multiple layers but not
          // specifying styles,we need the same number of commas to specify
          // the default style for each of the layers.  We can't just leave it
          // blank as we may be including other layers that do specify styles.
          var styleNames;
          if (layer.params.STYLES) {
              styleNames = layer.params.STYLES;
          } else {
              if (OpenLayers.Util.isArray(layer.params.LAYERS)) {
                  styleNames = new Array(layer.params.LAYERS.length);
              } else { // Assume it's a String
                  styleNames = layer.params.LAYERS.replace(/[^,]/g, "");
              }
          }
          return styleNames;
      }
docs: Method: getStyleNames
  Gets the STYLES parameter for the layer. Make sure the STYLES parameter
  matches the LAYERS parameter
  
  Parameters:
  layer - {<OpenLayers.Layer.WMS>}
  
  Returns:
  {Array(String)} The STYLES parameter