
function buildXHR() {
    try { return new XMLHttpRequest(); }
	catch(e) {
	    try { return new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e2) {
		    try { return new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e3) {
		        alert("Your browser doesn't support ajax.");
                return null;
		    }
	    }
    }
}


//simplest ajax functions ever
function ajaxFetch(url) {
	if(!url) url = "";
	var xhr = buildXHR();
	var loc = window.location.protocol + "//" + window.location.hostname + "/" + url;
	
	xhr.open("GET", loc, false);
	xhr.send(null);
	return xhr.status==200 ? xhr.responseText : "";
}


