function init_object() {
    var x;
    try {
        x = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
        try {
            x = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (oc) {
            x = null;
        }
    }
    if (!x && typeof XMLHttpRequest != "undefined") {
        x = new XMLHttpRequest();
    }
    if (x) {
        return x;
    }
}

function AjaxConnection(url) {
    this.connect = connect;
    this.uri = url;
}

function connect(return_func) {
    with (this) {
        x = init_object();
        x.open("POST", uri, true);
        x.onreadystatechange = function() {
            if (x.readyState != 4) {
                return;
            }
            eval(return_func+'(x.responseText)');
            delete x;
        };
        x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        x.send('');
    }
}

function doAJAX(url,call_function) {
    connection = new AjaxConnection(url);
    connection.connect(call_function);
}


