function create_request(method, request, datasend, handler) {
      /**
       * (string) method = метод отправки данных (обычно GET или POST);
       * (string) request = абсолютный или относительный путь до файла (этот файл и запрашиваемый должны быть с одного домена);
       * (string) datasend = данные отсылаемые при запросе (например: nick=ixRock&msg=JS/PHP 4EVER!);
       * (function) handler = функция обработчик для события onreadystatechange, by default в виде первого агрумента будет принимать xml.responseText;
       */
       handler = handler || false;
       if(window.XMLHttpRequest) xhr = new XMLHttpRequest();
       else {
              try { xhr = new ActiveXObject("Msxml2.XMLHTTP") }
              catch(e) {
                     try { xhr = new ActiveXObject("Microsoft.XMLHTTP") }
                     catch(e) {
                            try { xhr = new ActiveXObject("Msxml2.XMLHTTP.4.0") }
                            catch(e) { xhr = null }
                            }
              }
       }

       if(xhr != null) {
              datasend = method.toUpperCase() == 'POST' ? encodeURI(datasend) : datasend;
              xhr.open(method, request, true);
              xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
              xhr.send(datasend);
       xhr.onreadystatechange = function() {
              if(xhr.readyState == 4) {
                     if(xhr.status == 404) alert('Запрашиваемый файл не существует! \n\t(404 - Not Found)');
                     else if(xhr.status == 403) alert('Этот файл запрещен для просмотра! \n\t(403 - Forbidden)');
                     else if(xhr.status == 401) alert('Пользователь не авторизирован! \n\t(401 - Unauthorized)');
                     else if(handler != false) {
                            handler(xhr.responseText);
                            xhr.onreadystatechange = function() {}
                            delete xhr;
                            }
                     }
              }
       }
       else alert('Ваш браузер не поддерживает AJAX-технологию!');

}

function create_request2(method, request, datasend, handler) {
      /**
       * (string) method = метод отправки данных (обычно GET или POST);
       * (string) request = абсолютный или относительный путь до файла (этот файл и запрашиваемый должны быть с одного домена);
       * (string) datasend = данные отсылаемые при запросе (например: nick=ixRock&msg=JS/PHP 4EVER!);
       * (function) handler = функция обработчик для события onreadystatechange, by default в виде первого агрумента будет принимать xml.responseText;
       */
       handler = handler || false;
       if(window.XMLHttpRequest) xhr2 = new XMLHttpRequest();
       else {
              try { xhr2 = new ActiveXObject("Msxml2.XMLHTTP") }
              catch(e) {
                     try { xhr2 = new ActiveXObject("Microsoft.XMLHTTP") }
                     catch(e) {
                            try { xhr2 = new ActiveXObject("Msxml2.XMLHTTP.4.0") }
                            catch(e) { xhr2 = null }
                            }
              }
       }

       if(xhr2 != null) {
              datasend = method.toUpperCase() == 'POST' ? encodeURI(datasend) : datasend;
              xhr2.open(method, request, true);
              xhr2.setRequestHeader('Content-type','application/x-www-form-urlencoded');
              xhr2.send(datasend);
       xhr2.onreadystatechange = function() {
              if(xhr2.readyState == 4) {
                     if(xhr2.status == 404) alert('Запрашиваемый файл не существует! \n\t(404 - Not Found)');
                     else if(xhr2.status == 403) alert('Этот файл запрещен для просмотра! \n\t(403 - Forbidden)');
                     else if(xhr2.status == 401) alert('Пользователь не авторизирован! \n\t(401 - Unauthorized)');
                     else if(handler != false) {
                            handler(xhr2.responseText);
                            xhr2.onreadystatechange = function() {}
                            delete xhr2;
                            }
                     }
              }
       }
       else alert('Ваш браузер не поддерживает AJAX-технологию!');
}

function create_request3(method, request, datasend, handler) {
      /**
       * (string) method = метод отправки данных (обычно GET или POST);
       * (string) request = абсолютный или относительный путь до файла (этот файл и запрашиваемый должны быть с одного домена);
       * (string) datasend = данные отсылаемые при запросе (например: nick=ixRock&msg=JS/PHP 4EVER!);
       * (function) handler = функция обработчик для события onreadystatechange, by default в виде первого агрумента будет принимать xml.responseText;
       */
       handler = handler || false;
       if(window.XMLHttpRequest) xhr3 = new XMLHttpRequest();
       else {
              try { xhr3 = new ActiveXObject("Msxml2.XMLHTTP") }
              catch(e) {
                     try { xhr3 = new ActiveXObject("Microsoft.XMLHTTP") }
                     catch(e) {
                            try { xhr3 = new ActiveXObject("Msxml2.XMLHTTP.4.0") }
                            catch(e) { xhr3 = null }
                            }
              }
       }

       if(xhr3 != null) {
              datasend = method.toUpperCase() == 'POST' ? encodeURI(datasend) : datasend;
              xhr3.open(method, request, true);
              xhr3.setRequestHeader('Content-type','application/x-www-form-urlencoded');
              xhr3.send(datasend);
       xhr3.onreadystatechange = function() {
              if(xhr3.readyState == 4) {
                     if(xhr3.status == 404) alert('Запрашиваемый файл не существует! \n\t(404 - Not Found)');
                     else if(xhr3.status == 403) alert('Этот файл запрещен для просмотра! \n\t(403 - Forbidden)');
                     else if(xhr3.status == 401) alert('Пользователь не авторизирован! \n\t(401 - Unauthorized)');
                     else if(handler != false) {
                            handler(xhr3.responseText);
                            xhr3.onreadystatechange = function() {}
                            delete xhr3;
                            }
                     }
              }
       }
       else alert('Ваш браузер не поддерживает AJAX-технологию!');
}


function mailedit(textt, obj, a){
     //alert(textt);
     obj.innerHTML=unescape(textt);
     if(typeof(a)!='undefined'){
        obj.align='right';
     }
     else {
        obj.align='left';
     }
}

function doajax(text, obj){
     //alert(text);
     document.getElementById(obj).innerHTML=unescape(text);
}


