
function vota(id_cancion,puntuacion){
	ret = $.get("/ajax/index.html",{'id_cancion':id_cancion,'puntuacion': puntuacion},null);

	var celda = document.getElementById("pelotas_"+id_cancion);
	var textoVota;
	var votar;
	
	for(i=0; i<celda.childNodes.length; i++)
	{
		if(celda.childNodes[i].className == "txt_votar")
			textoVota = celda.childNodes[i];
                if(celda.childNodes[i].className == "votar")
                        votar = celda.childNodes[i];

	}

	textoVota.firstChild.nodeValue = "Tu voto ha sido enviado";

	celda.removeChild(votar);
}

function refreshVotaciones(data){
	obj = undefined;
	resultado = eval(data);
 	id_cancion = resultado[0].id_cancion;
 	estrellas = resultado[0].estrellas;
 	
	for(i=1;i<=5;i++){
 		obj = document.getElementById('img_'+id_cancion+i);
 		if(i<=estrellas){
 			obj.src="/img/ico_voto_punto.gif";
 		}else{
 			obj.src="/img/ico_voto.gif";
 		}
 	}
}
