var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:354,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:359,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:341,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:360,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:368,name:"Tischtennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:342,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:349,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:357,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:348,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:346,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:347,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:358,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:345,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:350,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:344,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:343,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:352,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:366,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:369,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:355,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:348,name:"Aquarobic",typ:1,bgcolor:"#FFFFFF",children:[]},{id:361,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:365,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:367,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:363,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:362,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:364,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:356,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:353,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:361,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(); } }