
// MOSNE FUNCTIONS

$(document).ready(function(){
    
   
	
	$(".ngg-gallery-thumbnail a").each(function(){
	       
	       $(this).attr ({"rel":"prettyPhoto[gallery]"});
	
	});
	
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
					theme: 'dark_square',
					showTitle: false
					});			

	$('.ngg-galleryoverview').cycle({
	   pause:1,
	   slideExpr: '.ngg-gallery-thumbnail-box',
	   speed:  1200, 
       timeout: 7000,
       next: $("#next"),
       prev: $("#prev"),
       before:function(currSlideElement, nextSlideElement, options, forwardFlag){
        var ctitle = $(nextSlideElement).find("img").attr("title");
        $("#ctitle").html(ctitle);
        
        var total =  $('.ngg-gallery-thumbnail-box').length;
   		var idxo =  $('.ngg-gallery-thumbnail-box').index(this);
		var idx =  idxo+1;
		
 		$("#tnumb").html(total);
 		$("#cnumb").html(idx);
		
       }
       
	});
		
			  
        


}); //scope 