var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  
  return true
}

var popup3Interval = false;
var popup6Interval = false;

function absPosition(obj) { 
	var x = y = 0; 
	while(obj) { 
	    x += obj.offsetLeft; 
	    y += obj.offsetTop; 
	    obj = obj.offsetParent; 
	} 
	x += 0;
	y += 0;
	return {x:x, y:y}; 
}

function showPopup6(a)
{
	if(popup6Interval)
		clearInterval(popup6Interval);
		
	var p = document.getElementById('popup6');
	
	if((p.style.display == 'none') || (p.style.display == ''))
	{
		p.style.display = 'block';
		var c = absPosition(a);
		p.style.top = c.y+20;  
		p.style.left = c.x-22;	
	}
}

function hidePopup6()
{
	popup6Interval = setInterval('hide6()', 100);
}

function hide6()
{
	var p = document.getElementById('popup6');
	var c = absPosition(p);
	if((tempX < c.x-22) || (tempX > c.x+262) || (tempY < c.y-20) || (tempY > c.y+254))
	{
		document.getElementById('popup6').style.display = 'none';
		clearInterval(popup6Interval);
	}
}

function showPopup3(a)
{
	if(popup3Interval)
		clearInterval(popup3Interval);
		
	var p = document.getElementById('popup3');
	
	if((p.style.display == 'none') || (p.style.display == ''))
	{
		p.style.display = 'block';
		var c = absPosition(a);
		p.style.top = c.y+20;  
		p.style.left = c.x-25;	
	}
}

function hidePopup3()
{
	popup3Interval = setInterval('hide3()', 100);
}

function hide3()
{
	var p = document.getElementById('popup3');
	var c = absPosition(p);
	if((tempX < c.x) || (tempX > c.x+222) || (tempY < c.y-20) || (tempY > c.y+185))
	{
		document.getElementById('popup3').style.display = 'none';
		clearInterval(popup3Interval);
	}
}
