function createXMLHttpRequest(){var xmlhttp=null;try{xmlhttp=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Your browser does not support the XMLHttpRequest Object!")}return xmlhttp}var xhr=createXMLHttpRequest();function karma(id,action,path){xhr.open('get','http\://'+path+'ck-processkarma.php?id='+id+'&action='+action+'&path='+path);xhr.onreadystatechange=handleResponse;xhr.send(null)}function handleResponse(){if(xhr.readyState==4){var response=xhr.responseText.split('|');if(response[0]=='done'){if(response[1]){document.getElementById("down-"+response[1]).src="http://"+response[3]+'images/gray_down.png';document.getElementById("down-"+response[1]).onclick='';document.getElementById("up-"+response[1]).src="http://"+response[3]+'images/gray_up.png';document.getElementById("up-"+response[1]).onclick='';if(!response[2]){alert("Response has no value")}var karmanumber=response[2];document.getElementById("karma-"+response[1]+"-"+response[4]).innerHTML=karmanumber}else{alert("WTF ?")}}else if(response[0]=='error'){var error='Error: '+response[1];alert(error)}else{alert("Reponse: "+response[0]);alert("Karma not changed, please try again later.")}}}