         
         public static function createPopup(clazz:Class):*
         {
-            var popup:Object = PopUpManager.createPopUp(Application.application as Application,
+            var popup:Object = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as Application,
                 clazz, false, PopUpManagerChildList.APPLICATION) as clazz;
             return popup as IFlexDisplayObject;
         }

    
    import mx.collections.ArrayCollection;
    import mx.core.Application;
    import mx.core.IFlexDisplayObject;
    import mx.formatters.NumberBaseRoundType;
    import mx.formatters.NumberFormatter;

            popup = popupForModel(model);
            if (popup == null)
            {
                popup = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as Application,
                    clazz, false, PopUpManagerChildList.APPLICATION) as clazz;
                
                popupModelMap[model] = popup;
