function delete_post(post_id)
{
	$.ajax({
		type: "POST",
		url: "/clubs_ajax/delete_post/",
		data: {
			post_id: post_id
		},
		success: function()
		{
			$('#post-'+post_id).fadeOut('slow');
		},
		error: function(e, m)
		{
			alert('Oh dear. '+e+' '+m+'\r\rRefresh and try again!')
		}
	});
}
function new_post(club_id)
{
	$('#newpost').fadeTo('fast',0.5);
	var newpostbody = $('#newpostbody').attr('value');
	$.ajax({
		type: "POST",
		url: "/clubs_ajax/post/",
		data: {
			newpostbody: newpostbody,
			club_id: club_id
		},
		dataType: "html",
		success: function(newpost)
		{
			$('#posts').prepend(newpost);
			$('#newpost').fadeTo('fast',1);
			$('#newpostbody').attr('value','');
		},
		error: function(e, m)
		{
			alert('Oh dear. '+e+' '+m+'\r\rRefresh and try again!')
		}
	});
}
function show_more(club_id, from)
{
	$('#show-'+from).fadeTo('fast',0.5);
	$.ajax({
		type: "POST",
		url: "/clubs_ajax/show_more/",
		data: {
			club_id: club_id,
			from: from
		},
		dataType: "html",
		success: function(more)
		{
			$('#posts').append(more);
			$('#show-'+from).hide();
		},
		error: function(e, m)
		{
			alert('Oh dear. '+e+' '+m+'\r\rRefresh and try again!')
		}
	});
}
