jQuery(document).ready(function()
{
	
	<!-- Start - Overlay : Product Overlay -->
	//jQuery(".imagecol").find("a").overlay({
	productOverlay = jQuery("a.product-overlay-trigger").overlay({
		expose: '#111',
		// optional exposing effect with custom color
		closeOnClick: true,
		target: ".product.overlay", 
		opacity: 0.9,
		oneInstance: false,
		absolute: false,
		fadeInSpeed: 'fast',
		api: true,
		onStart: function()
		{
			imgSrc = productOverlay.getTrigger().attr("href");
			if(imgSrc)
			{
				target = jQuery(productOverlay.getConf().target);

				/* cleanup! */
				target.children().remove();

				target.append(jQuery('<img></img>').attr('src', imgSrc));
			}
		}
	});
	<!-- End - Overlay : Product Overlay -->

	/*
	scrollLock, controlled by the thumbnail slider
	if the scrollLock is active, the mainScroller
	gets freezed...and the other way around...
	*/
	scrollLock = false;

	<!-- Start - Overlay - Global -->
	jQuery("img[rel]").overlay(
	{
		absolute: true,
		top: '20%',
		expose: '#53ADAD'
	});
	<!-- End - Overlay - Global -->
	
	<!-- Start - Overlay : Promobox -->
	jQuery("a.promobox[rel]").overlay({
		absolute: false,
		oneInstance: false,
		top: '20%',
		expose: '#53ADAD'
	});
	<!-- End - Overlay : Promobox -->
	
	<!-- Start - Overlay : Promobox -->
	jQuery("a.image[rel]").overlay({
		absolute: false,
		oneInstance: false,
		top: '20%',
		expose: '#111',
		opacity: 0.9
	});
	<!-- End - Overlay : Promobox -->

	<!-- Start - Tooltips : Testimonials -->
	jQuery(".trigger.slide").tooltip({
		tip: '.viewer',
		position: 'top center',
		relative: true,
		effect: 'slide',
		lazy: true,
		opacity: 0.9
	});
	<!-- End - Tooltips : Testimonials -->
	
	<!-- Start - Tooltips : Products -->
	jQuery('.trigger.fade').tooltip({
		tip: '.viewer',
		relative: true,
		position: 'center left'
	});
	<!-- End - Tooltips : Products -->
	
	<!-- Start - Tooltips : Price Labels -->
	jQuery(".trigger.price").tooltip({
		tip: '.viewer',
		position: 'bottom center',
		offset: [5, 0],
		relative: true,
		effect: 'slide',
		lazy: true,
		opacity: 1
	});
	<!-- End - Tooltips : Price Labels -->
	
		<!-- Start - Scrollable : inShop Category Slider -->
    jQuery(".category.slider").scrollable({
		clickable: false,
		items: '.categories',
		prev: '.prev.small',
		next: '.next.small',
		loop: true
	})
	.autoscroll(
	{
		autoplay: true,
		autopause: true,
		interval: 2000
	})
	.circular();
	<!-- End - Scrollable : inShop Category Slider -->
		
	<!-- Start - Scrollable : Showcase -->
	if(jQuery(".showcase.slider ul li.item").length > 1) // only enable the slider if there are two ore more items
	{
		mainScroller = jQuery(".showcase.slider").scrollable(
		{
			size: 1,
			clickable: false,
			easing: 'linear',
			items: 'ul.items',
			loop: true,
			prev: '#showcase .prev',
			next: '#showcase .next',
			globalNav: true,
			onBeforeSeek: function()
			{
				/* check whether the scrollLock is active */
				if(scrollLock)
				{
					return false;
				}
			}
			/*
			onSeek: function(ev, index)
			{
				// check whether we just scrolled to the first slide?
				if(index == 0)
				{
					jQuery('.prev').hide();
				}
				// or to the last one? 
				else if(index == this.getSize()-1)
				{
					jQuery('.next').hide();
				}
				else
				{
					jQuery('.prev').show();
					jQuery('.next').show();
				}
			},
			*/
		}).autoscroll(
		{
			autoplay: true,
			autopause: true,
			interval: 20000
		}).navigator(
		{
			navi: '.controls',
			idPrefix: 'slide-',
			naviItem: 'a',
			api: true
		});
	}

	<!-- Hide the globalNav for the mainScroller if only one slide is shown -->
	scrollerControls = jQuery('div.controls');
	if(jQuery('a', scrollerControls).length < 2)
	{
		scrollerControls.remove();
	}

	<!-- End - Scrollable : Showcase -->
	
	<!-- Start - Scrollable : Thumbnails -->
    	jQuery(".thumb.slider").scrollable(
	{
		size: 6,
		clickable: true,
		items: '.thumbs',
		globalNav: false					
	}).autoscroll(
	{
		autoplay: true,
		autopause: true,
		interval: 2000
	}).circular().navigator(
	{
		navi: '.thumbcontrols',
		idPrefix: 'thumb-',
		naviItem: 'a'
	}).find('a').overlay(
	{
		target: '#gallery',
		expose: '#000',
		opacity: 1.0,
		closeOnClick: true,
		onStart: function()
		{
			/* seems to doesn't work properly... */
			//mainScroller.stop();

			/* therefore, use our scrollLock workaround */
			scrollLock = true;
		},
		onClose: function()
		{
			/* seems to doesn't work properly... */
			//mainScroller.play();

			/* therefore, use our scrollLock workaround */
			scrollLock = false;
		}
	}).gallery(
	{
		disabledClass: 'inactive',
		autohide: false,
		template: '${title}'
	});
	<!-- End - Scrollable : Thumbnails -->
	
});
