$(document).ready(function(){
			
	$('#slideshowcnt2').WawSlideShow({
		classimage : 'slide-image'
	});

	$('#link-photo-left').bind('click', function(){
		clickLeft();
	});
	$('#link-photo-right').bind('click', function(){
		clickRight();
	});
	
});
	
var currentPage = 0;
var maxPages = 0;

var clickLeft = function() {

	currentPage--;	
	
	if( currentPage < 0 ) {
		currentPage = 0;
	}
	
	var total = $('.imgslide').size();
	var maxPages = Math.ceil( total / 3 );
	var totalLeft = $('.viewport').width() * currentPage;
	if( currentPage >= 0 ) {
	
		$('.overview').animate({
			left: totalLeft,
			}, 1000, function() {

			});	
	}
}

var clickRight = function() {

	var total = $('.imgslide').size();
	var maxPages = Math.ceil( total / 3 );
	
	var totalLeft = 0;
	if( currentPage == 0 ) {
		totalLeft = $('.viewport').width() * 1;
	}
	else {
		totalLeft = $('.viewport').width() * (currentPage+1);
	}
	
	if( currentPage < maxPages-1 ) {
		
		$('.overview').animate({
			left: '-'+ totalLeft,
			}, 1000, function() {

				currentPage++;	
			});
	}
}
