The following will allow you to open the window only once:
if (typeof win !== 'object') {
win = window.open('http://www.google.com');
}
else {
// Do nothing
}
As Sani suggested in another answer, it would be wise to keep track of when the window is closed, in order to be able to reopen it. You can listen for the window.onunload event in the popup window, as follows:
window.onunload = function() {
window.opener.win = undefined;
}
The onunload event handler will set the win global variable of the window that opened the popup to undefined, so you would be able to reopen the window.
Be aware that due to the same origin policy, this will only work if the popup you open will be in the same domain as the parent window. In addition note that I've only tested the above in Firefox.