function changeMenu(menuNr) {
// MENUNR ALFANUMERIEK
    if (menuNr < 10) {
        menuStr = '0' + String(menuNr);
    } else {
        menuStr = String(menuNr);
    }
// VORIGE DOT UITSCHAKELEN
    if (menu[menuNr].link != '' && menu[menuNr].window != 'n') {
        if (dotItem != '') {
            if (document.getElementById(dotItem)) {
                if (document.getElementById(dotItem).style.visibility == 'visible') {
                    document.getElementById(dotItem).style.visibility = 'hidden';
                }
            }
        }
    }
// OPENSTAANDE MENU'S INKLAPPEN
    if (menu[menuNr].link != '' && menu[menuNr].window != 'n') {
        for (x = 0; x < 10; x++) {
            if (x != Math.floor(menuNr / 10)) {
                menuColl = 'menu' + String(x) + '0';
                if (document.getElementById(menuColl)) {
                    if (document.getElementById(menuColl).style.visibility == 'visible') {
                        document.getElementById(menuColl).style.visibility = 'hidden';
                        document.getElementById(menuColl).style.display = 'none';
                    }
                }
            }
        }
    }
// GEKOZEN MENU UITKLAPPEN
    menuColl = 'menu' + String(Math.floor(menuNr / 10) * 10);
    if (document.getElementById(menuColl)) {
        if (document.getElementById(menuColl).style.visibility == 'hidden') {
            document.getElementById(menuColl).style.visibility = 'visible';
            document.getElementById(menuColl).style.display = 'block';
        }
    }
// DOT WEERGEVEN
    if (menu[menuNr].link != '' && menu[menuNr].window != 'n') {
        dotItem = 'dot' + menuStr;
        if (document.getElementById(dotItem)) {
            document.getElementById(dotItem).style.visibility = 'visible';
        }
    }
// LINK OPENEN
    if (menu[menuNr].link != '') {
        if (menu[menuNr].window == 'n') {
            winhandle = window.open(menu[menuNr].link,'blank','menubar=1,toolbar=1,location=1,scrollbars=1,resizable=1,status=1,width=1200,top=1,left=1');
        } else {
            parent.main.location.href = menu[menuNr].link;
        }
    }
}
// TOGGLE MENU
//    if (menuType == 'm') {
//        menuItem = 'menu' + menuNr;
//        if (document.getElementById(menuItem)) {
//            if (document.getElementById(menuItem).style.visibility == 'hidden') {
//                document.getElementById(menuItem).style.visibility = 'visible';
//                document.getElementById(menuItem).style.display = 'block';
//            } else {
//                document.getElementById(menuItem).style.visibility = 'hidden';
//                document.getElementById(menuItem).style.display = 'none';
//            }
//        }
//    }
// function testDot() {
//    for (y = 0; y < 10; y++) {
//        testDot = 'dot' + String(x) + String(y);
//        alert (testDot);
//        if (document.getElementById(testDot)) {
//            if (document.getElementById(testDot).style.visibility == 'visible') {
//                return true;
//            }
//        }
//    }
//    return false;
//}
//
// ALLE DOTS UITZETTEN
//        for (x = 0; x < 10; x++) {
//            for (y = 0; y < 10; y++) {
//                dotSpan = 'dot' + String(x) + String(y);
//                if (document.getElementById(dotSpan)) {
//                    if (document.getElementById(dotSpan).style.visibility == 'visible') {
//                        document.getElementById(dotSpan).style.visibility = 'hidden';
//                    }
//                }
//            }
//        }
function menuItem(type, window, title, link) {
  this.type=type;
  this.window=window;
  this.title=title;
  this.link=link;
}
