code: function(popup) {
          OpenLayers.Util.removeItem(this.popups, popup);
          if (popup.div) {
              try { this.layerContainerDiv.removeChild(popup.div); }
              catch (e) { } // Popups sometimes apparently get disconnected
                        // from the layerContainerDiv, and cause complaints.
          }
          popup.map = null;
      }
docs: APIMethod: removePopup
  
  Parameters:
  popup - {<OpenLayers.Popup>}