function startSlide()
{
	$('#slideshow').rsfSlideshow();
	$('#aboutPictures').rsfSlideshow();
}

$(document).ready(function() { 
	
	
		/* This is basic - uses default settings */

			$("a.achievementSlide").fancybox();

			/* Using custom settings */

			$("a#inline").fancybox({
				'hideOnContentClick': true
			});

			/* Apply fancybox to multiple items */

			$("a.group").fancybox({
				'transitionIn'	:	'elastic',
				'transitionOut'	:	'elastic',
				'speedIn'		:	800, 
				'speedOut'		:	400, 
				'overlayShow'	:	true,
				'overlayOpacity': 	0.5,
				'overlayColor'	: 	'black',
				'titleShow'		: 	true,
				'titlePosition' : 'inside',  
				'padding'		:   8,
				'cyclic'		:   true 
			});
	
		//for the a tag smooth scroll
		$(function()
		{
			$('a[href*=#]').click(function()
			{
				if (location.pathname.replace(/^\//,") == this.pathname.replace(/^\//,") && location.hostname == this.hostname)
				{
					var $target = $(this.hash);
					$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
					if ($target.length) 
					{
						var targetOffset = $target.offset().top;
						$('html,body').animate({scrollTop: targetOffset}, {duration:1600,easing:'easeInOutExpo'});
						return false;
					}
				}
			});
		});
	
		//slideshow on index page
		$('#slideshow').rsfSlideshow();
		$('#aboutPictures').rsfSlideshow();
		
		$('#header').click(function()
		{
			setTimeout("startSlide()", 1500);
		});
		
		//menu
        $('ul.sf-menu').superfish({ 
            delay:       0,                            		// one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  	// fade-in and slide-down animation 
            speed:       'fast',                          	// faster animation speed 
            autoArrows:  false,                           	// disable generation of arrow mark-up 
            dropShadows: false                            	// disable drop shadows 
        }); 
		
		//features panel
		$('#featuresPanelHeader').click(function()
			{
				$('#featuresPanelBlocks').slideToggle(500);
				if(down == false)
				{
					down = true;
				}
				else if(down == true)
				{
					down = false;
				}
         });

		$('#featuresPanelHeader').hover(function()
			{
				$(this).css({'cursor' : 'pointer'});
         });


		$('#getInvolved, #donateMoney, #donateGoods, #volunteer, #ourFriends, #projects, #newsAndEvents, #newsletter, #events, #contact, #headerDonateButton, #marshImageLogo, #marshTextLogo').click(function()
		{
			$('.internalNavAbout').hide(300);
		});

		$('#about, #subAbout, #subMeetTheBoard, #subTestimonials, #subPrivacy').click(function()
		{
			if(down == false)
			{
				$('.internalNavAbout').delay(1210).show(800);
			}
			else if(down == true)
			{
				$('.internalNavAbout').delay(810).show(800);
			}	
		});


    });
