currentImage = 0;

function previousImage()
{
	var previousImage = currentImage - 1;
	
	if (previousImage < 0)
		previousImage = $('#gallery li:not(.arrow)').length - 1;
		
	goToImage(previousImage);
}


function nextImage()
{
	var nextImage = currentImage + 1;

	if (nextImage > $('#gallery li:not(.arrow)').length - 1)
		nextImage = 0;
	
	goToImage(nextImage);
}

function goToImage(imageNo)
{
	$('#gallery li:not(.arrow):eq('+currentImage+')').fadeOut(700);

	$('#gallery li:not(.arrow):eq('+imageNo+')').fadeIn(700);
	
	currentImage = imageNo;
}
