function ajax_createRequest() {

    if ( window.XMLHttpRequest ) {
        return new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        var xmlVersions = new Array(
                                    "Microsoft.XMLHTTP",
                                    "MSXML2.XMLHTTP",
                                    "Msxml2.XMLHTTP.7.0",
                                    "Msxml2.XMLHTTP.6.0",
                                    "Msxml2.XMLHTTP.5.0",
                                    "Msxml2.XMLHTTP.4.0",
                                    "MSXML2.XMLHTTP.3.0"
                                    );
        for (var x = 0; x < xmlVersions.length; x++) {
            try {
                var xmlHTTP = new ActiveXObject(xmlVersions[x]);
                return xmlHTTP;     
            } catch (e) {
            }
        }
    }
    return false;
}

function send(sURL, sMethod, sVars, fnDone) {
    var httpRequest = new ajax_createRequest();

    if (httpRequest) {
        bComplete = false;
        sMethod = sMethod.toUpperCase();
        try {
            if (sMethod == "GET") {
                httpRequest.open(sMethod, sURL+"?"+sVars, true);
                sVars = "";
            } else {
                httpRequest.open(sMethod, sURL, true);
                httpRequest.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
                httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            }

            httpRequest.onreadystatechange = function() {
                if (httpRequest.readyState == 4 && !bComplete) {
                    bComplete = true;
                    eval(fnDone + "(httpRequest)");
                }
            }
            httpRequest.send(sVars);
        } catch(z) { 
        }
    }
    return false;
}