// JavaScript Document

var currentSpanObj = 0;
var firstSpanObj = 0;

function MyImageClickFunction(e)
{
	if (!e) e = window.event;
	thumbImage = (e.target) ? e.target : e.srcElement;
	spanObj = thumbImage.nextSibling;
	currentSpanObj.style.visibility = "hidden";
	spanObj.style.visibility = "visible";
	currentSpanObj = spanObj;
}

function MyLoadFunction()
{
	links = document.getElementsByTagName("a");
	anchor = location.hash;
	if (anchor.length) anchor = anchor.substring(1,anchor.length);
	
	for (i = 0; i < links.length; i++)
	{
		linkObj = links[i];
		if (linkObj.className == "thumbnail")
		{
			linkObj.onclick = MyImageClickFunction;	
			thumbImage = linkObj.firstChild;
			spanImage = linkObj.lastChild;
			fullImage = spanImage.firstChild;
			
			thumbImage.style.border = "none";
			thumbImage.style.borderWidth = "0";
			
			spanImage.style.position = "absolute";
			spanImage.style.left = (520 - fullImage.width/2) + "px";
			spanImage.style.top  = (405 - fullImage.height/2) + "px";
			if (anchor.length && linkObj.id == anchor)
			{
				currentSpanObj = spanImage;
				spanImage.style.visibility = "visible";
			}
			else
			{
				spanImage.style.visibility = "hidden";
			}
			spanImage.style.color = "#FFFFFF";
			spanImage.style.fontFamily = "Arial, Helvetica, sans-serif";
			spanImage.style.fontSize = "9pt";
			spanImage.style.textDecoration = "none";
			
			fullImage.style.borderWidth = "0";
			fullImage.style.padding = "2px";
			
			linkObj.className = "JavaImg";			
			if (!firstSpanObj) firstSpanObj = spanImage;			
		}
	}
	
	if (!currentSpanObj)
	{
		currentSpanObj = firstSpanObj;
		currentSpanObj.style.visibility = "visible";
	}
}

if (document.getElementsByTagName) window.onload = MyLoadFunction;

