var httpObject = null;
function getHTTPObject()
{
	if (window.ActiveXObject)
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		if(window.XMLHttpRequest)
		{
			return new XMLHttpRequest;
		}
		else
		{
			alert("Your browser does not support AJAX");
			return null;
		}
	}
}

function createXMLHttpRequest() 
{
   try { return new XMLHttpRequest(); } catch(e) {}
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
   //alert("XMLHttpRequest not supported");
   alert("Your browser does not support AJAX");
   return null;
}

//Implement bussiness logic
function doWork()
{
	httpObject = createXMLHttpRequest();	//getHTTPObject();
	if (httpObject!=null)
	{
		httpObject.open("GET", "traderscount.php?c=0", true);
		//catch the response from the server. setOutput function will be called if the sate of the
		//object was changed. 
		httpObject.onreadystatechange=setOutput;
		httpObject.send(null);
	}
}

//To implement the setOutput function
function setOutput()
{
	/*
		0 = uninitialized
		1 = loading
		2 = loaded
		3 = interactive
		4 = complete
	*/
	if(httpObject.readyState==4)
	{
		document.getElementById('traderscounter').innerHTML = httpObject.responseText+" ";
	}
}



