var Timeout;
var Pause = 200;
var Items = 4;

function n_GetX(El)
{
	var X = 0;
	do {X += El.offsetLeft} while ((El = El.offsetParent) != null);
	return X;
}

function n_GetY(El)
{
	var Y = 0;
	do { Y += El.offsetTop } while ((El = El.offsetParent) != null);
	return Y;
}

function ShowItem(num)
{
	HideAll();
	LeftCoord=n_GetX(document.getElementById('bg'+num));
	TopCoord=n_GetY(document.getElementById('bg'+num))

	if (document.getElementById('img'+num)!=null) {
		LeftCoord2=n_GetX(document.getElementById('bg'+(num+1)));
		document.getElementById('img'+num).width=LeftCoord2-LeftCoord-17;
	}

	document.getElementById('menu'+num).style.left = LeftCoord+10;
	document.getElementById('menu'+num).style.top = TopCoord+27;
	document.getElementById('menu'+num).style.visibility = 'visible';

	if (document.getElementById('navform')!=null) document.getElementById('navform').style.visibility='hidden'; 
}

function HideAll()
{
	for(var i = 1; i <= Items; i++)
		HideItem(i)
	if (document.getElementById('navform')!=null) document.getElementById('navform').style.visibility='visible'; 
}

function HideItem(num)
{
	document.getElementById('menu'+num).style.visibility = 'hidden';
}