/*
 * 
 * Common AJAX functions
 * REAL AJAX, not my cheap CSV immitation one!
 * 
 */

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

var xmlHttpRequest = getHTTPObject();

function xmlHttpRequest() {
    // create an Ajax Request
    var ajaxRequest;
    try {
        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e1) {
        try {
            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e2) {
            ajaxRequest = new XMLHttpRequest();
        }
    }
    return ajaxRequest;
}

