function showmore(event_id)
{
	$('#event-'+event_id+'-more').slideDown('slow');
	$('#event-'+event_id+'-showmore').hide();
	$('#event-'+event_id+'-showless').show();
}
function showless(event_id)
{
	$('#event-'+event_id+'-more').slideUp('slow');
	$('#event-'+event_id+'-showless').hide();
	$('#event-'+event_id+'-showmore').show();
}

function postcomment(eventid)
{
	$('#addcomment-'+eventid).hide();
	$.ajax({
		type: "POST",
		url: "/events/newcomment",
		data: {body: $('#newcomment-textarea-'+eventid).val(), event_id: eventid},
		dataType: "html",
		success: function(newcomment)
		{
			$('#commentsbottom-'+eventid).before(newcomment);
			$('#addcomment-'+eventid).show();
			$('#newcomment-textarea-'+eventid).val('');
		},
		error: function(e, m)
		{
			$('#addcomment'+eventid).show();
			alert('Sorry, an error occurred!'+e)
		}
	});
}
function delete_post(commentid)
{
	$.ajax({
		type: "POST",
		url: "/events/deletecomment",
		data: {comment_id: commentid},
		success: function()
		{
			$('#post-'+commentid).fadeOut('slow');
		},
		error: function(e, m)
		{
			alert('Error! '+m);
		}
	});
}