/*******************************************************************************
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();
imgs.apStop(10);
return false;
}
break;
case "prev":
elements[i].onclick = function() {
imgs.prevImg();
imgs.apStop(10);
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;
}
}
}
////////////////////////////////////////////////////////////////////////////////
// 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 = "http://www.damelioterras.com/MEDIA/02786.jpg";imgsGallery[0].titles = "Installation View
";imgsGallery[1] = new Object();imgsGallery[1].image = "http://www.damelioterras.com/MEDIA/02787.jpg";imgsGallery[1].titles = "Installation View
";imgsGallery[2] = new Object();imgsGallery[2].image = "http://www.damelioterras.com/MEDIA/02788.jpg";imgsGallery[2].titles = "Installation View
";imgsGallery[3] = new Object();imgsGallery[3].image = "http://www.damelioterras.com/MEDIA/02769.jpg";imgsGallery[3].titles = "Noguchi Rika
The Sun #3 2005-2006
Image Size: 17.83 x 25.71 inches (45.3 x 65.3 cm)
Frame Size: 18.46 x 26.34 x 1.26 inches (46.9 x 66.9 x 3.2 cm)
c-print
";imgsGallery[4] = new Object();imgsGallery[4].image = "http://www.damelioterras.com/MEDIA/02767.jpg";imgsGallery[4].titles = "Noguchi Rika
The Sun #8 2005-2006
Image Size: 17.83 x 25.71 inches (45.3 x 65.3 cm)
Frame Size: 18.46 x 26.34 x 1.26 inches (46.9 x 66.9 x 3.2 cm)
c-print
";imgsGallery[5] = new Object();imgsGallery[5].image = "http://www.damelioterras.com/MEDIA/02768.jpg";imgsGallery[5].titles = "Noguchi Rika
The Sun #1 2005-2006
Image Size: 17.83 x 25.71 inches (45.3 x 65.3 cm)
Frame Size: 18.46 x 26.34 x 1.26 inches (46.9 x 66.9 x 3.2 cm)
c-print
";
var start = 0;
imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: true, autoplay: 0});
// set the initial captions
var titles = (imgsGallery[0].titles) ? imgsGallery[0].titles : "No Title";
var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No caption";
$("imgDisplay_titles").innerHTML = titles;
$("imgDisplay_number").innerHTML = "(image 1 out of " + imgsGallery.length + ")";
$("imgDisplay").src = imgsGallery[start].image;
}
////////////////////////////////////////////////////////////////////////////////
// EVENTS
Event.observe(window, 'load', init, false);