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 voteit(id, voter, value)
{
  if (xmlhttp)
  {
    url = "voteit.php";
    var content = "id=" + id + "&voter=" + voter + "&value=" + value;
    
    myxmlhttp[id] = new myXMLHttpRequest();
    if (myxmlhttp)
    {
      myxmlhttp[id].open ("POST", url, true);
      myxmlhttp[id].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');

      myxmlhttp[id].send(content);
      errormatch = new RegExp ("^ERROR:");

      myxmlhttp[id].onreadystatechange = function () {
        if (myxmlhttp[id].readyState == 4) {
          mnmString[id] = myxmlhttp[id].responseText;
          if (mnmString[id].match(errormatch)) {
            changemnmvalues(id, true);
          } else {
            changemnmvalues(id, false);
          }
        }
      }
    }
  }
}
*/

function changemnmvalues(id, error)
{
	split = new RegExp ("~--~");
	b = mnmString[id].split (split);
	target1 = document.getElementById ('mnms-' + id);
	if (error) {
		return false;
	}
	if (b.length < 3) {
    return false;
	}
	target1.className = "star-rating-noh";
  target1.innerHTML = b[2];
}
