// configuration options
killdelay=500;

// image preload
homeCache = new Image();
homeCache.src = "images/nava1.gif";
popCache01 = new Image();
popCache02 = new Image();
popCache03 = new Image();
popCache04 = new Image();
popCache05 = new Image();
popCache06 = new Image();
popCache07 = new Image();
popCache08 = new Image();
popCache09 = new Image();
popCache10 = new Image();
popCache11 = new Image();
popCache12 = new Image();
popCache13 = new Image();
popCache14 = new Image();
popCache15 = new Image();
popCache16 = new Image();
popCache17 = new Image();
popCache18 = new Image();
popCache19 = new Image();
popCache20 = new Image();
popCache01.src = "images/pop0b.gif";
popCache02.src = "images/pop0c.gif";
popCache03.src = "images/pop0d.gif";
popCache04.src = "images/pop0e.gif";
popCache05.src = "images/pop1b.gif";
popCache06.src = "images/pop1c.gif";
popCache07.src = "images/pop1d.gif";
popCache08.src = "images/pop1e.gif";
popCache09.src = "images/pop2.gif";
popCache10.src = "images/pop3.gif";
popCache11.src = "images/pop4b.gif";
popCache12.src = "images/pop4c.gif";
popCache13.src = "images/pop4d.gif";
popCache14.src = "images/pop4e.gif";
popCache15.src = "images/pop5.gif";
popCache16.src = "images/pop6.gif";
popCache17.src = "images/pop7.gif";
popCache18.src = "images/pop8.gif";
popCache19.src = "images/pop9.gif";
popCache20.src = "images/pop10.gif";

// menu system variables
isReady = false;
currentwhich = null;
thiscommand = 0;

// system start
function starter()
{
	isReady = true;
}

// images rollover functions
function homeOver()
{
	if (isReady)
	{
		thiscommand++;
		if (currentwhich) killMenu(currentwhich);
		document.images["home"].src = "images/2-2-about-us1.gif";
	}
}

function homeOut()
{
	if (isReady)
	{
		document.images["home"].src = "images/2-2-about-us0.gif";
	}
}

// dynamic menu functions
function navOver(which)
{
	if (isReady)
	{
		thiscommand++;
		if (currentwhich) killMenu(currentwhich);
		displayMenu(which);
	}
}

function navOut(which)
{
	if (isReady)
	{
		thiscommand++;
		setTimeout("prekill('"+which+"','"+thiscommand+"');",killdelay);
	}
}

function showMenu(which)
{
	if (isReady)
	{
		thiscommand++;
	}
}

function hideMenu(which)
{
	if (isReady)
	{
		thiscommand++;
		setTimeout("prekill('"+which+"','"+thiscommand+"');",killdelay);
	}
}

function prekill(which,sendcommand)
{
	if (sendcommand == thiscommand) killMenu(currentwhich);
}

function displayMenu(which)
{
	if ((isReady) && (document.getElementById("menu"+which)))
	{
		document.getElementById("menu"+which).style.visibility = "visible";
		currentwhich = which;
	}
}

function killMenu(which)
{
	if ((isReady) && (document.getElementById("menu"+which)))
	{
		document.getElementById("menu"+which).style.visibility = "hidden";
	}
}

