var offSetX = new Array();
offSetX[0] = 126;
offSetX[1] = offSetX[0] + 89;
offSetX[2] = offSetX[0] + 460;
offSetX[3] = offSetX[0] + 525;
offSetY = (screen.width > 800) ? 95 : 72;


var timeout = 750;
var timeout2 = 5000;
var theTimeout;

function ResetTO2()
{
	clearTimeout(theTimeout);
	theTimeout = setTimeout("HideMenus()",timeout);
}

function ResetTO()
{
	clearTimeout(theTimeout);
	theTimeout = setTimeout("HideMenus()",timeout2);
}


function GetClientWidth()
{
	var theWidth = (!window.innerWidth) ? document.body.clientWidth : window.innerWidth;
	return parseInt(theWidth);
}


function GetDiv(theDiv)
{
	if (!document.all) document.all = document;

	myDiv = (document.layers) ? (document.all[theDiv]) : (document[( 'getElementById' || 'all' )]( theDiv ));
	return myDiv;
}

function ShowMenu(which)
{
	ResetTO();
	HideMenus();

	var theWidth = GetClientWidth();

	var left = (theWidth - 780) / 2;
	if (left < 0) 
	{
		if (screen.width>800)
			left = 6;
		else
			left = 0;
	} 


	left += offSetX[which];

	theDivName = "MenuDiv" + which;
	myDiv = GetDiv(theDivName);
	if (document.layers) myDiv.style = myDiv;

	myDiv.style.visibility = ((document.layers) ? "show" : "visible");
	myDiv.style.left = left + (document.layers ? 0 : "px");
	myDiv.style.top = offSetY + (document.layers ? 0 : "px");
}

function HideMenus()
{
	for (var which = 0; which < offSetX.length; which++)
	{
		theDivName = "MenuDiv" + which;
		myDiv = GetDiv(theDivName);

		if (document.layers) myDiv.style = myDiv;
		myDiv.style.visibility = ((document.layers) ? "hide" : "hidden");
	}
}


function ChangeClass(whatTable,toWhat,cursor) 
{
	if (document.layers) return;

	var what = GetDiv(whatTable);
	what.className=toWhat;
	what.style.cursor=cursor;
}