function prepareSlideshow() {
// Make sure the browser understands the DOM methods
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;

// Make sure the elements exist
  if (!document.getElementById("imageSwitch")) return false;
if (!document.getElementById("slideshow")) return false;
if (!document.getElementById("descActivator")) return false;
if (!document.getElementById("preview")) return false;
if (!document.getElementById("description")) return false;
 
// Set up variables for the slideshow
 var slideshow = document.getElementById("slideshow");
 var preview = slideshow.getElementsByTagName("img");
 var list = document.getElementById("imageSwitch");

// Set up variables for the Description
 var activator = document.getElementById("descActivator");
 var description = document.getElementById("description");

// Get all the links in the list
  var links = list.getElementsByTagName("a");

// Attach behavior to links so that they return false when Javascript is Disabled
for (var i=0; i < links.length; i++) {
	links[i].onclick = function() {
		return false;
	}
}

// Attach the animation behavior to the mouseover event

if (links[0]) {
links[0].onmouseover = function() {
    moveElement("preview",0,0,10);
  }
};

if (links[1]) {
  links[1].onmouseover = function() {
    moveElement("preview",-488,0,10);
  }
};

if (links[2]) {
  links[2].onmouseover = function() {
    moveElement("preview",-976,0,10);
  }
};

if (links[3]) {
	links[3].onmouseover = function() {
    moveElement("preview",-1464,0,10);
  }
};

if (links[4]) {
	links[4].onmouseover = function() {
    moveElement("preview",-1952,0,10);
  }
};

  activator.onmouseover = function() {
    moveElement("description",0,-30,10);
  }

	activator.onmouseout = function() {
    moveElement("description",0,0,10);
  }

}

// Setup Functions to briefly show the project description on page load

function openIt() {
	 	moveElement("description",0,-30,10);
	}
function briefDescription() {
    var timeoutID = setTimeout("openIt()", 250);
  }

function closeIt() {
	 	moveElement("description",0,0,10);
	}
	
function closeDescription() {
	var timeoutID = setTimeout("closeIt()", 3000);
};

addLoadEvent(prepareSlideshow);
addLoadEvent(briefDescription);
addLoadEvent(closeDescription);