﻿function xmlCreate() {
        var xmlHttp;
        if (typeof XMLHttpRequest != 'undefined') {
            xmlHttp = new XMLHttpRequest();
        } else {
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    xmlHttp = null;
                }
            }
        }
        return xmlHttp;
    }

    function xmlSync(url, postData) {
        var req = xmlCreate();
        if (req == null) return;
        var method = (postData) ? "POST" : "GET";
        req.open(method, url, false);
        req.setRequestHeader('User-Agent', 'XMLHTTP/1.0');
        if (postData) req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        req.send(postData);
        return req.responseText;
    }