
// Envia la petici�n ajax para realizar un voto.
function Votar(cod_receta, nota){

	if(cod_receta == undefined){
		alert("Error: se esperaba un código de receta");
		return;
	}

	if(nota == undefined){
		alert("Error: se esperaba una nota");
		return;
	}


	$.ajax({
		type: "GET",
		url: "votacion_ajax.php",
		data: "action=votar&cod_receta="+cod_receta+"&nota="+nota,
		success: function(msg){
			document.getElementById("votar_noticia_"+cod_receta).innerHTML = msg;
		}, 
		error: function(xho){
			document.getElementById("votar_receta_"+cod_receta).innerHTML = "Error:"+xho.responseText;
		}
	});
}
