// common.js

// --------------------------------------------
function thumbnailMouseOverShell(fileRoot, comment, title) {

	// only if mouseover swapping is enabled
	
		// ie fires mouseover on whatever the cursor is over during page load, I think because the onMouseOver="..." attaches the handler at object creations
		// time, not page load time; the "for" event handler syntax only fires at page load... maybe that would be better, postponing the attaching of the event handler
		// so maybe ie would then work like Firefox and Safari.
		
	if (!window.enableMouseovers) {
	
		// try to cancel the mouseover bubble up, and not complete this mouseover, so that the next movement over this image will fire??
		//window.event.cancelBubble = true; 
		
		// don't record that this mouseoverevent fired ????
		return false;  

	} else { // ok, do the swap
	
		thumbnailMouseOver(fileRoot, comment, title);
	
	}
	
}

// --------------------------------------------
function thumbnailMouseOver(fileRoot, comment, title) {

	var theImageTD    = document.getElementById("theImageTD");
	var theCommentary = document.getElementById("commentary");

	// recreate the image object

	theImageTD.innerHTML = '<img id="theImage" name="theImage" src="images/' + fileRoot + ' - viewer.jpg" border="1">';

	var theImage      = document.getElementById("theImage"  ); // the new image object
	
	theImage.title = title;                                  // set the title and alt (hover text) on the image
	theImage.alt   = title;
	
	commentary.innerHTML = comment;                          // set the commentary

}

// -----------------------------------------
function toggletext(textmorelinkSpanId,textSpanId) {
	var textMoreSpan = document.getElementById(textmorelinkSpanId);
	var textSpan     = document.getElementById(textSpanId);
	//alert(textMoreSpan.style.display);
	//alert(textSpan.style.display);
	if (textSpan.style.display == "none") {textMoreSpan.style.display = "none"; textSpan.style.display = "";  }
	else                                  {textMoreSpan.style.display = ""    ; textSpan.style.display = "none"; }
}
