When you open a window you can assign it to a variable:
myWin = window.open(...);
You can then test if myWin exists and if myWin.closed is false in order to determine that the window is still open (provided that you do it from the same page - once you leave the page then there is no link to the other window that can be tested from anywhere).