It's fine if they close the original browser window as long as you don't want to control it via your navWin or contWin or try to close it via navWin or contWin. You can issue a self.opener.close() from navWin, but IE and NS will alert the user asking them if it's OK to close the main browser window. Only a signed script, trusted by the user, will avoid this. So be prepared to leave the main browser window open underneath your two windows.
Basically, you could easily right code so that if anyone closed the navWin, then the contWin would close also but allowing them to close the contWin and leave the navWin if they want. Most of the code is in navWin. Your code in navWin would just need to do a check to see if contWin was open before issuing a location command or an open command. I don't have all of the code here with me, but the structure would look something like this.
Code:
<html>
<head>
<title>Navigation Window</title>
<script Lanuguage="Javascript">
<!--
function navCont(urlPass) {
if (code here determines of contWin is open) {
contWin.location(urlPass)
//Changes page in already open content window.
} else {
var contWin
contWin = window.open(urlPass,'contWin','parms')
//Opens new content window.
}
function closeAll() {
if (code here determines of contWin is open) {
contWin.close()
//Closes content window
} else {
//Do Nothing, window does not exist
}
}
//-->
</script>
</head>
<body onUnload="closeAll()" onLoad="navCont(pageref)">
<a href="javascript:navCont(pageref1)">Page Link 1</a>
<a href="javascript:navCont(pageref2)">Page Link 2</a>
</body>
</html>
I don't have the code handy for testing to see if a window you've previously created is a valid object (or open) but I know that I have an example in my office and can send it to you if you let me know. If you don't validate this first, Javascript will throw an error if trying to change the location of a window that does not exist OR will open a second contWin on top of an already existing one. Also, you will need to pass the URL in your calling Page Link href statement and the calling onLoad statement to the navCont function. I've never done this before but I've seen it done. I only navigate using select lists and input buttons. As long as the current page in navWin does not change, references to the Contents window can be made using the variable created before the window.open() statement. In this case, my reference is contWin. Now, if you reload navWin with a different page, the link is broken. That is why I wrote the closeAll() function so if the navWin is changed or closed, the contWin closes also and when the navWin is initiated or refreshed, a new contWin is created with the pageref you supply on the onLoad="navCont(startpageref)" statement.
This is untested code, but I'm sure it will work. Remember, both navWin and contWin need to be new windows and neither can be the original browser window. Otherwise, you'll have problems with the window.close() function. Also, should you need to reference the navWin from the contWin page, you can always do this using the self.opener property. For example self.opener.close() will close the navWin from the contWin. Remember, there's an onUnload statement in navWin. Closing navWin from contWin will immediately close contWin also. I would avoid making page changes to navWin from contWin. It will make contWin dissapear then re-open after the navWin page is refreshed.
Play around with it and let me know if you need the code to check first to see if a window if a valid object or currently open.
Have Fun !!
ToddWW