function buildScroller() {
	
	var container = $("#content .static");
	var toscroll = $(".to-scroll", container);
	var contain = $(".scrollbar", container);
	var handle = $(".scroller", container);
	
	var scrollHeight;
	var sliderPosition = 0;
	
	if(toscroll.innerHeight() > container.outerHeight()) {
		
		scrollHeight = toscroll.innerHeight() - container.outerHeight();	
		var step = toscroll.innerHeight() / 10;
		
		$(handle).slider({
	        animate: false,
			startValue: 0,
			min: 0,
	        max: scrollHeight,
	        handle: ".handle",
	       
			change: function(event, ui) {
				
				toscroll.css("top", ui.value * -1);
			},
			
			slide: function (event, ui) {
				
				toscroll.css("top", ui.value * -1);
	        }
	    });
		
		$(".rew").bind("click", function() { $(handle).slider("moveTo", "-=" + step) });
		$(".ffwd").bind("click", function() { $(handle).slider("moveTo", "+=" + step) });
	
	} else {
		
		contain.css("display", "none");
	}
}

$(function() {
	
	buildScroller();
});
