var xmlHttp

function ProcessVote(id,vote)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/include/ajax/process_vote.php";
url=url+"?id="+id+"&vote="+vote;
url=url+"&sid="+Math.random();
target='txtVote'+id;
selectbox='selRate'+id;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=ProcessVoteStateChanged(target,selectbox);
xmlHttp.send(null);
}


function ProcessVoteStateChanged(target,selectbox) 
{ 
//alert(xmlHttp.responseText);
if (xmlHttp.readyState==4)
{ 
//alert(target);
//alert(xmlHttp.responseText); 
document.getElementById(target).innerHTML=xmlHttp.responseText;

}
//document.getElementById(target).innerHTML="Thanks for Voting";
document.getElementById(selectbox).disabled=true;
//document.getElementById(target).innerHTML="";
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

