     {
         var modalBounds:Rectangle = modalWindow.getBounds(DisplayObject(sm));
         var excludeBounds:Rectangle;
-        
-        if (exclude is UIComponent)
-            excludeBounds = UIComponent(exclude).getVisibleRect(DisplayObject(sm));
+        var pt:Point;
+                
+        if (exclude is IApplicationLoader)
+        {
+            excludeBounds = IApplicationLoader(exclude).getVisibleApplicationRect();
+            pt = new Point(excludeBounds.x, excludeBounds.y);
+            pt = DisplayObject(sm).globalToLocal(pt);
+            excludeBounds.x = pt.x;
+            excludeBounds.y = pt.y;    
+        }
         else 
             excludeBounds = DisplayObject(exclude).getBounds(DisplayObject(sm));
         
         // apply excludeRect to the result
         if (excludeRect)
         {
-            var pt:Point = new Point(excludeRect.x, excludeRect.y);
+            pt = new Point(excludeRect.x, excludeRect.y);
             pt = DisplayObject(sm).globalToLocal(pt);
             var rect:Rectangle = new Rectangle(pt.x, pt.y, excludeRect.width, excludeRect.height);
             excludeBounds = excludeBounds.intersection(rect);

                                                o:PopUpData,
                                                visibleFlag:Boolean):void
    {
        var modalRequest:ModalWindowRequest = new ModalWindowRequest(type,
                                                                 !o.isRemoteModalWindow && sm != sbRoot,     
                                                                 visibleFlag,

            window.visible = visibleFlag;
        }
        
        sbRoot.addEventListener(MarshalMouseEvent.MOUSE_DOWN,  o.marshalMouseOutsideHandler);
        sbRoot.addEventListener(MarshalMouseEvent.MOUSE_WHEEL, o.marshalMouseOutsideHandler, true);

        // Listen for unload so we know to kill the window (and the modalWindow if modal)
        // this handles _all_ cleanup
