(function() {
    var Event = YAHOO.util.Event,
        Dom   = YAHOO.util.Dom,
        lang  = YAHOO.lang,
        slider, 
        bg="slider-bg", thumb="slider-thumb"

    // The slider can move 0 pixels up
    var topConstraint = 0;

    // The slider can move 400 pixels down
    var bottomConstraint = 390;

    // Custom scale factor for converting the pixel offset into a real value
    var scaleFactor = 2;

    Event.onDOMReady(function() {

        slider = YAHOO.widget.Slider.getVertSlider(bg, 
                         thumb, topConstraint, bottomConstraint);

        slider.getRealValue = function(height) {
            return Math.round(this.getValue() * (height/bottomConstraint-1));
        }
		
        slider.subscribe("change", function(move_it) {
			var myContent = Dom.get("content_container");
			var myText = Dom.get("scroll");
			myContent.scrollTop = slider.getRealValue(myText.offsetHeight);
        });

        // set an initial value
        slider.setValue(0);

    });
})();