public/javascripts/yui/container/container.js
function(overlay) {
            var mgr = this;

            if (!overlay.focusEvent) {
                overlay.focusEvent = overlay.createEvent("focus");
                overlay.focusEvent.signature = CustomEvent.LIST;
                overlay.focusEvent._managed = true;
            } else {
                overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr);
            }

            if (!overlay.focus) {
                Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay);
                overlay.focus = function () {
                    if (mgr._manageFocus(this)) {
                        // For Panel/Dialog
                        if (this.cfg.getProperty("visible") && this.focusFirst) {
                            this.focusFirst();
                        }
                        this.focusEvent.fire();
                    }
                };
                overlay.focus._managed = true;
            }
        }
function(overlay) {
            var mgr = this;

            if (!overlay.focusEvent) {
                overlay.focusEvent = overlay.createEvent("focus");
                overlay.focusEvent.signature = CustomEvent.LIST;
                overlay.focusEvent._managed = true;
            } else {
                overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr);
            }

            if (!overlay.focus) {
                Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay);
                overlay.focus = function () {
                    if (mgr._manageFocus(this)) {
                        // For Panel/Dialog
                        if (this.cfg.getProperty("visible") && this.focusFirst) {
                            this.focusFirst();
                        }
                        this.focusEvent.fire();
                    }
                };
                overlay.focus._managed = true;
            }
        }
function ( overlay ) { var mgr = this ; if ( ! overlay . focusEvent ) { overlay . focusEvent = overlay . createEvent ( "focus" ) ; overlay . focusEvent . signature = CustomEvent . LIST ; overlay . focusEvent . _managed = true ; } else { overlay . focusEvent . subscribe ( mgr . _onOverlayFocusHandler , overlay , mgr ) ; } if ( ! overlay . focus ) { Event . on ( overlay . element , mgr . cfg . getProperty ( "focusevent" ) , mgr . _onOverlayElementFocus , null , overlay ) ; overlay . focus = function ( ) { if ( mgr . _manageFocus ( this ) ) { // For Panel/Dialog if ( this . cfg . getProperty ( "visible" ) && this . focusFirst ) { this . focusFirst ( ) ; } this . focusEvent . fire ( ) ; } } ; overlay . focus . _managed = true ; } }
Subscribes to the Overlay based instance focusEvent, to allow the OverlayManager to
monitor focus state.

If the instance already has a focusEvent (e.g. Menu), OverlayManager will subscribe
to the existing focusEvent, however if a focusEvent or focus method does not exist
on the instance, the _bindFocus method will add them, and the focus method will
update the OverlayManager's state directly.

@method _bindFocus
@param {Overlay} overlay The overlay for which focus needs to be managed
@protected
Subscribes to the Overlay based instance focusEvent to allow the OverlayManager to monitor focus state .