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

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 = "travel/1_ja2.jpg";
	imgsGallery[0].title = "Japan";
	imgsGallery[0].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = new Image();
	imgsGallery[1].image.src = "travel/2_ja.jpg";
	imgsGallery[1].title = "Japan";
	imgsGallery[1].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = new Image();
	imgsGallery[2].image.src = "travel/3_ja3.jpg";
	imgsGallery[2].title = "Japan";
	imgsGallery[2].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = new Image();
	imgsGallery[3].image.src = "travel/4_ja7.jpg";
	imgsGallery[3].title = "Japan";
	imgsGallery[3].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[4] = new Object();
	imgsGallery[4].image = new Image();
	imgsGallery[4].image.src = "travel/5_ja5.jpg";
	imgsGallery[4].title = "Japan";
	imgsGallery[4].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[5] = new Object();
	imgsGallery[5].image = new Image();
	imgsGallery[5].image.src = "travel/6_ja13.jpg";
	imgsGallery[5].title = "Japan";
	imgsGallery[5].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[6] = new Object();
	imgsGallery[6].image = new Image();
	imgsGallery[6].image.src = "travel/7_ja11.jpg";
	imgsGallery[6].title = "Japan";
	imgsGallery[6].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[7] = new Object();
	imgsGallery[7].image = new Image();
	imgsGallery[7].image.src = "travel/8_ja16.jpg";
	imgsGallery[7].title = "Japan";
	imgsGallery[7].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[8] = new Object();
	imgsGallery[8].image = new Image();
	imgsGallery[8].image.src = "travel/9_ja15.jpg";
	imgsGallery[8].title = "Japan";
	imgsGallery[8].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[9] = new Object();
	imgsGallery[9].image = new Image();
	imgsGallery[9].image.src = "travel/10_gu2.jpg";
	imgsGallery[9].title = "Guam";
	imgsGallery[9].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[10] = new Object();
	imgsGallery[10].image = new Image();
	imgsGallery[10].image.src = "travel/11_gu8.jpg";
	imgsGallery[10].title = "Guam";
	imgsGallery[10].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[11] = new Object();
	imgsGallery[11].image = new Image();
	imgsGallery[11].image.src = "travel/12_gu7.jpg";
	imgsGallery[11].title = "Guam";
	imgsGallery[11].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[12] = new Object();
	imgsGallery[12].image = new Image();
	imgsGallery[12].image.src = "travel/13_gu12.jpg";
	imgsGallery[12].title = "Guam";
	imgsGallery[12].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[13] = new Object();
	imgsGallery[13].image = new Image();
	imgsGallery[13].image.src = "travel/14_mala1.jpg";
	imgsGallery[13].title = "Malaysia";
	imgsGallery[13].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[14] = new Object();
	imgsGallery[14].image = new Image();
	imgsGallery[14].image.src = "travel/15_mala6.jpg";
	imgsGallery[14].title = "Malaysia";
	imgsGallery[14].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[15] = new Object();
	imgsGallery[15].image = new Image();
	imgsGallery[15].image.src = "travel/16_mala7.jpg";
	imgsGallery[15].title = "Malaysia";
	imgsGallery[15].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[16] = new Object();
	imgsGallery[16].image = new Image();
	imgsGallery[16].image.src = "travel/17_mala8.jpg";
	imgsGallery[16].title = "Malaysia";
	imgsGallery[16].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[17] = new Object();
	imgsGallery[17].image = new Image();
	imgsGallery[17].image.src = "travel/18_mala11.jpg";
	imgsGallery[17].title = "Malaysia";
	imgsGallery[17].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[18] = new Object();
	imgsGallery[18].image = new Image();
	imgsGallery[18].image.src = "travel/19_mala9.jpg";
	imgsGallery[18].title = "Malaysia";
	imgsGallery[18].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[19] = new Object();
	imgsGallery[19].image = new Image();
	imgsGallery[19].image.src = "travel/20_thai1.jpg";
	imgsGallery[19].title = "Thailand";
	imgsGallery[19].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[20] = new Object();
	imgsGallery[20].image = new Image();
	imgsGallery[20].image.src = "travel/21_thai4.jpg";
	imgsGallery[20].title = "Thailand";
	imgsGallery[20].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[21] = new Object();
	imgsGallery[21].image = new Image();
	imgsGallery[21].image.src = "travel/22_thai7.jpg";
	imgsGallery[21].title = "Thailand";
	imgsGallery[21].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[22] = new Object();
	imgsGallery[22].image = new Image();
	imgsGallery[22].image.src = "travel/23_thai9.jpg";
	imgsGallery[22].title = "Thailand";
	imgsGallery[22].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";
	
	imgsGallery[23] = new Object();
	imgsGallery[23].image = new Image();
	imgsGallery[23].image.src = "travel/24_thai11.jpg";
	imgsGallery[23].title = "Thailand";
	imgsGallery[23].caption = "&copy Buddhabong 2000 - 2012 // all rights reserved";	
	
	// 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);
