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

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

////////////////////////////////////////////////////////////////////////////////
// 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/gruppen/quadrate/quadrate_1.png";
	imgsGallery[0].title = "Quadrat 69, V 2 A Stahl und Marmor, 130 x 130 x 20 cm, 2010<small></small>";
	imgsGallery[0].caption = "";
	imgsGallery[0].link = "";
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "images/gruppen/quadrate/quadrate_2.png";
	imgsGallery[1].title = "Quadrat 71, Stahl und Marmor, 30 x 30 x 12 cm, 2011<small></small>";
	imgsGallery[1].caption = "";
	imgsGallery[1].link = "";
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "images/gruppen/quadrate/quadrate_3.png";
	imgsGallery[2].title = "Quadrat 72, Stahl und Marmor, 21 x 21 x 12 cm, 2011<small></small>";
	imgsGallery[2].caption = "";
	imgsGallery[2].link = "";
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "images/gruppen/quadrate/quadrate_4.png";
	imgsGallery[3].title = "Quadrat 73, Stahl und Marmor, 40 x 30 x 15 cm, 2011<small></small>";
	imgsGallery[3].caption = "";
	imgsGallery[3].link = "";
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "images/gruppen/quadrate/quadrate_5.png";
	imgsGallery[4].title = "Quadrat 67, Stahl und Marmor, 69 x 69 x 10 cm, 2010, Hotel Rauriser Hof, Österreich<small></small>";
	imgsGallery[4].caption = "";
	imgsGallery[4].link = "";
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "images/gruppen/quadrate/quadrate_6.png";
	imgsGallery[5].title = "Quadrat 68, Stahl und Marmor, 69 x 69 x 10 cm, 2010, Hotel Rauriser Hof, Österreich<small></small>";
	imgsGallery[5].caption = "";
	imgsGallery[5].link = "";
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "images/gruppen/quadrate/quadrate_7.jpg";
	imgsGallery[6].title = "Quadrat 52, Stahl und Marmor, 75 x 75 x 15 cm, 2006, Rücker und Schindele; Beratende Ingenieure, München<small></small>";
	imgsGallery[6].caption = "";
	imgsGallery[6].link = "";
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "images/gruppen/quadrate/quadrate_8.jpg";
	imgsGallery[7].title = "Quadrat 56, Stahl und Marmor, 75 x 75 x 15 cm, 2007<small></small>";
	imgsGallery[7].caption = "";
	imgsGallery[7].link = "";
	imgsGallery[8] = new Object();
	imgsGallery[8].image = "images/gruppen/quadrate/quadrate_9.jpg";
	imgsGallery[8].title = "Quadrat 51, Stahl und Marmor, 75 x 75 x 15 cm, 2006<small></small>";
	imgsGallery[8].caption = "";
	imgsGallery[8].link = "";
	imgsGallery[9] = new Object();
	imgsGallery[9].image = "images/gruppen/quadrate/quadrate_10.jpg";
	imgsGallery[9].title = "Quadrat 50, Stahl und Marmor, 75 x 75 x 15 cm, 2006<small></small>";
	imgsGallery[9].caption = "";
	imgsGallery[9].link = "";
	imgsGallery[10] = new Object();
	imgsGallery[10].image = "images/gruppen/quadrate/quadrate_11.jpg";
	imgsGallery[10].title = "Quadrat 57, Stahl und Marmor, 27 x 27 x 5 cm, 2007<small></small>";
	imgsGallery[10].caption = "";
	imgsGallery[10].link = "";
	imgsGallery[11] = new Object();
	imgsGallery[11].image = "images/gruppen/quadrate/quadrate_12.jpg";
	imgsGallery[11].title = "Quadrat 37, Stahl und Marmor, 27 x 27 x 10 cm, 2004, Sammlung Stadt Schwandorf<small></small>";
	imgsGallery[11].caption = "";
	imgsGallery[11].link = "";
	imgsGallery[12] = new Object();
	imgsGallery[12].image = "images/gruppen/quadrate/quadrate_13.jpg";
	imgsGallery[12].title = "Quadrat 37, Stahl und Marmor, 27 x 27 x 10 cm, 2004, Sammlung Stadt Schwandorf<small></small>";
	imgsGallery[12].caption = "";
	imgsGallery[12].link = "";
	imgsGallery[13] = new Object();
	imgsGallery[13].image = "images/gruppen/quadrate/quadrate_14.jpg";
	imgsGallery[13].title = "Quadrat 53, Stahl und Marmor, 75 x 75 x 5 cm, 2006<small></small>";
	imgsGallery[13].caption = "";
	imgsGallery[13].link = "";
	imgsGallery[14] = new Object();
	imgsGallery[14].image = "images/gruppen/quadrate/quadrate_15.jpg";
	imgsGallery[14].title = "Quadrat 15, Stahl und Marmor, 27 x 27 x 10 cm, 2003, Privatsammlung Schweden<small></small>";
	imgsGallery[14].caption = "";
	imgsGallery[14].link = "";
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "images/gruppen/quadrate/quadrate_16.jpg";
	imgsGallery[15].title = "Quadrat 8, Stahl und Marmor, 69 x 69 x 10 cm, 2002, Privatsammlung, Korea <small></small>";
	imgsGallery[15].caption = "";
	imgsGallery[15].link = "";
	imgsGallery[16] = new Object();
	
	

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