// JavaScript Document
// JavaScript Document
// JavaScript Document

function showPic(whichpic) 
	{
	var source = whichpic.getAttribute("href");//set variable for source with the href
	var placeholder = document.getElementById("placeholder");//set variable for placeholder with element id placeholder
	placeholder.setAttribute("src",source); //set attribute src with the vaibale source
	var text = whichpic.getAttribute("title");//set variable for source with the title
	var description = document.getElementById("description");//set variable for description with the description
	description.firstChild.nodeValue = text; 
	}
	
function prepareGallery() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById("imagegallery")) return false;
	var gallery = document.getElementById("imagegallery");
	var links = gallery.getElementsByTagname("a");
	for (var i=0; i < links.length; i++) {
		links[i].onclick = function() {
			showPic(this);
			return false;
		}
	}
}
	