function GetAjaxXMLHttpRequest() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else { if (window.Ajax_Request) { return new ActiveXObject(window.Ajax_Request); } else { var a = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]; for (var i = 0; i < a.length; i++) { try { var x = new ActiveXObject(a[i]); window.Ajax_Request = a[i]; return x; } catch (e) { } } } } return; }
function sendRequest(url, func, isxml, postdata) {
    var xhr = GetAjaxXMLHttpRequest();
    if (!postdata) postdata = null;
    xhr.open(postdata ? "POST" : "GET", url, true);
    if (postdata) {
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    }
    if (func) {
        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4) {
                func(isxml && xhr.responseXML ? xhr.responseXML : xhr.responseText)
            }
        }
    }
    if (postdata === true) {
        postdata = '';
    }
    xhr.send(postdata)
}