var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:635,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:640,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:623,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:621,name:"Floorball-Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:641,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:622,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:630,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:638,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:629,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:627,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:628,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:639,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:626,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:631,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:625,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:624,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:633,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:647,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:649,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:636,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:629,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:642,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:646,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:648,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:644,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:643,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:645,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:637,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:634,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:642,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]}]}]} function sphLevel(previousLevel,root) { this.previousLevel=previousLevel; this.root=root; var el=document.getElementById("uonSportarten"); var newEl=document.createElement("div"); el.appendChild(newEl); var select=document.createElement("select"); select.name="sp_id_in"; newEl.appendChild(select); for (var i=-1;i0) text=text+" >"; opt.text=text; opt.value=child.id; opt.style.backgroundColor=child.bgcolor; select.options.add(opt); } var that=this; var onchange=function() { that.expand(that.select.options[that.select.selectedIndex].value); } if (window.addEventListener) { select.addEventListener("change",onchange,false); } else { select.attachEvent("onchange",onchange); } this.select=select; this.newEl=newEl; } sphLevel.prototype={ expand:function(id) { if (this.nextLevel) this.collapse(); var next=null; for (var i=0;i0) { this.nextLevel=new sphLevel(this,next); } this.select.blur(); return this.nextLevel; }, collapse:function() { this.nextLevel.remove(); this.nextLevel=null; }, remove:function() { this.newEl.parentNode.removeChild(this.newEl); if (this.nextLevel) this.nextLevel.remove(); } }