var xmlhttp;
function showPoll(pollid, lang)
{



xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="/poll.jsp";
url=url+"?pollid="+pollid;
url=url+"&lang="+lang;

url=url+"&sid="+Math.random();
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.send(null);
}


function processPollServlet(theForm)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  //alert(theForm.elements["concerns"].value);
 
var url="/servlet.pollProcess";
url=url+"?pollid="+theForm.elements["pollid"].value;
url=url+"&lang="+theForm.elements["lang"].value;
url=url+"&concerns="+theForm.elements["concerns"].value;
url=url+"&sid="+Math.random();
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.send(null);
}


function stateChanged()
{
    if (xmlhttp.readyState==4)
    {
        if(xmlhttp.status==200)
        {
            document.getElementById("pollArea").innerHTML=xmlhttp.responseText;
        }
        else
        {
            document.getElementById("pollArea").innerHTML="Error: " + xmlhttp.status + ":" + xmlhttp.statusText;
        }
    }
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;

}
