var xmlHttp;
function createXMLHttpRequest() 
 {
    if (window.ActiveXObject) 
    {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) 
    {
        xmlHttp = new XMLHttpRequest();
    }
}
var blockid;
function votePoll(record_id,vote,block_id)
{
 var submitURL = ''
 + '/polls/polls.php?'
 + 'id='   + record_id
 + '&vote=' + vote ;

 blockid = block_id; 
 isRatingsBarChanged = true;
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = handlePollStateChange;
  xmlHttp.open("GET", submitURL, true);
  xmlHttp.send(null);
}

function handlePollStateChange() {
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			var serverResponse = xmlHttp.responseText;
//			document.getElementById(blockid).innerHTML	= '<br><br>Thank you for voting!<br><br>';
			document.getElementById(blockid).innerHTML	= serverResponse;
//			alert("Thank you for reporting");
//		} else {
//			alert("Error in AJAX "+xmlHttp.status);
		}
	}
	return true;
}
