function init() {
	//set links to random color from list on hover
	$('a').mouseover(function() {
		//alert('over...');
		var colors = new Array(
			'#ef5398',
			'#7cc245',
			'#57c8e0',
			'#f68d40',
			'#b554b2');
		//console.log(this.id);
		var hover_color = colors[Math.floor(Math.random()*colors.length)];
		//console.log(hover_color);
		$('#' + this.id).css({'color' : hover_color});
	}).mouseout(function() {
		//alert('...and out.');
		$('#' + this.id).css({'color' : '#8e8e8e'});
	});
	
	$('a.menu_link').click(function() {
		var show_page = this.title;
		$('div.main_content').fadeTo(500, 0, function() {
			//alert("clicked: " + show_page);
			$('div.main_content').hide();
			$('div#' + show_page).show().fadeTo(500, 1);
		});
		
		//remove the "lasso" highlight around the arrow because it looks sloppy
		//do this by setting the cursor focus to a hidden text field 
		$('#last_img').focus();
	});

	//the about page needs to be faded out by default so that it can be faded in later
	$('div#about').fadeTo(500, 0);
	
	$('#gallery_nav a').click(function() {
		//determine the highest numbered image in the set
		var last_img = $('#last_img').val() * 1;

		//set the next image to show if the 'next' link is clicked
		if (this.id == 'next') {
			var show_img = $('#show_img').val() * 1 + 1;
			if (show_img > last_img) { show_img = 1; }
		}
		
		//set the next image to show if the 'previous' link is clicked
		if (this.id == 'prev') {
			show_img = $('#show_img').val() * 1 - 1;
			if (show_img < 1) { show_img = last_img; }
		}
		
		//remove the "lasso" highlight around the arrow because it looks sloppy
		//do this by setting the cursor focus to a hidden text field 
		$('#last_img').focus();
        
		//determine the height of the image that is currently displayed
		var img_height = $('#gallery_image img:first').height();
		
		//fade out the current image and wait until faded out
		$('#gallery_image').fadeTo(750, 0, function() {
			//place the spacer in as a place holder to keep the display box stretched to the height of this image
			//this is important because w/o doing so, the screen will jitter while loading the next image
			$('#gallery_image').html('<img src="img/spacer.gif" alt="Spacer" width="1" height="' + img_height +'"/>');
			//fade out the caption text and wait until faded out
			$('#caption_text').fadeTo(250, 0, function() {
				//place the next image on the page then fade it in
				$('#gallery_image').html('<img src="artwork/' + show_img + '.jpg" alt="Gallery Image"/>').fadeTo(1000,1,
					function() {
						//load the caption text for the next image then fade it in
						$.get("artwork/" + show_img + ".txt", function(data) {
				        	$('#caption_text').html(data.replace(/(\n)/g, "<br/>")).fadeTo(250, 1);
						});
					});
				});
		});
		
		//store the number of the currently shown image for recall later
		$('#show_img').val(show_img);
		
		//preload the next images so the gallery loads faster next time
		var preload_next_img = new Image();
		var next_img = show_img + 1;
		if (next_img > last_img) {next_img = 1; }
		preload_next_img.src = "artwork/" + show_img + ".jpg";	});	
		
		var preload_prev_img = new Image();
		var prev_img = show_img - 1;
		if (prev_img < 1) {prev_img = last_img; }
		preload_prev_img.src = "artwork/" + show_img + ".jpg";
}