// Do a HTTP request.
// The callback function is the onreadystatechange function of the
// http request.
var xmlhttp = false;

function doHTTPRequest(url, callback) {
    o = getHTTPObject();
    if (typeof o == "object") {
        o.open("GET", url, true);
        
        alert(callback);
        o.onreadystatechange = function() {callback(o)};
        
        
        o.send(null);
        return true;
    }
    
    return false;
}

// Get an XMLHttpRequest object, or false if not available.
function getHTTPObject() {

    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) { }
    }
    if (xmlhttp === false) {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) { }
    }
    return xmlhttp;
}
