code: function(evt) {
          var sameMarkerClicked = (this == this.layer.selectedFeature);
          this.layer.selectedFeature = (!sameMarkerClicked) ? this : null;
          for(var i=0, len=this.layer.map.popups.length; i<len; i++) {
              this.layer.map.removePopup(this.layer.map.popups[i]);
          }
          if (!sameMarkerClicked) {
              this.layer.map.addPopup(this.createPopup()); 
          }
          OpenLayers.Event.stop(evt);
      }
docs: Property: markerClick
  
  Parameters:
  evt - {Event}
  
  Context:
  - {<OpenLayers.Feature>}