So - due to the weird design of this application, the main window opens another in which one does one's work. The 'logout' button simply closes the work window and redirects the original one. However if you close the original window manually the work window keeps working, then when you click the aforementioned logout button you get a javascript error of course. The logout button tries to call a javascript function in the parent window.
So if the main window has been closed all I want to do is close the work window when the user clicks logout. However that does not seem to be possible. Looks like only the parent window can close the child window - it can't close itself. Is that right?

