/* @author john@line.uk.com */
(function ($) {
	var LOW_OPACITY = 0.8;

	$(function () {
		$('.map_wrapper').each(function () {
			$('.map_toggle', this).each(function () {
				var toggle = $(this);
				var target = $(toggle.attr('href'));

				toggle.parent().css('opacity', LOW_OPACITY);
				target.hide();

				toggle.click(function () {
					if (target.css('display') == 'none') {
						toggle.parent().css('opacity', 1);
						target.fadeIn();
					} else {
						toggle.parent().css('opacity', LOW_OPACITY);
						target.fadeOut();
					}
					return false;
				});
			});
		});
	});
})(jQuery);
