public/javascripts/yui/container/container.js
function () {

            var aOverlays = [],
                oElement = this.element;

            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {

                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),

                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);

                if (nZIndex1 > nZIndex2) {
                    return -1;
                } else if (nZIndex1 < nZIndex2) {
                    return 1;
                } else {
                    return 0;
                }
            }

            function isOverlayElement(p_oElement) {

                var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                    Panel = YAHOO.widget.Panel;

                if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) {
                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
                        aOverlays[aOverlays.length] = p_oElement.parentNode;
                    } else {
                        aOverlays[aOverlays.length] = p_oElement;
                    }
                }
            }

            Dom.getElementsBy(isOverlayElement, "DIV", document.body);

            aOverlays.sort(compareZIndexDesc);

            var oTopOverlay = aOverlays[0],
                nTopZIndex;

            if (oTopOverlay) {
                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");

                if (!isNaN(nTopZIndex)) {
                    var bRequiresBump = false;

                    if (oTopOverlay != oElement) {
                        bRequiresBump = true;
                    } else if (aOverlays.length > 1) {
                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
                            bRequiresBump = true;
                        }
                    }
                    if (bRequiresBump) {
                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
                    }
                }
            }
        }
function () {

            var aOverlays = [],
                oElement = this.element;

            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {

                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),

                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);

                if (nZIndex1 > nZIndex2) {
                    return -1;
                } else if (nZIndex1 < nZIndex2) {
                    return 1;
                } else {
                    return 0;
                }
            }

            function isOverlayElement(p_oElement) {

                var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
                    Panel = YAHOO.widget.Panel;

                if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) {
                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
                        aOverlays[aOverlays.length] = p_oElement.parentNode;
                    } else {
                        aOverlays[aOverlays.length] = p_oElement;
                    }
                }
            }

            Dom.getElementsBy(isOverlayElement, "DIV", document.body);

            aOverlays.sort(compareZIndexDesc);

            var oTopOverlay = aOverlays[0],
                nTopZIndex;

            if (oTopOverlay) {
                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");

                if (!isNaN(nTopZIndex)) {
                    var bRequiresBump = false;

                    if (oTopOverlay != oElement) {
                        bRequiresBump = true;
                    } else if (aOverlays.length > 1) {
                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
                            bRequiresBump = true;
                        }
                    }
                    if (bRequiresBump) {
                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
                    }
                }
            }
        }
function ( ) { var aOverlays = [ ] , oElement = this . element ; function compareZIndexDesc ( p_oOverlay1 , p_oOverlay2 ) { var sZIndex1 = Dom . getStyle ( p_oOverlay1 , "zIndex" ) , sZIndex2 = Dom . getStyle ( p_oOverlay2 , "zIndex" ) , nZIndex1 = ( ! sZIndex1 || isNaN ( sZIndex1 ) ) ? 0 : parseInt ( sZIndex1 , 10 ) , nZIndex2 = ( ! sZIndex2 || isNaN ( sZIndex2 ) ) ? 0 : parseInt ( sZIndex2 , 10 ) ; if ( nZIndex1 > nZIndex2 ) { return - 1 ; } else if ( nZIndex1 < nZIndex2 ) { return 1 ; } else { return 0 ; } } function isOverlayElement ( p_oElement ) { var isOverlay = Dom . hasClass ( p_oElement , Overlay . CSS_OVERLAY ) , Panel = YAHOO . widget . Panel ; if ( isOverlay && ! Dom . isAncestor ( oElement , p_oElement ) ) { if ( Panel && Dom . hasClass ( p_oElement , Panel . CSS_PANEL ) ) { aOverlays [ aOverlays . length ] = p_oElement . parentNode ; } else { aOverlays [ aOverlays . length ] = p_oElement ; } } } Dom . getElementsBy ( isOverlayElement , "DIV" , document . body ) ; aOverlays . sort ( compareZIndexDesc ) ; var oTopOverlay = aOverlays [ 0 ] , nTopZIndex ; if ( oTopOverlay ) { nTopZIndex = Dom . getStyle ( oTopOverlay , "zIndex" ) ; if ( ! isNaN ( nTopZIndex ) ) { var bRequiresBump = false ; if ( oTopOverlay != oElement ) { bRequiresBump = true ; } else if ( aOverlays . length > 1 ) { var nNextZIndex = Dom . getStyle ( aOverlays [ 1 ] , "zIndex" ) ; // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if ( ! isNaN ( nNextZIndex ) && ( nTopZIndex == nNextZIndex ) ) { bRequiresBump = true ; } } if ( bRequiresBump ) { this . cfg . setProperty ( "zindex" , ( parseInt ( nTopZIndex , 10 ) + 2 ) ) ; } } } }
Places the Overlay on top of all other instances of
YAHOO.widget.Overlay.
@method bringToTop
Places the Overlay on top of all other instances of YAHOO . widget . Overlay .