function activateHeroCycle() {
	/* Variables */
	var JheroBanners = J("#heroBanners li");
	var current = 0;
	var next = 1;
	var speed = 5000;
	var transitionSpeed = 3000;
	var JheroBannerThumbs = J("#heroBannerThumbs li");
	var thumbTransparency = 0.3;
	var JheroLink = J("#heroMoreInfo");
		
	function cycleHeros() {
		J(JheroBannerThumbs[current]).find("a").removeClass("active");
		J(JheroBannerThumbs[next]).find("a").addClass("active");
		J(JheroBanners[current]).fadeOut(transitionSpeed);
		J(JheroBanners[next]).fadeIn(transitionSpeed, function() {
			current = current + 1;
			if ( current > JheroBanners.length - 1 ) {
				current = 0;
			} else {    
			}
			next = next + 1;
			if ( next > JheroBanners.length - 1 ) {
				next = 0;
			}
			var link = J(JheroBanners[current]).find("a").attr("href");
			JheroLink.attr("href", link);
		});
	}
		
	var heroInterval = setInterval(cycleHeros, speed);

	JheroBannerThumbs.mouseover(function() {
		clearInterval(heroInterval);
		var thisElem = J(this);
		J("#heroBannerThumbs li:not(this)").find("a").removeClass("active");
		J("#heroBannerThumbs li:not(this)").find("a").addClass("none");
		thisElem.find("a").addClass("active");
		var slideIndex = parseInt(thisElem.find("a").text()) - 1;
		if ( slideIndex != current ) {
			J(JheroBanners[current]).stop().animate({ opacity: 0 }, function() {
				J(this).hide();
			});
			J(JheroBanners[slideIndex]).stop().css({ display: "block", opacity: 0 }).animate({ opacity: 1 });
			var link = J(JheroBanners[slideIndex]).find("a").attr("href");
			JheroLink.attr("href", link);
		}
		current = slideIndex;
	});

	/* End Hero Banner SlideShow */
}

var bodyID = J("body").attr("id");
switch(bodyID){
    case "home":

        J(function() {
			
			/* Hero Banner SlideShow */
        if (J("#heroBanners").length > 0) {
				activateHeroCycle();
			}  
				
		});  		
		
        break;
   
    default:
        break;
}
