document.write('');
document.write('<div id="mess" ');
document.write('style="position:fixed;top: 40%;left: 40%; visibility: hidden;">');
document.write('<table ');
document.write('style="border: solid 1px black;');
document.write('background-color: white; width: 150px; height: 100px;">');
document.write('<td > <img src="/loading.gif" alt="Wait" id="imgload"> </td>');
document.write('<td><font size=3> <div id="ldtxt">Загрузка</div></font></td>');
document.write('</table>');
document.write('</div>');

document.write('<div id="bodyt">');
document.write('');
document.write('</div>');


var load=document.getElementById('mess');
var img=document.getElementById('imgload');
var ldtxt=document.getElementById('ldtxt');
var body=document.getElementById('comments');

function loadXMLDoc(url) {
//document.location=document.location + '#post';
showmsg('\u0417агрузка..');
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}

function processReqChange() {
    if (req.readyState == 4) {
    		
        if (req.status == 200) {
            
		    body.innerHTML=req.responseText;
                        document.documentElement.scrollTop=0;
		    hidemsg();
        } else {
			//img.src="/stop.png";
			body.innerHTML="\u041eшибка: " + req.statusText;
        }
    }
}


function showmsg(text){
load.style.visibility='visible';
ldtxt.innerHTML=text;
}
function hidemsg(){
load.style.visibility='hidden';
}

