var hideTimeout = -1;
var xPos = 100;
var yPos = 100;

function getMousePos(e) 
{ 
	//NS
	if (document.layers||document.getElementById&&!document.all)
	{
		xPos = e.pageX - 50;//document.getElementById('X').value=e.pageX + 10;
		yPos = e.pageY + 10;//document.getElementById('Y').value=e.pageY + 10;
	}
	//IE
	else if (document.all) 
	{
		xPos = window.event.clientX - 50;//document.getElementById('X').value=window.event.clientX + 10;
		yPos = window.event.clientY + 10;//document.getElementById('Y').value=window.event.clientY + 10;
	}
}

if(!window.captureEvents) document.onmousemove=getMousePos
if (window.captureEvents) 
{
	window.captureEvents(Event.MOUSEMOVE)
	window.onmousemove=getMousePos //e should not be defined
}

function showDiv( divName )
{
	// stop timeout if one exists
	if (hideTimeout != -1)	clearTimeout(hideTimeout);
	
	var popup = document.getElementById("prodOpts");
	
	// set the contents of the div
	popup.innerHTML = document.getElementById(divName).innerHTML;

	// show link
	popup.style.top = yPos + "px"; //document.getElementById('Y').value;
	popup.style.left = xPos + "px"; //document.getElementById('X').value;
	popup.style.visibility = 'visible';
}

function hideDiv( )
{
	// hide the div
	document.getElementById("prodOpts").style.visibility = 'hidden';
}

// the functionality below is to prevent div from causing itself to disapperar
function startHide()
{
	hideTimeout = setTimeout(hideDiv, 500);
}

function stopHide()
{
	clearTimeout(hideTimeout);
	hideTimeout = -1;
}