// JavaScript Document

$(document).ready( function() {
	
	// PROGRAM PAGES SHOW/HIDES
	//$(".hidden_box").click( function() {
	//	$(this).children(".hidden_content").slideToggle();
	//});
	
	
	// PROGRAM PAGES SHOW/HIDES
	//$(".hidden_box").click( function() {
//		$(this).children(".hidden_content").slideToggle();
//	});
	
	//var currentSchool = "none";
//	
//	$("#lower_school").click(function() {
//		hideSchools();
//		if (currentSchool != "lower_school") {
//			$("#lower_school_content").slideDown();
//			currentSchool = "lower_school";
//		}
//		
//	});
//	
//	$("#intermediate_school").click(function() {
//		hideSchools();
//		if (currentSchool != "intermediate_school") {
//			$("#intermediate_school_content").slideDown();
//			currentSchool = "intermediate_school";
//		}
//		
//	});
//	
//	$("#middle_school").click(function() {
//		hideSchools();
//		if (currentSchool != "middle_school") {
//			$("#middle_school_content").slideDown();
//			currentSchool = "middle_school";
//		}
//		
//	});
//	
//	$("#sports").click(function() {
//		hideSchools();
//		if (currentSchool != "sports") {
//			$("#sports_content").slideDown();
//			currentSchool = "sports";
//		}
//		
//	});
//	
//	function hideSchools () {
//		if (currentSchool == "lower_school") 
//		{
//			$("#lower_school_content").slideUp();
//		} 
//		else if (currentSchool == "intermediate_school")
//		{
//			$("#intermediate_school_content").slideUp();
//		}
//		else if (currentSchool == "middle_school")
//		{
//			$("#middle_school_content").slideUp();
//		}
//		else if (currentSchool == "sports")
//		{
//			$("#sports_content").slideUp();
//		}
//	}
	
	
	
	$(".hidden_content_title").click(function() {
		hideSchools();
		$(this).siblings(".hidden_content").slideToggle();
	});
	
	function hideSchools() {
		$(".hidden_content").slideUp();
	}
	
	$(".tourForm").click(function() {
		$("#formBox").load('http://www.harfordday.org/contact/tourform.php', function() {
			$("#formWindow").fadeIn(function(){
				$("#formWindow .closeButton").click(function() {
					$("#formWindow").fadeOut();
				});
			});
			
		});
	});
	
	// HOME PAGE SLIDESHOW
	if(jQuery().nivoSlider) {
		$('#slideshow').nivoSlider({
			effect:'fade', //Specify sets like: 'fold,fade,sliceDown,random'
			slices:15,
			animSpeed:800, //Slide transition speed
			pauseTime:5000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:true, //Next & Prev
			directionNavHide:true, //Only show on hover
			controlNav:false, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
			controlNavThumbsFromRel:false, //Use image rel for thumbs
			controlNavThumbsSearch: '.jpg', //Replace this with...
			controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav:true, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:0 //Universal caption opacity
		});
	}
	
	
	//create scroller for each element with "horizontal_scroller" class...
	
	if(jQuery().SetScroller) {
		$('.horizontal_scroller').SetScroller({	
			velocity: 	 60,
			direction: 	 'horizontal',
			startfrom: 	 'right',
			loop:		 'infinite',
			movetype: 	 'linear',
			onmouseover: 'pause',
			onmouseout:  'play',
			onstartup: 	 'play',
			cursor: 	 'pointer'
		});
	}
	/*
		All possible values for options...
		
		velocity: 		from 1 to 99 								[default is 50]						
		direction: 		'horizontal' or 'vertical' 					[default is 'horizontal']
		startfrom: 		'left' or 'right' for horizontal direction 	[default is 'right']
						'top' or 'bottom' for vertical direction	[default is 'bottom']
		loop:			from 1 to n+, or set 'infinite'				[default is 'infinite']
		movetype:		'linear' or 'pingpong'						[default is 'linear']
		onmouseover:	'play' or 'pause'							[default is 'pause']
		onmouseout:		'play' or 'pause'							[default is 'play']
		onstartup: 		'play' or 'pause'							[default is 'play']
		cursor: 		'pointer' or any other CSS style			[default is 'pointer']
	*/
	
});
