
var xmlHttp
var currentobj
var voteobj
var aftervotetext
var gpostid
function function_exists(function_name){if(typeof function_name=='string'){return(typeof window[function_name]=='function');}else{return(function_name instanceof Function);}}
function lg_AJAXrequest(scriptURL){xmlHttp=zGetXmlHttpObject()
if(xmlHttp==null)
{alert("Your browser does not support AJAX!");return;}
xmlHttp.onreadystatechange=zvoteChanged;xmlHttp.open("GET",scriptURL,true);xmlHttp.send(null);}
function zGetXmlHttpObject()
{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 zvoteChanged()
{if(xmlHttp.readyState==4)
{var votedisp=document.getElementById('voteid'+currentobj);var votenodisp=document.getElementById('votes'+currentobj);var voteno=xmlHttp.responseText;currentobj_obj=document.getElementById(currentobj);voteobj_obj=document.getElementById(voteobj);votewidgetobj_obj=currentobj_obj.parentNode;votebuttonobj_obj=voteobj_obj.parentNode;currentobj_obj.innerHTML=voteno;voteobj_obj.innerHTML=aftervotetext;if(aftervotetext==''){votebuttonobj_obj.style.display='none';votewidgetobj_obj.setAttribute("class","post_votewidget_closed");votewidgetobj_obj.setAttribute("className","post_votewidget_closed");}}}
function vote(obj,votelinkobj,aftervote,postID,userID,baseURL){currentobj=obj;voteobj=votelinkobj;gpostid=postID;aftervotetext=aftervote;var scripturl=baseURL+"/voteinterface.php?type=vote&tid=total&uid="+userID+"&pid="+postID+"&auth="+Math.random();lg_AJAXrequest(scripturl);}
function sink(obj,votelinkobj,aftervote,postID,userID,baseURL){currentobj=obj;voteobj=votelinkobj;aftervotetext=aftervote;var scripturl=baseURL+"/voteinterface.php?type=sink&tid=total&uid="+userID+"&pid="+postID+"&auth="+Math.random();lg_AJAXrequest(scripturl);}
