
var nSessionTimeout = 90;
var nTimeout = 5280000;
var nAngelTimeout = null;
//called only when the session is two minutes from expiring
//and this is the topmost handler for the warning
function angelTimeoutWarning(nMins) {
	var nTop = parseInt((screen.availHeight-100)/2);
	var nLeft = parseInt((screen.availWidth-300)/2);
	var w = window.open('/Timeout/default.htm', '_blank', 'alwaysRaised=yes,width=300,height=100,scrollbars=no,top=' + nTop + ',left=' + nLeft);
}
//called only when the page loads to initiate the timeout warning
//or called from a child window when it loads
function setAngelTimeoutWarning(nMins) {
	//If a parent window is handling then just exit
	w = self;
	while (w && w.parent && w.parent != w) {
		if (w.parent.nAngelTimeout) { return; }
		w = w.parent;
	}
	//If a parent window is handling then just exit
	w = self;
	while (w && w.opener && w.opener != w) {
		if (w.opener.nAngelTimeout) { return; }
		w = w.opener;
	}
	nSessionTimeout = nMins;
	var nMilsecInMin = 60000;
	nTimeout = (parseInt(nMins)-2) * nMilsecInMin;
	if (nAngelTimeout) { clearTimeout(nAngelTimeout); }
	nAngelTimeout = setTimeout('angelTimeoutWarning(' + nMins + ')', nTimeout);
	var w;
}

function gotoLogout() {
	top.location.replace("/SignOn/Logout.asp");
}

	
//initiate the timeout warning

setAngelTimeoutWarning(nSessionTimeout);
