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

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/hisnoire/hisn_001.gif"
	imgsGallery[0].title = "";
	imgsGallery[0].caption = "";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = "../../images/hisnoire/hisn_002.gif";
	imgsGallery[1].title = "";
	imgsGallery[1].caption = "";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = "../../images/hisnoire/hisn_003.gif";
	imgsGallery[2].title = "";
	imgsGallery[2].caption = "";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = "../../images/hisnoire/hisn_004.gif";
	imgsGallery[3].title = "";
	imgsGallery[3].caption = "";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = "../../images/hisnoire/hisn_005.gif";
	imgsGallery[4].title = "";
	imgsGallery[4].caption = "";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = "../../images/hisnoire/hisn_006.gif";
	imgsGallery[5].title = "";
	imgsGallery[5].caption = "";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = "../../images/hisnoire/hisn_007.gif";
	imgsGallery[6].title = "";
	imgsGallery[6].caption = "";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = "../../images/hisnoire/hisn_008.gif";
	imgsGallery[7].title = "";
	imgsGallery[7].caption = "";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = "../../images/hisnoire/hisn_009.gif";
	imgsGallery[8].title = "";
	imgsGallery[8].caption = "";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = "../../images/hisnoire/hisn_010.gif";
	imgsGallery[9].title = "";
	imgsGallery[9].caption = "";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = "../../images/hisnoire/hisn_011.gif"
	imgsGallery[10].title = "";
	imgsGallery[10].caption = "";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = "../../images/hisnoire/hisn_012.gif";
	imgsGallery[11].title = "";
	imgsGallery[11].caption = "";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = "../../images/hisnoire/hisn_013.gif";
	imgsGallery[12].title = "";
	imgsGallery[12].caption = "";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = "../../images/hisnoire/hisn_014.gif";
	imgsGallery[13].title = "";
	imgsGallery[13].caption = "";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = "../../images/hisnoire/hisn_015.gif";
	imgsGallery[14].title = "";
	imgsGallery[14].caption = "";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = "../../images/hisnoire/hisn_016.gif";
	imgsGallery[15].title = "";
	imgsGallery[15].caption = "";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = "../../images/hisnoire/hisn_017.gif";
	imgsGallery[16].title = "";
	imgsGallery[16].caption = "";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = "../../images/hisnoire/hisn_018.gif";
	imgsGallery[17].title = "";
	imgsGallery[17].caption = "";
	
	imgsGallery[18] = new Object();
	imgsGallery[18].image = "../../images/hisnoire/hisn_019.gif";
	imgsGallery[18].title = "";
	imgsGallery[18].caption = "";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = "../../images/hisnoire/hisn_020.gif";
	imgsGallery[19].title = "";
	imgsGallery[19].caption = "";
	
	imgsGallery[20] = new Object();
	imgsGallery[20].image = "../../images/hisnoire/hisn_021.gif"
	imgsGallery[20].title = "";
	imgsGallery[20].caption = "";
	
	imgsGallery[21] = new Object();
	imgsGallery[21].image = "../../images/hisnoire/hisn_022.gif";
	imgsGallery[21].title = "";
	imgsGallery[21].caption = "";
	
	imgsGallery[22] = new Object();
	imgsGallery[22].image = "../../images/hisnoire/hisn_023.gif";
	imgsGallery[22].title = "";
	imgsGallery[22].caption = "";
	
	imgsGallery[23] = new Object();
	imgsGallery[23].image = "../../images/hisnoire/hisn_024.gif";
	imgsGallery[23].title = "";
	imgsGallery[23].caption = "";
	
	imgsGallery[24] = new Object();
	imgsGallery[24].image = "../../images/hisnoire/hisn_025.gif";
	imgsGallery[24].title = "";
	imgsGallery[24].caption = "";
	
	imgsGallery[25] = new Object();
	imgsGallery[25].image = "../../images/hisnoire/hisn_026.gif";
	imgsGallery[25].title = "";
	imgsGallery[25].caption = "";
	
	imgsGallery[26] = new Object();
	imgsGallery[26].image = "../../images/hisnoire/hisn_027.gif";
	imgsGallery[26].title = "";
	imgsGallery[26].caption = "";
	
	imgsGallery[27] = new Object();
	imgsGallery[27].image = "../../images/hisnoire/hisn_028.gif";
	imgsGallery[27].title = "";
	imgsGallery[27].caption = "";
	
	imgsGallery[28] = new Object();
	imgsGallery[28].image = "../../images/hisnoire/hisn_029.gif";
	imgsGallery[28].title = "";
	imgsGallery[28].caption = "";
	
	imgsGallery[29] = new Object();
	imgsGallery[29].image = "../../images/hisnoire/hisn_030.gif";
	imgsGallery[29].title = "";
	imgsGallery[29].caption = "";
	
	imgsGallery[30] = new Object();
	imgsGallery[30].image = "../../images/hisnoire/hisn_031.gif"
	imgsGallery[30].title = "";
	imgsGallery[30].caption = "";
	
	imgsGallery[31] = new Object();
	imgsGallery[31].image = "../../images/hisnoire/hisn_032.gif";
	imgsGallery[31].title = "";
	imgsGallery[31].caption = "";
	
	imgsGallery[32] = new Object();
	imgsGallery[32].image = "../../images/hisnoire/hisn_033.gif";
	imgsGallery[32].title = "";
	imgsGallery[32].caption = "";
	
	imgsGallery[33] = new Object();
	imgsGallery[33].image = "../../images/hisnoire/hisn_034.gif";
	imgsGallery[33].title = "";
	imgsGallery[33].caption = "";
	
	imgsGallery[34] = new Object();
	imgsGallery[34].image = "../../images/hisnoire/hisn_035.gif";
	imgsGallery[34].title = "";
	imgsGallery[34].caption = "";
	
	imgsGallery[35] = new Object();
	imgsGallery[35].image = "../../images/hisnoire/hisn_036.gif";
	imgsGallery[35].title = "";
	imgsGallery[35].caption = "";
	
	imgsGallery[36] = new Object();
	imgsGallery[36].image = "../../images/hisnoire/hisn_037.gif";
	imgsGallery[36].title = "";
	imgsGallery[36].caption = "";
	
	imgsGallery[37] = new Object();
	imgsGallery[37].image = "../../images/hisnoire/hisn_038.gif";
	imgsGallery[37].title = "";
	imgsGallery[37].caption = "";
	
	imgsGallery[38] = new Object();
	imgsGallery[38].image = "../../images/hisnoire/hisn_039.gif";
	imgsGallery[38].title = "";
	imgsGallery[38].caption = "";
	
	imgsGallery[39] = new Object();
	imgsGallery[39].image = "../../images/hisnoire/hisn_040.gif";
	imgsGallery[39].title = "";
	imgsGallery[39].caption = "";
	
	imgsGallery[40] = new Object();
	imgsGallery[40].image = "../../images/hisnoire/hisn_041.gif";
	imgsGallery[40].title = "";
	imgsGallery[40].caption = "";
	
	imgsGallery[41] = new Object();
	imgsGallery[41].image = "../../images/hisnoire/hisn_042.gif";
	imgsGallery[41].title = "";
	imgsGallery[41].caption = "";
	
	imgsGallery[42] = new Object();
	imgsGallery[42].image = "../../images/hisnoire/hisn_043.gif";
	imgsGallery[42].title = "";
	imgsGallery[42].caption = "";
	
	imgsGallery[43] = new Object();
	imgsGallery[43].image = "../../images/hisnoire/hisn_044.gif";
	imgsGallery[43].title = "";
	imgsGallery[43].caption = "";
	
	imgsGallery[44] = new Object();
	imgsGallery[44].image = "../../images/hisnoire/hisn_045.gif";
	imgsGallery[44].title = "";
	imgsGallery[44].caption = "";
	
	imgsGallery[45] = new Object();
	imgsGallery[45].image = "../../images/hisnoire/hisn_046.gif";
	imgsGallery[45].title = "";
	imgsGallery[45].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 = " " + imgsGallery.length + " images";
	$("imgDisplay").src = imgsGallery[start].image;
}

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

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