docs: function (popup) {
                  var curZIndex = popup.getZIndex();
                  var newBaseZIndex = this.currentZIndex;
                  if (curZIndex === newBaseZIndex) {
                      // already top most, nothing to do in any case!
                      return;
                  }
                  // gets all popups supposed to be in front of this one, including this one
                  var openedPopups = this.openedPopups;
                  var popupsToKeepInFront = [];
                  var i, l;
                  for (i = openedPopups.length - 1; i >= 0; i--) {
                      var curPopup = openedPopups[i];
                      if (curPopup === popup || curPopup.conf.zIndexKeepOpenOrder) {
                          popupsToKeepInFront.unshift(curPopup);
                          if (curPopup.getZIndex() === newBaseZIndex) {
                              newBaseZIndex -= 10;
                          }
                          if (curPopup === popup) {
                              break;
                          }
                      }
                  }
                  if (i < 0 || newBaseZIndex + 10 === curZIndex) {
                      // either the popup is not in openedPopups (i < 0)
                      // or it is already correctly positioned (newBaseZIndex + 10 === curZIndex)
                      return;
                  }
                  var eventObject = {
                      name : "beforeBringingPopupsToFront",
                      popups : popupsToKeepInFront,
                      cancel : false
                  };
                  this.$raiseEvent(eventObject);
                  if (eventObject.cancel) {
                      return;
                  }
                  this.currentZIndex = newBaseZIndex;
                  for (i = 0, l = popupsToKeepInFront.length; i < l; i++) {
                      var curPopup = popupsToKeepInFront[i];
                      curPopup.setZIndex(this.getZIndexForPopup(curPopup));
                  }
              }