var SocialAggregator = {
	
	initialize: function () {
		$('#social-aggregator').masonry({columnWidth: 93});
		$('#social-aggregator .item a').mouseenter (function () {
			$(this).find('.content, strong').stop(true, true);
			$(this).find('.content, strong').animate({opacity:0.5});
		});
		
		$('#social-aggregator .item a').mouseleave (function () {
			$(this).find('.content, strong').stop(true, true);
			$(this).find('.content, strong').animate({opacity:1});
		});
		
		$('#social-aggregator .item a strong').each (function () {
			var obj = $(this);
			if (obj.outerHeight() > 42) {
				var str = '';
				
				while (obj.outerHeight() > 42) {
					str = obj.text();
					var lastspace = str.lastIndexOf(' ');
					str = str.substr(0, lastspace);
					obj.text(str + "...");
				}
			}
			
			var y = Math.round((obj.parent().outerHeight() / 2 ) - (obj.outerHeight() / 2));
			//console.log (y);
			obj.css({top:y});
			
		});
		
	}
	
};
$(function () {
	SocialAggregator.initialize();
});
