$(document).ready(function(){
	$('#portfolio-menu a').click(function (){
		// get the filter string
		var filter = $(this).text();
		
		// 
		if(filter != 'All')
		{
			// reset everything so it's shown
			$('#portfolio-list li').show();	
			// create jquery selector withthe filter
			var hideEveryThingButThis = '#portfolio-list :not(li.'+filter.toLowerCase()+')';		
			// hide everything but what we filter out
			$(hideEveryThingButThis).hide();
			// show the stuff in the LI that was hidden by the previous command
			$('#portfolio-list :not(li:hidden) *').show();
			// get rid of the alternate class
			$('#portfolio-list li').removeClass('alternate');
			// add the alternate class back on to the odd items that are shown
			$('#portfolio-list li:not(:hidden):odd').addClass('alternate');
		}
		else
		{
			// reset everything so it's shown
			$('#portfolio-list li').show();	
			$('#portfolio-list li *').show();
			// get rid of the alternate class
			$('#portfolio-list li').removeClass('alternate');
			// add the alternate class back on to the odd items that are shown
			$('#portfolio-list li:odd').addClass('alternate');
		}
	});
	
	
	// Lightbox
	$('#gallery a').lightBox({fixedNavigation:true});

	// show categories and archives
	$('#menu-item-421 a').click(function(){
		//hide all menus
		$('.hidden-menu').hide();
		$('#categories.hidden-menu').show();
	})
	$('#menu-item-422 a').click(function(){
		//hide all menus
		$('.hidden-menu').hide();
		$('#archive.hidden-menu').show(); 
	})
});

