function $AdfDhtmlModalityManager$$() {
  this.Init()
}
$goog$exportSymbol$$("AdfDhtmlModalityManager", $AdfDhtmlModalityManager$$);
$AdfObject$$.$createSubclass$($AdfDhtmlModalityManager$$);
$AdfDhtmlModalityManager$$.prototype.Init = function $$AdfDhtmlModalityManager$$$$Init$() {
  $AdfDhtmlModalityManager$$.$superclass$.Init.call(this);
  this.$_modalElementStack$ = [];
  this.$_glassPaneStack$ = []
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.Init", {Init:$AdfDhtmlModalityManager$$.prototype.Init});
$AdfDhtmlModalityManager$$.prototype.$getElementCount$ = function $$AdfDhtmlModalityManager$$$$$getElementCount$$() {
  return this.$_modalElementStack$.length
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.getElementCount", {$getElementCount$:$AdfDhtmlModalityManager$$.prototype.$getElementCount$});
$AdfDhtmlModalityManager$$.prototype.$dispose$ = function $$AdfDhtmlModalityManager$$$$$dispose$$() {
  this.$_glassPaneStack$ = this.$_modalElementStack$ = $JSCompiler_alias_NULL$$
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.dispose", {$dispose$:$AdfDhtmlModalityManager$$.prototype.$dispose$});
$AdfDhtmlModalityManager$$.prototype.$pushModal$ = function $$AdfDhtmlModalityManager$$$$$pushModal$$($element$$141$$) {
  $AdfAssert$$.$assertDomElement$($element$$141$$);
  if(this.$isGlassPaneVisible$()) {
    this.$_glassPaneStack$[this.$_glassPaneStack$.length - 1].style.display = "none"
  }else {
    var $agent$$48_layerId$$ = $AdfAgent$$.$AGENT$, $domWindow$$65_glassPane$$ = $agent$$48_layerId$$.$getDomWindow$();
    $JSCompiler_StaticMethods__setupEventHandler$$(this, $agent$$48_layerId$$, this.$_handleResize$, $JSCompiler_alias_TRUE$$, $domWindow$$65_glassPane$$)
  }
  $AdfAssert$$.$assertDomElement$($element$$141$$.parentNode);
  $agent$$48_layerId$$ = $element$$141$$.parentNode.getAttribute("id");
  $AdfAssert$$.$assertString$($agent$$48_layerId$$);
  $domWindow$$65_glassPane$$ = this.$_createGlassPane$();
  $AdfPage$$.$PAGE$.$getZOrderManager$().$addElementToLayer$($domWindow$$65_glassPane$$, $agent$$48_layerId$$, $element$$141$$);
  $AdfPopupScopingUtils$$.$markAsScopingContainer$($domWindow$$65_glassPane$$);
  this.$_modalElementStack$.push($element$$141$$);
  this.$_glassPaneStack$.push($domWindow$$65_glassPane$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.pushModal", {$pushModal$:$AdfDhtmlModalityManager$$.prototype.$pushModal$});
$AdfDhtmlModalityManager$$.prototype.$popModal$ = function $$AdfDhtmlModalityManager$$$$$popModal$$() {
  this.$_modalElementStack$.pop();
  var $agent$$49_docDom_glassPane$$1$$ = this.$_glassPaneStack$.pop();
  $agent$$49_docDom_glassPane$$1$$.style.width = "1px";
  $agent$$49_docDom_glassPane$$1$$.style.height = "1px";
  var $page$$35$$ = $AdfPage$$.$PAGE$;
  $page$$35$$.$getZOrderManager$().$removeElement$($agent$$49_docDom_glassPane$$1$$);
  if(0 < this.$_modalElementStack$.length) {
    this.$_glassPaneStack$[this.$_glassPaneStack$.length - 1].style.display = "block"
  }else {
    var $agent$$49_docDom_glassPane$$1$$ = $AdfAgent$$.$AGENT$, $domWindow$$66$$ = $agent$$49_docDom_glassPane$$1$$.$getDomWindow$();
    $JSCompiler_StaticMethods__setupEventHandler$$(this, $agent$$49_docDom_glassPane$$1$$, this.$_handleResize$, $JSCompiler_alias_FALSE$$, $domWindow$$66$$);
    $agent$$49_docDom_glassPane$$1$$ = $agent$$49_docDom_glassPane$$1$$.getElementById($page$$35$$.$_documentClientId$);
    $page$$35$$.$doResizeNotifyDom$($agent$$49_docDom_glassPane$$1$$, $JSCompiler_alias_TRUE$$)
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.popModal", {$popModal$:$AdfDhtmlModalityManager$$.prototype.$popModal$});
$AdfDhtmlModalityManager$$.prototype.$_createGlassPane$ = function $$AdfDhtmlModalityManager$$$$$_createGlassPane$$() {
  var $agent$$50$$ = $AdfAgent$$.$AGENT$, $el$$12$$ = $AdfPage$$.$PAGE$.$getDomDocument$().createElement("div"), $style$$11$$ = $el$$12$$.style, $domWindow$$67$$ = $agent$$50$$.$getDomWindow$();
  $el$$12$$.className = "AFModalGlassPane";
  $style$$11$$.width = $agent$$50$$.$getWindowScrollWidth$($domWindow$$67$$) + "px";
  $style$$11$$.height = $agent$$50$$.$getWindowScrollHeight$($domWindow$$67$$) + "px";
  $agent$$50$$.$disableUserSelect$($el$$12$$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "keydown", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "keyup", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "keypress", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "mousedown", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "mouseup", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "mouseover", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "mouseout", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "click", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "focusin", $AdfAgent$$.$eatEventCallback$);
  $agent$$50$$.$addBubbleEventListener$($el$$12$$, "focus", $AdfAgent$$.$eatEventCallback$);
  return $el$$12$$
};
$AdfDhtmlModalityManager$$.prototype.$_handleResize$ = function $$AdfDhtmlModalityManager$$$$$_handleResize$$() {
  $AdfPage$$.$PAGE$.$scheduleTimer$(this, this.$_onResize$, $JSCompiler_alias_NULL$$, 1)
};
$AdfDhtmlModalityManager$$.prototype.$_onResize$ = function $$AdfDhtmlModalityManager$$$$$_onResize$$() {
  for(var $agent$$51$$ = $AdfAgent$$.$AGENT$, $domWindow$$68$$ = $agent$$51$$.$getDomWindow$(), $i$$131$$ = 0;$i$$131$$ < this.$_glassPaneStack$.length;$i$$131$$++) {
    var $glassPane$$2$$ = this.$_glassPaneStack$[$i$$131$$];
    $glassPane$$2$$.style.display = "none";
    $glassPane$$2$$.style.width = $agent$$51$$.$getWindowScrollWidth$($domWindow$$68$$) + "px";
    $glassPane$$2$$.style.height = $agent$$51$$.$getWindowScrollHeight$($domWindow$$68$$) + "px";
    $glassPane$$2$$.style.display = ""
  }
};
$AdfDhtmlModalityManager$$.prototype.$getTopGlassPane$ = function $$AdfDhtmlModalityManager$$$$$getTopGlassPane$$() {
  if(this.$isGlassPaneVisible$()) {
    return this.$_glassPaneStack$[this.$_glassPaneStack$.length - 1]
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.getTopGlassPane", {$getTopGlassPane$:$AdfDhtmlModalityManager$$.prototype.$getTopGlassPane$});
function $JSCompiler_StaticMethods__setupEventHandler$$($JSCompiler_StaticMethods__setupEventHandler$self$$, $agent$$52$$, $func$$12$$, $setup$$, $listenElement$$) {
  $JSCompiler_StaticMethods__setupEventHandler$self$$._handleResizeStub == $JSCompiler_alias_NULL$$ && ($JSCompiler_StaticMethods__setupEventHandler$self$$._handleResizeStub = $JSCompiler_StaticMethods__setupEventHandler$self$$.$createCallback$($func$$12$$));
  $setup$$ ? $agent$$52$$.$addBubbleEventListener$($listenElement$$, "resize", $JSCompiler_StaticMethods__setupEventHandler$self$$._handleResizeStub) : $agent$$52$$.$removeBubbleEventListener$($listenElement$$, "resize", $JSCompiler_StaticMethods__setupEventHandler$self$$._handleResizeStub)
}
$AdfDhtmlModalityManager$$.prototype.$isAboveTopGlassPane$ = function $$AdfDhtmlModalityManager$$$$$isAboveTopGlassPane$$($element$$143_zIndexTopGlass$$) {
  if(!this.$isGlassPaneVisible$() || !$element$$143_zIndexTopGlass$$) {
    return $JSCompiler_alias_TRUE$$
  }
  var $constWindowContainer$$ = $AdfDhtmlZOrderManager$$.$FLOATINGTYPE_WINDOW$, $constTooltipContainer$$ = $AdfDhtmlZOrderManager$$.$FLOATINGTYPE_TOOLTIP$, $constMaskingFrameContainer$$ = $AdfDhtmlZOrderManager$$.$FLOATINGTYPE_MASKINGFRAME$, $popupElement$$6$$ = $element$$143_zIndexTopGlass$$;
  for($element$$143_zIndexTopGlass$$ = $element$$143_zIndexTopGlass$$.parentNode;$element$$143_zIndexTopGlass$$;$element$$143_zIndexTopGlass$$ = $element$$143_zIndexTopGlass$$.parentNode) {
    if(1 == $element$$143_zIndexTopGlass$$.nodeType) {
      var $containerName_id$$231_tokens$$5$$ = $element$$143_zIndexTopGlass$$.getAttribute("id");
      if($containerName_id$$231_tokens$$5$$) {
        var $containerName_id$$231_tokens$$5$$ = $containerName_id$$231_tokens$$5$$.split(":"), $tokensLen$$ = $containerName_id$$231_tokens$$5$$.length;
        if(0 < $tokensLen$$) {
          $containerName_id$$231_tokens$$5$$ = $containerName_id$$231_tokens$$5$$[$tokensLen$$ - 1];
          if($constTooltipContainer$$ == $containerName_id$$231_tokens$$5$$) {
            return $JSCompiler_alias_TRUE$$
          }
          if($constMaskingFrameContainer$$ == $containerName_id$$231_tokens$$5$$) {
            break
          }else {
            if($constWindowContainer$$ == $containerName_id$$231_tokens$$5$$) {
              return $element$$143_zIndexTopGlass$$ = this.$getTopGlassPane$().style.zIndex, $popupElement$$6$$.style.zIndex > $element$$143_zIndexTopGlass$$
            }
          }
        }
      }
    }
    $popupElement$$6$$ = $element$$143_zIndexTopGlass$$
  }
  return $JSCompiler_alias_FALSE$$
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.isAboveTopGlassPane", {$isAboveTopGlassPane$:$AdfDhtmlModalityManager$$.prototype.$isAboveTopGlassPane$});
$AdfDhtmlModalityManager$$.prototype.$isGlassPaneVisible$ = function $$AdfDhtmlModalityManager$$$$$isGlassPaneVisible$$() {
  return 0 < this.$_glassPaneStack$.length
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlModalityManager.prototype.isGlassPaneVisible", {$isGlassPaneVisible$:$AdfDhtmlModalityManager$$.prototype.$isGlassPaneVisible$});
