Well, each document that you load into the main window is going to have to re-establish the connection with the popup window. This can be accomplished by using the same window.open() specification for the window name that was used when the popup was first create. So, if the following was used the first time:
window.open('...someURL...', 'MyWindow', '...optional features...');
then the following is what you want to do from the new document when it loads into the main window:
winPtr = window.open('', 'MyWindow', '...optional features...');
winPtr.opener = self;
As strange as it may seem, using a zero-length string for the URL and giving a matching window name will re-create a pointer to that popup window. Then you can refresh the window.opener reference as shown above.
Mind you, this means that you can't be using window.opener.parent.location... anymore. I recommend you change that to window.opener.top.location... as this will be a consistent reference to the topmost window in the browser no matter which way the window.opener reference is currently set.