Refactored code to use the 'popup' functions contained in ansilove.js