$( function(){
	        
	$('#nieuwsFotos').galleria({
				
	        insert: '#foto',
	        
	        history: false,
	        
	        clickNext : false,
	
	        onImage: function(image, caption, thumb) {        

          	  image.hide().fadeIn(500);
	            
	            $('#foto').trigger('image-loaded');
	        },
	        
	        onThumb: function(thumb)
			{
				
	            var $li = thumb.parent(),
	                opacity = $li.is('.active') ? 1 : 0.2;
	            
	            $li.hover(
	                function() { $li.fadeTo(200, 1); },
	                function() { $li.not('.active').fadeTo(200, opacity); }
	            )
	        }        
    } );
    
   	if( $('#nieuwsFotos li').length < 2 )
   	{
   		$( '#next' ).css( 'display', 'none' );
   		$( '#prev' ).css( 'display', 'none' );
   	}
   	else
   	{
   		$( '#next' ).css( 'display', 'block' );
   		$( '#prev' ).css( 'display', 'block' );
   		
   		$.galleria.clickNext = true;
   	}
	
	
	$( '#next' ).click( function()
	{
		
		if( $('#nieuwsFotos li').length > 1 ) $.galleria.next();
		
		return false;
	});
	
	$( '#prev' ).click( function()
	{
		if( $('#nieuwsFotos li').length > 1 ) $.galleria.prev();
		
		return false;
	});
});