/*---
* build scrolling block with slidebar for product menus
------*/

// http://solutoire.com/2008/03/11/update-mootools-css-styled-scrollbar/
function makeScrollbar(content,scrollbar,handle){
	var steps = content.getSize().scrollSize.x - content.getSize().size.x

	// if steps is 0 then we have divide-by-zero and problems in IE6
	// .. but we don't want to hide the slider, so just fudge it
	if (steps==0) steps = 1;

	var slider = new Slider(scrollbar, handle, {    
		steps: steps,
		mode: 'horizontal',
		onChange: function(step){
			// Scrolls the content element in x or y direction.
			var x = step;
			var y = 0;
			content.scrollTo(x,y);
		}
	}).set(0);
	// Stops the handle dragging process when the mouse leaves the document body.
	$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
}
