function getXMLHTTPRequest() 
{
var req = false;
try 
  {
   req = new XMLHttpRequest(); /* e.g. Firefox */
  } 
catch(err1) 
  {
  try 
    {
     req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
    } 
  catch(err2) 
    {
    try 
      {
       req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
      } 
      catch(err3) 
        {
         req = false;
        } 
    } 
  }
return req;
}

var myRequest = getXMLHTTPRequest();

function callAjax(whichtype, whichvote) {

var whichtypetovote = whichtype;
var whichitemtovote = whichvote;
var url = "/voting/vote/" + whichtypetovote + "/" + whichitemtovote + "/";
myRequest. open("GET", url, true);
myRequest.onreadystatechange = responseAjax(whichitemtovote);
myRequest.send(null);
}


function responseAjax(whichvoted) {
	//var plusshow = "showplus" + whichvoted;
	//var checkshow = "showcheck" + whichvoted;
	//alert("showplus"+whichvoted);
	document.getElementById("showplus"+whichvoted).style.display = 'none';
	document.getElementById("showcheck"+whichvoted).style.display = 'block';

}

