// Does the first action by showing microblogentries
$(document).ready(function() 
{
	if (usrId) 
	{
		blgUpdateMicroBlog(usrId);
	}
});

// Adds a new entry into DB and shows entries on page
function blgUpdateMicroBlog(usrId, action, mcbId) 
{
	var text = $('#microBloggingText').val();
	var container = getById('microBlogEntry_container');
	
	$.getJSON(pathPrefix + '/Ajax/blgUpdateMicroBlog' + sid2, {
		text: text,
		usrId: usrId,
		mcbId: mcbId,
		action: action
	}, function(data) {
		$('#microBlogLastUpdate').html('(' + data['date'] + ')');
		$('#microBlogEntry_container').html(data['tpl']);
	});
}
