var vote_xmlHttp
function vote(item,table) 
{
vote_xmlHttp=GetXmlHttpObject()

   if (vote_xmlHttp==null)
   {
      alert ("Browser does not support HTTP Request")
      return
   }

Gitem=item;
var email = document.getElementById('email'+Gitem).value;

   var vote_url = 'ajax/vote.php';
   var vote_params = "table="+table+"&item="+item+"&email="+email;

 if (!email.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/)) {
   alert('Please enter a valid E-mail address.');
   document.getElementById('email'+Gitem).focus();
 }else{
   vote_xmlHttp.open("POST", vote_url, true);
   vote_xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   vote_xmlHttp.setRequestHeader("Content-length", vote_params.length);
   vote_xmlHttp.setRequestHeader("Connection", "close");
   vote_xmlHttp.onreadystatechange = vote_statechange;
   vote_xmlHttp.send(vote_params);
  }
}
function vote_statechange() 
{
    if (vote_xmlHttp.readyState==4 && vote_xmlHttp.status == 200)
    { 
        document.getElementById('voteBubble'+Gitem).innerHTML= vote_xmlHttp.responseText;
    } 
}

