 
function displayCustomerInfo1(sText,modes) {
sElem = document.getElementById(modes+"Comment");
sElem.innerHTML = sText;
}
   
  function com_edit(modes, ids) {
   var kod = document.getElementById(modes+"_com_kod").value;
   var messag = document.getElementById(modes+"_comment_message").value;
   var oXmlHttp = createXMLHttp();
   var params='mod='+modes+'&ids='+ids+'&messag='+messag+'&kod='+kod;
   oXmlHttp.open("POST","/"+modes+"_com_edit_ok.php",true);
   oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   oXmlHttp.onreadystatechange = function() {
    if(oXmlHttp.readyState == 4) {
     if(oXmlHttp.status == 200) {
      displayCustomerInfo1(oXmlHttp.responseText,modes);
     } else {
      displayCustomerInfo1("Ошибка: " + oXmlHttp.statusText);
     }
    }
   };
   oXmlHttp.send(params);
  }

function displayCustomerInfo2(sText) {
sElem = document.getElementById("Comment_del");
sElem.innerHTML = sText;
}

function com_del(modes, ids) {
if (confirm("Уверены, что хотите удалить выбранный комментарий?")) {
	var oXmlHttp = createXMLHttp();
	var params='mod='+modes+'&ids='+ids;
	if (modes=="news"){oXmlHttp.open("POST","/news_com_del_ok.php",true);}
	if (modes=="article"){oXmlHttp.open("POST","/article_com_del_ok.php",true);}
	if (modes=="foto"){oXmlHttp.open("POST","/foto_com_del_ok.php",true);}
	if (modes=="video"){oXmlHttp.open("POST","/video_com_del_ok.php",true);}
	if (modes=="blogs"){oXmlHttp.open("POST","/blogs_com_del_ok.php",true);}
	oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	oXmlHttp.onreadystatechange = function() {
	if(oXmlHttp.readyState == 4) {
	if(oXmlHttp.status == 200) {
	displayCustomerInfo2(oXmlHttp.responseText);
	} else {
	displayCustomerInfo2("Ошибка: " + oXmlHttp.statusText);
	}
	}
	};
	oXmlHttp.send(params);
}
}

function com_del_post(modes, ids) {
if (confirm("Уверены, что хотите удалить выбранный пост?")) {
	var oXmlHttp = createXMLHttp();
	var params='mod='+modes+'&ids='+ids;
	if (modes=="blogs"){oXmlHttp.open("POST","/blogs_com_del_post_ok.php",true);}
	oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	oXmlHttp.onreadystatechange = function() {
	if(oXmlHttp.readyState == 4) {
	if(oXmlHttp.status == 200) {
	displayCustomerInfo2(oXmlHttp.responseText);
	} else {
	displayCustomerInfo2("Ошибка: " + oXmlHttp.statusText);
	}
	}
	};
	oXmlHttp.send(params);
}
}
