var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:1018,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:1023,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1006,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1049,name:"Flag-Football",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1048,name:"Floorball-Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1024,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1002,name:"Tennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1032,name:"Tischtennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1007,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1050,name:"Wasserball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1013,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1041,name:"GERÄTTURNEN - AKROBATIK",typ:1,bgcolor:"#FFFFFF",children:[{id:1043,name:"AcroYoga- Partnerakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1044,name:"Bodenturnen-Bodenakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1045,name:"Gerätturnen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1046,name:"Handstandtraining",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1047,name:"Partnerakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1021,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:1004,name:"Paddeln",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1003,name:"Rudern",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1011,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1005,name:"Tauchen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1051,name:"Wasserball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1012,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1022,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:1010,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1014,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1009,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1008,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1016,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:1030,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1033,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1019,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:1025,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1029,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:1036,name:"Sommersport",typ:1,bgcolor:"#FFFFFF",children:[{id:1035,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1034,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1031,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:1027,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1026,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1028,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:1020,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1017,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:1025,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1001,name:"zu Sonstigem",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1037,name:"Xunde BEWEGUNG für JKU-MA",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(); } }