﻿// c = ul
// n = li
// n.firstChild = a
// n.firstChild.childNodes[0] = out image
// n.firstChild.childNodes[1] = over image
function hoverMenu() {
    var c = document.getElementById("hovermenu")
    
    if (c == null) return

    for (var n = c.firstChild; n != null; n = n.nextSibling) {
        if (n.nodeType == 1) {
            if (n.firstChild.className.indexOf("active") >= 0) {
                n.firstChild.childNodes[0].style.display = 'none'; n.firstChild.childNodes[1].style.display = '';
            } else {
                n.firstChild.onmouseover = function() { this.childNodes[0].style.display = 'none'; this.childNodes[1].style.display = ''; };
                n.firstChild.onmouseout = function() { this.childNodes[0].style.display = ''; this.childNodes[1].style.display = 'none'; };
            }
        }
    }
}

hoverMenu();
            