
function stillLoggedIn () {
	//test if we're still logged in
	postAjax("",_path['relative_root'] + "login/script-login/loginTest/?script=1","stillLoggedInResultsVar");
	//run this function every couple of mins, to check if we've been logged out
	setTimeout("stillLoggedIn()",120000);
	//run results
	stillLoggedInResults();
}
function stillLoggedInResults() {
	if (window.stillLoggedInResultsVar) {
		//if not logged in, refresh the page (which should trigger the logout)
		if (window.stillLoggedInResultsVar=="0") {
			window.location.href = window.location.href;
		}
		if (window.stillLoggedInResultsVar=="2") {
			flashMsg("<b>Are you still there?</b>\n\nYour session will be logged out in a few minutes. <a href=\"javascript:extendLoginSession()\">Click here to extend your time.</a>");
		}
	} else {
		setTimeout("stillLoggedInResults()",200);
	}
}





function extendLoginSession() {
	//clear flash
	flashClear();	
	//test if we're still logged in
	postAjax("",_path['relative_root'] + "login/script-login/extendSession/?script=1","none");
}
