X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=static%2Fstatic%2Fmenu.js;h=12c3a30fe6ba5b73756fa5bcc350e7b1037f7ff1;hp=b73827eb6383bcff219200ee841e4b615a04ca97;hb=7f22ccdc95d968a3f8a5affcab74687c22823d74;hpb=f9690dc20a342802275d70e088b34dfa8e8868b3 diff --git a/static/static/menu.js b/static/static/menu.js index b73827eb..12c3a30f 100644 --- a/static/static/menu.js +++ b/static/static/menu.js @@ -21,12 +21,35 @@ } } } + function showExpert(a) + { + b=document.getElementsByClassName("expert"); + for(i=0;b.length>i;i++) + { + if(!a) {b[i].setAttribute("class","expert experthidden"); } + else {b[i].setAttribute("class","expert");} + } + b=document.getElementsByClassName("expertoff"); + for(i=0;b.length>i;i++) + { + b[i].setAttribute("class",""); + } + + } + function init(){ + initMenu(); + showExpert(false); + var expert = document.getElementById("expertbox"); + if(expert !== null) { + expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert); + } + } (function(oldLoad) { if (oldLoad == undefined) { - window.onload = initMenu; + window.onload = init; } else { window.onload = function() { - initMenu(); + init(); oldLoad(); } }