function PrepareImages()
{
	// Set onClick event for all anchors within the Thumbnails Div
	if (!document.getElementById) return false;
	if (!document.getElementById("thumbnails")) return false;
	if (!document.getElementsByTagName) return false;
	var Thumbnails = document.getElementById("thumbnails");
	var aryAnchors = Thumbnails.getElementsByTagName("img");
	for(ndx=0;ndx<aryAnchors.length;ndx++)
	{
		aryAnchors[ndx].onclick = function() {
			return PopupEnlargedImage(this);
		}
	}
}
function PopupEnlargedImage(WhichImage)
{
	// Get source and alt attributes from the thumbnail image
	var strImageURI="";
	strImageURI = WhichImage.getAttribute("src");

	// Remove _thumb from the source attribute to get the source of the enlarged image
	var reSearchTerm = /_thumb/g;
	strImageURI = strImageURI.replace(reSearchTerm,"");
	
	// Open a new window and set source and alt attributes for the enlarged image
	window.open(strImageURI,'Image','scrollbars=yes,resizable=yes,width=840,height=640');
	
	return false;
}

function PopupImage(src,height,width){
	if(height == "undefined") height = 640;
	if(width == "undefined") width = 840;
	window.open(src,'Image','scrollbars=yes,resizable=yes,width='+width+',height='+height);
}