window.onload = function()
{
 // Simple slider

new Dragdealer('simple-slider');

// Vertical

var mask = document.getElementById('scroll-mask');
var content = document.getElementById('scroll-content');

new Dragdealer('scroll-bar',
{
horizontal: false,
vertical: true,
yPrecision: content.offsetWidth,
animationCallback: function(x, y)
{
 var margin = y * (content.offsetWidth - mask.offsetWidth);
 content.style.marginTop = String(-margin) + 'px';
 }
 });

 // Magnifier

 var text = document.getElementById('magnifying-text');

 new Dragdealer('magnifier',
 {
 steps: 3,
 snap: true,
 animationCallback: function(x, y)
 {
 text.style.fontSize = String(12 + y * 24) + 'px';
 }
 });

 // Slideshow

 var menuWrapper = document.getElementById('slideshow-menu-wrapper');
 var cursor = document.getElementById('slideshow-menu-cursor');

 var slideshow = new Dragdealer('slideshow',
 {
 steps: 3,
 loose: true,
 animationCallback: function(x, y)
 {
 var top = y * (menuWrapper.offsetWidth - cursor.offsetWidth);
 cursor.style.top = String(top) + 'px';
 }
 });

 document.getElementById('slideshow-photo-1').onclick = function()
 {
 slideshow.setStep(1);
 return false;
 }
 document.getElementById('slideshow-photo-2').onclick = function()
 {
 slideshow.setStep(2);
 return false;
 }
 document.getElementById('slideshow-photo-3').onclick = function()
 {
 slideshow.setStep(3);
 return false;
 }



}
