/*******************************************************************************

FILE: mud_Scripts.js
REQUIRES: prototype.js, mud_FadeGallery.js
AUTHOR: Takashi Okamoto mud(tm) - http://www.mudcorp.com/
VERSION: 2.0 - converted to use prototype.js
DATE: 01/05/2006

--------------------------------------------------------------------------------

This file is part of MudFadeGallery.

	MudFadeGallery is free for anyone to use, but this header MUST be
	included, and may not be modified.

*******************************************************************************/

////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARS

var imgsGallery = new Array();
var imgs;

///////////////////////////////////////////////////////////////////////////////
// MOUSE EVENTS

function setOnMouseClick() {
	var elements = document.getElementsByTagName("a");
	for (var i = 0; i < elements.length; i++) {
		switch(elements[i].className) {
			case "next":
				elements[i].onclick = function() {
					 imgs.nextImg();
					 return false;
				}
				break;
			case "prev":
				elements[i].onclick = function() {
					 imgs.prevImg();
					 return false;
				}
				break;
			case "s0":
				elements[i].onclick = function() {
					 imgs.showImg(0);
					 return false;
				}
				break;
			case "s1":
				elements[i].onclick = function() {
					 imgs.showImg(1);
					 return false;
				}
				break;
			case "s2":
				elements[i].onclick = function() {
					 imgs.showImg(2);
					 return false;
				}
				break;
			case "s3":
				elements[i].onclick = function() {
					 imgs.showImg(3);
					 return false;
				}
				break;
			case "s4":
				elements[i].onclick = function() {
					 imgs.showImg(4);
					 return false;
				}
				break;
			case "s5":
				elements[i].onclick = function() {
					 imgs.showImg(5);
					 return false;
				}
				break;
			case "s6":
				elements[i].onclick = function() {
					 imgs.showImg(6);
					 return false;
				}
				break;
			case "s7":
				elements[i].onclick = function() {
					 imgs.showImg(7);
					 return false;
				}
				break;
			case "s8":
				elements[i].onclick = function() {
					 imgs.showImg(8);
					 return false;
				}
				break;
			case "s9":
				elements[i].onclick = function() {
					 imgs.showImg(9);
					 return false;
				}
				break;
			case "s10":
				elements[i].onclick = function() {
					 imgs.showImg(10);
					 return false;
				}
				break;
			case "s11":
				elements[i].onclick = function() {
					 imgs.showImg(11);
					 return false;
				}
				break;
			case "s12":
				elements[i].onclick = function() {
					 imgs.showImg(12);
					 return false;
				}
				break;
			case "s13":
				elements[i].onclick = function() {
					 imgs.showImg(13);
					 return false;
				}
				break;
			case "s14":
				elements[i].onclick = function() {
					 imgs.showImg(14);
					 return false;
				}
				break;
			case "s15":
				elements[i].onclick = function() {
					 imgs.showImg(15);
					 return false;
				}
				break;
			case "s16":
				elements[i].onclick = function() {
					 imgs.showImg(16);
					 return false;
				}
				break;
			case "s17":
				elements[i].onclick = function() {
					 imgs.showImg(17);
					 return false;
				}
				break;
			case "s18":
				elements[i].onclick = function() {
					 imgs.showImg(18);
					 return false;
				}
				break;
			case "s19":
				elements[i].onclick = function() {
					 imgs.showImg(19);
					 return false;
				}
				break;	
			case "s20":
				elements[i].onclick = function() {
					 imgs.showImg(20);
					 return false;
				}
				break;
				case "s21":
				elements[i].onclick = function() {
					 imgs.showImg(21);
					 return false;
				}
				break;
				case "s22":
				elements[i].onclick = function() {
					 imgs.showImg(22);
					 return false;
				}
				break;	
				break;
				case "s23":
				elements[i].onclick = function() {
					 imgs.showImg(23);
					 return false;
				}
				break;	
				break;
				case "s24":
				elements[i].onclick = function() {
					 imgs.showImg(24);
					 return false;
				}
				break;	

	
		}
	}
}

