$(document).ready(
	function()
	{
		
		// Animate color swatches

		jQuery.fn.fadeToggle = function(speed, easing, callback) {
		   return this.animate({opacity: 'toggle'}, speed, easing, callback);

		};

		$("div.color_group ul.top_level").hide();

		$("div.color_group h4").click(function() {
			$(this).next("ul.top_level").fadeToggle("slow");
			$(this).toggleClass('arrow_up');
		});


		$('div.color_group ul li a').imgPreview({
		    containerID: 'imgPreviewWithStyles',
		    imgCSS: {
		        // Limit preview size:
		        height: 140
		    },
		    // When container is shown:
		    onShow: function(link){
		        // Reset image:
		        $('img', this).stop().css({opacity:0});
		    },
		    // When image has loaded:
		    onLoad: function(){
		        // Animate image
		        $(this).animate({opacity:1}, 300);
		    }
		});
		

	}
);