function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() { 
	
	jQuery("#homePicCarousel").jcarousel({
		auto: 4,
		wrap: 'circular',
		initCallback: mycarousel_initCallback
	});
	
	jQuery('ul#homeRotateLeft').innerfade({
		speed: 1000,
		timeout: 4500,
		type: 'random',
		containerheight: '355px'
	});
	
	jQuery('ul#homeRotateMiddle').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'random',
		containerheight: '355px'
	});
	
	jQuery('ul#homeRotateRight').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'random',
		containerheight: '355px'
	});

	jQuery("#liveit").hover(
		function() {
			jQuery(this).find(".hotspot").fadeIn("fast");
		},
		function() {
			jQuery(this).find(".hotspot").fadeOut("fast");
		}
	);
	
	if (jQuery('body').hasClass('slug-features-amenities') == false) {
		jQuery("#learnit").hover(
			function() {
				jQuery(this).find(".hotspot").fadeIn("fast");
			},
			function() {
				jQuery(this).find(".hotspot").fadeOut("fast");
			}
		);
		
	}
	
	if (jQuery('body').hasClass('slug-floorplans') == false) {
	
		jQuery("#loftit").hover(
			function() {
				jQuery(this).find(".hotspot").fadeIn("fast");
			},
			function() {
				jQuery(this).find(".hotspot").fadeOut("fast");
			}
			
		);
	
		jQuery("#bottomText").hover(
			function() {
				jQuery(this).find("#bottomSpot").fadeIn("fast");
			},
			function() {
				jQuery(this).find("#bottomSpot").fadeOut("fast");
			}
		);
		
	}

});
