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

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 setOnMouseClick2() {
	var elements = document.getElementsByTagName("a");
	for (var i = 0; i < elements.length; i++) {
		switch(elements[i].className) {
			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;
		}
	}
}

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

function init() {
	setOnMouseClick2();
	// 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/projekte/huethig/huethig_1.jpg";
	imgsGallery[0].title = "Temporäre Installation im Foyer des Verlages Hüthig Jehle Rehm, München, 2004 <small></small>";
	imgsGallery[0].caption = "";
	imgsGallery[0].link = "";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "images/projekte/huethig/huethig_2.jpg";
	imgsGallery[1].title = "Kreis 3, 2001, 200 x 200 x 4 cm, Marmor, Kupfer und Stahl, Ausstellungsansicht im Verlagshaus Hüthig Jehle Rehm, 2004 <small></small>";
	imgsGallery[1].caption = "";
	imgsGallery[1].link = "";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "images/projekte/huethig/huethig_3.jpg";
	imgsGallery[2].title = "Stele Pol 2, 180 x 45 x 45 cm, Marmor und Stahl, Ausstellungsansicht im Verlagshaus Hüthig Jehle Rehm, 2004 <small></small>";
	imgsGallery[2].caption = "";
	imgsGallery[2].link = "";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "images/projekte/huethig/huethig_4.jpg";
	imgsGallery[3].title = "Garten der Steine, 2004, 190 x 190 x 70 cm, Marmor und Edelstahl, Ausstellungsansicht im Verlagshaus Hüthig Jehle Rehm, 2004 <small></small>";
	imgsGallery[3].caption = "";
	imgsGallery[3].link = "";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "images/projekte/huethig/huethig_5.jpg";
	imgsGallery[4].title = "Garten der Steine, 2004, 190 x 190 x 70 cm, Marmor und Edelstahl, Ausstellungsansicht im Verlagshaus Hüthig Jehle Rehm, 2004 <small></small>";
	imgsGallery[4].caption = "";
	imgsGallery[4].link = "";
	
	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 : "";
	var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "";
	$("imgDisplay_title").innerHTML = title;
	$("imgDisplay_caption").innerHTML = caption;
	$("imgDisplay_number").innerHTML = "1 / " + imgsGallery.length;
	$("imgDisplay").src = imgsGallery[start].image;
	$("imgDisplay_link").href = imgsGallery[start].link;
	$("imgDisplay_link").title = imgsGallery[start].title;
}

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

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