var sporthierarchie= { children:[ { id:0, name:"Sporthierarchie", typ:1, children:[ {id:1236,name:"BALLSPIELE",typ:1,bgcolor:"#FFFFFF",children:[{id:1241,name:"Badminton",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1225,name:"Basketball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1264,name:"Faustball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1252,name:"Flag-Football",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1224,name:"Floorball-Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1242,name:"Fußball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1263,name:"Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1267,name:"Squash",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1266,name:"Tennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1265,name:"Tischtennis",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1223,name:"Volleyball",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1231,name:"Weitere",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1222,name:"GERÄTTURNEN - AKROBATIK",typ:1,bgcolor:"#FFFFFF",children:[{id:1256,name:"AcroYoga- Partnerakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1255,name:"Bodenturnen-Bodenakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1254,name:"Gerätturnen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1257,name:"Handstandtraining",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1221,name:"Partnerakrobatik",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1263,name:"Hallenhockey",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1239,name:"IM AM UNTER WASSER",typ:1,bgcolor:"#FFFFFF",children:[{id:1229,name:"Schwimmen",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1230,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1240,name:"KAMPFSPORT - KAMPFKUNST",typ:1,bgcolor:"#FFFFFF",children:[{id:1228,name:"Aikido",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1232,name:"Kampfsportfitness",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1227,name:"Taekwondo",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1226,name:"Weiteres",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1234,name:"KLETTERN",typ:1,bgcolor:"#FFFFFF",children:[{id:1248,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1250,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1237,name:"KONDITION - FITNESS",typ:1,bgcolor:"#FFFFFF",children:[{id:1243,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1261,name:"NEUER USI-Kurs",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1247,name:"OUTDOORWOCHEN / KURSTAGE",typ:1,bgcolor:"#FFFFFF",children:[{id:1249,name:"Wintersport",typ:1,bgcolor:"#FFFFFF",children:[{id:1245,name:"Ausrüstung",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1244,name:"Kurse",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1246,name:"USI-Bus",typ:1,bgcolor:"#FFFFFF",children:[]}]}]},{id:1238,name:"TANZ",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1262,name:"USI-Fitness-Studio",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1235,name:"WEITERES",typ:1,bgcolor:"#FFFFFF",children:[{id:1243,name:"Yoga",typ:1,bgcolor:"#FFFFFF",children:[]},{id:1251,name:"zu Sonstigem",typ:1,bgcolor:"#FFFFFF",children:[]}]},{id:1253,name:"XUNDES 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(); } }