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

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

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