
<!--
var secs;
var timerID = null;
var timerRunning = false;
var delay = 1000;
var repeat = 0;

function InitializeTimer(timeout)
{
    // Set the length of the timer, in seconds
    secs = timeout;
    StopTheClock();
    StartTheTimer();
    repeat = repeat + 1;
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID);
    timerRunning = false;
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock();
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:


        alert("Are you still there? Your Session has become idle and you have been logged out for security reasons. Click 'OK' to be directed to the login screen.");
	    if (window.pid){
	        document.location.href = "logout.aspx?pid="+window.pid;
	    }else{
		    document.location.href = "logout.aspx";
        }
    
    }
    else
    {
        // self.status = secs
        secs = secs - 1;
        timerRunning = true;
        timerID = self.setTimeout("StartTheTimer()", delay);
    }
}

InitializeTimer(1200);

//-->
