function xmlRequestBoy(){
}
xmlRequestBoy.prototype.loadXMLDoc = function (url, handler, args){

    var date = new Date();
    var e;

	var req;

    if(window.XMLHttpRequest) {
        // branch for native XMLHttpRequest object
        try {
            req = new XMLHttpRequest();
        } catch(e) {
            req = false;
        }
    }
    else if(window.ActiveXObject) {
        // branch for IE/Windows ActiveX version
        try {
            req = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                req = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e) {
                req = false;
            }
        }
    }

    var queryString = url.substring(url.indexOf('?')+1);
    var queryTarget = url.substring(0, url.indexOf('?'));

    var getPost = 'GET';

    // long gets usually work but is never good karma.
    // IE has a hard limit and when you hit it it just drops the request.
    // so if the data is longer than 255 we convert it to a post

    if(req) {
        req.onreadystatechange = function (){ xmlBoy.processReqChange(req, handler, args) };
        if (queryString.length >255){
            req.open('POST', queryTarget, true);
            req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            req.send(queryString);
        }
        else{
            req.open('GET', url, true);
            req.send("");
        }
    }

}
xmlRequestBoy.prototype.processReqChange = function (req, handler, args){
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            handler(req, args);
        }
        else {
            alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}

var xmlBoy;
xmlBoy = new xmlRequestBoy();
