
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 (user, id, htmlid, md5, votes)
{
		url = "/menealo.php";
		var content = "id=" + id + "&user=" + user + "&md5=" + md5 + "&votes=" + votes;
		anonymous_vote = true;
        if (anonymous_vote == false && user == '0') {
            window.location="http://www.onflysoft.com/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, false);

    				}
    			}
    		}
    	}
}



function changemnmvalues (id, error)
{
	split = new RegExp ("~--~");
	b = mnmString[id].split (split);
	target1 = document.getElementById ('mnms-' + id);
	if (b.length <= 3) {
		target1.innerHTML = b[0];
		target1.style.background = 'transparent url(http://www.onflysoft.com/templates/digitalnature/images/vote-active.gif) no-repeat left top';
	}
	target2 = document.getElementById ('link-' + id);
	target2.href = '#';
	return false;
}
