﻿

var scrollCount = 0;
var scrollIndex = 0;
jQuery(function() {
	
	jQuery('.scrolltop a').click(scrollDown);
	jQuery('.scrollbund a').click(scrollUp);
	scrollCount = jQuery('.picturescroller .pictureframe').length;
});

function scrollUp()
{
	if(scrollIndex + 3 < scrollCount)
	{
		scrollIndex++;
		var margin = scrollIndex * -190
		jQuery('.picturescroller').animate({marginTop: margin+'px'}, 750, 'swing');
	}
}

function scrollDown()
{
	if(scrollIndex > 0)
	{
		scrollIndex--;
		var margin = scrollIndex * -190
		jQuery('.picturescroller').animate({marginTop: margin+'px'}, 750, 'swing');
	}
}
