function mcAccessible(menuid) {
    var mcEls = document.getElementById(menuid).getElementsByTagName("A");
    for (var i=0; i<mcEls.length; i++) {
        mcEls[i].onfocus=function() {
            this.className+=(this.className.length>0? " ": "") + "sffocus"; //a:focus
            this.parentNode.className+=(this.parentNode.className.length>0? " ": "") + "sfhover"; //li < a:focus
            if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
                this.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < a:focus
                if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
                    this.parentNode.parentNode.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < ul < li < a:focus
                }
            }
        }
        mcEls[i].onblur=function() {
            this.className=this.className.replace(new RegExp("( ?|^)sffocus\\b"), "");
            this.parentNode.className=this.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
            if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
                this.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
                if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
                    this.parentNode.parentNode.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
                }
            }
        }
    }
}
addEvent( window, 'load', function(){ mcAccessible('headermenu'); mcAccessible('footermenu'); } );
