        var stat;

function loadXMLDoc(url) {
   // branch for native XMLHttpRequest object
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
       req.onreadystatechange = processReqChange;
       req.open("GET", url, true);
       req.send(null);
   // branch for IE/Windows ActiveX version
   } else if (window.ActiveXObject) {
       isIE = true;
       req = new ActiveXObject("Microsoft.XMLHTTP");
       if (req) {
           req.onreadystatechange = processReqChange;
           req.open("GET", url, true);
           req.send();
       }
   }
}

// handle onreadystatechange event of req object
function processReqChange() {
   // only if req shows "loaded"
   if (req.readyState == 4) {
       // only if "OK"
       if (req.status == 200) {

//        alert(req.responseText);
        } else {
           alert("There was a problem retrieving the XML data:\n" +
               req.statusText);
        }
   }
}

function showthread(n){
        if( document.getElementById ){
                blk = eval("document.getElementById('dthread"+ n +"')");
        } else if (document.all){
                blk = eval('document.all.dthread'+ n);
        }
        img = eval('topicimg'+ n);
        if (blk.style.display == "none") {
                blk.style.display = "block";
                img.src = "/i/minus.gif";
        } else {
                blk.style.display = "none";
                img.src = "/i/plus.gif";
        }
}
function ChangeValue (id) {
	document.getElementById('full_' + id).style.display = 'none';
	if (document.getElementById('anounce_' + id)) document.getElementById('anounce_' + id).style.display = 'none';
	document.getElementById('modify_' + id).style.display = 'block';
	document.getElementById('but_modify_' + id).style.display = 'none';
	return false;
}
function CancelValue (id) {
	document.getElementById('full_' + id).style.display = 'block';
	document.getElementById('modify_' + id).style.display = 'none';
	document.getElementById('but_modify_' + id).style.display = 'inline';
	return false;
}
function SubmitValue (id) {
	document.getElementById('full_' + id).style.display = 'block';
	document.getElementById('modify_' + id).style.display = 'none';
	document.getElementById('but_modify_' + id).style.display = 'inline';
	document.getElementById('full_' + id).innerHTML = document.getElementById('textarea_' + id).value;
	loadXMLDoc('/forum_new/submit.html?id=' + id + '&filled=Сохранить&message=' + document.getElementById('textarea_' + id).value);
	return false;
}
