]> WPIA git - gigi.git/blobdiff - static/static/menu.js
Suggestions to enhance the SQL call pattern.
[gigi.git] / static / static / menu.js
index aff0c36bfc1c3900a4db91502d7ebdff0f8ce600..bcaee0d8860666258df22ecd387995b6694fafb8 100644 (file)
@@ -1,9 +1,9 @@
 (function() {
        function explodeMenu(e) {
-               if (document.getElementById(e).className == 'menu hidden') {
-                       document.getElementById(e).className = 'menu';
+               if (e.className == 'menu hidden') {
+                       e.className = 'menu';
                } else {
-                       document.getElementById(e).className = 'menu hidden';
+                       e.className = 'menu hidden';
                }
        }
 
                for (var i = 0; i < max; i++) {
                        var nodeObj = Nodes.item(i);
                        if (nodeObj.className.indexOf("menu") > -1 && nodeObj.id != "recom") {
-                               nodeObj.previousSibling.previousSibling.onclick = (function(nid) {
+                               nodeObj.previousSibling.previousSibling.onclick = (function(node) {
                                        return function() {
-                                               explodeMenu(nid);
+                                               explodeMenu(node);
                                        };
-                               })(nodeObj.id);
+                               })(nodeObj);
                        }
                }
        }
-       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 = init;
                } else {
                        window.onload = function() {
-                               init();
+                               initMenu();
                                oldLoad();
                        }
                }