var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		link_home_on = newImage("images/link_home_on.gif");
		link_about_on = newImage("images/link_about_on.gif");
		link_sermons_on = newImage("images/link_sermons_on.gif");
		link_ministries_on = newImage("images/link_ministries_on.gif");
		link_youth_on = newImage("images/link_youth_on.gif");
		link_resources_on = newImage("images/link_resources_on.gif");
		staff2 = newImage("images/pic_staff2.jpg");
		staff3 = newImage("images/pic_staff3.jpg");
		preloadFlag = true;
	}
}
function changeImages( m, image) {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
	showDropdownMenu( m );
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var curMenu
curMenu = ''

function showDropdownMenu( m )
{
	if( document.getElementById )
	{
		hideDropdownMenu( curMenu );
		e = document.getElementById( "menu" + m )
		if( e != null )
		{
			e.style.visibility = "visible"
			e.style.zindex= 100

			curMenu = m
		}		
	}
}
function hideDropdownMenu( m )
{
	e = document.getElementById( "menu" + m )
	if( e != null )
	{
		e.style.visibility = "hidden"
		e.style.zindex= 0
	}		
}
function dropdownMenuMover( m )
{
	e = document.getElementById( "menuCell" + m )
	if( e != null )
	{
		e.bgColor = "#D0D0D0"
	}		
}
function dropdownMenuMout( m )
{
	e = document.getElementById( "menuCell" + m )
	if( e != null )
	{
		e.bgColor = "#EFEFEF"
	}
}
function reportMouseMove()
{
	if( curMenu != "" )
	{
		e = document.getElementById( "menu" + curMenu )
		if( e != null )
		{
			y = window.event.y;
			if( y < 60 || y > 100 )
				hideDropdownMenu( curMenu );
		}
	}
}
function newWin(page, features) {
	 newwin = window.open(page, 'pic', features);
	 newwin.focus()
}
