// This script hides all the sub menus when move is moved out of the menu area or clicked on the area out of the menu area.
var upperY;
var lowerY;
var ie;
// Check for browser 
if (document.all) {
	n=0;ie=1;ns6=0;
	}
if (document.getElementById&&!document.all){
	n=0;ie=0;ns6=1;
	}
if (document.layers){
	n=1;ie=0;ns6=0;
	}
// Traps mouse events and movements	
if (ie||ns6)
{ 
	//das_document.onclick = allOff;
	document.onscroll=allOff;
	document.onmousemove=updateIt;
}
if (document.layers)
{
	window.captureEvents(Event.MOUSEMOVE);
	//window.captureEvents(Event.CLICK);
	window.onmousemove= updateIt;
	//das_window.onclick=allOff
}

// Function checks for x and y co-ordinates and hides sub menus.
function updateIt(e)
{ 
	//upperY = 0;
	//lowerY = upperY + 600;
	
	if (ie)
	{
		var x = window.event.clientX;
		var y = window.event.clientY;

		if (x > 600 || x < 0) {  allOff();}
		else if (y > 750  || y < 0 ) allOff();
	}
	if (n||ns6)
	{
		var x = e.pageX;
		var y = e.pageY;

		if (x > 600 || x < 0) allOff();
		//else if (y > lowerY   || y < upperY) allOff();
		else if (y > 790   || y < 0) allOff();
	}
}

// This function assigns upper and lower y positions.
function setUpperY(  )
{ 
	
	if (ie)
	{
		upperY = window.event.clientY;
		upperY = upperY - 25;
		lowerY = upperY + 400;
	}
	if (n||ns6)
	{
		//upperY = window.Event.pageY;
		upperY = 0
		lowerY = 370;
	}
	
	
}

//********************************************************************************************************************************************