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

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/image_0.jpg";
	imgsGallery[0].title = "";
	imgsGallery[0].caption = "";
	
	imgsGallery[1] = new Object();
	imgsGallery[1].image = new Image();
	imgsGallery[1].image.src = "images/image_1.jpg";
	imgsGallery[1].title = "A Perfect Human";
	imgsGallery[1].caption = "Video (2005)";
	
	imgsGallery[2] = new Object();
	imgsGallery[2].image = new Image();
	imgsGallery[2].image.src = "images/image_politics.jpg";
	imgsGallery[2].title = "My Life in Politics: Tim Davis";
	imgsGallery[2].caption = "Book for Aperture (2006)";
	
	imgsGallery[3] = new Object();
	imgsGallery[3].image = new Image();
	imgsGallery[3].image.src = "images/image_toiss.jpg";
	imgsGallery[3].title = "<span style=\"color: #FFFFFF;\">To One I Saw Small</span>";
	imgsGallery[3].caption = "<span style=\"color: #FFFFFF;\">Postcard for South Pleasant Company (2005)</span>";

	imgsGallery[4] = new Object();
	imgsGallery[4].image = new Image();
	imgsGallery[4].image.src = "images/image_segal.jpg";
	imgsGallery[4].title = "Two Lore Segal Novels";
	imgsGallery[4].caption = "Bookcovers for The New Press (2004)";

	imgsGallery[5] = new Object();
	imgsGallery[5].image = new Image();
	imgsGallery[5].image.src = "images/image_4.jpg";
	imgsGallery[5].title = "For A Change";
	imgsGallery[5].caption = "Video for Sundance Channel (2005)";

	imgsGallery[6] = new Object();
	imgsGallery[6].image = new Image();
	imgsGallery[6].image.src = "images/image_shore.jpg";
	imgsGallery[6].title = "Stephen Shore: Uncommon Places, the Complete Works";
	imgsGallery[6].caption = "Book for Aperture (2004)";

	imgsGallery[7] = new Object();
	imgsGallery[7].image = new Image();
	imgsGallery[7].image.src = "images/image_6.jpg";
	imgsGallery[7].title = "Eight Experiments for Toby";
	imgsGallery[7].caption = "Video (2006)";

	imgsGallery[8] = new Object();
	imgsGallery[8].image = new Image();
	imgsGallery[8].image.src = "images/image_airports.jpg";
	imgsGallery[8].title = "10 Airports: Fentress Bradburn Architects";
	imgsGallery[8].caption = "Book for Edizioni Press (2006)";

	imgsGallery[9] = new Object();
	imgsGallery[9].image = new Image();
	imgsGallery[9].image.src = "images/image_7.gif";
	imgsGallery[9].title = "<span style=\"color: #FFFFFF;\">Yale University exhibit <em> The Pink and the Blue </ em></span>";
	imgsGallery[9].caption = "<span style=\"color: #FFFFFF;\">Wallpaper (and exhibition design) (2004)</span>";

	imgsGallery[10] = new Object();
	imgsGallery[10].image = new Image();
	imgsGallery[10].image.src = "images/image_morimura.gif";
	imgsGallery[10].title = "Yasumasa Morimura: Daughter of Art History";
	imgsGallery[10].caption = "Book for Aperture (2003)";

	imgsGallery[11] = new Object();
	imgsGallery[11].image = new Image();
	imgsGallery[11].image.src = "images/image_8.jpg";
	imgsGallery[11].title = "A Minor Transformation";
	imgsGallery[11].caption = "Video (2004)";


	// 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);