$(document).ready(function()
	{
		var current = 1;
		var total = $('.entry').length;
		$('.entry').hide();
		$('#pic1').fadeIn('slow');
		$('#imageNumber').html('1 of ' + total );
		$('div.first').click(function()
		{
			var prev  = 1;
			if (current != 1)
			{
				$('#pic' + current).hide();
				$('#pic' + prev).fadeIn('slow');
				current = 1;
				$('#imageNumber').html(current + ' of ' + total)
			}
			return false;
		});


		$('div.previous').click(function()
		{
			var prev  = current - 1;
			if (prev < 1) prev = 1;
			if (current != 1)
			{
				$('#pic' + current).hide();
				$('#pic' + prev).fadeIn('slow');
				current = prev;
				$('#imageNumber').html(current + ' of ' + total)
			}
			return false;
		});

		$('div.next').click(function()
		{
			var next = current + 1;
			if (next > total) next = total;
			if (current != total)
			{
				$('#pic' + current).hide();
				$('#pic' + next).fadeIn('slow');
				current = next;
				$('#imageNumber').html(current + ' of ' + total)
			}
			return false;
		});

		$('div.last').click(function()
		{
			var next  = total;
			if (current != total)
			{
				$('#pic' + current).hide();
				$('#pic' + next).fadeIn('slow');
				current = total;
				$('#imageNumber').html(current + ' of ' + total)
			}
			return false;
		});
	});