var isIE8 = (function()
{
    return !!( (/msie 8./i).test(navigator.appVersion) && window.ActiveXObject && XDomainRequest );
});

function nav() {
	var a=(document.all)?document.getElementById("sectionA").childNodes[0].childNodes[0]:document.getElementById("sectionA").childNodes[0].childNodes[0];
	var b=(document.all)?(a.childNodes[2])?a.childNodes[2]:a.nextSibling.childNodes[2]:(a.childNodes[1])?a.childNodes[1]:a.nextSibling.childNodes[1];
	for(var c=0,d;d=a.getElementsByTagName("ul")[c];c++) {
		if(d.parentNode.nodeName=="LI") {
			d.setAttribute((document.all?"className":"class"),"off");
			if(isIE8) {
				d.setAttribute("class","off");
			}
		}
	}
	var e=window.location.href.split("/")[window.location.href.split("/").length-2];
	if(!isNaN(e)) {
		for(var f=0,g;g=document.getElementsByTagName("a")[f];f++) {
			if(g.getAttribute("href")!=null && g.getAttribute("href").split("/")[g.getAttribute("href").split("/").length-2]==e) {
				if(isIE8()) { // IE8 isn't recognizing the ternary operator
					if(g.parentNode.parentNode.parentNode.nodeName=="LI") {
						g.parentNode.parentNode.parentNode.setAttribute("class","on");
						g.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("class","on");
						g.parentNode.setAttribute("class","on");
						g.parentNode.parentNode.setAttribute("class","on");
					}
					else {
						g.parentNode.setAttribute("class","on");
						g.parentNode.setAttribute("id", "HouseMenuNavItem"+g.getAttribute("href").split("/")[g.getAttribute("href").split("/").length-2]);
					}
				} 
				else if(g.parentNode.parentNode.parentNode.nodeName=="LI") {
					g.parentNode.parentNode.parentNode.setAttribute((document.all?"className":"class"),"on");
					g.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute((document.all?"className":"class"),"on");
					g.parentNode.setAttribute((document.all?"className":"class"),"on");
					g.parentNode.parentNode.setAttribute((document.all?"className":"class"),"on");
				}
				else {
					g.parentNode.setAttribute((document.all?"className":"class"),"on");
					g.parentNode.setAttribute("id", "HouseMenuNavItem"+g.getAttribute("href").split("/")[g.getAttribute("href").split("/").length-2]);
				}
			}
		}
	}
	//document.getElementById("sectionA").style.visibility="visible";
}