	function ScrollCallback(carousel, li, index, state) {	
		// scale the first 5 images
		doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + (parseInt(index) - 1) + ")"), 0, true);
		doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + parseInt(index) + ")"), 1, true);
		doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + (parseInt(index) + 1) + ")"), 2, true);
		doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + (parseInt(index) + 2) + ")"), 1, true);
		doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + (parseInt(index) + 3) + ")"), 0, true);
		// make other images small
		var numImages = $(".jcarousel-skin-tango .jcarousel-item").children().length;
		for(var i = (index + 4); i < numImages; i++) {
			doAnimate($(".jcarousel-skin-tango .jcarousel-item:eq(" + parseInt(i) + ")"), 0, false);
		}
	}
	
	function ShowroomScrollCallback(carousel, li, index, state) {	
		var numImages = $(".jcarousel-skin-tango .jcarousel-item").children().length;
		// write info into info panel
		var info = "" + parseInt(index) + "-" + (parseInt(index)+2) + " of " +  numImages;
		$("#info_box p").html(info);
	}
	
	function doAnimate(obj, size, animate) {
		// size options
		var cssSmall = {
		        'width' 		: '95px',
				'height'		: '118px',
		        'top' 			: '146px',
				'opacity' 		: '.30'
		      }
		var cssMedium = {
		        'width' 		: '180px',
				'height'		: '224px',
		        'top' 			: '93px',
				'opacity' 		: '.65'
		      }
		var cssLarge = {
		        'width' 		: '330px',
				'height'		: '410px',
		        'top' 			: '0px',
				'opacity' 		: '1'
		      }
		var arrSizes = [cssSmall, cssMedium, cssLarge];
		// perform animation (or not)
		if(animate) {
			obj.animate(arrSizes[size]);
		} else {
			obj.css(arrSizes[size]);
		}
		// image size options
		var imgSmall = [95,118];
		var imgMedium = [180,224];
		var imgLarge = [330,410];
		var arrImgSizes = [imgSmall, imgMedium, imgLarge];
		// resize images
		var img = obj.children(0).children(0);
		img.attr("width", arrImgSizes[size][0]);
		img.attr("height", arrImgSizes[size][1]);
	}
	
	function InitCarousel (carousel, state) {
		$(window).keydown(function(event){
			switch (event.keyCode) {
		    	case 37:
					carousel.prev();
					break;
				case 39:
					carousel.next();
					break;
			}
		});
		// set up Shadowbox
		var options = {
	        displayCounter: 	false,
			overlayOpacity: 	"0.85",
			onOpen:    		function(){
				carousel.lock();
			},
			onClose:    		function(){
				carousel.unlock();
			}
	    };
		Shadowbox.init(options);
	}
