function createAjaxRequest()
{
    var r;
        try {
        r = new XMLHttpRequest();
    } catch (e) {
        try {
            r = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                r = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (failed) {
                r = null;
            }
        }
    }
    return r;
}

function ajaxCallback()
{
    switch(ajaxRequest.readyState) {
        case 4:
            if(ajaxRequest.status!=200) {
                alert("AJAX-Error: " + ajaxRequest.status);
            } else {
                ajaxCallbackObj.execute(ajaxRequest);
            }
        break;
        default:
            return false;
        break;
    }
}

ajaxRequest = null;
ajaxCallbackObj = null;

EfxAjaxRequest = function() {
    this.openAndSend =
        function(mth, url, async, callback) {
            ajaxRequest = createAjaxRequest();
            ajaxCallbackObj = callback;
            ajaxRequest.open(mth, url, async);
            ajaxRequest.onreadystatechange = ajaxCallback;
            ajaxRequest.send(null);
        }
}



