// creates xmlhttp object for AJAX techniques.

// create boolean variable to check for a valid IE instance
var xmlhttp = false;

// Check if we are using IE
try
{
	// if the javascript version is greter then 5
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
	// if not then use the older active x object
	try
	{
		// if we are using IE
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (E)
	{
		// else we must be using a non-IE browser.
		xmlhttp = false;
	}
}

// If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
	xmlhttp = new XMLHttpRequest();
}



function insertStat(theelement)
	{
		serverPage = 'insertStat.php';
		
		//replace this eventually...
		/////////////////////////////////////////////////////////////
		// Get Data
		
		/////////////////////////////////////////////////////////////
		
		var screenRes = screen.width +"x"+ screen.height;
		
		var obj = document.getElementById(theelement);
		xmlhttp.open('POST', serverPage);
		
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{
				obj.innerHTML = xmlhttp.responseText;
			}
		}
	
		xmlhttp.setRequestHeader( 
    		'Content-Type', 
    		'application/x-www-form-urlencoded; charset=UTF-8' 
		); 

	xmlhttp.send("");
		
	}