jQuery.noConflict();
jQuery(document).ready(function($){
//quicskand project categories filtering
	//see http://razorjack.net/quicksand/demos/one-set-clone.html
	// clone applications to get a second collection
	var $data = $(".portfolio-content .container").clone();	
	//note: only filter on the main portfolio page, not on the subcategory pages
	$('.quicksand-filter li').click(function(e) {
		$(".filter li").removeClass("current-cat");	
		//use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
		var filterClass=$(this).attr('class').split(' ').slice(-1)[0];
		
		if (filterClass == 'all-projects') {
			var $filteredData = $data.find('.project');
		} else {
			var $filteredData = $data.find('.project[data-type=' + filterClass + ']');
		}
		$(".portfolio-content .container").quicksand($filteredData, {
			duration: 800,
			easing: 'easeInOutQuad'
		}, function(){
				//callback function to re-apply hover effects on cloned elements
				setCaptions();
				setZoom();
		});		
		$(this).addClass("current-cat");			
		return false;
	});
});