/*
* Returns a browser independant XMLHttpRequest object, or false on error.
*/
function getHttpRequestObject() {
	var httpReq = false;
	
	//Mozilla/Safari/IE7+
	if (window.XMLHttpRequest) {
		try {
			httpReq = new XMLHttpRequest();
			// Some versions of Mozilla are reported as locking up when anything other than XML is returned
			// IE7 doesn't like overrideMimeType, only call this if its supported.
			if (httpReq.overrideMimeType)   {
				httpReq.overrideMimeType("text/xml");
			}
		}  catch (e) {
			httpReq = false;
		}
	} else if (window.ActiveXObject) {
		// IE6 or less
		try {
			httpReq = new window.ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				httpReq = new window.ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				httpReq = false;
			}
		}
	}
	return httpReq;
}

function Ajax(url, func, errfunc, isxml) {

	var httpReq = getHttpRequestObject();

	if (httpReq) {
		httpReq.onreadystatechange = function() {func(httpReq)}
		httpReq.open("GET", url, isxml);
		httpReq.send(null);
        }
}

