// Depends on jquery.js, jquery.cycle.js, jquery.lazyload.js, and autocolumn.min.js
$(document).ready(function() {
			
	// if JavaScript is enabled, hide the extra content so that it doens't look strange while the page is loading
	document.getElementById('show').style.overflow = "hidden"; 
	
	// create the slideshow and add #nav slideshow navigation
	$('#slides').before('<div id="nav">').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 0, 
	next:   '.next', 
    prev:   '.prev',
	pager:  '#nav',
    // builds #nav based on img titles
	pagerAnchorBuilder: function(idx, slide) { 
    		var title=$('img',slide).attr('title');
        	return '<span class="artist"><a href="#">' + title + '</a></span>'; 
    	}    
	});	
	
	$('#nav').append('<p id="home" class="small"><a href="index.html">&laquo; back to Zea Mays</a></p>');
	
	// loads images when they are requested to speed up page load
 	$("img").lazyload();
	
	// turns the #nav into 2 columns
	$('#nav').columnize({ columns: 2 });
 	$('#nav a').addClass("dontsplit"); 
 	
});