How to close a popup window in a parent window?
<p>I need to close a popup window which has been loaded by a parent window.</p>

<p>This popup window is a <code>Documentviewer</code> window in my webapp.</p>

<p>I need to close this viewer by clicking a logout button which is in master page.</p>

<p>My code:</p>

<pre><code>public string MySession //server side code

{
    get 
    {
        if (Session["RegID"] != null)
        {
            return Session["RegID"].ToString();
        }
        else
        {
            return "";
        }
    }

}


//client side code
   $(window).load(function() {

      Start();
   });


    function Start()
    {
      timedCount();
      var t=setTimeout("Start()",10000);
    }


   function timedCount()
   { 
     /*var out="&lt;%=Session["RegID"]%&gt;";*/


      var out='&lt;%=MySession%&gt;'; 
      if(out!="")
      {
        alert(out);       
      }else
      {
        window.close();
      }

   }
</code></pre>

<p>Server code is executed at very first time only.</p>

<p>My target is to close the popup if it is opened when user logs out.</p>
