var mainmenu = new Array("Tales of Midgard", "Informacion", "Rankings"); var lvlmenu = new Array("-2", "-2", "-2"); var submenu = new Array("", "", -1, "Noticias", "news.php", 0, "Online", "whoisonline.php", 1, "Online x Guild", "onlinexguild.php", 1, "WorldMap", "worldmap.php?vid=1", 1, "Familias", "family.php", 1, "Log Nombres", "lognames.php", 1, "Class", "ladder.php", 2, "Guild", "guild.php", 2, "Castle", "castles.php", 2, "WoE", "woerank.php", 2, "Zeny", "top100zeny.php", 2, "Hom", "homunculus.php", 2, "Mer", "mercenary.php", 2, "MVP", "topmvp.php", 2, "PK", "toppk.php", 2, "TK", "toptk.php", 2, "Forja", "topforja.php", 2, "Potion", "toppotion.php", 2, "PVP", "pvprank.php", 2, "BG", "bgrank.php", 2, "Playtime", "topplaytime.php", 2, "Hunting", "hunting.php", 2); function main_menu() { var the_menu = ""; var head = ""; for (i = 0; i < mainmenu.length; i++) { if (lvlmenu[i] >= 0) the_menu = the_menu + head + "" + mainmenu[i] + ""; else if (lvlmenu[i] == -1) the_menu = the_menu + head + "" + mainmenu[i] + ""; else the_menu = the_menu + head + "" + mainmenu[i] + ""; head = " | "; } document.getElementById('main_menu').innerHTML = the_menu; document.getElementById('sub_menu').innerHTML = " "; return false; } function sub_menu(index) { var the_menu = ""; var head = ""; for (i = 0; i < submenu.length; i = i + 3) { if (submenu[i + 2] == index) { the_menu = the_menu + head + "" + submenu[i] + ""; head = " | "; } } document.getElementById('sub_menu').innerHTML = the_menu; return false; } main_menu(); sub_menu(0);