var slides = new Array();
var slidetitle = new Array();
var description = new Array();
var thisSlide = getSlideNumber();	

function preloadAlbum() {

	slides[1] = "grafx/gallery/cdminicover.jpg";
	slidetitle[1] = "Inside My Mind's Eye";
	description[1] = "The mind-bending art of Max Haptonstahl (Jim's brother), adorning the latest Jim Haptonstahl CD cover.";
	
	slides[2] = "grafx/gallery/jim_hap_promo.jpg";
	slidetitle[2] = "Jim Haptonstahl";
	description[2] = "Jim Haptonstahl brings life to his songs in Happy Gunner Studio.";
	
	slides[3] = "grafx/gallery/seeing_red.jpg";
	slidetitle[3] = "Seeing Red";
	description[3] = "Jim's daughter Julia Haptonstahl coaxes sweet sounds from her Fender Jazz bass.";
	
	slides[4] = "grafx/gallery/brain_hi_res.jpg";
	slidetitle[4] = "Brain Tryptych";
	description[4] = "Max Hap's original intaglio print... and inspiration for <i>Inside My Mind's Eye</i>.";
	
	slides[5] = "grafx/gallery/fitzgeralds_1.jpg";
	slidetitle[5] = "CD Release Party";
	description[5] = "Jim Hap, Steve Jackson and Julia Hap live at Fitzgerald's, Chicago area's premiere nightclub, at the CD release party 3.20.05";
	
	slides[6] = "grafx/gallery/fitzgeralds_2.jpg";
	slidetitle[6] = "Jim Hap and Band";
	description[6] = "Performing at Fitzgerald's 3.20.05";
	
	slides[7] = "grafx/gallery/fitzgeralds_3.jpg";
	slidetitle[7] = "In the Intensity of the Moment";
	description[7] = "Jim Hap with Steve Jackson at Fitzgerald's";
	
	slides[8] = "grafx/gallery/fitzgeralds_4.jpg";
	slidetitle[8] = "Taking the Crowd through 'Orphans of Shadows'";
	description[8] = "Jim Hap, Steve Jackson and Chris DeMonk live at Fitzgerald's";
	
	slides[9] = "grafx/gallery/buzz.jpg";
	slidetitle[9] = "Enveloped by Art";
	description[9] = "Jim Hap performing at the Buzz Cafe";
	
	
	slides[10] = "grafx/gallery/bobdog.jpg";
	slidetitle[10] = "Techno-Warriors Behind the Controls";
	description[10] = "Chris DeMonk & Bill Kavanagh at BobDog Studios, site of mixing/mastering of <i>Inside My Mind's Eye</i>.";
	
	slides[11] = "grafx/gallery/the_beat_generation.jpg";
	slidetitle[11] = "The Beat Generation";
	description[11] = "Jim Haptonstahl & Steve Jackson (Jim's nephew, and cellist for live gigs), somewhere near the Left Bank.";
	
	slides[12] = "grafx/gallery/wooden_drum.jpg";
	slidetitle[12] = "To the Beat of His Own Drum";
	description[12] = "Jim Hap in live performance on wooden drum, fashioned by Arizona artist Michael Thiele.";
	
	slides[13] = "grafx/gallery/new_moon.jpg";
	slidetitle[13] = "A New Moon Is Rising";
	description[13] = "Joel Batty, 'Doc', Jim Hap & Bob Egan performing at the Illinois State University Student Union, circa 1984.";
	
	slides[14] = "grafx/gallery/helix.jpg";
	slidetitle[14] = "Helix - Band of Renown";
	description[14] = "Doug Lady, Mark Smith, Rudy Higgins, Hugh Higgins, Jim Haptonstahl & Robin Akins of Peoria-area cult favorite Helix, circa 1980.";
	
	slides[15] = "grafx/gallery/chiaroscuro.jpg";
	slidetitle[15] = "Chiaroscuro";
	description[15] = "Jim Hap in a guitar meditation, Florida-1996.";
	
	slides[16] = "grafx/gallery/prairie_skies_1.jpg";
	slidetitle[16] = "Prairie Skies";
	description[16] = "Visual inspiration for <i>Inside My Mind's Eye</i> and other Jim Hap songs.";
	
	slides[17] = "grafx/gallery/barnyard_fantasy.jpg";
	slidetitle[17] = "Barnyard Fantasy";
	description[17] = "Jim's wife Michele Hap's self-portrait with Joshua, near Trivoli, Illinois... art triggering a musical response.";
	
	slides[18] = "grafx/gallery/billy_green_eye.jpg";
	slidetitle[18] = "Billy with the Green Eye";
	description[18] = "Julia Hap's portrait of Billy Corgan of Smashing Pumpkins... music inspires art.";
	
	slides[19] = "grafx/gallery/brandon_1.jpg";
	slidetitle[19] = "Brandon #1";
	description[19] = "Julia Hap's interpretation of Brandon Boyd, lead singer of Incubus.";
	
	slides[20] = "grafx/gallery/red_billy.jpg";
	slidetitle[20] = "Red Billy";
	description[20] = "Julia Hap's alternate portrait of Billy Corgan.";
	
	slides[21] = "grafx/gallery/potted_man.jpg";
	slidetitle[21] = "Potted Man";
	description[21] = "Possible cover shot for Jim Hap's next CD? Ready for another Garden Party?";
	
	slides[22] = "grafx/gallery/troxell_red_village.jpg";
	slidetitle[22] = "Troxell's Adobe Village";
	description[22] = "Pencil drawing by Maryland based-artist (and Jim Hap friend) Jim Troxell ... inviting a musical reaction in the House of Hap-pennings.";
	
	slides[23] = "grafx/gallery/prairie_skies_2.jpg";
	slidetitle[23] = "Prairie Skies #2";
	description[23] = "'Blue in the sky, and spiraling clouds drifting by, feet on the ground, feeling so right, everything sound, and shining so bright'-- excerpt from the song 'Never To Be Lost Again' from the <i>Inside My Mind's Eye</i> CD.";
	
	slides[24] = "grafx/gallery/live_at_vals.jpg";
	slidetitle[24] = "Entering Val's Halla";
	description[24] = "Julia Hap, Bill Kavanagh & Jim Hap live at the legendary Val's halla  7.9.05";
	
	slides[25] = "grafx/gallery/flauting.jpg";
	slidetitle[25] = "Silhouettes of Intensity";
	description[25] = "Julia Hap flauting & Bill Kavanagh free-bassing at Val's  7.9.05";
	
}

