/***************************************************

  This file handles all the ajax scripting handles

***************************************************/

function AjaxConfig() {
    this.req = false;
    this.reqType = "GET";
    this.reqUrl = "";
    this.reqArr = new Array();
}

var c = new AjaxConfig();

function debug(str) {
    alert(str);
}

// Initialize our object to use later
function init() {
    try {
        c.req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            c.req = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (ea) {
            c.req = null;
        }
    }
    if (!c.req && typeof XMLHttpRequest != "undefined") {
        c.req = new XMLHttpRequest();
    }
    if (!c.req) {
        debug("Could not load the XMLHttpRequest");
    }
    return c.req;
}

function doCall(id,args) {
    var el = document.getElementById(id);
    if (!c.reqArr[args]) {
        c.reqArr[args] = id;
        var objXml = init();
        //debug(objXml);
        var url = c.reqUrl + args;
        //debug(c.reqType + " " + url);
        objXml.open(c.reqType,url,true);
        objXml.onreadystatechange = function() {
            if (objXml.readyState == 4) {
                el.innerHTML = objXml.responseText;
            }
        }
        objXml.send(null);
    }
    el.style.display = "block";
}
