var js_ajaxMode = true;

var js_xmlHttp;

function js_doAjax(readyFunction, errorFunction, phpFile, parameters) {
    try {
        try {
            // Firefox, Opera 8.0+, Safari
            js_xmlHttp = new XMLHttpRequest();
        } catch (e0) {
            //Internet Explorer
            try {
                js_xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e1) {
                try {
                    js_xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e2) {
                }
            }
        }
        js_xmlHttp.onreadystatechange = function() {
            if ((js_xmlHttp.readyState == 4) || (js_xmlHttp.readyState == "complete")) {
                 if (js_xmlHttp.responseText.indexOf("Error") == 0) {
                 	 errorFunction(js_xmlHttp.responseText);
                 } else {
                 	 readyFunction(js_xmlHttp.responseText);
                 }
            }
        }
        js_xmlHttp.open("POST", phpFile, true);
        js_xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        js_xmlHttp.setRequestHeader("Content-length", parameters.length);
        js_xmlHttp.setRequestHeader("Connection", "close");
        js_xmlHttp.send(parameters);
    } catch (error) {
    }
}

function js_ajax_done(text) {
}

function js_ajax_error(error) {
	alert(error);	
}