function getSlideNumber() {

	var args = new Object();
	var query = location.search.substring(1);
	
	var pos = query.indexOf('=');
	if (pos == -1)  {
	
		return 1;
		
	}

	var argname = query.substring(0,pos);
	var value = query.substring(pos+1);
	return unescape(value);

}

function writeSlideImg(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	document.write("<img src=\"" + slides[slideNumber] + "\"><br>");	

}

function writeSlideTitle(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	document.write(slidetitle[slideNumber]);	

}

function writeSlideDesc(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	document.write(description[slideNumber]);	

}

function writeSlideNum(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	document.write("<span class=\"subtle\">[ " + slideNumber + " of " + (slides.length -1) + " ] </span>");

}

function writeSlidePrev(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	
	if (slideNumber > 1) {

		prevSlideNum =slideNumber -1;
		prevSlide = this.location.pathname + "?slide=" + prevSlideNum;
		
	} else {

		prevSlide = "gallery.html";
		
	}
	
	document.write("<a href=\"" + prevSlide + "\">&nbsp;&lt; Previous</a>");

}

function writeSlideNext(slideNumber) {

	if (!slides[slideNumber]) { preloadAlbum(); }
	
	if (slideNumber != (slides.length -1)) {

		nextSlideNum = Number(slideNumber) +1;
		nextSlide = this.location.pathname + "?slide=" + nextSlideNum;
		
	} else {

		nextSlide = "gallery.html";
		
	}
	
	document.write("<a href=\"" + nextSlide + "\">Next &gt;&nbsp;</a>");


}

