var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject()
{
	var xmlHttp;
	//if running Internet Explorer
	if(window.ActiveXObject)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			xmlHttp = false;
		}
	}
	else
	{
		try
		{
			xmlHttp = new XMLHttpRequest();
		}
		catch(e)
		{
			xmlHttp = false;
		}
	}
	
	if(!xmlHttp)
	{
		alert("Error creating the XMLHttpRequest Object.");
	}else
	{
		return xmlHttp;
	}
}	

function process(land)
{
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		xmlHttp.open("GET", "/tauchziele/getland.php?land="+land, true);
		xmlHttp.onreadystatechange = handleServerResponse;
                xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(null);
	}
}

function handleServerResponse()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			//extract the XML retrieved from the server
			var response = xmlHttp.responseText;
                        var div = document.getElementById("reponse");
                        div.innerHTML = response ;
		}// a HTTP status different than 200 signals an error
		else
		{
			alert("There was a problem accessing the server: "+
			xmlHttp.statusText);
			}
		}
	}
