Fixed bug in creating new document:
- added warning about erasing old document, if you create a new doc while an old one is open.

- actually remove popup from DOM instead of setting display to 'none'. Previously caused a new one to be added and id conflicts