// JavaScript Document

	var theHandle, theRoot, theThumb, theScroll;
	var thumbTravel, ratio;

	theScroll = new ypSimpleScroll("scroll", 2, 19, 550, 315);
	
	window.onload = function() {
		theHandle = document.getElementById("handle");
		theRoot   = document.getElementById("root");
		theThumb  = document.getElementById("thumb");

		theScroll.load();

		Drag.init(theHandle, theRoot);
		Drag.init(theThumb, null, 135, 135, 19, 71);

		// the number of pixels the thumb can travel vertically (max - min)
		thumbTravel = theThumb.maxY - theThumb.minY;

		// the ratio between scroller movement and thumbMovement
		ratio = theScroll.scrollH / thumbTravel;

		theThumb.onDrag = function(x, y) {
			theScroll.jumpTo(null, Math.round((y - theThumb.minY) * ratio));
		}
	
	}