function stopBuble()
{
	if(window.event)
	{
		var e = window.event;
		if (!e)
		{ window.alert('bubble')
			e.cancelBubble = true;
		}
		if (e.stopPropagation) 
		{
			e.stopPropagation();
		}
	}
}

var timerID;
var menuID = new Array();
//add menus here
menuID['churchLink'] = "";
menuID['academyLink'] = "";
menuID['campLink'] = "";

menuID['churchLink2'] = "";
menuID['academyLink2'] = "";
menuID['campLink2'] = "";


function menuManage(menuEl)
{
	menuState = document.getElementById(menuEl);
	stopBuble();
	if(menuState.style.visibility == "hidden" || menuState.style.visibility == "")
	{
		menuState.style.visibility = "visible";
		if(menuID[menuEl] == "")
		{
			menuID[menuEl] = setTimeout('timerClose()',5000);
		}
		else
		{
			clearTimeout(menuID[menuEl]);
			menuID[menuEl] = "";
		}
	}
}
function upManage(menuEl)
{
	document.getElementById(menuEl).style.visibility = "hidden";
}

function timerClose()
{
	menuArray = new Array('churchLink','academyLink','campLink','churchLink2','academyLink2','campLink2');
	for(i=0;i<3;i++)
	{	
		theMenu = document.getElementById(menuArray[i]);
		menuState = getStyle(menuArray[i],'visibility')
		if(menuState == "visible")
		{
			theMenu.style.visibility = 'hidden';
		}
	}
}

function getStyle(el,styleProp)
{
        var x = document.getElementById(el);
        if (x.currentStyle)
                var y = x.currentStyle[styleProp];
        else if (window.getComputedStyle)
                var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
        return y;
}


