var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:778,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:783,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:766,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:784,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:762,name:"Tennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:792,name:"Tischtennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:767,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:773,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:781,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:764,name:"Paddeln",typ:1,bgcolor:"#FFFFFF",children:[]},{id:763,name:"Rudern",typ:1,bgcolor:"#FFFFFF",children:[]},{id:771,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:765,name:"Tauchen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:772,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:782,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:770,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:774,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:769,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:768,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:776,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:790,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:793,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:779,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:785,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:789,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:796,name:"Sommersport",typ:1,bgcolor:"#FFFFFF",children:[{id:795,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:794,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:791,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:787,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:786,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:788,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:780,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:777,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:785,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]},{id:761,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(); } }