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

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 = "images/0-bubbles.jpg";
	imgsGallery[0].title = "0-bubbles.jpg";
	imgsGallery[0].caption = "desert";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = new Image();
	imgsGallery[1].image.src = "images/1-balloonseller2.jpg";
	imgsGallery[1].title = "1-balloonseller2.jpg";
	imgsGallery[1].caption = "bus";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = new Image();
	imgsGallery[2].image.src = "images/2-fallingshort.jpg";
	imgsGallery[2].title = "2-fallingshort.jpg";
	imgsGallery[2].caption = "Hotan Road";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = new Image();
	imgsGallery[3].image.src = "images/3-picnic.jpg";
	imgsGallery[3].title = "3-picnic.jpg";
	imgsGallery[3].caption = "men of business";
	
		imgsGallery[4] = new Object();
	imgsGallery[4].image = new Image();
	imgsGallery[4].image.src = "images/4-girlabacus.jpg";
	imgsGallery[4].title = "4-girlabacus.jpg";
	imgsGallery[4].caption = "chili";
	
		imgsGallery[5] = new Object();
	imgsGallery[5].image = new Image();
	imgsGallery[5].image.src = "images/5-peachfestival.jpg";
	imgsGallery[5].title = "5-peachfestival.jpg";
	imgsGallery[5].caption = "tagger";
	
		imgsGallery[6] = new Object();
	imgsGallery[6].image = new Image();
	imgsGallery[6].image.src = "images/6-staringatstramger.jpg";
	imgsGallery[6].title = "6-staringatstramger.jpg";
	imgsGallery[6].caption = "night pool";
	
		imgsGallery[7] = new Object();
	imgsGallery[7].image = new Image();
	imgsGallery[7].image.src = "images/7-whorehouse.jpg";
	imgsGallery[7].title = "7-whorehouse.jpg";
	imgsGallery[7].caption = "old city";
	
		imgsGallery[8] = new Object();
	imgsGallery[8].image = new Image();
	imgsGallery[8].image.src = "images/8-computerroom.jpg";
	imgsGallery[8].title = "8-computerroom.jpg";
	imgsGallery[8].caption = "girl in red";
	
		imgsGallery[9] = new Object();
	imgsGallery[9].image = new Image();
	imgsGallery[9].image.src = "images/9-limbo.jpg";
	imgsGallery[9].title = "9-limbo.jpg";
	imgsGallery[9].caption = "purple pants";
	
		imgsGallery[10] = new Object();
	imgsGallery[10].image = new Image();
	imgsGallery[10].image.src = "images/10-truckerslounge.jpg";
	imgsGallery[10].title = "10-truckerslounge.jpg";
	imgsGallery[10].caption = "men of business";
	
		imgsGallery[11] = new Object();
	imgsGallery[11].image = new Image();
	imgsGallery[11].image.src = "images/11-chinesemadrasa.jpg";
	imgsGallery[11].title = "11-chinesemadrasa.jpg";
	imgsGallery[11].caption = "woman in white";
	
		imgsGallery[12] = new Object();
	imgsGallery[12].image = new Image();
	imgsGallery[12].image.src = "images/12-photostudiolinxia.jpg";
	imgsGallery[12].title = "12-photostudiolinxia.jpg";
	imgsGallery[12].caption = "men of business";
	
		imgsGallery[13] = new Object();
	imgsGallery[13].image = new Image();
	imgsGallery[13].image.src = "images/13-greatwallphotostudio.jpg";
	imgsGallery[13].title = "13-greatwallphotostudio.jpg";
	imgsGallery[13].caption = "men of business";
	
		imgsGallery[14] = new Object();
	imgsGallery[14].image = new Image();
	imgsGallery[14].image.src = "images/14-1030pm.jpg";
	imgsGallery[14].title = "14-1030pm.jpg";
	imgsGallery[14].caption = "men of business";
	
		imgsGallery[15] = new Object();
	imgsGallery[15].image = new Image();
	imgsGallery[15].image.src = "images/15-safety.jpg";
	imgsGallery[15].title = "15-safety.jpg";
	imgsGallery[15].caption = "men of business";
	
		
		imgsGallery[16] = new Object();
	imgsGallery[16].image = new Image();
	imgsGallery[16].image.src = "images/16-dogshow.jpg";
	imgsGallery[16].title = "16-dogshow.jpg";
	imgsGallery[16].caption = "men of business";
	
	
	
	// 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);