$(function() {
	$('article, header, nav').hide();
	$('header, nav').fadeIn(3000,'swing');	

	$('#head').click(function() {
		$('#ath').fadeIn(500, 'swing');
		});
	$('#bckj').click(function() {
		$('#crackerjack').fadeIn(500, 'swing');
		});
	$('#bcredits').click(function() {
		$('#credits').fadeIn(500, 'swing');
		});
	$('#blisten').click(function() {
		$('#listen').fadeIn(500, 'swing');
		});
	$('#bthanks').click(function() {
		$('#thanks').fadeIn(500, 'swing');
		});
	$('#bsocial').click(function() {
		$('#social').fadeIn(500, 'swing');
		});
		
	$('#bgallery').click(function() {
		$('#gal').fadeIn(500, 'swing');
		});


	$('.closebutton').click(function() {
		$('article').fadeOut(500, 'swing');
		});	
});

	var pics = new Array();								//	array for gallery pictures
		pics[0] = "pic1.jpg";
		pics[1] = "pic2.jpg";
		pics[2] = "pic3.jpg";
		pics[3] = "pic4.jpg";
		pics[4] = "pic5.jpg";
	
	var n = 0;											//	index of array at current picture
	var size = pics.length-1;							//	size of picture array


// go to next picture
	function nextImg() {

	n++;
	if (n > size) {
		document.getElementById("gallerypic").src=("./gallery/" + pics[0] );
		n = 0;
		}
	else {
		document.getElementById("gallerypic").src=("./gallery/" + pics[n] );
		}
	};
	

