var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:678,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:683,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:665,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:684,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:661,name:"Tennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:692,name:"Tischtennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:666,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:673,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:681,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:663,name:"Paddeln",typ:1,bgcolor:"#FFFFFF",children:[]},{id:662,name:"Rudern",typ:1,bgcolor:"#FFFFFF",children:[]},{id:670,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:664,name:"Tauchen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:671,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:682,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:669,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:674,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:668,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:667,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:676,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:690,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:693,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:679,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:685,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:689,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:696,name:"Sommersport",typ:1,bgcolor:"#FFFFFF",children:[{id:695,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:694,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:691,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:687,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:686,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:688,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:680,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:677,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:685,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]},{id:701,name:"zu Sonstigem",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(); } }