//For setting OnlineStatus to OfflineStatus when session time is out

var timerID = null;
		var timerRunning = false;
		
		function startWatching()
		{
			// Make sure the clock is stopped
			stopWatching();
			timerID = setInterval("doLogout()",3600000);
			timerRunning = true;
		}
	//3600000
		function stopWatching()
		{
			if(timerRunning) {clearInterval(timerID) };
			timerRunning = false;
			
			//HandleOnClose();
		}
	
		function doLogout()
		{
			stopWatching();
			
			if (window.opener == null || window.opener.closed.toString() == 'true')
			{
				//alert('Session TimeOver.');
				self.location='../userarea/logout.aspx?forced=1';
				//window.resizeTo(800,600);
				
			}
			startWatching();
		}
		//when user close the browser
		function HandleOnClose() { 
  
     window.location.href("../userarea/logout.aspx");
     
  }