     {
         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,

     *  @param sm The system manager that hosts the modal window
     *  @param modalWindow The base area of the mask
     *  @param exclude The area to exlude from the mask, may be null.
     *  @param excludeRect An optionally rectangle that is included in the area
     *  to exclude. The rectangle is in global coordinates.
     *  @param mask A non-null sprite. The mask is rewritten for each call.
     * 
     */  
