			jQuery(function($) {

					//scrollpane parts
					var scrollPane = $( ".scroll-pane" ),
						scrollContent = $( ".scroll-content" );

					// set scrollInterval
					var scrollInterval = 150;
								
					// show scroll arrows on hover
					scrollPane.hover( 
						function(){
							$(".scroller-arrow:not(.disabled)").stop(false, true).fadeIn();
						},
						function(){ 
							$(".scroller-arrow:not(.disabled)").stop(false, true).fadeOut();
						}
					);
		
					setScrollerWidth();
									
					$(window).load(function(){
						
						if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod'){
							$("#scroll_left, #scroll_right").css({ display: 'block' });
						}
						
						$cw = 0;
						$('li.item',scrollContent).each(function(){ 
							$cw = $cw + $(this).outerWidth(true);
						})
						scrollContent.width( $cw );
					});
					
					var slide_handler = function(e, ui) {
						
						if(navigator.platform != 'iPad' || navigator.platform != 'iPhone' || navigator.platform != 'iPod'){
						
							if(ui.value == 0){
								$("#scroll_left").addClass('disabled').stop(false, true).fadeOut();
								$("#scroll_right").removeClass('disabled').stop(false, true).fadeIn();
							}
							
							if(ui.value > 0 && ui.value < 100){
								$("#scroll_left").removeClass('disabled').stop(false, true).fadeIn();
								$("#scroll_right").removeClass('disabled').stop(false, true).fadeIn();
							}
							if(ui.value == 100){
								$("#scroll_left").removeClass('disabled').stop(false, true).fadeIn();
								$("#scroll_right").addClass('disabled').stop(false, true).fadeOut();
							}
						
						}
						
						if ( scrollContent.width() > scrollPane.width() ) {
							scrollContent.css( "margin-left", Math.round(
								ui.value / 100 * ( scrollPane.width() - scrollContent.width() )
							) + "px" );
						} else {
							scrollContent.css( "margin-left", 0 );
						}
					};					
					
					//build slider
					var scrollbar = $( ".scroll-bar" ).slider({
						slide: slide_handler,
						change: slide_handler
					});
					
				$('.scroll-content-item:last').css({marginRight: 0});
				
				// Mousewheel plugin
				scrollPane.mousewheel(function(event, delta) {
					var value = scrollbar.slider('option', 'value');
				
					if (delta > 0) { value += 10; }
					else if (delta < 0) { value -= 10; }
				
					// Ensure that its limited between 0 and 100
					value = Math.max(0, Math.min(100, value));
					
					scrollbar.slider('option', 'value', value);
					event.preventDefault();
				});									
				



				
				function setScrollerWidth(){
					var origWidth = $(".scroll-bar").width();//read the original slider width
					var sliderWidth = origWidth -200;//the width through which the handle can move needs to be the original width minus the handle width
					var sliderMargin =  (origWidth - sliderWidth)*0.5;//so the slider needs to have both top and bottom margins equal to half the difference					
					$(".scroll-bar-wrap").css({width:sliderWidth,marginRight: sliderMargin});//set the slider height and margins
				}
				

			});
