code: function(opacity) {
          if (opacity !== this.opacity) {
              if (this.map != null) {
                  this.map.events.triggerEvent("changelayer", {
                      layer: this,
                      property: "opacity"
                  });
              }
              this.opacity = opacity;
          }
          // Though this layer's opacity may not change, we're sharing a container
          // and need to update the opacity for the entire container.
          if (this.getVisibility()) {
              var container = this.getMapContainer();
              OpenLayers.Util.modifyDOMElement(
                  container, null, null, null, null, null, null, opacity
              );
          }
      }
docs: APIMethod: setOpacity
  Sets the opacity for the entire layer (all images)
  
  Parameters:
  opacity - {Float}