$(function() {
	$('[control]').click(function() {
		var quantity = parseInt($(this).attr('control')),
			positive_momentum = quantity > 0,
			current_image = $('.workPost:visible:first'),
			start = 0;
			
		if(!positive_momentum)
			current_image = current_image.prev()
			
		if(positive_momentum && !$('.workPost:visible:eq(' + quantity + ')').size())
			return false;
		
		while(start < Math.abs(quantity)) {
			if(positive_momentum) {
				current_image.fadeOut();
				
				current_image = current_image.next();
			} else {
				current_image.fadeIn();
				
				current_image = current_image.prev();
			}
			
			if(!current_image.size()) {
				return false;
			}
				
			start++;
		}
		
		return false;
	});
});
