var xmlhttp=null;
var error = null;
function sendOnline(url)
{
	if (window.XMLHttpRequest){  
		xmlhttp   =   new   XMLHttpRequest();  
		xmlhttp.onreadystatechange   =   processReqChange;  
		xmlhttp.open("GET",   url,   true);
		xmlhttp.send(null);
	}   else   if   (window.ActiveXObject)   {
		isIE   =   true;  
		xmlhttp   =   new   ActiveXObject("Microsoft.XMLHTTP");  
		if   (xmlhttp){  
		xmlhttp.onreadystatechange   =   processReqChange;  
		xmlhttp.open("GET",   url,   true);  
		xmlhttp.send();  
		}  
	}   
}
function   processReqChange()   {
	var error = '';
	if  (xmlhttp.readyState   ==   4)   {  
		if   (xmlhttp.status   ==   200)   {  
			error = xmlhttp.responseText;
			if (error)
			{
				location.href='error.php?err='+error;
			}
		}
	}  
 }   
setInterval("sendOnline('online.php?isfree='+isfree+'&username='+username+'&id='+Online)", parseInt(Refresh)*1000);
window.onunload = function()
{
 	sendOnline('online.php?username='+username+'&id='+Online+'&action=exit');
}