I am calling CloseModalWindow from a page I opened with an OpenModelWindow JScript call:

Code:
ClientScript.RegisterClientScriptBlock(cstype, Guid.NewGuid().ToString(), _
        "$(document).ready(function() {CloseModelWindow();});", True)
When I do, the Window closes, but I get a JavaScript error in the JScript.js file:

"Microsoft JScript runtime error: 'Date' is undefined." in the now function:

Code:
    function now() {

        return (new Date).getTime();
    }
Which is causing my onclose event from the calling page not to fire, so my grid isn't being refreshed. Any thoughts on why it wouldn't recognize date? Hell I'm not even sure why the now(); function is called.

Code:
$("#faddbtn").click(function (e) {
                var url = "addevent.aspx";

                OpenModelWindow(url, { width: 600, height: 425, caption: "Schedule Event", onclose: function (e) {
                    $("#gridcontainer").reload();

                }
                });
            });