How to call Javascript method (out of scope?)
<p>I'm using <a href="http://programmerramblings.blogspot.com/2010/08/aspnet-40-session-timeout-control.html" rel="nofollow">this ASP.Net/jQuery session timeout control</a>. Works great, but I have a need to access one of its javascript methods from some place other than the jQuery dialog box. Here is the snippet that I want to access:</p>

<pre><code>TSC.Timeout.Timeout.prototype =
{
    // THE METHOD I WANT TO CALL: _resetTimeout()
    _resetTimeout: function (e) {
        // modify timeout to do jquery dialog
        if (typeof jQuery.ui == 'undefined')
            $get(this._clientId).style.display = 'none';

        clearTimeout(this._timerAboutToTimeout);
        clearTimeout(this._timerTimeout);
        clearTimeout(this._timerCountDown);

        this._showAboutToTimeoutDelegate = Function.createDelegate(this, this.showAboutToTimeout);
        this._timerAboutToTimeout = setTimeout(this._showAboutToTimeoutDelegate, this._aboutToTimeoutMinutes * 5 * 1000); //TODO: Change this back to 60
        this._timeoutDelegate = Function.createDelegate(this, this.timeout);
        this._timerTimeout = setTimeout(this._timeoutDelegate, this._timeoutMinutes * 10 * 1000); //TODO: Change this back to 60
    },

    // HOW IT'S BEING CALLED FROM WITHIN THE JS OBJECT:
    initDialog: function (e) {
        // modify timeout to do jquery dialog
        if (typeof jQuery.ui != 'undefined') {
            var tsc = this;
            $("#" + this._clientId).dialog({
                autoOpen: false,
                width: 500,
                resizeable: false,
                bgiframe: true,
                modal: true,
                position: 'center',
                buttons: {
                    "Keep Me Signed In": function () {
                        $(this).dialog('close');
                        CallServer();
                        tsc._resetTimeout();
                    }
                }
            });
        }
    }
}
</code></pre>

<p>I can not seem to get <code>_resetTimeout()</code> to work from the console. Calling <code>TSC.Timeout.Timeout.prototype._resetTimeout();</code> yields the following errors:</p>

<pre><code>Uncaught TypeError: Cannot read property 'length' of undefined
TSC.Timeout.Timeout.showAboutToTimeoutWebResource.axd:200
(anonymous function)ScriptResource.axd:47
WebResource.axd:217Uncaught TypeError: Cannot read property 'length' of undefined
TSC.Timeout.Timeout.timeoutWebResource.axd:217
(anonymous function)ScriptResource.axd:47
WebResource.axd:213Uncaught TypeError: Property 'focus' of object [object DOMWindow] is not a function
TSC.Timeout.Timeout.showAboutToTimeoutWebResource.axd:213
(anonymous function)
</code></pre>

<p>Any ideas how I can call that method?</p>
