/*

	This file contains things that only need to be loaded
	on the home page.

*/
$(document).ready(function(){
	//make the promo boxes on the home page clickable
	$(".homePromoBlock").click(function(){
		location.href=$(this).find("a").attr('href');
	});

	//setup slideshow for home page
	//buid an array of links for each slide
	var ssLength=$("#slideshow li").length;
	var slideButtonArray = new Array();
	$(".slideshowNav li").each(function(){
		slideButtonArray.unshift("."+$(this).attr('class'));
	});
	//initialize navigation
	adjustSlideControls($("#slideshow li:first"));
	//set up slideshow
	$("#slideshow").jCarouselLite({
		btnNext: ".rightArrow",
		btnPrev: ".leftArrow",
		btnGo: slideButtonArray,
	    auto: 5000,
    	speed: 1000,
    	visible: 1,
    	afterEnd: adjustSlideControls	
	});
	//call back function to move the selected item in the nav
	function adjustSlideControls(a){
		$(".slideshowNav li").removeClass("active");
		$(".slideNav"+a.attr('class')).addClass("active");
	}
});
