(function($) {
$.fn.static_nav = function() { 
	var triggers = this;
	// for each element
	return this.each(function() {
		// event handling
	  	$(this).click(function(event) {
			var el = $(event.target);
			if (el.hasClass('open')) { return false; }
			// remove the active class from all the elements less the clicked
			$('#viewer .static.open').removeClass('open');
			// remove the active class from the gallery nav
			$('.gallery_nav .active').removeClass('active');
			el.addClass('open');
			// hide any open static sections
			$('#viewer .static.active').hide();
			// hide any open albums
			$('ul.album_nav.active').hide().blur().removeClass('active');
			// show the new album
			$(el.attr('href')).show().addClass('active');
			return false;
	   });
	});
};
})(jQuery);