
//jQuery(function($) {
		
	var animating = false;
	var position = 0;
	
	 $(".gallery .up").css('display', 'block').bind("click", function(e){
		  var gallery = $('.galleryWrapper', this.parentNode);
		  var galleryItems = $('.galleryItemWrapper', gallery.get(0));
	  
		  position -= 12;
		  
		  if(position < 0)
			 position = 0;
			 
		  gallery.scrollTo(galleryItems.eq(position), 500);
	});
	 
	 $(".gallery .down").css('display', 'block').bind("click", function(e){
		  var gallery = $('.galleryWrapper', this.parentNode);
		  var galleryItems = $('.galleryItemWrapper', gallery.get(0));
		 
		  position += 12;
		  
		  //If we scroll to anything within the bottom 10 (since this is the miniumum for 3 columns that requires 4 rows, we animate to the top of this 'stack'
		  if(position >= galleryItems.size() -10)
			position = galleryItems.size() - 10;
			
		  animating = true;
		  gallery.scrollTo(galleryItems.eq(position), 500);
	});
//});