If you want to hide a link when the window is closed, you can use the onunload event. In this case, 'hr1' refers to your link id on the opener page:
Here's how you can do it on the popped-up page:
function CloseOpener(){
window.opener.document.getElementById('hr1').style.display='none';
}
Then, add this code to the same popped-up page:
<body onunload="CloseOpener();"> </body>
Alternatively, you can use a separate button on the same page to trigger the closing:
<input id="Button1" type="button" value="button" onclick="CloseOpener();"/>
This setup has been tested and confirmed working on my browsers, but there are some considerations to keep in mind when using the onunload event. For more information, check out this discussion: onunload not working in Chrome and Safari.