var elementid;

function voteajax(ideaid,vote,cs)
{
  elementid="votebut"+ideaid.toString();
  xmlHttp=GetXmlHttpObject();
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open("GET","vote.asp?id="+ideaid.toString()+"&vote="+vote.toString()+"&cs="+cs.toString(),true);
  xmlHttp.send(null);
}

function GetXmlHttpObject()
{
var xmlHttp;
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;
}

function stateChanged() 
{ 
  if (xmlHttp.readyState==4)
  { 
	document.getElementById(elementid).innerHTML=xmlHttp.responseText;
  }
}
