var xmlHttp

function updatePoll(id,status,pol_value)
{ 
//var f=document.forms[0];
//alert(f.selected_poll.value);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="poll.jsp";
url=url+"?poll_id="+id+"&status="+status+"&pol_value="+pol_value;
//alert(url);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{
	
document.getElementById("loader").style.display = "block";
//alert(xmlHttp.readyState);
	if (xmlHttp.readyState==4)
	{ //alert(xmlHttp.statusText);
	document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	
	document.getElementById("loader").style.display = "none";
	}
}

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;
}

