var xmlHttp
var currentobj
var voteobj

//Javascript Function for JavaScript to communicate with Server-side scripts
function AJAXrequest(scriptURL) {
	xmlHttp=GetXmlHttpObject()
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
	xmlHttp.onreadystatechange=voteChanged;
	xmlHttp.open("GET",scriptURL,true);
	xmlHttp.send(null);
}

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;
}

function voteChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		var votedisp = document.getElementById('voteid' + currentobj);
		var votenodisp = document.getElementById('votes' + currentobj);
		var voteTitle = document.getElementById('title' + currentobj);
		var votedTitle = document.getElementById('votedTitle' + currentobj);
		var votenoUp = document.getElementById('postVoteCount');
		var votenoUpNum = document.getElementById('postVote' + currentobj);
		var voteno = xmlHttp.responseText;
	
		votenoUpNum.innerHTML = voteno;
		votenoUp.style.display = 'block';
		votedisp.innerHTML = '';
		voteTitle.style.display = 'none';
		votedisp.style.display = 'none';
		votedTitle.style.display = 'block';
		votenodisp.style.display = 'block';
	
	}
}

function vote_boose(articleID,voteID,userID,baseURL) {
	currentobj = voteID;
	var scripturl = baseURL+"/voteinterface.php?type=vote&tid=total&uid="+userID+"&pid="+articleID+"&auth="+Math.random();
	AJAXrequest(scripturl);
}