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

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;
		}
	}
}

////////////////////////////////////////////////////////////////////////////////
// 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/01.jpg";
	imgsGallery[0].title = "Cook - ";
	imgsGallery[0].caption = "A 50th wedding anniversary invitation for Clyde and AnnaBelle. A	blend of traditional and modern help to celebrate this important milestone and momentous occasion.";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "/_images/02.jpg";
	imgsGallery[1].title = "Hidy - ";
	imgsGallery[1].caption = " A spring wedding invitation for Emilee and Joseph. This invitation reflects simplicity and function and allows the true meaning of their day to be given the most importance. A perforated RSVP card gives a convenient and casual way for friends to respond.";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "/_images/03.jpg";
	imgsGallery[2].title = "Musser - ";
	imgsGallery[2].caption = " An evening wedding invitation for Michael and Kimiko in the city of Seattle. It was important to this couple to emphasize family roots in their invitation. This was done through the Japanese cherry blossom theme and also by the ribbon on the front, which tied the individual cards together and connected the West Coast to the East Coast of the United States.";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "/_images/04.jpg";
	imgsGallery[3].title = "Musser - ";
	imgsGallery[3].caption = "Individual cards highlighted the various information needed for guests traveling to an out-of-town wedding. Each guest was also given a paper crane for seat assignments.";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "/_images/05.jpg";
	imgsGallery[4].title = "Rae - ";
	imgsGallery[4].caption = "A wedding invitation for Mallory and Andrew. Straying from all traditions, this invite appealed to the senses with different textures, materials, and scents. It was screenprinted, backed with flocked paper, placed into muslins bags, and sprinkled with rosemary for a pleasant surprise upon opening.";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "/_images/06.jpg";
	imgsGallery[5].title = "Reynaga - ";
	imgsGallery[5].caption = " An Americana winter wedding invitation for Rachel and Jeremy. With Jeremy in the Marine Reserves, this invitation captures an updated Americana theme through color, pattern, and a customized wax seal. The map, RSVP card and envelope are attached to the back of the invite with simple photo corners.";

	imgsGallery[6] = new Object();
	imgsGallery[6].image = "/_images/07.jpg";
	imgsGallery[6].title = "Smith - ";
	imgsGallery[6].caption = " A custom wedding invitation for Victoria and Steve, who wanted to blend their impeccable taste of fashion and love for everything vintage. Being held in a modern art gallery, the invitation had to feel modern, yet personable. The mossy lime with design hints of the eclectic furniture being used for wedding attendees bring their theme together. The package is completed with sewn pages placed inside a pastry bag, also sealed with thread.";

	imgsGallery[7] = new Object();
	imgsGallery[7].image = "/_images/08.jpg";
	imgsGallery[7].title = "Smith (cont.) - ";
	imgsGallery[7].caption = " A custom wedding invitation for Victoria and Steve, who wanted to blend their impeccable taste of fashion and love for everything vintage. Being held in a modern art gallery, the invitation had to feel modern, yet personable. The mossy lime with design hints of the eclectic furniture being used for wedding attendees bring their theme together. The package is completed with sewn pages placed inside a pastry bag, also sealed with thread.";

	imgsGallery[8] = new Object();
	imgsGallery[8].image = "/_images/09.jpg";
	imgsGallery[8].title = "Myers - ";
	imgsGallery[8].caption = " An evening, garden wedding invitation for Amanda and Joel. The invitation is folded accordion style and backed with a book cover from an old Shakespeare anthology, so that with the unfolding of each page, an additional phrase is revealed. And being a casual spring affair, this invitation naturally pulls design elements from the surroundings their guests will experience. The old book cover, paper made from banana fibers, screen printed organic flourishes, and a simple ribbon and button all allude to the whimsical and intimate gathering.";

	imgsGallery[9] = new Object();
	imgsGallery[9].image = "/_images/10.jpg";
	imgsGallery[9].title = "Centennial Gala - ";
	imgsGallery[9].caption = " An elegantly simple square invites guests to an equally elegant affair. The paper is the showcase of the piece with a rich suede feel and the information was printed using white foil. The package was mailed in a formal double envelope that was lined with metallic gold.";

	imgsGallery[10] = new Object();
	imgsGallery[10].image = "/_images/11.jpg";
	imgsGallery[10].title = "The Wiebners - ";
	imgsGallery[10].caption = " A talented husband and wife photography team was moving across the city to a new gallery space. This recyclable moving announcement was printed on both sides of the heavy vellum paper. The translucency of the paper and double-sided printing allowed for different shades of blue to be achieved with a sense of three-dimensionality. A chartreuse vellum envelope also made the package as fun as the couple themselves.";

	imgsGallery[11] = new Object();
	imgsGallery[11].image = "/_images/12.jpg";
	imgsGallery[11].title = "Nebel - ";
	imgsGallery[11].caption = " Colby's bar mitzvah save the date needed a punch of youthfulness without losing its dignity. With a modern monogram playing off his love of snowboarding and skating, and a sophisticated color palette of navy and silver, the save the date is fun yet dignified. They were printed by hand to give slight imperfections and an eroded effect. To complete an icy wintry feel, they were mailed in semi-transparent bags and sealed with a monogrammed sticker.";

	imgsGallery[12] = new Object();
	imgsGallery[12].image = "/_images/13.jpg";
	imgsGallery[12].title = "Salata - ";
	imgsGallery[12].caption = " A Save the Date card for Rachel and Nick and their summer wedding in coastal Maine. The sage green envelope is custom printed with their return address and matching bird on the flap, while a romantic tandem bike takes it cue from the vintage seaside setting.";

	imgsGallery[13] = new Object();
	imgsGallery[13].image = "/_images/14.jpg";
	imgsGallery[13].title = "Fitzgerald - ";
	imgsGallery[13].caption = " A whimsical and modern wedding for Olivia and Eric all centered around black and white. Escort cards were hand-printed feathers with guests' names while nonpareil-filled favor boxes featured their monogram and calligraphy details.";

	imgsGallery[14] = new Object();
	imgsGallery[14].image = "/_images/15.jpg";
	imgsGallery[14].title = "Grace - ";
	imgsGallery[14].caption = " A boxed invitation set the theme for Grace and Elliot's rustic wedding. Guests opened their invitation to discover a nest with two eggs and a banner declaring 'We're making our nest'. The printed invitation was secured inside the box lid with brown gingham ribbon.";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "/_images/16.jpg";
	imgsGallery[15].title = "Grace (cont.) - ";
	imgsGallery[15].caption = " Rustically chic details continued into the reception which included sparklers for favors (which were lit as the evening ended), escort banner cards pinned on apples, and menus printed on slices of wood.";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = "/_images/17.jpg";
	imgsGallery[16].title = "Kate - ";
	imgsGallery[16].caption = " All things bright and circular were incorporated into Kate and Jack's reception pieces. Round menus nestled inside the plates' rims while cocktail glasses were wrapped in ribbon and secured with a guest's name on a pin. Guests sat at the table that coordinated with the color of their pin.";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = "/_images/18.jpg";
	imgsGallery[17].title = "Quinn - "
	imgsGallery[17].caption = " A glamorous Hollywood affair complete with enveloped menus sealed in red wax and red velvet jewelry box escort cards.";
	
	imgsGallery[18] = new Object();
	imgsGallery[18].image = "/_images/19.jpg";
	imgsGallery[18].title = "Slater - "
	imgsGallery[18].caption = " Maui awaited guests bound for this destination wedding and the tube the screenprinted invitation was sent in ensured anticipation. The baby pink and moss green colors echoed the exotic location. Coral pieces held the escort cards at the reception.";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = "/_images/20.jpg";
	imgsGallery[19].title = "Thom -  "
	imgsGallery[19].caption = " An elegant wedding in elegant New England for Alicia and Thom. The invitations were backed with pearlescent blue paper and mailed in black boxes. Butterflies cut and folded from the invitation paper gave dimension and whimsy to the garden affair.";
	
	var start = 0;
	imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: true, autoplay: 4});
	
	// set the initial captions
	var title = (imgsGallery[0].title) ? imgsGallery[0].title : "No Title";
	var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No caption";
	$("imgDisplay_title").innerHTML = title;
	$("imgDisplay_caption").innerHTML = caption;
	$("imgDisplay_number").innerHTML = "1 of " + imgsGallery.length + " projects";
	$("imgDisplay").src = imgsGallery[start].image;
}

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

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