/******************************************************************************* 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; case "s9": elements[i].onclick = function() { imgs.showImg(9); 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://mud.pixelink.co.uk/photo/image/33/normal/Morricone_ptg_fron_B_D_website.jpg"; imgsGallery[0].title = "Morricone"; imgsGallery[0].caption = "2007, oil on canvas"; imgsGallery[1] = new Object(); imgsGallery[1].image = "http://mud.pixelink.co.uk/photo/image/18/normal/Rocks-2.jpg"; imgsGallery[1].title = "Rock 2 (d)"; imgsGallery[1].caption = "2007, oil on canvas61 x 41cm"; imgsGallery[2] = new Object(); imgsGallery[2].image = "http://mud.pixelink.co.uk/photo/image/19/normal/Small_Ex_Peel.jpg"; imgsGallery[2].title = "Small Ex Peel"; imgsGallery[2].caption = "2007, oil on canvas, 30 x 35cm"; imgsGallery[3] = new Object(); imgsGallery[3].image = "http://mud.pixelink.co.uk/photo/image/28/normal/bowles-001.jpg"; imgsGallery[3].title = "Bowles"; imgsGallery[3].caption = "2007, oil on canvas35 x 25 cm"; imgsGallery[4] = new Object(); imgsGallery[4].image = "http://mud.pixelink.co.uk/photo/image/32/normal/St.Jerome.jpg"; imgsGallery[4].title = "st Jerome"; imgsGallery[4].caption = "2007, oil on canvas61.4 x 41 cm"; imgsGallery[5] = new Object(); imgsGallery[5].image = "http://mud.pixelink.co.uk/photo/image/12/normal/Ex-Ox.jpg"; imgsGallery[5].title = "Ex Ox"; imgsGallery[5].caption = "2007, oil on canvas122 x93cm"; imgsGallery[6] = new Object(); imgsGallery[6].image = "http://mud.pixelink.co.uk/photo/image/27/normal/Danilo-001.jpg"; imgsGallery[6].title = "Danillo"; imgsGallery[6].caption = "2007, oil on canvas35 x 25 cm"; imgsGallery[7] = new Object(); imgsGallery[7].image = "http://mud.pixelink.co.uk/photo/image/34/normal/clearing-001.jpg"; imgsGallery[7].title = "Clearing"; imgsGallery[7].caption = "2007, oil on canvas "; imgsGallery[8] = new Object(); imgsGallery[8].image = "http://mud.pixelink.co.uk/photo/image/25/normal/CC0011.jpg"; imgsGallery[8].title = "Orange Bay Tree (bi)"; imgsGallery[8].caption = "2004, 91 x80.5 cmoil on canvas"; imgsGallery[9] = new Object(); imgsGallery[9].image = "http://mud.pixelink.co.uk/photo/image/23/normal/CC0016.jpg"; imgsGallery[9].title = "matches etc (small)"; imgsGallery[9].caption = "2003, 18 x 21 cmoil on canvas"; var start = 0; imgs = new MudFadeGallery('imgs', 'imgDisplay', imgsGallery, {startNum: start, preload: true, autoplay: false}); // set the initial captions var title = (imgsGallery[0].title) ? imgsGallery[0].title : "No Title"; var caption = (imgsGallery[0].caption) ? imgsGallery[0].caption : "No caption"; $("imgDisplay_title").innerHTML = title; $("imgDisplay_caption").innerHTML = caption; $("imgDisplay_number").innerHTML = "1 of " + imgsGallery.length + " "; $("imgDisplay").src = imgsGallery[start].image; } //////////////////////////////////////////////////////////////////////////////// // EVENTS Event.observe(window, 'load', init, false);