//The following line is critical for menu operation, and MUST APPEAR ONLY ONCE.

menunum=0;
menus=new Array();
_d=document;

//Please leave the above line intact. The above also needs to be enabled if it not already enabled unless you have more than one _array.js file
function addmenu()
{
	menunum++;
	menus[menunum]=menu;
}

function dumpmenus()
{
	mt="<scr"+"ipt language=JavaScript>";
	for(a=1;a<menus.length;a++)
	{
		mt+=" menu"+a+"=menus["+a+"];"
	}
	mt+="<\/scr"+"ipt>";
	_d.write(mt);
}

function MM_startTimeout() 
{
	if( window.ActiveMenu ) 
	{
		mmStart = new Date();
		mmDHFlag = true;
		mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
	}
}

//SEARCH ID=TD_
function FIND(item) 
{
	if( window.mmIsOpera ) 
		return(document.getElementById(item));
	if (document.all) 
		return(document.all[item]);
	if (document.getElementById) 
		return(document.getElementById(item));
	return(false);
}

// POSIZIONE DELLA LINEA Y
function moveY(y, img) 
{
	if(!document.layers) 
	{
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par)
		{
			if( par.topMargin && !onWindows ) 
				y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) 
				y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) 
				lastOffset = par.offsetTop;
				par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	}
	else if (img.y >= 0)
	{ 
		y += img.y;
	}
	return y;
}


// POSIZIONE DELLA LINEA X
function moveX(x, img) 
{
	if(!document.layers) 
	{
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par)
		{
			if( par.leftMargin && !onWindows ) 
				x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) 
				x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) 
				lastOffset = par.offsetLeft;
				par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	}
	else if (img.x >= 0)
	{ 
		x += img.x;
	}
	return x;
}

//INSERISCE LA POSIZIONE DEL MENU A TENDINA
function movemenu(td, mn, delta)
{
	var obj = FIND(td);
	var Y = moveY(-1, obj);
	var X = moveX(delta, obj);
	spos(gmobj("menu"+getMenuByName(mn)),Y,X,null,null);
}

////////////////////////////////////
// Editable properties START here //
////////////////////////////////////

timegap=500;		// DEFAULT The time delay for menus to remain visible
followspeed=5;		// DEFAULT Follow Scrolling speed
followrate=40;		// DEFAULT Follow Scrolling Rate
suboffset_top=0;	// DEFAULT Sub menu offset Top position 
suboffset_left=0;	// DEFAULT Sub menu offset Left position