﻿(function() {
    var Event = YAHOO.util.Event,
        Dom   = YAHOO.util.Dom,
        lang  = YAHOO.lang,
        slider, 
        bg="slider-bg", thumb="slider-thumb", 
        valuearea="slider-value", textfield="slider-converted-value"

    // The slider can move 0 pixels up
    var topConstraint = 10;

    // The slider can move 200 pixels down
    var bottomConstraint = 41;

    // Custom scale factor for converting the pixel offset into a real value
    var scaleFactor = 0;

    // The amount the slider moves when the value is changed with the arrow
    // keys
    var keyIncrement = 0;

    Event.onDOMReady(function() {

        slider = YAHOO.widget.Slider.getHorizSlider(bg, thumb, topConstraint, bottomConstraint, 18);

        // Sliders with ticks can be animated without YAHOO.util.Anim
        slider.animate = true;

        slider.getRealValue = function() {
            return Math.round(this.getValue() * scaleFactor);
        }

        slider.subscribe("change", function(offsetFromStart) {

            var valnode = Dom.get(valuearea);
            var fld = Dom.get(textfield);

            // Display the pixel value of the control
												if(offsetFromStart=="-2" || offsetFromStart<="11")
												document.getElementById("Content").style.fontSize = 11+"px";
												else if(offsetFromStart=="18")
												document.getElementById("Content").style.fontSize = 14+"px";
												else
												document.getElementById("Content").style.fontSize = 17+"px";

          
        });

    });
})();