$(document).ready(function(){
	var imgWrapper = $('#project-piece li');
	var imgNav = $('ul#project-nav li a');
	imgNav.filter(':first').addClass('current');
	// only show the first image, hide the rest
	imgWrapper.hide().filter(':first').show();
			
	$(imgNav).click(function () {
			
	// check if this item doesn't have class "current"
	// if it has class "current" it must not execute the script again
	if (this.className.indexOf('current') == -1){
		imgWrapper.hide().fadeOut('slow');
		imgWrapper.filter(this.hash).fadeIn('slow');
		$(imgNav).removeClass('current');
		$(this).addClass('current');
		}
		return false;
	});
});
