$(function() { // Navbar hover function
	$('.navimg').hover(function(){
			$(this).stop().animate({opacity: '.4'}, { "duration": 100 } );
		}, function(){
			$(this).stop().animate({opacity: '1'}, { "duration": 1000 } );
		});
	});


// ----------------------------------
// Photoslider functions
//-----------------------------------



$(function(){
			$('#slides').slides({
				effect: 'fade',
				crossfade: true,
				bigTarget: true,
				preload: true,
				play: 5000,
				pause: 2500,
				fadeSpeed: 2000,
				fadeEasing: "easeOutQuad",
				generatePagination: false,
				hoverPause: true
			});
		});

$(function(){ // Displays arrows to 60% opacity when the mouse hovers over the photoslide
	$('.next').stop().animate({opacity: '0'}, {"duration": 0});
	$('.prev').stop().animate({opacity: '0'}, {"duration": 0});
	$('#slides .slides_container div').hover(function(){
		$('.next').stop().animate({opacity:'.6'}, {"duration": 500});
		$('.prev').stop().animate({opacity:'.6'}, {"duration": 500});
	},function(){
		$('.next').stop().animate({opacity:'0'}, {"duration": 100});
		$('.prev').stop().animate({opacity:'0'}, {"duration": 100});
	});
});

// ----------------------------------
// Next and Previous arrows functions
//----------------------------------

$(function(){ // Next arrow animates to 100% when hovered
	$('.next').hover(function(){
		$(this).stop().animate({opacity:'1'}, {"duration": 100});
		$('.prev').stop().animate({opacity:'.6'}, {"duration": 100});
	},function(){
		$(this).stop().animate({opacity:'0'}, {"duration": 100});
	});
});

$(function(){ // Next arrow shifts down when clicked
	$(".next").mousedown(function(){
	      $(this).stop().animate({marginTop:'1px'}, {"duration": 0});
	    }).mouseup(function(){
	      $(this).stop().animate({marginTop:'0px'}, {"duration": 0});
	    });	
});

$(function(){ // Previous arrow animates to 100% when hovered
	$('.prev').hover(function(){
		$(this).stop().animate({opacity:'1'}, {"duration": 100});
		$('.next').stop().animate({opacity:'.6'}, {"duration": 100});
	},function(){
		$(this).stop().animate({opacity:'0'}, {"duration": 100});
	});
});

$(function(){ // Previous arrow shifts down when clicked
	$(".prev").mousedown(function(){
	      $(this).stop().animate({marginTop:'1px'}, {"duration": 0});
	    }).mouseup(function(){
	      $(this).stop().animate({marginTop:'0px'}, {"duration": 0});
	    });	
});


// ----------------------------------
// Google Maps functions
//----------------------------------


$(function(){ // Main function
	$('.north-map-link').click(function(){
		$("#googlemap-north").slideToggle(200);
		$(this).hide();
		$('.north-map-link-hide').show().delay(500);
	});
});

$(function(){ // Main function
	$('.north-map-link-hide').click(function(){
		$("#googlemap-north").slideToggle("fast");
		$(this).hide();
		$('.north-map-link').show().delay(500);
	});
});

$(function(){ // Main function
	$('.south-map-link').click(function(){
		$("#googlemap-south").slideToggle(200);
		$(this).hide();
		$('.south-map-link-hide').show().delay(500);
	});
});

$(function(){ // Main function
	$('.south-map-link-hide').click(function(){
		$("#googlemap-south").slideToggle("fast");
		$(this).hide();
		$('.south-map-link').show().delay(500);
	});
});



$(function(){
	$('#faqs h3').click(function() {
		$(this).next().slideToggle('slow');
		return false;
	}).next().hide();
});




