Mucking about with popups and stuff. This is getting terribly complex...
Fixed some more popup issues.
This is the most convoluted thing I have ever programmed...