
var perPage = 6;
var atNum = 0;


var startThumbShow = function(id, photos){
	myShow = new Slideshow(id, {
		type: 'fade',
		navigation: 'thumbnails',
		perPage: perPage,
		duration: [2000, 2000],
		hu: '/images/',
		images: photos
	});
	
	var myScroll = function(to){
		var scroll = new Fx.Scroll('slideshow_thumbs', {
			wait: false,
			duration: 500
		});
		if($('thumb_li_'+to)){
			scroll.toElement('thumb_li_'+to);
			atNum = to;
		}
	}
	
	$('next').addEvent('click', function(e){
		e = new Event(e).stop();
		myScroll(atNum+perPage);
	});
	
	$('prev').addEvent('click', function(e){
		e = new Event(e).stop();
		myScroll(atNum-perPage);
	});
}