// names of divs in primarynav.html
var subMenuArray = ['subhome', 'subaboutUs', 'subkidsYouth', 'subchurchLife'];
                    
function getRefToDiv(divID) {
	return document.getElementById(divID);
}

function shout(e) {
;
}

function showSubmenu(obj) {
	var objId = obj.id;
	strDiv = 'sub' + objId;
	for (var i=0; i<subMenuArray.length; i++) {
		var myReference = getRefToDiv(subMenuArray[i]);
		if (myReference) {
			if (subMenuArray[i] == strDiv) {
				myReference.style.visibility = 'visible';
				// ensure submenu leaps in front of everything else
				myReference.style.zIndex = '999';
				myReference.style.left = obj.offsetLeft + 5;
			} else {
				myReference.style.visibility = 'hidden';
			}
		}
	}
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);




