window.setTimeout("keepAlive();", 1140000); //1140 sec = 19 min//window.setTimeout("keepAlive();", 10000); //10 sec for testing/*Function opens a popup window that alerts user that his session is aboutto timeout. If the user does not respond to the prompt of the popup hisform will automatically be saved and he will be*/function keepAlive(){	popTimeoutAlert();	window.setTimeout("keepAlive();", 1140000); //1140 sec = 19 min		//window.setTimeout("keepAlive();", 10000); //10 sec for testing	sndReqSessionKeepAlive('/session_keepalive.php');}function createRequestObject() {	var ro;	var browser = navigator.appName;	if(browser == "Microsoft Internet Explorer"){		ro = new ActiveXObject("Microsoft.XMLHTTP");	}else{		ro = new XMLHttpRequest();	}	return ro;}var http = createRequestObject();function sndReqSessionKeepAlive(url){	http.open('get', url);	http.onreadystatechange = handleResponseSessionKeepAlive;	http.send(null);}function handleResponseSessionKeepAlive() {	if(http.readyState == 4){		var response = http.responseText;	}}function popTimeoutAlert(){		//pop up a window for 5 minutes that warns of an impending session timeout			window.setTimeout("closeTimeoutAlert()", 30 * 1000); //300 sec = 5 min	//window.setTimeout("closeTimeoutAlert()", 1000); //300 sec = 5 min	//window.setTimeout("popTimeoutAlert()", 1140 * 1000); //1140 sec = 19 min	//window.setTimeout("closeTimeoutAlert()", 10 * 1000); //300 sec = 5 min	//window.setTimeout("popTimeoutAlert()", 100 * 1000); //1140 sec = 19 min	//src: http://www.irt.org/script/1316.htm	var w = 480, h = 340;    w = screen.availWidth;    h = screen.availHeight;	var popW = 300, popH = 120;	var leftPos = (w-popW)/2, topPos = (h-popH)/2;	//end src			//open the popup window	popwin = window.open(	"/timeout.htm",	"timeout_alert",	"width=" +  popW + ",height=" + popH + ",top=" + topPos + ",left=" + leftPos + ",scrollbars=no,resizable=no,menubar=no,toolbar=no,location=no,status=no"	);}function closeTimeoutAlert(){				if(popwin){			//close popup window		popwin.close();		}		//Save the parent document's form if one named "frmEntry" exists.		if(document.frmEntry)	{				var hidden_action="Save as draft";		if(document.getElementById('extra_action_div')){			document.getElementById('extra_action_div').innerHTML = "<input type=\"hidden\" name=\"cmd\" value=\"" + hidden_action + "\">";		}				document.frmEntry.submit();	}		//Save the parent document's form if one named "theForm" exists.		if(document.theForm)	{				var hidden_action="Save as draft";		if(document.getElementById('extra_action_div')){			document.getElementById('extra_action_div').innerHTML = "<input type=\"hidden\" name=\"cmd\" value=\"" + hidden_action + "\">";		}				document.theForm.submit();	}}
