$(document).ready(function() {
	
	$('#portfolioCategoryItems a.itemLink').livequery( function(){
		$(this).click( function() {
			url = $(this).attr('href');
			$('#imgLoadingTiny').clone().addClass('loadingImage').appendTo($(this).parents('.item'));
			$('#portfolioItem').load(url,function() {
				$('.loadingImage').remove();
				//$('#portfolioCategoryItems').jScrollPane({showArrows:true});
			});
			return false;
		});
	});
	
	$('#portfolioCategoryItems').jScrollPane({showArrows:true});
	
	$('#portfolioSort a.sortLink').livequery( function(){
		$(this).click(function(){
			url = $(this).attr('href');
			//$('#imgLoadingTiny').clone().addClass('loadingImage').appendTo($(this).parents('#portfolioSort'));
			$('#portfolioSort').html($('#imgLoadingTiny').clone());
			$('#portfolioCategoryItems').load(url,function() {
				$('.loadingImage').remove();
				$('#portfolioCategoryItems').jScrollPane({showArrows:true});
			});
			return false;
		});
	});

	
});
