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

FILE: mud_Scripts.js
REQUIRES: prototype.js
AUTHOR: Takashi Okamoto mud(tm) - http://www.mudcorp.com/
VERSION: 2.1 - update to make it work more like MudFadeGallery
DATE: 04/07/2006

--------------------------------------------------------------------------------

This file is part of MudShiftContent.

	MudShiftContent is free for anyone to use, but this header MUST be
	included, and may not be modified.

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

////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARS

var imgs;
var imgsGallery = new Array();

////////////////////////////////////////////////////////////////////////////////
// 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.move('next');
					 return false;
				}
				break;
			case "prev":
				elements[i].onclick = function() {
					 imgs.move('prev');
					 return false;
				}
				break;
		}
	}
}


////////////////////////////////////////////////////////////////////////////////
// INIT

function init() {
	setOnMouseClick();
	// images gallery
	imgsGallery[0] = new Object();
	imgsGallery[0].image = new Image();
	imgsGallery[0].image.src = "photos/jbach1.jpg";
	imgsGallery[0].title = "1 / 18";
	imgsGallery[0].caption = "Jordan Bach";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = new Image();
	imgsGallery[1].image.src = "photos/jbach2.jpg";
	imgsGallery[1].title = "2 / 18";
	imgsGallery[1].caption = "Jordan Bach";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = new Image();
	imgsGallery[2].image.src = "photos/jbach3.jpg";
	imgsGallery[2].title = "3 / 18";
	imgsGallery[2].caption = "Jordan Bach";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = new Image();
	imgsGallery[3].image.src = "photos/christianortega01.jpg";
	imgsGallery[3].title = "4 / 18";
	imgsGallery[3].caption = "Christian Ortega";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = new Image();
	imgsGallery[4].image.src = "photos/daniellaalma01.jpg";
	imgsGallery[4].title = "5 / 18";
	imgsGallery[4].caption = "Daniella Alma";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = new Image();
	imgsGallery[5].image.src = "photos/daniellaalma02.jpg";
	imgsGallery[5].title = "6 / 18";
	imgsGallery[5].caption = "Daniella Alma";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = new Image();
	imgsGallery[6].image.src = "photos/daniellaalma03.jpg";
	imgsGallery[6].title = "7 / 18";
	imgsGallery[6].caption = "Daniella Alma";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = new Image();
	imgsGallery[7].image.src = "photos/daniellaalma04.jpg";
	imgsGallery[7].title = "8 / 18";
	imgsGallery[7].caption = "Daniella Alma";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = new Image();
	imgsGallery[8].image.src = "photos/schoi1.jpg";
	imgsGallery[8].title = "9 / 18";
	imgsGallery[8].caption = "Sooji Choi";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = new Image();
	imgsGallery[9].image.src = "photos/schoi2.jpg";
	imgsGallery[9].title = "10 / 18";
	imgsGallery[9].caption = "Sooji Choi";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = new Image();
	imgsGallery[10].image.src = "photos/schoi3.jpg";
	imgsGallery[10].title = "11 / 18";
	imgsGallery[10].caption = "Sooji Choi";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = new Image();
	imgsGallery[11].image.src = "photos/schoi4.jpg";
	imgsGallery[11].title = "12 / 18";
	imgsGallery[11].caption = "Sooji Choi";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = new Image();
	imgsGallery[12].image.src = "photos/johncarbonara01.jpg";
	imgsGallery[12].title = "13 / 18";
	imgsGallery[12].caption = "John Carbonara";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = new Image();
	imgsGallery[13].image.src = "photos/johncarbonara02.jpg";
	imgsGallery[13].title = "14 / 18";
	imgsGallery[13].caption = "John Carbonara";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = new Image();
	imgsGallery[14].image.src = "photos/rachelrymar01.jpg";
	imgsGallery[14].title = "15 / 18";
	imgsGallery[14].caption = "Rachel Rymar";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = new Image();
	imgsGallery[15].image.src = "photos/rachelrymar01.jpg";
	imgsGallery[15].title = "16 / 18";
	imgsGallery[15].caption = "Rachel Rymar";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = new Image();
	imgsGallery[16].image.src = "photos/saba01.jpg";
	imgsGallery[16].title = "17 / 18";
	imgsGallery[16].caption = "Saba";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = new Image();
	imgsGallery[17].image.src = "photos/saba01.jpg";
	imgsGallery[17].title = "18 / 18";
	imgsGallery[17].caption = "Saba";
	
	// MudShiftContent(id, unitX, unitTotal)
	imgs = new MudShiftContent('imgs', imgsGallery);
	
	// set init
	if ($('imgs_title')) $('imgs_title').innerHTML = imgsGallery[0].title;
	if ($('imgs_caption')) $('imgs_caption').innerHTML = imgsGallery[0].caption;
}

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

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