$(document).ready(function(){
	$('.photo-nav').css('display','none'); // hides the nav initially
		
	$('ul.photo-gallery').addClass('gallery-standard'); // adds new class name to maintain degradability
	
	$('ul.photo-gallery').galleria({
		history   : false, // deactivates the history object for bookmarking, back-button etc.
		clickNext : false, // helper for making the image clickable. Let's not have that in this example.
		insert    : undefined, // the containing selector for our main image. 
							   // If not found or undefined galleria creates container
		onImage   : function(image, caption) {
						image.css('display','none').fadeIn(600);
						caption.css('display','none').fadeIn(600);
						$('.photo-nav').css('display','block'); 		
						}
	});
	var firstItem = $('ul.galleria li:first').addClass('active').find('img').addClass('selected');
	$.galleria.activate(firstItem.attr('src'));
	
	$('#prev-image').click(function(){
		$.galleria.prev();
		return false;
	});
	$('#next-image').click(function(){
		$.galleria.next();
		return false;
	});

});