function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported")
   return null
}
//-------------------------------------------
function getRequestBody(oForm) {
    var aParams = new Array();
    
    for (var i=0 ; i < oForm.elements.length; i++) {
        var sParam =encodeURIComponent(oForm.elements[i].name);
        sParam += "=";
        sParam += encodeURIComponent(oForm.elements[i].value);
        aParams.push(sParam);
    } 
    return aParams.join("&");
}
//-------------------------------------------
function trim(str)
{
 return str.replace(/^\s+|\s+$/g, ''); 
}

function getOnline(){
	var url="getOnline.php";
	
   var  xmlHttp = Inint_AJAX();
     xmlHttp.onreadystatechange = function () { 
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				var CListOnline = xmlHttp.responseText;  
				//Don't show anytings cuz I wan't to call for update database only
			}
		}
     }
	xmlHttp.open('GET', url, true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(null);
}

function startOnline_random(){

	getOnline();
	setInterval("getOnline()",5000)//-----call function getOnline every 5 millisec
}


