
var xmlHttp
var currentobj
var voteobj
var votedisptype
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
{xmlHttp=new XMLHttpRequest();}
catch(e)
{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 voteno=xmlHttp.responseText;switch(votedisptype){case'bar':votenodisp.style.width=voteno;votedisp.innerHTML='';break;case'ticker':votenodisp.innerHTML=voteno;votedisp.innerHTML='';votedisp.style.display='none';break;}}}
function vote_link_com(votelinkID,voteID,userID,baseURL){}
function vote_ticker(articleID,voteID,userID,baseURL){votedisptype='ticker';currentobj=voteID;var scripturl=baseURL+"/voteinterface.php?type=vote&tid=total&uid="+userID+"&pid="+articleID+"&auth="+Math.random();AJAXrequest(scripturl);}
function sink_ticker(articleID,voteID,userID,baseURL){votedisptype='ticker';currentobj=voteID;var scripturl=baseURL+"/voteinterface.php?type=sink&tid=total&uid="+userID+"&pid="+articleID+"&auth="+Math.random();AJAXrequest(scripturl);}
function vote(articleID,voteID,userID,baseURL){votedisptype='bar';currentobj=voteID;var scripturl=baseURL+"/voteinterface.php?type=vote&uid="+userID+"&pid="+articleID+"&auth="+Math.random();AJAXrequest(scripturl);}
function sink(articleID,voteID,userID,baseURL){votedisptype='bar';currentobj=voteID;var scripturl=baseURL+"/voteinterface.php?type=sink&uid="+userID+"&pid="+articleID+"&auth="+Math.random();AJAXrequest(scripturl);}
