window.close(); not working when page changed or refreshed
<p>I have this little function to open/close a popup player:</p>

<pre><code>function popuponclick(popup)
{
  my_window = window.open("folder/player-itself.htm", popup, "width=350,height=150");  
}

function closepopup()
{
  my_window.close();
}
</code></pre>

<p>I call the functions from HTML anchors that are on each page of the site (idea is to have the player stopped/started whenever you want)...now...</p>

<p>it works well until i change the page, or refresh the existing one - and from then the window can't be closed anymore. Any idea where i'm wrong?  Tested in FF and IE8, same behavior.</p>

<p>Thanks for your help.</p>
