
var xmlhttp

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
  try {
	xmlhttp = new XMLHttpRequest ();
  }
  catch (e) {
  xmlhttp = false}
}

function myXMLHttpRequest ()
{
  var xmlhttplocal;
  try {
  	xmlhttplocal = new ActiveXObject ("Msxml2.XMLHTTP")}
  catch (e) {
	try {
	xmlhttplocal = new ActiveXObject ("Microsoft.XMLHTTP")}
	catch (E) {
	  xmlhttplocal = false;
	}
  }
  

  if (!xmlhttplocal && typeof XMLHttpRequest != 'undefined') {
	try {
	  var xmlhttplocal = new XMLHttpRequest ();
	}
	catch (e) {
	  var xmlhttplocal = false;
	}
  }
  
  return (xmlhttplocal);
}

var mnmxmlhttp = Array ();
var mnmString = Array ();
var mnmPrevColor = Array ();
var responsestring = Array ();
var myxmlhttp = Array ();
var responseString = new String;


function menealo (htmlid, link_id, link_votes, link_category, link_blog, key)
{
		url = "http://www.livepress.ru/menealo.php";
		var content = "id=" + link_id + "&votes=" + link_votes + "&category=" + link_category + "&blog=" + link_blog + "&key=" + key;
		anonymous_vote = true;
        if (anonymous_vote == false && user == '0') {
            window.location="http://www.livepress.ru/login.php?return="+location.href;
        } else {
    		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
    		if (mnmxmlhttp) {
    			mnmxmlhttp[htmlid].open ("POST", url, true);
    			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type',
    					   'application/x-www-form-urlencoded');
    
    			mnmxmlhttp[htmlid].send (content);
    			errormatch = new RegExp ("^ERROR:");
    
    			mnmxmlhttp[htmlid].onreadystatechange = function () {
    				if (mnmxmlhttp[htmlid].readyState == 4) {
    					mnmString[htmlid] = mnmxmlhttp[htmlid].responseText;
						changemnmvalues (htmlid);
    				}
    			}
    		}
    	}
}



function changemnmvalues (id)
{
split = new RegExp ("~--~");
b = mnmString[id].split (split);
target1 = document.getElementById ('mnms-' + id);
target1.innerHTML = b[0];
	
	for (i=1; i<=10; i=i+1) 
	{
    target = document.getElementById ('link-' + i);
	y = target.onclick;
	target.onclick = '#';
   	}
	
return false;
}