////////////////////////////////////////////////////////////////////////////////
// INIT

function init() {
	setOnMouseClick();
	// images gallery
	// load images note: imgsGallery[].image isn't an array of images, just strings to hold location
	
	imgsGallery[0] = new Object();
	imgsGallery[0].image = "images/gallery_lg/trailheads.jpg";
	imgsGallery[0].caption = "<h2>Trailheads</h2>North Carolina Museum of Art, Raleigh, NC, 2005.<br>  Photograph: Courtesy of the North Carolina Museum of Art.";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "images/gallery_lg/owaiawi_1.jpg";
	imgsGallery[1].caption = "<h2>Na Hale 'o waiawi</h2> (Roughly translated from the Hawaiian language to mean: Wild Dwellings Built from Strawberry Guava).<br> The Contemporary Art Museum, Honolulu, Hawaii, 2003. <br>Photographer: Paul Kodama.<br><br><a href='#' onclick='imgs.showImg(18); return false;'>view alternate image</a>";

	imgsGallery[2] = new Object();
	imgsGallery[2].image = "images/gallery_lg/dointhelocomotion.jpg";
	imgsGallery[2].caption = "<h2>Doin' the Locomotion</h2> Grounds For Sculpture, Hamilton, NJ, 2004.<br> Photographer:  Ricardo Barros.";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "images/gallery_lg/ninelives.jpg";
	imgsGallery[3].caption = "<h2>Nine Lives</h2> Franklin Park Conservatory, Columbus, Ohio, 2006.<br> Photographer: Greg Sailor.";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "images/gallery_lg/justaroundthecorner_summer.jpg";
	imgsGallery[4].caption = "<h2>Around the Corner</h2> University of Southern Indiana, New Harmony Gallery, New Harmony, IN, 2003.<br> Photographer: Doyle Dean. <br><br><a href='#' onclick='imgs.showImg(17); return false;'>view alternate image</a>";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "images/gallery_lg/callofthewild.jpg";
	imgsGallery[5].caption = "<h2>Call of the Wild</h2> Museum of Glass, Tacoma, WA, 2002.<br> Photographer: Duncan Price.";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "images/gallery_lg/standbyme.jpg";
	imgsGallery[6].caption = "<h2>Standby</h2> Raleigh-Durham Airport Authority, Raleigh, NC, 2000.<br> Photographer: Jerry Blow.";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "images/gallery_lg/toadhall.jpg";
	imgsGallery[7].caption = "<h2>Toad Hall</h2> Santa Barbara Botanic Garden, Santa Barbara, CA, 2005.<br> Photographer: Nell Campbell.";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = "images/gallery_lg/paradisegate.jpg";
	imgsGallery[8].caption = "<h2>Paradise Gate</h2> Smith College Museum of Art, Northampton, MA, 2001.<br> Photographer: Stephen Petegorsky.";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = "images/gallery_lg/jugornaught.jpg";
	imgsGallery[9].caption = "<h2>Jug or Naught</h2> Fredric Meijer Gardens, Grand Rapids, Michigan, 1999.<br> Photographer: David Ferris.";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = "images/gallery_lg/spinoffs.jpg";
	imgsGallery[10].caption = "<h2>Spinoffs</h2> Decordova Museum, Lincoln, Massachusettes, 1990.<br> Photographer: George Vasquez.";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = "images/gallery_lg/crossingover.jpg";
	imgsGallery[11].caption = "<h2>Crossing Over</h2> American Craft Museum, New York, New York, 1996.<br> Photographer: Dennis Cowley.";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = "images/gallery_lg/sittinpretty.jpg";
	imgsGallery[12].caption = "<h2>Sittin' Pretty</h2> South Carolina Botanical Gardens, Clemson, South Carolina, 1996.<br> Photographer: David Lewis.";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = "images/gallery_lg/easydoesit.jpg";
	imgsGallery[13].caption = "<h2>Easy Does It</h2> Hollywood Art &amp; Culture Center, Hollywood, Florida, 1998.<br> Photographer: John Lawrence.";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = "images/gallery_lg/celldivision.jpg";
	imgsGallery[14].caption = "<h2>Cell Division</h2> Savannah College of Art, Savannah, Georgia, 1998.<br> Photographer: Wayne Moore.";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "images/gallery_lg/fullcourtpress.jpg";
	imgsGallery[15].caption = "<h2>Full Court Press</h2> Munson Williams Proctor Arts Institute, Utica, New York, 2001.<br> Photographer: David Revette.";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = "images/gallery_lg/owache.jpg";
	imgsGallery[16].caption = "<h2>Owache</h2> Northern Illinois University, Dekalb, Illinois, 1999.<br> Photographer: Larry Gregory.";

	imgsGallery[17] = new Object();
	imgsGallery[17].image = "images/gallery_lg/justaroundthecorner_winter.jpg";
	imgsGallery[17].caption = "<h2>Around the Corner</h2> University of Southern Indiana, New Harmony Gallery, New Harmony, IN, 2003.<br> Photographer: Doyle Dean.<br><br><a href='#' onclick='imgs.showImg(4); return false;'>< back</a>";

	imgsGallery[18] = new Object();
	imgsGallery[18].image = "images/gallery_lg/owaiawi_3.jpg";
	imgsGallery[18].caption = "<h2>Na Hale 'o waiawi</h2> (Roughly translated from the Hawaiian language to mean: Wild Dwellings Built from Strawberry Guava).<br> The Contemporary Art Museum, Honolulu, Hawaii, 2003. <br>Photographer: Paul Kodama.<br><br><a href='#' onclick='imgs.showImg(1); return false;'>< back</a>";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = "images/gallery_lg/closeties_1.jpg";
	imgsGallery[19].caption = "<h2>Close Ties</h2>Brahan Estate, Dingwall, Scottish Highlands, 2006. <br>Photographer: Fin Macrae.";
	
	imgsGallery[20] = new Object();
	imgsGallery[20].image = "images/gallery_lg/childhood_dreams_1.jpg";
	imgsGallery[20].caption = "<h2>Childhood Dreams</h2>Desert Botanical Garden, Phoenix, Arizona, 2007. <br> Photographer: Adam Rodriguez.";

	imgsGallery[21] = new Object();
	imgsGallery[21].image = "images/gallery_lg/france.jpg";
	imgsGallery[21].caption = "<h2>Sortie de Cave</h2>Jardin des Arts, Chateaubourg, France, 2008. <br/> Photography: Charles Crie.";
	
	imgsGallery[22] = new Object();
	imgsGallery[22].image = "images/gallery_lg/morris.jpg";
	imgsGallery[22].caption = "<h2>The Summer Palace</h2>Morris Arboretum of the University of Pennsylvania, Philadelphia, PA, 2009. <br/> Photographer: Rob Cardillo.";
	
	imgsGallery[23] = new Object();
	imgsGallery[23].image = "images/gallery_lg/UffDaNight_Todd-Mulvihill_2_lg.jpg";
	imgsGallery[23].caption = "<h2>Uff-Da Palace</h2>Minnesota Landscape Arboretum of the University of Minnesota, Chaska, MN, 2010. <br/> Photographer: Todd Mulvihill.";
	
	imgsGallery[24] = new Object();
	imgsGallery[24].image = "images/gallery_lg/DSC_1619_lg.jpg";
	imgsGallery[24].caption = "<h2>Ain't Misbehavin'</h2>Winthrop College, Rock Hill, SC, 2010. <br/> Photographer: Zan Maddox.";
	
	var start = 1;
	imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: false, autoplay: 0});
	
	// set the initial captions
	var title = (imgsGallery[1].title) ? imgsGallery[1].title : "";
	var caption = (imgsGallery[1].caption) ? imgsGallery[1].caption : "No caption";
	$("imgDisplay_title").innerHTML = title;
	$("imgDisplay_caption").innerHTML = caption;
	$("imgDisplay").src = imgsGallery[start].image;
}

////////////////////////////////////////////////////////////////////////////////
// EVENTS

Event.observe(window, 'load', init, false);
