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

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

////////////////////////////////////////////////////////////////////////////////
// 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/odile/odile-fette-henne.png";
	imgsGallery[0].title = "<span class='red'>|</span> title: Fette Henne<br /><span class='red'>|</span> project: Book<br /><span class='red'>|</span> design: Martin Thiemann<br /><span class='red'>|</span> year: 2008";
	
	imgsGallery[0].caption = "<em>Fette Henne</em> is a diploma project about interesting facts, curiosities and news about Germany: How many bridges are there in Hamburg, what means &ldquo;zeitgeisty&rdquo; and how often do Germans have sex? How many Trabbis are driving the streets of Germany and what about the &ldquo;Fat Hen&rdquo;? This book of 140 pages reveals interesting, strange and new statistical facts and figures about Germany. These data resources are made available in a humorous and surprising fashion. The book&rsquo;s meticulously designed details are complemented with a thread stitching, embossed hard cover and dust jacket, assuming a design object in itself.";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "images/odile/odile-mystic-grits.png";
	imgsGallery[1].title = "<span class='red'>|</span> title: Mystic Grits<br /><span class='red'>|</span> project: Softcover Book<br /><span class='red'>|</span> design: Brian M Johnson, N Silas Munro<br /><span class='red'>|</span> year: 2009";
	imgsGallery[1].caption = "";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "images/odile/odile-nguen-book.png";
	imgsGallery[2].title = "<span class='red'>|</span> title: De Retour<br /><span class='red'>|</span> project: Hardcover Photography Book<br /><span class='red'>|</span> design: Mathieu Christe<br /><span class='red'>|</span> photography: Loan Nguyen<br /><span class='red'>|</span> publisher: Christoph Merian Verlag<br /><span class='red'>|</span> year: 2007";
	imgsGallery[2].caption = "";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "images/odile/odile-gap-magazine.png";
	imgsGallery[3].title = "<span class='red'>|</span> title: The Gap<br /><span class='red'>|</span> project: Magazine<br /><span class='red'>|</span> design: Sig Ganhoer<br /><span class='red'>|</span> year: 2008";
	imgsGallery[3].caption = "";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "images/odile/odile-culture-japonaise.png";
	imgsGallery[4].title = "<span class='red'>|</span> title: Mois de la Culture Japonaise<br /><span class='red'>|</span> project: Poster<br /><span class='red'>|</span> design: Mathieu Christe<br /><span class='red'>|</span> year: 2005";
	imgsGallery[4].caption = "";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "images/odile/odile-arthur-magazine.png";
	imgsGallery[5].title = "<span class='red'>|</span> title: Arthur<br /><span class='red'>|</span> project: Magazine<br /><span class='red'>|</span> design: Michael Worthington, Yasmin Khan<br /><span class='red'>|</span> year: 2006";
	imgsGallery[5].caption = "";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "images/odile/odile-specimen.png";
	imgsGallery[6].title = "<span class='red'>|</span> title: Odile Typeface Family<br /><span class='red'>|</span> project: Type Specimen<br /><span class='red'>|</span> design: Catharina Meyer<br /><span class='red'>|</span> year: 2005";
	imgsGallery[6].caption = "";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "images/odile/odile-cultureel-report.png";
	imgsGallery[7].title = "<span class='red'>|</span> title: Mondriaan Foundation Annual Report<br /><span class='red'>|</span> project: Annual report<br /><span class='red'>|</span> designer: Ingeborg Scheffers<br /><span class='red'>|</span> photography: DirkWolf.nl<br /><span class='red'>|</span> year: 2008";
	imgsGallery[7].caption = "";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = "images/odile/odile-mediterrane-book.png";
	imgsGallery[8].title = "<span class='red'>|</span> title: Territoire M&eacute;diterran&eacute;e<br /><span class='red'>|</span> project: Book<br /><span class='red'>|</span> design: Mathieu Christe<br /><span class='red'>|</span> year: 2005";
	imgsGallery[8].caption = "";
	
	var start = 0;
	imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: true, autoplay: 0});
	
	// set the initial captions
	var title = (imgsGallery[0].title) ? imgsGallery[0].title : "No Title";
	var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No Description";
	$("imgDisplay_title").innerHTML = title;
	$("imgDisplay_caption").innerHTML = caption;
	$("imgDisplay_number").innerHTML = "1 | " + imgsGallery.length;
	$("imgDisplay").src = imgsGallery[start].image;
}

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

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