function getXhr(){var xhr=null;if(window.XMLHttpRequest)
xhr=new XMLHttpRequest();else if(window.ActiveXObject){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}}else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");xhr=false;}
return xhr}
function vote(postID,vote){var response='';var xhr=getXhr()
xhr.onreadystatechange=function(){if(xhr.readyState==4&&xhr.status==200){response=xhr.responseText;if(response=="SUCCESS"){updateVote(postID);}else{updateVote(postID);}}}
xhr.open("GET","/vote.php?ID="+postID+"&vote="+vote,true);xhr.send(null);}
function updateVote(postId){isIE=(document.all)
isNN6=(!isIE)&&(document.getElementById)
if(isIE)votes=document.all['vote_'+postId];if(isNN6)votes=document.getElementById('vote_'+postId);votes.innerHTML=eval(votes.innerHTML)+1;}
function cOut(link){var response='';var xhr=getXhr()
xhr.open("GET","/cout.php?link="+link,true);xhr.send(null);}
