var xmlhttp;
var currentElement;

function ajax(element, url)
{
	currentElement=element;
	document.getElementById(currentElement).innerHTML='';

	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
		xmlhttp.onreadystatechange=ajaxState;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if(xmlhttp)
		{
			xmlhttp.onreadystatechange=ajaxState;
			xmlhttp.open("GET",url,true);
			xmlhttp.send();
		}
	}
}

function ajaxState()
{
	if (xmlhttp.readyState==4)
	{
		if (xmlhttp.status==200)
		{
			document.getElementById(currentElement).innerHTML='';
			document.getElementById(currentElement).innerHTML=xmlhttp.responseText;
			currentElement='';
		}
	}
}