jQuery(document).ready(function() {
	if ($('.m-body').length > 0) {
		init_moblog_entries();
	}
});

/* ***************************************************************************************************************************
	Moblog Entries
*/
function init_moblog_entries() {
	jQuery('.m-body .m-entry').each( function (i) {
		
		text_el = $(this).find('.m-entry-text');
		hover_el = $(this).find('.m-entry-hover')
		
		create_mesh(hover_el, text_el);
		
		$(this).mouseover(function(){
			$(this).addClass('active');
    }).mouseout(function(){
			$(this).removeClass('active');
    });
	});
}

function create_mesh(hover_el, text_el) {
	var htmlStr = $(text_el).html();
	
	cat_el = $(hover_el).find('.m-categories');
	
	if (htmlStr == null) {
	} else {
		$(hover_el).prepend('<div class="m-entry-text">'+ htmlStr +'</div>');
	}
	$(text_el).remove();
}

