var slider = new Control.Slider('handle', 'track', {
	onSlide: function(v) { scrollHorizontal(v, $('content'), slider);  },
	onChange: function(v) { scrollHorizontal(v, $('content'), slider); }
});


// 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));
}

// disable horizontal scrolling if text doesn't overflow the div
if ($('content').scrollWidth <= $('content').offsetWidth) {
	slider.setDisabled();
	$('track').hide();
}

function popupImg(productID) {
	window.open("popup.php?product_id="+productID,"prodPopup","location=no")
}
