function Scroller(obj, clickSize){
	var object;
	var current;
	var child;
	var childHeight;
	var parentHeight;
	var maxClicks;
	var deltaAnimation=500;
	var deltaClick=30;
	var locked=false;
	var self=this;

	if(clickSize>0)
	{
		deltaClick=clickSize;
	}

	this.setClickSize=function(clickSize){
		deltaClick=clickSize;
	}
	this.setAnimationTime=function(animationTime){
		deltaAnimation=animationTime;
	}
	this.clickMath=function(){
		maxClicks=0;
		var deltaPosition=childHeight-parentHeight;
		if(deltaPosition>0){
			maxClicks=Math.ceil(deltaPosition/deltaClick);
//			alert(maxClicks+"="+childHeight+"-"+parentHeight);
		}
	}
	this.init=function(obj){
		object=jQuery(obj);
		child=object.find('.scroller').children();
		parentHeight=object.find('.scroller').outerHeight(true);
		childHeight=child.outerHeight(true);
		self.clickMath();
		child.css('position','absolute');
		self.setTriggers();
		current=0;
	}

	this.setTriggers=function(){
		object.find('.controls .prev').click(function(){
			if(current>0){
				self.move('+='+deltaClick);
				current--;
			}
		});
		object.find('.controls .next').click(function(){
			if(current<maxClicks){
				self.move('-='+deltaClick);
				current++
			}
		});

		r_timer=setInterval(
			function(e){
				if(child.outerHeight(true)!=childHeight)
				{
					self.clickMath();
					childHeight=child.outerHeight(true)
				}
			}, 500);
	}
	this.move=function(input){
		if(!locked){
			locked=true;
			child.animate({top: input},deltaAnimation, function(){locked=false});
		}
	}
	self.init(obj);
}

