/*
	returns XMLHTTPRequest
	version 1.0
	
	details:
	https://developer.mozilla.org/En/XMLHttpRequest

	Browser compatibility:
	all
	
	example usage:
		var req = getXMLHTTPObject();
		req.open('GET', 'http://www.mozilla.org/', true);
		req.onreadystatechange = 
			function() { 
				if(req.readyState == 4)
					// do something
			};
		req.send(null);
*/

var getXMLHTTPObject = function() {
	var xmlHttp = null;
	// Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
	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  = null;
	        }
	    }
	}
	return xmlHttp;
}

