
function HandleOnClose()
{
/*
	var keyCd = null;
	var altKy = false;
	var ctlKy = false;
	var shiftKy = false;
	var mouseBtn = null;



	if (event.clientY < 0)
	{
		event.returnValue = "Please Logout properly by clicking Logout button.";
	}



	if ( mouseBtn == null && 
		 keyCd==null && 
		 Math.abs(window.screenTop) > screen.height && 
		 Math.abs(window.screenLeft) > screen.width && 
		 Math.abs(event.clientX) > screen.width && 
		 Math.abs(event.clientY) > screen.height) 
	{
		altKy = false;
		keyCd = null;
		ctlKy = false;
		shiftKy = false;
		Logoff();
	}	
	else if ((altKy && keyCd == 115) && !ctlKy && !shiftKy && keyCd != 116)
	{
		altKy = false;
		keyCd = null;
		ctlKy = false;
		shiftKy = false;
		Logoff();
	}
	else if ((altKy && keyCd == 70) && !ctlKy && !shiftKy && keyCd != 116)
	{
		altKy = false;
		keyCd = null;
		ctlKy = false;
		shiftKy = false;
		Logoff();
	}

	*/
}

/*
function getMouseButton()
{
	mouseBtn = event.button;
}

function getKeyCode()
{
	keyCd = event.keyCode;
	altKy = event.altKey;
	ctlKy = event.ctlKey;
	shiftKy = event.shiftKey;
}
*/


function Logoff()
{
	//event.returnValue = "You will be logged off";
	//return false;

	var xmlhttp;
	if (window.ActiveXObject) { // code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("GET","Logout.aspx",false);
		xmlhttp.send(null);
	}
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
		xmlhttp.open("GET","../main/Logout.aspx",false);
		xmlhttp.send(null);
	}
}

function RefreshSession()
{
	var xmlhttp;
	if (window.ActiveXObject) { // code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("GET","RefreshSession.aspx",false);
		xmlhttp.send(null);
	}
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
		xmlhttp.open("GET","../main/RefreshSession.aspx",false);
		xmlhttp.send(null);
	}
}

function AlertLogoff()
{
	if (confirm('Session has been inactive .You will be automatically logged off in 5 minutes.\nClick \'OK\' to log off immediately.\nClick \'Cancel\' to continue to use this session.'))
	{
		window.location.replace('../main/logout.aspx');
	}
	else
	{
		RefreshSession();
		RefreshLogoffAlert();
	}
}

function RefreshLogoffAlert()
{
	setTimeout('AlertLogoff()', 900000);
}