Use globals for XXXXPopupShown and isXXXXActive variables