var xmlHttp = false;

function init_xmlHttp() {
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof(XMLHttpRequest) != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	if (!xmlHttp) {
		// Internet Explorer 6 und älter
		try {
			xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlHttp  = false;
			}
		}
	}
}

function async_request(url, response_action) {
	if(!xmlHttp)
		init_xmlHttp();
	
	if (xmlHttp) {
		xmlHttp.open('GET', url, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				response_action(xmlHttp.responseText)
			}
		};
		xmlHttp.send(null);
	}
	else alert("FEHLER: Ihr Browser unterstützt XMLHTTP nicht!");
}

function sync_request(url) {
	if(!xmlHttp)
		init_xmlHttp();
	
	if (xmlHttp) {
		xmlHttp.open("GET", url, false);
		xmlHttp.send(null);
		return xmlHttp.responseText;
	}
	else alert("FEHLER: Ihr Browser unterstützt XMLHTTP nicht!");
}
