$(document).ready(function() {
	pictureGallery();
  
});

function pictureGallery(){
	 $("div.gallery-item:not(:first)").hide();
	 $("div.gallery-item:first").addClass("print-only");//class is for print css styling
	   $("div.gallery-item").each(function(count){
	   		var vCurrent = $(this);
	   		var vCurrentPagination = vCurrent.find(".slideshow-pag span.imagecount");

	   		if (vCurrentPagination.hasClass("show-navigation")) {
	   			vCurrentPagination.append('&nbsp;&nbsp;<a href="#" class="prev-link">&lt; Prev</a>&nbsp;&nbsp;<a href="#" class="next-link">Next &gt;</a>');

		   		vCurrent.find(".next-link").click(function(){
		   			if (vCurrent.next().length > 0) {
						vCurrent.hide();
						vCurrent.next().show(); 
		   			}
					return false;   			
		   		});
		
		   		vCurrent.find(".prev-link").click(function(){
		   			if (vCurrent.prev().length > 0) {
						vCurrent.hide();
						vCurrent.prev().show(); 
		   			}
		   			
					return false;   			
		   		});
	   		}
	   });
	
}