Dialog windows open conditionally

All of these are partly altered and in `dialogs.js`.