var sp_contentFrame;
var sp_maxScroll;
function sp_onReady(){	
	sp_contentFrame=$(".scrollpane .content-frame");	
	sp_maxScroll=
		sp_contentFrame.get(0).scrollHeight-sp_contentFrame.height();
	if(sp_maxScroll){
		sp_contentFrame.css("overflow","hidden");
		sp_contentFrame.addClass("js");
		var slider=$(".scrollpane .slider");
		slider.slider(
			{
				orientation:"vertical",
				value:sp_maxScroll,
				max:sp_maxScroll
				
			}
		);	
		slider.bind("slide",sp_onSlide);
	}
}
function sp_onSlide(event,ui){	
	sp_contentFrame.scrollTop(sp_maxScroll-ui.value);
}
$(sp_onReady);
