// Home Page Slider config
$(window).load(function() { // initializes when images have loaded as opposed to $(document).ready();
	$('#slider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500,
		pauseTime:4000,
		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.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});
// Educational Program Tabs
/*$(document).ready(function(){
		//$("#classes, #historic-houses, #dill-sanctuary, #package-programs, #to-go, #register").hide();
		// When a link is clicked
		$("a.tab").click(function () {
			// switch all tabs off
			$(".current").removeClass("current");
			// switch this tab on
			$(this).addClass("current");
			// slide all content up
			$(".content").slideUp();
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).slideDown();
		});
	  }); */
// flickr
/* var apiKey = 'aa6330aef48786452b89cdd197cbe39e';
    var userId = '8490526@N03';
    var tag = '';
	var wid = '70px';
    var perPage = '6';
    var showOnPage = '6';
//$.ajaxSetup({ cache: false }); // stupid IE caches the request, so we have to explicitly tell it not to.
    $.getJSON('http://api.flickr.com/services/rest/?format=json&method='+
        'flickr.photos.search&api_key=' + apiKey + '&user_id=' + userId + 
        '&per_page=' + perPage + '&jsoncallback=?',
    function(data){
        var classShown = 'class="lightbox"';
        var classHidden = 'class="lightbox hidden"';
        
        $.each(data.photos.photo, function(i, rPhoto){
            var basePhotoURL = 'http://farm' + rPhoto.farm + '.static.flickr.com/'
                + rPhoto.server + '/' + rPhoto.id + '_' + rPhoto.secret;
            
            var thumbPhotoURL = basePhotoURL + '_s.jpg';
            var mediumPhotoURL = basePhotoURL + '.jpg';
            
            var photoStringStart = '<a ';
            var photoStringEnd = ' title="' + rPhoto.title + '" href="'+ 
                mediumPhotoURL +'"><img width="' + wid + '" src="' + thumbPhotoURL + '" alt="' + 
                rPhoto.title + '" /></a>';
            var photoString = (i < showOnPage) ? 
                photoStringStart + classShown + photoStringEnd : 
                photoStringStart + classHidden + photoStringEnd;

            $(photoString).appendTo("#flickr");
        });
        $("a.lightbox").lightBox(); 
    }); */
