d = new Date();
year = d.getFullYear();

function menuDisplay(state) {
	var navContact = document.getElementById("nav-contact");
	var nav2Contact = document.getElementById("nav2-contact");
	var navBusiness = document.getElementById("nav-business");
	var nav2Business = document.getElementById("nav2-business");
	var navEstate = document.getElementById("nav-estate");
	var nav2Estate = document.getElementById("nav2-estate");
	var navLitigation = document.getElementById("nav-litigation");
	var nav2Litigation = document.getElementById("nav2-litigation");
	if (state == "start") {
		navContact.style.display = "block";
		nav2Contact.style.display = "none";
		navBusiness.style.display = "block";
		nav2Business.style.display = "none";
		navEstate.style.display = "block";
		nav2Estate.style.display = "none";
		navLitigation.style.display = "block";
		nav2Litigation.style.display = "none";
	}
	if (state == "contact") {
		navContact.style.display = "none";
		nav2Contact.style.display = "block";
		nav2Contact.getElementsByTagName("DIV")[0].style.display = "block";
		navBusiness.style.display = "block";
		nav2Business.style.display = "none";
		navEstate.style.display = "block";
		nav2Estate.style.display = "none";
		navLitigation.style.display = "block";
		nav2Litigation.style.display = "none";
	}
	if (state == "business") {
		navContact.style.display = "block";
		nav2Contact.style.display = "none";
		navBusiness.style.display = "none";
		nav2Business.style.display = "block";
		nav2Business.getElementsByTagName("DIV")[0].style.display = "block";
		navEstate.style.display = "block";
		nav2Estate.style.display = "none";
		navLitigation.style.display = "block";
		nav2Litigation.style.display = "none";
	}
	if (state == "estate") {
		navContact.style.display = "block";
		nav2Contact.style.display = "none";
		navBusiness.style.display = "block";
		nav2Business.style.display = "none";
		navEstate.style.display = "none";
		nav2Estate.style.display = "block";
		nav2Estate.getElementsByTagName("DIV")[0].style.display = "block";
		navLitigation.style.display = "block";
		nav2Litigation.style.display = "none";
	}
	if (state == "litigation") {
		navContact.style.display = "block";
		nav2Contact.style.display = "none";
		navBusiness.style.display = "block";
		nav2Business.style.display = "none";
		navEstate.style.display = "block";
		nav2Estate.style.display = "none";
		navLitigation.style.display = "none";
		nav2Litigation.style.display = "block";
		nav2Litigation.getElementsByTagName("DIV")[0].style.display = "block";
	}
}

window.onload = function() {
	if (menuVar == "") {
		menuDisplay('start');
	} else {
		menuDisplay(menuVar);
	}
	clearCurrentLink();
}

/*
CLCP v2.1 Clear Links to Current Page
Jonathan Snook
This code is offered unto the public domain
http://www.snook.ca/jonathan/
*/

//MOVED INTO FUNCTION ABOVE
//window.onload = clearCurrentLink;

function clearCurrentLink(){
    var a = document.getElementsByTagName("A");
    for(var i=0;i<a.length;i++)
        if(a[i].href == window.location.href.split("#")[0])
            a[i].className = "on"; //removeNode(a[i]);
}

function removeNode(n){
    if(n.hasChildNodes())
        for(var i=0;i<n.childNodes.length;i++)
            n.parentNode.insertBefore(n.childNodes[i].cloneNode(true),n);
    n.parentNode.removeChild(n);
}
