(function($) {
$.fn.gallery_nav = function() { 
	var triggers = this;
	// for each element
	return this.each(function() {
		// event handling
	  	$(this).click(function(event) {
			var el = $(event.target);
			if (el.parent().hasClass('active')) { return false; }
			// remove the active class from all the elements less the clicked
			el.parent().siblings().removeClass('active');
			el.parent().addClass('active');
			// 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().focus().addClass('active');
			return false;
	   });
	});
};
})(jQuery);