// TODO: replace with using jQuery's AJAX library, which handles more bugs and such

// determine if using IE by trying to create object the IE way
var xmlhttp = false;
try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch ( e ) {
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch ( e2 ) {
        xmlhttp = false;
    }
}
// if that failed, create object the way everyone else does
if ( !xmlhttp && typeof XMLHttpRequest != 'undefined' ) {
    xmlhttp = new XMLHttpRequest();
}

function makerequest(serverPage, queryString) {
    xmlhttp.open("POST", serverPage, true);
    xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.onreadystatechange = function() {
        if ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) {
	    requestComplete(xmlhttp.responseText);
        }
    }
    xmlhttp.send(queryString);
}
