function deleteStatus(bid)
{
	$.get("deletestatus.php",{id:bid,ajax:1},function(data)
	{
		$('#status'+bid).remove();
		
		$('#statusresults').hide();
		$('#statusresults').html(data);
		$('#statusresults').fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).slideUp(2000);
	});
}
function deleteComment(cid)
{
	$.get("selfdelete.php",{commentid:cid,ajax:1},function(data)
	{
		$('#comment'+cid).fadeOut(1000);
		
		$('#commentresults span').html(data);
		$('#commentresults span').fadeOut(500).fadeIn(500).fadeOut(300);
	});
}
function loadComments(uid)
{
	$.get("loadcomments.php",{id:uid},function(data)
	{
		$(".loadcomments").html('<img src="images/ajax-loader.gif" alt="Loading..." />');
		$('#commentssection').html(data);
		setTimeout(function(){$(".loadcomments").html('Load older comments');},2000);
	});
}
function limitChars(textid, limit, infodiv)
{
	var text = $('#'+textid).val(); 
	var textlength = text.length;
	if(textlength > limit)
	{
		$('#' + infodiv).html('0 characters remaining.');
		$('#'+textid).val(text.substr(0,limit));
		return false;
	}
	else
	{
		$('#' + infodiv).html((limit - textlength) +' characters remaining.');
		return true;
	}	
}
