var ua = navigator.userAgent.toLowerCase();
var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
var ieVersion = parseFloat(ua.substring(ua.indexOf('msie ') + 5));

/* hide select elements and prevent from showing through flyouts */
function activateMenu(nav) {
	try {
		if (document.all && document.getElementById(nav).currentStyle) {  
			var navroot = document.getElementById(nav);
			var lis=navroot.getElementsByTagName("LI");  
			for (i=0; i<lis.length; i++) {
				if(lis[i].lastChild.tagName=="UL"){
					lis[i].onmouseover=function() {		
						this.lastChild.style.display="block";
						try {
							formSelects = document.getElementById('central_content').getElementsByTagName('select');
							for (j=0; j<lis.length; j++) {
								formSelects[j].style.visibility = 'hidden';
							}
						} catch (e) {
						}
					}
					lis[i].onmouseout=function() {                       
						this.lastChild.style.display="none";
						try {
							formSelects = document.getElementById('central_content').getElementsByTagName('select');
							for (j=0; j<lis.length; j++) {
								formSelects[j].style.visibility = 'visible';
							}
						} catch (e) {
						}
					}
				}
			}
		}
	} catch (e) {
		setTimeout("activateMenu('" + nav + "');", 100);
	}
}

/* use this version if you don't want to hide select elements (they'll peek through flyouts) */
/*
function activateMenu(nav) {
	try {
		if (document.all && document.getElementById(nav).currentStyle) {  
			var navroot = document.getElementById(nav);
			var lis=navroot.getElementsByTagName("LI");  
			for (i=0; i<lis.length; i++) {
				if(lis[i].lastChild.tagName=="UL"){
					lis[i].onmouseover=function() {		
					   this.lastChild.style.display="block";
					}
					lis[i].onmouseout=function() {                       
						this.lastChild.style.display="none";
					}
				}
			}
		}
	} catch (e) {
		setTimeout("activateMenu('" + nav + "');", 100);
	}
}*/

if (isIE && ieVersion >= 7) {
   activateMenu('nav');
}

