var xmlHttp=createXMLHttpRequestObject();

function createXMLHttpRequestObject()
{
	var xmlHttp;
	if (window.ActiveXObject)
	{
		try
		{
			xmlHttp=new ActiveXObjext("Microsoft.XMLHTTP");
		}
		catch (e)
		{
		xmlHttp=false;
		}
	}
else
{
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		xmlHttp=false;
	}
}

if (!xmlHttp)
{
	alert("Fehler beim Erzeugen des XMLHttpRequest Objekt.");
}
else
{
	return xmlHttp;
}
}

function process()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0)
	{
		name=encodeURIComponent(document.getElementById("Kopf1").value);
		xmlHttp.open("GET", "sam4s180t.php?name=" + name, true);
		xmlHttp.onreadystatechange=handleServerResponse;
		xmlHttp.send(null);
	}
	else
	{
		setTimeout('process()', 1000)
	}
}

function handleServerResponse()
{
	if (xmlHttp.readyState==4)
	{
		if (xmlHttp.status==200)
		{
			xmlResponse=xmlHttp.responseXML;
			xmlDocumentElement=xmlResponse.documentElement;
			helloMessage=xmlDocumentElement.firstChild.data;
			document.getElementById ("Wkopf1").innerHTML='<i>' + helloMessage + '</i>';
			document.getElementById ("Wkopf2").innerHTML='<i>' + helloMessage + '</i>';
			setTimeout('process()',1000);
		}
		else
		{
			alert("Zugriffsfehler Server: "+xmlHttp.statusText);
		}
	}
}