function $(a) {
    return document.getElementById(a);
}
function getElementsByClassName(k, g) {
    var c = $(g) || document;
    var d = c.getElementsByTagName("*");
    var h = new Array();
    for (var f = 0; f < d.length; f++) {
        var b = d[f];
        var a = b.className.split(" ");
        for (var e = 0; e < a.length; e++) {
            if (a[e] == k) {
                h.push(b);
                break;
            }
        }
    }
    return h;
}
ajax = function(a, e, d, c, b) {
    this.url = a;
    this.postback = e;
    this.params = c;
    this.xmlHttpRequest = null;
    this.method = d;
    this.format = b;
    this.getDocument(a);
};
ajax.prototype = {
    createXMLHttpRequest: function() {
        if (typeof XMLHttpRequest != "undefined") {
            this.xmlHttpRequest = new XMLHttpRequest();
        } else {
            if (typeof ActiveXObject != "undefined") {
                var c = ["Microsoft.XMLHTTP", "MSXML.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP"];
                for (var a = 0; a < c.length; a++) {
                    try {
                        this.xmlHttpRequest = new ActiveXObject(c[a]);
                        break;
                    } catch(b) {}
                }
            } else {
                return this.xmlHttpRequest;
            }
        }
    },
    getDocument: function(a) {
        this.createXMLHttpRequest();
        if (this.xmlHttpRequest) {
            try {
                this.xmlHttpRequest.open(this.method, a, true);
                var c = this;
                this.xmlHttpRequest.onreadystatechange = function() {
                    c.onReadyState();
                };
                this.xmlHttpRequest.send(this.params);
            } catch(b) {}
        }
    },
    onReadyState: function() {
        if (this.xmlHttpRequest.readyState == 4) {
            if (this.xmlHttpRequest.status == 200 || this.xmlHttpRequest.status == 0) {
                reuqest = this.xmlHttpRequest.responseText;
                if (this.format == "json") {
                    var json = eval("(" + reuqest + ")");
                    this.postback(json);
                } else {
                    this.postback(reuqest);
                }
            }
        }
    }
};
function ajaxRequest(c, b, f, a, e) {
    var d = new ajax(c, b, f, a, e);
}
function ajaxUpdater(d, b) {
    var a = function(e) {
        $(d).innerHTML = e;
    };
    var c = new ajax(b, a, "get", "");
}