/*******************************************************************************
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;
}
}
}
////////////////////////////////////////////////////////////////////////////////
// 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.faile.net/store/files/large/s-f_28768_MyConfessions_TO.jpg";
imgsGallery[0].title = "My Confessions To Order";
imgsGallery[0].caption = "This is the first image...";
imgsGallery[0].entryid = "94573182";
imgsGallery[1] = new Object();
imgsGallery[1].image = "http://www.faile.net/store/files/large/s-f_37197_Challenger.jpg";
imgsGallery[1].title = "Challenger";
imgsGallery[1].caption = "This is the first image...";
imgsGallery[1].entryid = "804180106";
imgsGallery[2] = new Object();
imgsGallery[2].image = "http://www.faile.net/store/files/large/s-f_38223_TenderForeverPrint08.jpg";
imgsGallery[2].title = "Tender Forever";
imgsGallery[2].caption = "This is the first image...";
imgsGallery[2].entryid = "74374624";
imgsGallery[3] = new Object();
imgsGallery[3].image = "http://www.faile.net/store/files/large/s-f_32229_ThisIsFaileBlue.jpg";
imgsGallery[3].title = "This is Faile in Blue";
imgsGallery[3].caption = "This is the first image...";
imgsGallery[3].entryid = "1452342";
var start = 0;
imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: true, autoplay: 2});
// set the initial captions
var title = (imgsGallery[0].title) ? imgsGallery[0].title : "No Title";
var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No caption";
var entryid = (imgsGallery[0].entryid) ? imgsGallery[0].entryid : "No id";
$("imgDisplay_title").innerHTML = title;
$("imgDisplay_caption").innerHTML = entryid;
$("imgDisplay_number").innerHTML = "1 of " + imgsGallery.length + " projects";
$("imgDisplay").src = imgsGallery[start].image;
}
////////////////////////////////////////////////////////////////////////////////
// EVENTS
Event.observe(window, 'load', init, false);
function failelogoroll() {
document.faile_logo.src = "imgs/faile_logo_roll.gif";
}
function failelogo() {
document.faile_logo.src = "imgs/faile_logo.gif";
}