JavaScript: Refresh page only when the popup is not opened
<p>I have a html page which contains the video link ,onclicking that, the video will play in a popup fading the main page.</p>

<p>On closing the popup the main page is viewed.
Now the problem is that I have set the timer in onload function for every 2 mins page refresh, such that when the timer reaches the exact time it should refresh the page checking whether the popup window is opened or not. If it is opened it should not refresh otherwise it should refresh. How can i achieve this.</p>
