	jQuery(function() {
	
		jQuery(".horizontal-scroller").productScroller({
	        itemWidth : 215,
	        speed : "slow",
			slideBy : 3
	    });


		// swap the sub-category product Image on hover 	
		jQuery("#categoryProperties .itemBox > a > img").each(function(){
			 // store original img source
			var origSrc = jQuery(this).attr('src');
			 // get the new source filename from parent REL (link)
			var swapSrc = jQuery(this).parent().attr('rel');
			var aSwapSrc = swapSrc.split(',');
			swapSrc = aSwapSrc[0];
			 // replace the img source with new filename
			swapSrc = swapSrc.length > 0 ? '/public/pictures/products/thumbs/' + swapSrc : origSrc
			 
			jQuery(this).attr('rel',swapSrc);
			jQuery(this).hover(
			      function () {
			        jQuery(this).attr('src',swapSrc);
			      }, 
			      function () {
			        jQuery(this).attr('src',origSrc);
			      }
		    );
		});

		// assign a color to link
		jQuery("#subcategoriesList .itemBox dt a").each(function(){
			jQuery(this).css('color',jQuery(this).attr('rel'));
		});

	});

