function vote_post(id) {
	new Ajax.Request(
		'/controls/vote_post.php',
		{
			method:'post',
			parameters: $('vote_post_'+id).serialize(true),
		    onSuccess: function(ajax) {
	    		var response = ajax.responseText || false;
	    		if (response) {
	    			$('vote_box_'+id).innerHTML=response;
					$('vote_post_'+id).btVotar.value="Votado";
		    		$('vote_post_'+id).btVotar.disabled=true;
		    	}
	    	}
	    }
	);
}

function comment_post(id) {
	new Ajax.Request(
		'/controls/comment_post.php',
		{
			method:'post',
			parameters: $('enviar_comentario').serialize(true),
		    onSuccess: function(ajax) {
	    		var response = ajax.responseText || false;
	    		if (response) $('comment_form').innerHTML=response;
	    		update_comments(id);
	    	}
	    }
	);
}

function update_comments(id) {
	new Ajax.Updater(
		'comments',
		'/controls/update_comments.php',
		{
			method:'get',
			parameters:'id='+id
	    }
	);
}

function send_history() {
	new Ajax.Request(
		'/controls/send_history.php',
		{
			method:'post',
			parameters: $('enviar_historia').serialize(true),
		    onSuccess: function(ajax) {
	    		var response = ajax.responseText || false;
	    		if (response) $('comment_form').innerHTML=response;
	    	}
	    }
	);
}