function $(t) { // Alias para document.getElementById
	return document.getElementById(t);
}
	
function votacion_post(post_id,voto){
	var contenedor = $("div_post_"+post_id); 
	var ajax=nuevoAjax();
	ajax.open("POST","ajax.php?post="+post_id+"&opcion="+voto,true); 
	ajax.onreadystatechange=function() { 
	if (ajax.readyState==4) { 
		contenedor.innerHTML = ajax.responseText;
		} 
	} 
	ajax.send(null);
}

function votacion_pregunta(pregunta_id,voto){
	var contenedor = $("div_pregunta"); 
	var ajax=nuevoAjax();
	ajax.open("POST","ajax.php?pregunta="+pregunta_id+"&opcion="+voto,true); 
	ajax.onreadystatechange=function() { 
	if (ajax.readyState==4) { 
		contenedor.innerHTML = ajax.responseText;
		} 
	} 
	ajax.send(null);
}

function enviar_comentario(id_post){
	var contenedor = $("div_formulario"); 
	var nombre = $("tunombre").value; 
	var comentario = $("comentario").value;
	var ajax=nuevoAjax();
	ajax.open("POST","ajax.php?id_post="+id_post+"&nombre="+nombre+"&comentario="+comentario,true); 
	ajax.onreadystatechange=function() { 
	if (ajax.readyState==4) { 
		contenedor.innerHTML = ajax.responseText;
		} 
	} 
	ajax.send(null);
	return false;
}