/*
var mouseX, mouseY;

function getMousePos(e)
{
	if (!e)
	var e = window.event||window.Event;
	
	if('undefined'!=typeof e.pageX)
	{
		mouseX = e.pageX;
		mouseY = e.pageY;
	}
	else
	{
		mouseX = e.clientX + document.documentElement.scrollLeft;
		mouseY = e.clientY + document.documentElement.scrollTop;		
	}
}
*/

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
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 = getMousePos;

// Temporary variables to hold mouse x-y pos.s
var mouse_x = 0
var mouse_y = 0

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

function getMousePos(e) {
 
  if (IE) { // grab the x-y pos.s if browser is IE
    mouse_x = event.clientX + document.body.scrollLeft;
    mouse_y = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    mouse_x = e.pageX;
    mouse_y = e.pageY;
  }  
  // catch possible negative values in NS4
  if (mouse_x < 0){ mouse_x = 0; }
  if (mouse_y < 0){ mouse_y = 0; }  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
 
  return true
}


function mouse_div_status(div_name)
{
	var box_coords = get_bounding_box(div_name);
	var mouse_box_status = '';

	var box_x1 = box_coords[0];
	var box_y1 = box_coords[1];
	var box_x2 = box_coords[2];
	var box_y2 = box_coords[3];
	//var box_mouse_x = box_coords[4];
	//var box_mouse_y = box_coords[5];
	var box_mouse_x = mouseX;
	var box_mouse_y = mouseY;
	
	mouse_box_status = 'in'; // default value, otherwise if conditions are met, set to 'out'
	
	if (BrowserDetect.browser == 'Firefox')
	{
		getMousePos();
		if (((mouseX + 1)< box_x1) || (mouseX > box_x2) || ((mouseY-1) < box_y1) || (mouseY > box_y2))
		{
			//alert(mouse_box_status + ' at: ' + div_name + ' (' + box_x1 + ', ' + box_y1 + ') - (' + box_x2 + ', ' + box_y2 + ') mouse at: (' + mouseX + ', ' + mouseY + ')');
			mouse_box_status = 'out';
		}
		
		//if(div_name == 'alt_menu')
		//{
		//alert(mouse_box_status + ' at: ' + div_name + ' (' + box_x1 + ', ' + box_y1 + ') - (' + box_x2 + ', ' + box_y2 + ') mouse at: (' + temp_mouseX + ', ' + temp_mouseY + ')');
		//}
	}
	else
	{
		getMousePos();		
		if (((mouseX-1)<= box_x1) || (mouseX >= box_x2) || ((mouseY-1) <= box_y1) || (mouseY >= box_y2))
		{
			mouse_box_status = 'out';
		}
	}

	return mouse_box_status;	
}


