return type of modal dialog box is undefined
<p>I am using the modal dialog box to open the modal dialog.
Here is the code</p>

<pre><code>var Window;

function PopDis()
{
    Window=window.showModalDialog('/collector/modalBox.jsp', '', 'dialogHeight:300px; dialogWidth:500px;scroll:no; status:no; help:no; center:yes; resizable:no'); 

}
</code></pre>

<p>In another function i want to close the modal dialog.
Code is</p>

<pre><code>function CloseModalDialog()
{
    alert("in fun close"+Window);
    Window.close();
}
</code></pre>

<p>But var Window is undefined
hence unable to close the window.
Please give me the solution.</p>
