$(document).ready(function() {
	// clients filter scripps
	
	$clientsHolder = $('ul.portfolio_items'); // get original list
	$clientsClone = $clientsHolder.clone(); // clone it so it can be reverted back to
	
	$('.filter_portfolio a').click(function(e) {
		e.preventDefault(); // stop anchor tags from doing anything
		
		$filterClass = $(this).attr('class'); // gets class from clicked anchor
		
		$('.filter_portfolio li').removeClass('active'); // remove active class from all filter links
		$(this).parent().addClass('active'); // add active class to clicked link
		
		if($filterClass == 'all'){
			$filters = $clientsClone.find('li'); // get all li's from original cloned list and assign them to variable
		} else {
			$filters = $clientsClone.find('li[data-type~='+ $filterClass +']'); // get li's from ul.source with data-type containing $filterclass
		}
		
		$clientsHolder.quicksand($filters, {
			duration: 1000,
			easing: 'easeInOutQuint',
			adjustHeight: 'dynamic'
		}); // initiate quicksand fn
	});

	
});
