var objXmlHttp = null;
var objTarget = null;

function ajax(txtSource, txtTarget)
{
	objTarget = txtTarget;
	
	document.getElementById(objTarget).innerHTML = "Aan het laden ...";
	
	if(window.XMLHttpRequest)
	{
		try
		{
			objXmlHttp = new XMLHttpRequest();
		}
		catch(exc)
		{
			objXmlHttp = null;
		}
	}
	else if(window.ActiveXObject)
	{
		try
		{
			objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(exc)
		{
			objXmlHttp = null;
			
			try
			{
				objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(exc)
			{
				objXmlHttp = null;
			}
		}
	}
	
	if(objXmlHttp != null)
	{
		objXmlHttp.onreadystatechange = showResult;
		objXmlHttp.open("GET", txtSource, true);
		objXmlHttp.send("");
	}
}

function showResult()
{
	if (objXmlHttp.readyState == 4)
	{
		if (objXmlHttp.status == 200)
		{
			document.getElementById(objTarget).innerHTML = objXmlHttp.responseText;
		}
		else
		{
			document.getElementById(objTarget).innerHTML = "Fout bij het laden: " + objXmlHttp.statusText;
		}
	}
}
