/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var tableau_slider;

function CreateSlider()
{
 
 tableau_slider = new Control.Slider('tableau_slider', 'tableau_slider_track', {
				onSlide: function(v) { scrollHorizontal(v, $('tableau_thumb_pics'), tableau_slider);  },
				onChange: function(v) { scrollHorizontal(v, $('tableau_thumb_pics'), tableau_slider); }
			});
}

// scroll the element vertically based on its width and the slider maximum value
function scrollVertical(value, element, slider) {
    element.scrollTop = Math.round(value/slider.maximum*(element.scrollHeight-element.offsetHeight));
}

// scroll the element horizontally based on its width and the slider maximum value
function scrollHorizontal(value, element, slider) {
    element.scrollLeft = Math.round(value/slider.maximum*(element.scrollWidth-element.offsetWidth));
}

function isCursorNeeded(rubrique)
{
    if ($(rubrique + '_thumb_pics').scrollWidth <= $(rubrique + '_thumb_pics').offsetWidth) {
        return false;
    }
    else return true;
}

