/// <reference path="System/Frontoffice/Toolbox.js"/>
/// <reference path="System/Frontoffice/jquery/jquery-vsdoc.js"/>

$(function() {
	$('.Slider').each(function() {
		var classes = $(this).attr('class').split(' ');

		// Set default options
		var options = {
			visible: 4,
			speed: 1000,
			scroll: 4,
			mouseWheel: true
		};

		// Set options via classes
		for (var key in classes) {
			var className = classes[key];
			if (IsEmpty(className))
				continue;

			if (className.length > 6 && className.startsWith('Slider')) {
				if (className.startsWith('SliderScroll'))
					options.scroll = parseInt(className.substr(12));
				else if (className.startsWith('SliderVisible'))
					options.visible = parseInt(className.substr(13));
			}
		}

		//Set buttons
		options.btnPrev = $('.prev', this)[0];
		options.btnNext = $('.next', this)[0];
		$(this).jCarouselLite(options);
	});
});