Parent Window is not getting disabled in asp.net web page via javascript
<p>I want to open a popup window and disable the parent window. Below is the code that I am using.For some reason, the parent window does not get disabled. Do I need some additional code OR what is the case?I also want to gray out the parent page while it is disabled so help me in this also.</p>

<pre><code>&lt;script type="text/javascript"&gt;

    var popupWindow = null;
    function OpenPopup() {
        popupWindow = window.open("ClockPopUP.aspx", "Time", "scrollbars=no,resizable=no,width=550,height=350,left=300,top=300");
        return false;
    }

    function parent_disable() {
        if (popupWindow &amp;&amp; !popupWindow.closed)
            popupWindow.focus();
            document.onmousedown = focusPopup;
            document.onkeyup = focusPopup;
            document.onmousemove = focusPopup;
        }
        function focusPopup() {
            if (popupWindow &amp;&amp; !popupWindow.closed) { popupWindow.focus(); }
        } 
    function CheckDateEalier(sender, args)
     {
        var toDate = new Date();
        toDate.setMinutes(0);
        toDate.setSeconds(0);
        toDate.setHours(0);
        toDate.setMilliseconds(0);
        if (sender._selectedDate &lt; toDate)
         {
            alert("You can't select day earlier than today! In Case if you are selecting Previous date then, By default it will take current Date.");
            sender._selectedDate = toDate;
            //set the date back to the current date
            sender._textbox.set_Value(sender._selectedDate.format(sender._format))
        }
        if (sender._selectedDate &gt; toDate) 
        {
            document.getElementById('&lt;%= txtTimeSpent.ClientID%&gt;').disabled = false;
        }
    }
</code></pre>

<p></p>

<pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="cphTop" runat="server" &gt;
&lt;asp:ScriptManager ID="ScriptManger1" runat="server"&gt;
        &lt;%--&lt;Scripts&gt;
            &lt;asp:ScriptReference Path="js/Progress.js"/&gt;
        &lt;/Scripts&gt;--%&gt;
    &lt;/asp:ScriptManager&gt;
&lt;asp:UpdatePanel runat="server" ID="updProduction"&gt;
    &lt;ContentTemplate&gt;
    &lt;div id="counter" &gt;
    &lt;/div&gt;
    &lt;div id="content"&gt;
    &lt;div id="right"&gt;
    &amp;nbsp
        &lt;asp:Button ID="Button1" runat="server" Text="Lunch" CausesValidation="false" CssClass="bigbuttons" style="background:url(../App_Themes/Images/green-box.gif)" Font-Bold="True"  ForeColor="White" Font-Size="Large"  /&gt; &lt;br /&gt;
        &lt;asp:Button ID="Button2" runat="server" Text="Break" CausesValidation="false" CssClass="bigbuttons"  style="background:url(../App_Themes/Images/red-box.gif)"  Font-Bold="True"  ForeColor="White" Font-Size="Large"   /&gt; &lt;br /&gt;
        &lt;asp:Button ID="Button3" runat="server" Text="L&amp;amp;D Training " CausesValidation="false" CssClass="bigbuttons" style="background:url(../App_Themes/Images/green-box.gif)"   Font-Bold="True"  ForeColor="White" Font-Size="Large"  /&gt; &lt;br /&gt;
        &lt;asp:Button ID="Button4" runat="server" Text="Shift End" CausesValidation="false"  CssClass="bigbuttons" style="background:url(../App_Themes/Images/red-box.gif)"  Font-Bold="True"  ForeColor="White" Font-Size="Large"  /&gt; &lt;br /&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>
