$(document).ready(function(){
  $("#control div").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide
  });
});

function handleSliderChange(e, ui)
{
  var maxScroll = $("#wall").attr("scrollWidth") - $("#wall").width();
  $("#wall").animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $("#wall").attr("scrollWidth") - $("#wall").width();
  $("#wall").attr({scrollLeft: ui.value * (maxScroll / 100) });
}
