$(function() {
    setInterval( "bannerSwitch()", 5000 );

	if($("#callouts").length){
		$("body").addClass("homePage");
	}
	
	
	var callouts = $("#callouts > div");
	
	callouts.mouseenter(function(){
		$(this).children(".calloutContent").stop().animate({
			top: 0
		});
	});
	
	callouts.mouseleave(function(){
		$(this).children(".calloutContent").stop().animate({
			top: '100px'
		});
	});

	$(".faqTitle").click(function(){
		$(".faqTitle").removeClass("on").next("div").slideUp();
		$(this).addClass("on").next("div").slideDown();
	});
	
	$(".contactTitle:first-child").addClass("on").next(".contactInfo").show();
	
	$(".contactTitle").click(function(){
		$(".contactTitle").removeClass("on").next(".contactInfo").hide();
		$(this).addClass("on").next(".contactInfo").show();
	});
	
	$("#ctaForm").mouseover(function(){
		$(".hiddenFields").slideDown();
	});
	
});

function bannerSwitch(){

	var activeBanner = $(".activeBanner");
	
	if($(".activeBanner").next("div").length){
		nextBanner = activeBanner.next("div");
	}else{
		nextBanner = $("#banner div").first();
	}
	
	nextBanner.fadeIn(function(){
		activeBanner.fadeOut(function(){
			$(this).removeClass("activeBanner");
		});
	}).addClass("activeBanner");
}

