function http_request(){
	if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}
var http = http_request();
function votar(ID, arriba, tipo){
	http = http_request();
	if(tipo == "m"){
		http.onreadystatechange = update_moderar;
		http.open("GET", "/puntos.php?ID=" + ID + "&v=" + arriba + "&tipo=" + tipo, true);
		http.send(null);
	}else{
		element = document.getElementById(tipo + arriba + ID);
		element.innerHTML = parseInt(element.innerHTML.split(">")[2]) + 1;
		http.open("GET", "/puntos.php?ID=" + ID + "&v=" + arriba + "&tipo=" + tipo, true);
		http.send(null);
		delete http;
	}
}
function update_moderar(){
	if(http.readyState == 4){
		if(http.status == 200){
			document.getElementById("moderar").innerHTML = http.responseText;
		}else{
			moderar();
		}
	}
}
function moderar(){
	http.onreadystatechange = update_moderar;
	http.open("GET", "/puntos.php?&tipo=m", true);
	http.send(null);
}
