


$(function() {

	var numberOfHomeItems = $('.recent-work-sample').size();
	var currentItem = 1;
	var newLocationTemp;
	var newLocation;
	
	$('a#right-button').click(function() {
		if(currentItem >= numberOfHomeItems - 2) {
			currentItem = 1;
			$('#recent-work-slider-inner').animate({"left":"0px"});
		} else {
			newLocationTemp = currentItem * 225;
			newLocation = newLocationTemp - newLocationTemp - newLocationTemp;
			$('#recent-work-slider-inner').animate({"left":newLocation});
			currentItem++;
		}
			return false;
	});
	
	$('a#left-button').click(function() {
		if(currentItem == 1) {
			currentItem = numberOfHomeItems - 2;
			newLocation = numberOfHomeItems*225;
			newLocation = newLocation - newLocation - newLocation + 225 + 225 + 225;
			$('#recent-work-slider-inner').animate({"left":newLocation});
		} else {
			newLocationTemp = currentItem * 225 - 450;
			newLocation = newLocationTemp - newLocationTemp - newLocationTemp;
			$('#recent-work-slider-inner').animate({"left":newLocation});
			currentItem--;
		}
			return false;
	});



	var thisImage;
	$('#work-sample #thumbnails a').click(function() {
		thisImage = $(this).find('img').attr("src");
		$(this).parent('#thumbnails').parent('#work-sample').find('.mainImage').attr("src",thisImage);
		return false;
	});
	
	$('.gallery1 a').lightBox();
	$('.gallery2 a').lightBox();
	$('.gallery3 a').lightBox();
	$('.gallery4 a').lightBox();
	$('.gallery5 a').lightBox();
	$('.gallery6 a').lightBox();
	$('.gallery7 a').lightBox();
	$('.gallery8 a').lightBox();
	$('.gallery9 a').lightBox();
	$('.gallery10 a').lightBox();
	$('.gallery11 a').lightBox();
	$('.gallery12 a').lightBox();
	$('.gallery13 a').lightBox();
	$('.gallery14 a').lightBox();
	$('.gallery15 a').lightBox();
	
	
	
	$('#large-thumbnails a').click(function() {
		thisImage = $(this).attr("href");
		$(this).parent('#large-thumbnails').parent('#work-sample').find('#main-image').find('.mainImage').attr("src",thisImage);
		return false;
	});
	


});



























