$(document).ready(function() {

	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#work li.hidden').removeClass('hidden').animate({
   				width: '80px',
   				opacity: '1',
  				}, 1000, function() {
  				  // Animation complete.
 				 }); 
			

		} else {
			
			$('ul#work li').each(function() {
				
			if(!$(this).hasClass(filterVal)) {
					
			$(this).addClass('hidden').animate({
    				width: '0px',
    				   				opacity: '0.3',
  				}, 1000, function() {
    				// Animation complete.
  				});
 
		} else {
			$(this).removeClass('hidden').animate({
    			width: '80px',
   			color: '#ffffff',
                        opacity: '1',
                        }, 1000, function() {
                         // Animation complete.
  			}); 

	
			}

		});

	}
		
	return false;
	});
});

