var xhrHandler = null;															//xhr = xmlHttpRequest

/**************************
Erzeugen des AJAX-Requests
**************************/
function xhrObject()
{
	var xhrHandler = null;

	try
	{
		xhrHandler = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(Error)
	{
		try
		{
			xhrHandler = new ActiveXObject("MSXML2.XMLHTTP");
		}
		catch(Error)
		{
			try
			{
				xhrHandler = new XMLHttpRequest();
			}
			catch(Error)
			{
				alert("Erzeugung des XMLHttpRequest-Objekts nicht möglich");
			}
		}
	}

	return xhrHandler;
}



/**************************
Request Senden
**************************/
function xhrSendRequest(xhrMethod, xhrUrl, xhrElement, xhrIndicator, xhrIndicatorGif)
{
	

	xhrHandler.open(xhrMethod,xhrUrl,true);
	xhrHandler.onreadystatechange = function() {
        xhrHandleResponse(xhrElement, xhrIndicator, xhrIndicatorGif);
    };
	xhrHandler.send(null);
}


/**************************
Request auswerten
**************************/
function xhrHandleResponse(xhrElement, xhrIndicator, xhrIndicatorGif)
{
	
	if(xhrHandler.readyState == 1)
	{
		document.getElementById(xhrElement).innerHTML = '<div id="'+xhrIndicator+'"><img src="'+xhrIndicatorGif+'"></div>';
	}
	if(xhrHandler.readyState == 4)
	{
		document.getElementById(xhrElement).innerHTML = xhrHandler.responseText;
	}
}

xhrHandler = xhrObject();