Work out a script to generate the modal popups