if (document.layers)
{
	document.captureEvents(Event.MOUSEMOVE);
}

document.onmousemove=MouseTrack;

var popUp;
var positionX=0;
var positionY=0;
var offsetX=16;
var offsetY=16;
var popUpVisible = false;

function InitializePopUp()
{
	if (document.getElementById("indexBody"))
	{
		popUp = document.createElement("div");
		popUp.style.background = "#ffffff";
		popUp.style.border = "1px solid black";
		popUp.style.width = 200;
		popUp.style.height = 200;
		popUp.style.left = "-400px";
		popUp.style.top = "-400px";
		popUp.style.position = 'absolute';
		popUp.style.zIndex = 1000;
		popUp.innerHTML = '';
		document.getElementById("indexBody").appendChild(popUp);
	}
}

function MouseTrack(e)
{
	if (popUpVisible)
	{
		if (!e)
		{
			var e = window.event;
		}

		if (e.pageX || e.pageY)
		{
			positionX = e.pageX;
			positionY = e.pageY;
		}
		else if (e.clientX || e.clientY)
		{
			positionX = e.clientX + document.body.scrollLeft;
			positionY = e.clientY + document.body.scrollTop;
		}

		var x = positionX + offsetX;
		var y = positionY + offsetY;
		
		popUp.style.left = x + "px";
		popUp.style.top = y + "px";
	}
}

function ShowPopUp(src)
{
	popUpVisible = true;
	popUp.innerHTML = "<img src='" + src + "' />";
}

function HidePopUp()
{
	popUpVisible = false;
	popUp.style.left = -400;
	popUp.style.top = -400;
	popUp.innerHTML = "";
}
