var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:514,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:519,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:502,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:541,name:"Floorball-Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:520,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:501,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:509,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:517,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:508,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:506,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:507,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:518,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:505,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:510,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:504,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:503,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:512,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:526,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:529,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:515,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:508,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:521,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:525,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:527,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:523,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:522,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:524,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:516,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:513,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:521,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(); } }