jQuery.noConflict();

window.addEvent('domready', function() {
	$('showcase').removeClass('overflowhidden');
});

jQuery(document).ready(function() {
	var scrollSpeed = ($('scroll-speed')) ? (parseInt($('scroll-speed').get('value')) * 1000) : 5000;
	jQuery("#showcase").awShowcase(
	{
		content_width:			978,
		content_height:			294,
		fit_to_parent:				false,
		auto:							true,
		interval:						scrollSpeed,
		continuous:				true,
		loading:						true,
		tooltip_width:				200,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:			18,
		tooltip_offsety:			0,
		arrows:						true,
		buttons:						true,
		btn_numbers:			true,
		keybord_keys:			true,
		mousetrace:				false,
		pauseonover:				true,
		stoponclick:				false,
		transition:					'hslide',
		transition_delay:			0,
		transition_speed:		500,
		show_caption:			'show',
		thumbnails:				false,
		thumbnails_position:	'outside-last',
		thumbnails_direction:	'vertical',
		thumbnails_slidex:		1,
		dynamic_height:			false,
		speed_change:			true,
		viewline:					false,
		custom_function:		null
	});
});

/*
window.addEvent('domready', function() {
	//Get our variables
	var count = ($('total-promotions')) ? $('total-promotions').get('value') : 0;
	var width = (count * 978);
	var scrollbusy = false;
	
	var scrollSpeed = ($('scroll-speed')) ? (parseInt($('scroll-speed').get('value')) * 1000) : 5000;
	var periodicalID;
	var current = 0;
	
	if (count != 0) {
		//Set the container width based on the promotions we have
		$('promotion-items').setStyles({
			'width': width,
			'left': 0
		});
	}
	
	var begin = function() {
		periodicalID = (function() {
			if (scrollbusy) {
			}
			else {
				current++;
				scrollbusy = true;
			
				var position = (current >= count) ? 0 : ($('promotion-items').getStyle('left').toInt() - 978);
						
				current = (current > count) ? 0 : current;
										
				var fx = new Fx.Tween('promotion-items', {
					duration: 605,
					transition: 'quint:in:out'
				});
			
				fx.addEvent('complete', function(){
					scrollbusy = false;
				});
			
				fx.start('left', position);
			}
			
		}).periodical(scrollSpeed);
	};
	
	begin();
});
*/
