$(document).ready(function() {


	// product carousel with arrows
	$('#carousel_ul li:first').before($('#carousel_ul li:last')); 

	$('#right_scroll').click(function(){
		var item_width = $('#carousel_ul li').outerWidth();
		var left_indent = parseInt($('#carousel_ul').css('left')) - item_width;
		
		$('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){    
			$('#carousel_ul li:last').after($('#carousel_ul li:first')); 
			$('#carousel_ul').css({'left' : '-123px'});
		}); 
	});

	$('#left_scroll').click(function(){
		var item_width = $('#carousel_ul li').outerWidth();
		var left_indent = parseInt($('#carousel_ul').css('left')) + item_width;
		
		$('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){    
			$('#carousel_ul li:first').before($('#carousel_ul li:last')); 	
			$('#carousel_ul').css({'left' : '-123px'});
		});
	});

	/*
		$('#right_scroll img').hover(function() {
			$('#carousel_ul').animate({
				left: '+=500'
			}, 500, function() {
				$('#carousel_ul li:first').before($('#carousel_ul li:last')); 	
				$('#carousel_ul').css({'left' : '-120px'});
			});
		});
	*/



	// zoom effect for product carousel items on hover
	$('#carousel_ul li a').hover(
		function () {
			$(this).parent().addClass('zoom');
		},
		function () {
			$(this).parent().removeClass('zoom');
		}
	);



	// hero slider according to items in product carousel
	$('#carProd1 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '0'
		}, 500);
	});
	
	$('#carProd2 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '980'
		}, 500);
	});
	
	$('#carProd3 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '1960'
		}, 500);
	});
	
	$('#carProd4 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '2940'
		}, 500);
	});
	
	$('#carProd5 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '3920'
		}, 500);
	});
	
	$('#carProd6 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '4900'
		}, 500);
	});
	
	$('#carProd7 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '5880'
		}, 500);
	});
	
	$('#carProd8 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '6860'
		}, 500);
	});
	
	$('#carProd9 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '7840'
		}, 500);
	});
	
	$('#carProd10 a').hover(function() {
		$('#hero-slider ul').stop().delay(125).animate({
			right: '8820'
		}, 500);
	});



	// modal navigation - popout menus
	
		// default hide action to prevent sticking
		$('#modal-buttons li').hover(function() {
			$('.modal').hide();
		});
		
		// 1 - students
		$('#modal-button_1').hover(function() {
			$('#modal1').fadeIn(100);
		});		
		$('#modal1').hover(function() {
			$(this).show();
		}, function() {
			$(this).fadeOut(200);
		});
		
		// 2 - athletes
		$('#modal-button_2').hover(function() {
			$('#modal2').fadeIn(100);
		});
		$('#modal2').hover(function() {
			$(this).show();
		}, function() {
			$(this).fadeOut(200);
		});
		
		// 3 - parents
		$('#modal-button_3').hover(function() {
			$('#modal3').fadeIn(100);
		});
		$('#modal3').hover(function() {
			$(this).show();
		}, function() {
			$(this).fadeOut(200);
		});
		
		// 4 - educators
		$('#modal-button_4').hover(function() {
			$('#modal4').fadeIn(100);
		});
		$('#modal4').hover(function() {
			$(this).show();
		}, function() {
			$(this).fadeOut(200);
		});
		
		// 5 - military
		$('#modal-button_5').hover(function() {
			$('#modal5').fadeIn(100);
		});
		$('#modal5').hover(function() {
			$(this).show();
		}, function() { 
			$(this).fadeOut(200);
		});


});
