// JavaScript Document

//rollover javascript function for artgallery.html
function swapImg(thisImg){
	// --------------------------------------------------------
	//  modified by: Terrilyn Henry
	// --------------------------------------------------------
		var mainPic = document.getElementById("featurepic");
	
	// each time this function is called from one of the thumbnails, a "this" reference is passed
	// so our script knows which thumbnail made the function call. Once we know which image called the function,
	// we can access that images src property which comes back as a string.
		var srcString = thisImg.src; // "images/buds_thumb.jpg"
		var altString = thisImg.alt; // "Buds"
	
	// we use the String Object's replace method to remove "_thumb" and replace it with nothing. What we are left with
	// is the name of the large image - assuming the naming convention was followed. 
		var newSrc = srcString.replace(".gif",""); 
		
	// finally, we specify newSrc as the new value for our mainPic's src property
	// this new picture is what is displayed 
	
		mainPic.src = newSrc;
		mainPic.alt = altString;
		mainPic.title = altString;	
}
