function AddVotoDjs(id){
	$("#votar_"+id).attr('disabled',true);
	$("#votar_"+id).attr('value','espere...');
	$("#votard_"+id).attr('disabled',true);
	$("#votard_"+id).attr('value','espere...');
	$("#pol").ajaxSubmit({
		url: 'ajax_djs.php',
		type: 'POST',
		data: {id:id, add_voto_djs:true},
		dataType: 'json',
		error: function(){
			$("#votar_"+id).attr('disabled',false);
			$("#votar_"+id).attr('value','+ votar');
			$("#votard_"+id).attr('disabled',false);
			$("#votard_"+id).attr('value','+ votar');
			alert('No se pudo agregar el voto, por favor intente nuevamente en unos minutos.');
		},
		success: function (m) {
			if (m.error){
				$("#votar_"+id).hide();
				$("#votard_"+id).hide();
				alert("Ya ha votado a este Dj hoy");
			} else {
				$("#votar_"+id).hide();
				$("#votard_"+id).hide();
				DivVotoDjs(m, id);	
			}
		}
	});
}

function FormatDivVotoDjs(obj, id){
str='';
str+=		obj.img_rank;
str+='		<br />'+obj.data+' votos';
return str;
}

function DivVotoDjs(obj, id) {
	var cnt = FormatDivVotoDjs(obj, id);
	$("#div_"+id).fadeOut("slow", function(){
		$("#div_"+id).html(cnt).fadeIn("slow");
	});
	
	$("#ran_"+id).html('Ranking ('+obj.data+')');
	
	$("#img_"+id).fadeOut("slow", function(){
		$("#img_"+id).html(obj.img_rank);
		$("#img_"+id).fadeIn("slow");
	});
}
