// use on load due to us wanting all the images loaded first before we ajax in the slideshow part
$(window).load(function(){
//	$('#home_pic').load(config.basePath + 'HomeBannerHelper.aspx', function(html){
		
		var o = {};
		o.delay = 4500;
		o.transSpeed = 400;
		o.autorun = false;
		var currentSlideIndex = 0;
		
		var $slideShowContainer = $('#home_pic>ul');
		
		//$slideShowContainer.changeSlide(3);
		var $homeSections = $('#home_cols li');
		
		var displaySlide = function(index){
			$('#home_cols li').eq(currentSlideIndex).removeClass('on');
			$('#home_cols li').eq(index).addClass('on');
			currentSlideIndex = index;
		}
		
		
		$slideShowContainer.bind('slideChanged', function(){
			displaySlide($slideShowContainer.currentSlideIndex());
		});
		
		 // need to call startSlides because we are passed the autorun window load event
		$slideShowContainer.slideShow(o).startSlides();
		
		$homeSections.hover(
			function(){
				$slideShowContainer.stopSlides().changeSlide($homeSections.index(this));
			},
			function(){
				$slideShowContainer.startSlides();
			}
		);
	});
	
	// setup links to sections
	$('.student').click(function(){
		window.location = config.basePath + 'student-advantage';
	});

	$('.instructor').click(function(){
		window.location = config.basePath + 'instructor-advantage';
	});

	$('.author').click(function(){
		window.location = config.basePath + 'author-advantage';
	});
//});