if (typeof jQuery != "undefined") jQuery(document).ready(function($) {
	var cb_carousel = function(carousel) {
		$("#previous").click(function() {
			carousel.prev();
			return false;
		});
		$("#next").click(function() {
			carousel.next();
			return false;
		});

		// Pause autoscrolling if the user moves with the cursor over the clip.
		$("#featured-property").hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
	}

	var cb_itemFirstInCallback = function(carousel, item, idx, state) {
		$('.mainimage', item).innerfade({
			animationtype: 'fade',
			speed: 1000,
			timeout: 2000,
			type: 'random',
			containerheight: '200px'
		});
	};

	if (jQuery.fn.jcarousel) $("#slider-list").jcarousel({
		auto: 5,
		visible: 1,
		scroll: 1,
		wrap: "circular",
		animation: 1000,
		initCallback: cb_carousel,
		itemVisibleInCallback: {
			onAfterAnimation: cb_itemFirstInCallback
		}
	});
});

