//maked all added functions work onload. at the end of each function you want to work onload add addLoadEvent(function); to the end of the function.
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

//-- Create a :Hover psuedo attribute for IE for sidenav -- //
hdrHover = function() {
	if (document.getElementById('mnlnks') != null) {
		if((document.all)&&(document.getElementById)) {
			var hdrCat = document.getElementById("mnlnks").getElementsByTagName("li");
			for (var i=0; i<hdrCat.length; i++) {
				hdrCat[i].onmouseover=function() {
					this.className+=" hdrhover";
				}
				hdrCat[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" hdrhover\\b"), "");
				}
			}
		}	
	}
}
if (window.attachEvent) window.attachEvent("onload", hdrHover);

//-- Create a :Hover psuedo attribute for IE for attorney list page -- //
mnHover = function() {
	if (document.getElementById('attnylst') != null) {
		if((document.all)&&(document.getElementById)) {
			var mnCat = document.getElementById("attnylst").getElementsByTagName("li");
			for (var i=0; i<mnCat.length; i++) {
				mnCat[i].onmouseover=function() {
					this.className+=" mnhover";
				}
				mnCat[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" mnhover\\b"), "");
				}
			}
		}
	}	
}
if (window.attachEvent) window.attachEvent("onload", mnHover);

//hide attorney directory
function hideDir() {
	if (document.getElementById('padir') != null) {
		document.getElementById('ltgdir').style.display = "none";
		document.getElementById('ltgdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('crpdir').style.display = "none";
		document.getElementById('crpdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('resdir').style.display = "none";
		document.getElementById('resdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('tcfdir').style.display = "none";
		document.getElementById('tcfdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('hltdir').style.display = "none";
		document.getElementById('hltdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('tepdir').style.display = "none";
		document.getElementById('tepdirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
		document.getElementById('laedir').style.display = "none";
		document.getElementById('laedirarw').style.backgroundImage = 'url(../attorneys/images/mn-arrw01.gif)';
	}
}
addLoadEvent(hideDir);

//show attorney directory
var dirOpen = "";
function showDir(whichArea) {
	hideDir();
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById('padir')) return false;
	if (whichArea != dirOpen) {
		document.getElementById(whichArea).style.display = "block";
		document.getElementById(whichArea + 'arw').style.backgroundImage = 'url(../attorneys/images/mn-arrw02.gif)';
		dirOpen = whichArea;
	} else {
		dirOpen = "";
	}
}