var xmlHttp
function refreshpage(){ 
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null){
	alert ("Your browser does not support AJAX!");
        return;
    } 
    var url="/quick_test/participanti.php";
    url=url+"?sid="+Math.random();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}
function stateChanged(){ 
    if (xmlHttp.readyState==4){
		if(xmlHttp.status==200){
			document.getElementById("participanti").innerHTML=xmlHttp.responseText;
		}else{
			document.getElementById("participanti").innerHTML="There was a problem with the request!"+xmlHttp.status;
		};
    }
}

var xmlHttp3
function showPms(){ 
    xmlHttp3=GetXmlHttpObject();
    if (xmlHttp3==null){
	alert ("Your browser does not support AJAX!");
        return;
    } 
    var url="/ajax/getpms.php";
    url=url+"?sid="+Math.random();
    xmlHttp3.onreadystatechange=stateChanged3;
    xmlHttp3.open("GET",url,true);
    xmlHttp3.send(null);
}
function stateChanged3(){ 
    if (xmlHttp3.readyState==4){
		if(xmlHttp3.status==200){
			document.getElementById("ajaxpms").innerHTML=xmlHttp3.responseText;
		}else{
			document.getElementById("ajaxpms").innerHTML="There was a problem with the request!"+xmlHttp3.status;
		};
    }
}


var xmlHttp2
var pageloadstart
function showonlineusers_quicktest(){ 
	pageloadstart = new Date();
    xmlHttp2=GetXmlHttpObject();
    if (xmlHttp2==null){
	alert ("Your browser does not support AJAX!");
        return;
    } 
    var url="/quick_test/online_users.php";
    url=url+"?sid="+Math.random();
    xmlHttp2.onreadystatechange=stateChanged2;
    xmlHttp2.open("GET",url,true);
    xmlHttp2.send(null);
	showPms();
}
function stateChanged2(){ 
    if (xmlHttp2.readyState==4){ 
		if(xmlHttp2.status==200){
			document.getElementById("onlineusers").innerHTML=xmlHttp2.responseText;
		}else{
			document.getElementById("onlineusers").innerHTML="There was a problem with the request!"+xmlHttp2.status;
		};	
    }
}


var xmlHttp5
function show_quicktest_chat(){ 
    xmlHttp5=GetXmlHttpObject();
    if (xmlHttp5==null){
	alert ("Your browser does not support AJAX!");
        return;
    } 
    var url="/quick_test/read.php";
    url=url+"?sid="+Math.random();
    xmlHttp5.onreadystatechange=stateChangednivriachat;
    xmlHttp5.open("GET",url,true);
    xmlHttp5.send(null);
}
function stateChangednivriachat(){ 
    if (xmlHttp5.readyState==4){
		if(xmlHttp5.status==200){
			document.getElementById("chat_nivria").innerHTML=xmlHttp5.responseText;
		}else{
			document.getElementById("chat_nivria").innerHTML="There was a problem with the request!"+xmlHttp5.status;
		};
    }
}

function GetXmlHttpObject(){
    var xmlHttp=null;
    try{
        xmlHttp=new XMLHttpRequest();
    }
    catch(e){
        try{
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e){
	    try{
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                  alert("Your browser does not support AJAX!");
                  return false;
            }
        }
    }
    return xmlHttp;
}

