$(function () {

	// Display messages for reached goals on mouseover
	$('.collection-meter.has-messages').each(function () {
		var meter = $(this),
		    targets = $('<div class="targets"></div>'),
		    bars = meter.find('.bar.part');
		meter.append(targets);
		bars.each(function () {
			var $this = $(this), target = $('<a href="#"></a>');
			target.css({
				width: $this.width(),
				height: $this.height()
			});
			target.mouseover(function () {
				meter.find('.bar-message').hide();
				$this.find('.bar-message').show();
			});
			targets.append(target);
		});
	});

});
