﻿function clickResponse(arg){
    if (arg) {

        if (consoletimeout == 0) {
            window.location.href = '/home.aspx';
        } else {
            timeCount = 0;
        }
            
    } else {
        
        if (consoletimeout == 0) {
            window.location.href = '/authenticate/login.logout.aspx';
        } else {
            window.close();
        }

    }
}

var timeCount ;
timeCount = 0;

function clickTimer() {
    if (window.location.href.toLowerCase().search(/authenticate/) == -1) {
	    timeCount = timeCount + 1;
	    if (timeCount == sessiontimeout - 5 ) {
		    //alert('Your session has been idle for 25 minutes, and will be cleared in 5 minutes to conserve server resources if your session is not active.\nPlease save your work to keep your session active.');
		    radconfirm(timeoutmessage, clickResponse);
	    } else if (timeCount > sessiontimeout) {
	        if (consoletimeout == 0) {
	            window.location.href = '/authenticate/login.logout.aspx';
	        } else {
	            window.close();
	        }
	        
	    }
	    //window.status = timeCount;
			
	    window.setTimeout("clickTimer()", 60000);
	}
}

window.setTimeout("clickTimer()", 60000);

