         
         const visibleFlag:Boolean = window.visible;
         
-		if (parent is IUIComponent && window is IUIComponent &&
-			IUIComponent(window).document == null)
-			IUIComponent(window).document = IUIComponent(parent).document;
-
-		if (parent is IUIComponent && IUIComponent(parent).document is IFlexModule &&
-			window is UIComponent && UIComponent(window).moduleFactory == null)
-			UIComponent(window).moduleFactory = IFlexModule(IUIComponent(parent).document).moduleFactory;
+        if (parent is IUIComponent && window is IUIComponent &&
+              IUIComponent(window).document == null)
+              IUIComponent(window).document = IUIComponent(parent).document;
+
+        if (parent is IUIComponent && IUIComponent(parent).document is IFlexModule &&
+              window is UIComponent && UIComponent(window).moduleFactory == null)
+              UIComponent(window).moduleFactory = IFlexModule(IUIComponent(parent).document).moduleFactory;
 
         var sm:ISystemManager = getTopLevelSystemManager(parent);
+        // smp is the actual systemManager that will parent the popup
+        // it might get changed by the request
+        var smp:ISystemManager = sm;
         var children:IChildList;
         var topMost:Boolean;
 
-        if (!sm)
-        {
-            // check if parent is our sandbox root
-            sm = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
-            if (sm.getSandboxRoot() != parent)
-            {
-                //trace("error: popup root was not SystemManager");
-                return; // and maybe a nice error message
-            }
-        }
-
-		var smp:ISystemManager = sm;
-		
-		// if using a bridge, then create a System Manager Proxy to host
-		// the popup. The System Manager Proxy is the display object
-		// added to the top-level system manager's children, not
-		// the popup itself.
-		var sbRoot:DisplayObject = sm.getSandboxRoot();
-		var request:SWFBridgeRequest = null;
-		if (sm.useSWFBridge())
-		{
-			if (sbRoot != sm)
-			{
-				smp = new SystemManagerProxy(sm);
-				request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_REQUEST, false, false,
-				                                    sm.swfBridgeGroup.parentBridge,
-													{ window: DisplayObject(smp),
-														parent: parent,
-														modal: modal,
-														childList: childList});
-				sbRoot.dispatchEvent(request);
-			}
-			else 
-				smp = sm;		// host w/o system manager proxy.
-		}
-		
+        var request:Request = new Request("addPopUp", false, true, { parent: parent, sm: sm, modal: modal, childList: childList} );
+        if (!dispatchEvent(request))
+              smp = request.value as ISystemManager;
+            
         if (window is IUIComponent)
             IUIComponent(window).isPopUp = true;
         

            o.modalWindow.visible = false;
        }
        
        var sm:ISystemManager = ISystemManager(FlexGlobals.topLevelApplication.systemManager);
        if (sm.useSWFBridge())
        {
            var sbRoot:DisplayObject = sm.getSandboxRoot();
            
            // if our first target is a sandbox root that is the top level root,
            // then we don't need to send a modal request. 
            if (!o.isRemoteModalWindow && sm != sbRoot)
            {
                var request:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false,
                                                            "isTopLevelRoot");
                sbRoot.dispatchEvent(request);
                if (Boolean(request.value))
                    return;
            }
            
            var modalRequest:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, false, false, null,
														{ skip: !o.isRemoteModalWindow && sm != sbRoot, 
															show: false,
															remove: destroy});
            var bridge:IEventDispatcher = sm.swfBridgeGroup.parentBridge;
            var target:IEventDispatcher;
            modalRequest.requestor = bridge;

            bridge.dispatchEvent(modalRequest);
        }

    }
    
    /**

        if (modal)
        {
            // create a modal window shield which blocks input and sets up mouseDownOutside logic
            createModalWindow(parent, o, children, visibleFlag, smp, smp.getSandboxRoot());
        }
        else
        {
