/*
$(document).ready(function(){
  $("#content-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide
  });
});

function handleSliderChange(e, ui)
{
  //var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
  //$("#content-scroll").animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
  var maxScroll = $("#content-scroll").attr("scrollHeight") - $("#content-scroll").height();
  $("#content-scroll").animate({scrollTop: ui.value * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  //var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
  //$("#content-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) });
  var maxScroll = $("#content-scroll").attr("scrollHeight") - $("#content-scroll").height();  
  $("#content-scroll").attr({scrollTop: ui.value * (maxScroll / 100) });
}

$(document).ready(function(){
  $("#content-slider").slider({
    animate: true,
    orientation: 'vertical',
    change: handleSliderChange,
    slide: handleSliderSlide
  });
});

function handleSliderChange(e, ui)
{
  var maxScroll = $("#content-scroll").attr("scrollHeight") - $("#content-scroll").height();
  $("#content-scroll").animate({scrollTop: ((100 - ui.value) * (maxScroll / 100))  }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $("#content-scroll").attr("scrollHeight") - $("#content-scroll").height();
  $("#content-scroll").attr({scrollTop: ((100 - ui.value) * (maxScroll / 100)) });
}
*/
$(document).ready(function(){
	$("#content-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide,
    orientation: 'vertical',
    value: 100
  });
});

function handleSliderChange(e, ui)
{
  var maxScroll =
  $("#content-scroll").attr("scrollHeight") -  $("#content-scroll").height();
  $("#content-scroll").animate({scrollTop: (100-ui.value) * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll =
  $("#content-scroll").attr("scrollHeight") - $("#content-scroll").height();
  $("#content-scroll").attr({scrollTop: (100-ui.value) * (maxScroll / 100) });
}

$(document).ready(function(){
	$("#content-slider-b").slider({
    animate: true,
    change: handleSliderChangeb,
    slide: handleSliderSlideb,
    orientation: 'vertical',
    value: 100
  });
});

function handleSliderChangeb(e, ui)
{
  var maxScroll =
  $("#content-scroll-b").attr("scrollHeight") - $("#content-scroll-b").height();
  $("#content-scroll-b").animate({scrollTop: (100-ui.value) * (maxScroll / 100) }, 1000);
}

function handleSliderSlideb(e, ui)
{
  var maxScroll =
  $("#content-scroll-b").attr("scrollHeight") - $("#content-scroll-b").height();
  $("#content-scroll-b").attr({scrollTop: (100-ui.value) * (maxScroll / 100) });
}
