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

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/la une js/1janvlibe.jpg";
	imgsGallery[0].title = "";
	imgsGallery[0].caption = "";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "../../images/la une js/2janvlibe.jpg";
	imgsGallery[1].title = "";
	imgsGallery[1].caption = "";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "../../images/la une js/3janvlibe.jpg";
	imgsGallery[2].title = "";
	imgsGallery[2].caption = "";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "../../images/la une js/4janvlibe.jpg";
	imgsGallery[3].title = "";
	imgsGallery[3].caption = "";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "../../images/la une js/5et6janvlibe.jpg";
	imgsGallery[4].title = "";
	imgsGallery[4].caption = "";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "../../images/la une js/7janvlibe.jpg";
	imgsGallery[5].title = "";
	imgsGallery[5].caption = "";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "../../images/la une js/8janvlibe.jpg";
	imgsGallery[6].title = "";
	imgsGallery[6].caption = "";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "../../images/la une js/9janvlibe.jpg";
	imgsGallery[7].title = "";
	imgsGallery[7].caption = "";

	imgsGallery[8] = new Object();
	imgsGallery[8].image = "../../images/la une js/10janvlibe.jpg";
	imgsGallery[8].title = "";
	imgsGallery[8].caption = "";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = "../../images/la une js/11janvlibe.jpg";
	imgsGallery[9].title = "";
	imgsGallery[9].caption = "";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = "../../images/la une js/12janvlibe.jpg";
	imgsGallery[10].title = "";
	imgsGallery[10].caption = "";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = "../../images/la une js/14janvlibe.jpg";
	imgsGallery[11].title = "";
	imgsGallery[11].caption = "";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = "../../images/la une js/15janvlibe.jpg";
	imgsGallery[12].title = "";
	imgsGallery[12].caption = "";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = "../../images/la une js/16janvlibe.jpg";
	imgsGallery[13].title = "";
	imgsGallery[13].caption = "";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = "../../images/la une js/17janvlibe.jpg";
	imgsGallery[14].title = "";
	imgsGallery[14].caption = "";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "../../images/la une js/18janvlibe.jpg";
	imgsGallery[15].title = "";
	imgsGallery[15].caption = "";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = "../../images/la une js/19-20janvlibe.jpg";
	imgsGallery[16].title = "";
	imgsGallery[16].caption = "";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = "../../images/la une js/21janvlibe.jpg";
	imgsGallery[17].title = "";
	imgsGallery[17].caption = "";
	
	imgsGallery[18] = new Object();
	imgsGallery[18].image = "../../images/la une js/22janvlibe.jpg";
	imgsGallery[18].title = "";
	imgsGallery[18].caption = "";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = "../../images/la une js/23janvlibe.jpg";
	imgsGallery[19].title = "";
	imgsGallery[19].caption = "";
	
	imgsGallery[20] = new Object();
	imgsGallery[20].image = "../../images/la une js/24janvlibe.jpg";
	imgsGallery[20].title = "";
	imgsGallery[20].caption = "";
	
	imgsGallery[21] = new Object();
	imgsGallery[21].image = "../../images/la une js/25janvlibe.jpg";
	imgsGallery[21].title = "";
	imgsGallery[21].caption = "";
	
	imgsGallery[22] = new Object();
	imgsGallery[22].image = "../../images/la une js/26et27janvlibe.jpg";
	imgsGallery[22].title = "";
	imgsGallery[22].caption = "";
	
	imgsGallery[23] = new Object();
	imgsGallery[23].image = "../../images/la une js/28janvlibe.jpg";
	imgsGallery[23].title = "";
	imgsGallery[23].caption = "";
	
	imgsGallery[24] = new Object();
	imgsGallery[24].image = "../../images/la une js/29janvlibe.jpg";
	imgsGallery[24].title = "";
	imgsGallery[24].caption = "";
	
	imgsGallery[25] = new Object();
	imgsGallery[25].image = "../../images/la une js/30janvlibe.jpg";
	imgsGallery[25].title = "";
	imgsGallery[25].caption = "";
	
	imgsGallery[26] = new Object();
	imgsGallery[26].image = "../../images/la une js/31janvlibe.jpg";
	imgsGallery[26].title = "";
	imgsGallery[26].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);
