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

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 = "../../images/martine/m_01.jpg";
	imgsGallery[0].title = "";
	imgsGallery[0].caption = "";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "../../images/martine/m_002.jpg";
	imgsGallery[1].title = "";
	imgsGallery[1].caption = "";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "../../images/martine/m_003.jpg";
	imgsGallery[2].title = "";
	imgsGallery[2].caption = "";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "../../images/martine/m_004.jpg";
	imgsGallery[3].title = "";
	imgsGallery[3].caption = "";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "../../images/martine/m_005.jpg";
	imgsGallery[4].title = "";
	imgsGallery[4].caption = "";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "../../images/martine/m_006.jpg";
	imgsGallery[5].title = "";
	imgsGallery[5].caption = "";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "../../images/martine/m_007.jpg";
	imgsGallery[6].title = "";
	imgsGallery[6].caption = "";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "../../images/martine/m_008.jpg";
	imgsGallery[7].title = "";
	imgsGallery[7].caption = "";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = "../../images/martine/m_009.jpg";
	imgsGallery[8].title = "";
	imgsGallery[8].caption = "";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = "../../images/martine/m_010.jpg";
	imgsGallery[9].title = "";
	imgsGallery[9].caption = "";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = "../../images/martine/m_011.jpg";
	imgsGallery[10].title = "";
	imgsGallery[10].caption = "";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = "../../images/martine/m_012.jpg";
	imgsGallery[11].title = "";
	imgsGallery[11].caption = "";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = "../../images/martine/m_013.jpg";
	imgsGallery[12].title = "";
	imgsGallery[12].caption = "";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = "../../images/martine/m_014.jpg";
	imgsGallery[13].title = "";
	imgsGallery[13].caption = "";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = "../../images/martine/m_015.jpg";
	imgsGallery[14].title = "";
	imgsGallery[14].caption = "";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "../../images/martine/m_016.jpg";
	imgsGallery[15].title = "";
	imgsGallery[15].caption = "";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = "../../images/martine/m_017.jpg";
	imgsGallery[16].title = "";
	imgsGallery[16].caption = "";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = "../../images/martine/m_018.jpg";
	imgsGallery[17].title = "";
	imgsGallery[17].caption = "";
	
	imgsGallery[18] = new Object();
	imgsGallery[18].image = "../../images/martine/m_019.jpg";
	imgsGallery[18].title = "";
	imgsGallery[18].caption = "";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = "../../images/martine/m_020.jpg";
	imgsGallery[19].title = "";
	imgsGallery[19].caption = "";
	
	imgsGallery[20] = new Object();
	imgsGallery[20].image = "../../images/martine/m_021.jpg";
	imgsGallery[20].title = "";
	imgsGallery[20].caption = "";
	
	imgsGallery[21] = new Object();
	imgsGallery[21].image = "../../images/martine/m_022.jpg";
	imgsGallery[21].title = "";
	imgsGallery[21].caption = "";
	
	imgsGallery[22] = new Object();
	imgsGallery[22].image = "../../images/martine/m_023.jpg";
	imgsGallery[22].title = "";
	imgsGallery[22].caption = "";
	
	imgsGallery[23] = new Object();
	imgsGallery[23].image = "../../images/martine/m_024.jpg";
	imgsGallery[23].title = "";
	imgsGallery[23].caption = "";
	
	imgsGallery[24] = new Object();
	imgsGallery[24].image = "../../images/martine/m_025.jpg";
	imgsGallery[24].title = "";
	imgsGallery[24].caption = "";
	
	imgsGallery[25] = new Object();
	imgsGallery[25].image = "../../images/martine/m_026.jpg";
	imgsGallery[25].title = "";
	imgsGallery[25].caption = "";
	
	imgsGallery[26] = new Object();
	imgsGallery[26].image = "../../images/martine/m_027.jpg";
	imgsGallery[26].title = "";
	imgsGallery[26].caption = "";
	
	imgsGallery[27] = new Object();
	imgsGallery[27].image = "../../images/martine/m_028.gif";
	imgsGallery[27].title = "Georges Michael";
	imgsGallery[27].caption = "";
	
	imgsGallery[28] = new Object();
	imgsGallery[28].image = "../../images/martine/m_030.gif";
	imgsGallery[28].title = "The Police";
	imgsGallery[28].caption = "";
	
	imgsGallery[29] = new Object();
	imgsGallery[29].image = "../../images/martine/m_031.gif";
	imgsGallery[29].title = "Bob Dylan";
	imgsGallery[29].caption = "";
	
	imgsGallery[30] = new Object();
	imgsGallery[30].image = "../../images/martine/m_033.gif";
	imgsGallery[30].title = "The Velvet Underground";
	imgsGallery[30].caption = "";
	
	imgsGallery[31] = new Object();
	imgsGallery[31].image = "../../images/martine/m_034.gif";
	imgsGallery[31].title = "Frank Sinatra";
	imgsGallery[31].caption = "";
	
	imgsGallery[32] = new Object();
	imgsGallery[32].image = "../../images/martine/m_035.gif";
	imgsGallery[32].title = "The Rolling Stones";
	imgsGallery[32].caption = "";
	
	imgsGallery[33] = new Object();
	imgsGallery[33].image = "../../images/martine/m_036.gif";
	imgsGallery[33].title = "The Beatles";
	imgsGallery[33].caption = "";
	
	imgsGallery[34] = new Object();
	imgsGallery[34].image = "../../images/martine/m_037.gif";
	imgsGallery[34].title = "Otis Redding";
	imgsGallery[34].caption = "";
	
	imgsGallery[35] = new Object();
	imgsGallery[35].image = "../../images/martine/m_038.gif";
	imgsGallery[35].title = "Iggy Pop and The Stooges";
	imgsGallery[35].caption = "";
	
	imgsGallery[36] = new Object();
	imgsGallery[36].image = "../../images/martine/m_039.gif";
	imgsGallery[36].title = "Barry White";
	imgsGallery[36].caption = "";
	
	imgsGallery[37] = new Object();
	imgsGallery[37].image = "../../images/martine/m_040.gif";
	imgsGallery[37].title = "Nirvana";
	imgsGallery[37].caption = "";
	
	imgsGallery[38] = new Object();
	imgsGallery[38].image = "../../images/martine/m_041.gif";
	imgsGallery[38].title = "The Fray";
	imgsGallery[38].caption = "";
	
	imgsGallery[39] = new Object();
	imgsGallery[39].image = "../../images/martine/m_042.gif";
	imgsGallery[39].title = "Barbara";
	imgsGallery[39].caption = "";
	
	imgsGallery[40] = new Object();
	imgsGallery[40].image = "../../images/martine/m_043.gif";
	imgsGallery[40].title = "America";
	imgsGallery[40].caption = "";
	
	imgsGallery[41] = new Object();
	imgsGallery[41].image = "../../images/martine/m_044.gif";
	imgsGallery[41].title = "Michael Jackson";
	imgsGallery[41].caption = "";
	
	imgsGallery[42] = new Object();
	imgsGallery[42].image = "../../images/martine/m_045.gif";
	imgsGallery[42].title = "The Rolling Stones";
	imgsGallery[42].caption = "";
	
	imgsGallery[43] = new Object();
	imgsGallery[43].image = "../../images/martine/m_046.gif";
	imgsGallery[43].title = "Serge Gainsbourg";
	imgsGallery[43].caption = "";
	
	imgsGallery[44] = new Object();
	imgsGallery[44].image = "../../images/martine/m_047.gif";
	imgsGallery[44].title = "The Doors";
	imgsGallery[44].caption = "";
	
	imgsGallery[45] = new Object();
	imgsGallery[45].image = "../../images/martine/m_048.gif";
	imgsGallery[45].title = "The Who";
	imgsGallery[45].caption = "";
	
	imgsGallery[46] = new Object();
	imgsGallery[46].image = "../../images/martine/m_049.gif";
	imgsGallery[46].title = "Jacques Brel";
	imgsGallery[46].caption = "";
	
	imgsGallery[47] = new Object();
	imgsGallery[47].image = "../../images/martine/m_050.gif";
	imgsGallery[47].title = "";
	imgsGallery[47].caption = "";
	
	imgsGallery[48] = new Object();
	imgsGallery[48].image = "../../images/martine/m_051.gif";
	imgsGallery[48].title = "";
	imgsGallery[48].caption = "";
	
	imgsGallery[49] = new Object();
	imgsGallery[49].image = "../../images/martine/m_052.gif";
	imgsGallery[49].title = "";
	imgsGallery[49].caption = "";
	
	imgsGallery[50] = new Object();
	imgsGallery[50].image = "../../images/martine/m_053.gif";
	imgsGallery[50].title = "";
	imgsGallery[50].caption = "";
	
	imgsGallery[51] = new Object();
	imgsGallery[51].image = "../../images/martine/m_054.gif";
	imgsGallery[51].title = "";
	imgsGallery[51].caption = "";
	
	imgsGallery[52] = new Object();
	imgsGallery[52].image = "../../images/martine/m_055.gif";
	imgsGallery[52].title = "";
	imgsGallery[52].caption = "";
	
	imgsGallery[53] = new Object();
	imgsGallery[53].image = "../../images/martine/m_056.gif";
	imgsGallery[53].title = "";
	imgsGallery[53].caption = "";
	
	imgsGallery[54] = new Object();
	imgsGallery[54].image = "../../images/martine/m_057.gif";
	imgsGallery[54].title = "";
	imgsGallery[54].caption = "";
	
	imgsGallery[55] = new Object();
	imgsGallery[55].image = "../../images/martine/m_058.gif";
	imgsGallery[55].title = "";
	imgsGallery[55].caption = "";
	
	imgsGallery[56] = new Object();
	imgsGallery[56].image = "../../images/martine/m_059.gif";
	imgsGallery[56].title = "";
	imgsGallery[56].caption = "";
	
	imgsGallery[57] = new Object();
	imgsGallery[57].image = "../../images/martine/m_060.gif";
	imgsGallery[57].title = "";
	imgsGallery[57].caption = "";
	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 of " + imgsGallery.length + " images";
	$("imgDisplay").src = imgsGallery[start].image;
}

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

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