// библиотека для ajax управление обновления каптче

var req = null;

var READY_STATE_UNINITIALIZED = 0;
var READY_STATE_LOADING = 1;
var READY_STATE_LOADED = 2;
var READY_STATE_COMPLETE = 4;


// чтение xml потока
function loadXMLDoc(url, post,s)
{
        if (window.XMLHttpRequest) // branch for native XMLHttpRequest object
                req = new XMLHttpRequest();
        else if (window.ActiveXObject) // branch for IE/Windows ActiveX version
                req = new ActiveXObject("Microsoft.XMLHTTP");
        //document.body.style.cursor = 'wait';
        if (req)
        {
                //req.overrideMimeType('text/xml');
                eval('req.onreadystatechange = '+s+';');
//                req.onreadystatechange = processReqChange;
                if ( post )
                {
                        req.open("POST", url, true);
                        req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                        req.send(post);
                }
                else
                {
                        req.open("GET", url, true);
                        req.send(null);
                }
        }
        else
                alert("There was a problem communicating with XMLHttpRequest object in your browser!");
}

