function addupdate()
{
	$('#addupdate').hide();
	$('#addupdateform').show();
}
function addupdateclose()
{
	$('#addupdate').show();
	$('#addupdateform').hide();
}
function postupdate(clubid)
{
	$('#addupdateform').hide();
	$.ajax({
		type: "POST",
		url: "/clubs/update/",
		data: {body: $('#newupdate').val(), club_id: clubid},
		dataType: "html",
		success: function(newupdate)
		{
			$('#updatestop').after(newupdate);
			$('#addupdate').show();
			$('#newupdate').val('');
		},
		error: function(e, m)
		{
			$('#addupdateform').show();
		}
	});
}
function postboard(clubid)
{
	$('#newpost').hide();
	$.ajax({
		type: "POST",
		url: "/clubs/post/",
		data: {body: $('#post').val(), club_id: clubid},
		dataType: "html",
		success: function(newpost)
		{
			$('#boardtop').after(newpost);
			$('#newpost').show();
			$('#post').val('');
		},
		error: function(e, m)
		{
			$('#newpost').show();
		}
	});
}
function deletepost(postid)
{
	$.ajax({
		type: "POST",
		url: "/clubs/deletepost",
		data: {post_id: postid},
		success: function()
		{
			$('#post'+postid).fadeOut('slow');
		},
		error: function(e, m)
		{
			$('#post').val(m);
		}
	});
}
