
		var json = {
			tag: "",
			label: "root",
			childs: [				
				{
					tag: "kinder",
					label: "Kinder",
					childs: [
						{
							tag: "spiele",
							label: "Spiele",
							childs: [
								{
									tag: "indoor",
									label: "Indoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "kennenlernspiele",
											label: "Kennenlernspiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										},
										{
											tag: "spieleshows",
											label: "Spieleshows",
											childs: []
										}
									]
								},
								{
									tag: "outdoor",
									label: "Outdoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "gelaendespiele",
											label: "Geländespiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										}
									]
								}
							]
						},
						{
							tag: "themen-und-impulse",
							label: "Themen",
							childs: [
								{
									tag: "andachten",
									label: "Andachten",
									childs: []
								},
								{
									tag: "thematische-einheiten",
									label: "Thematische Einheiten",
									childs: []
								}
							]
						},
						{
							tag: "kreativ",
							label: "Kreativ",
							childs: [
								{
									tag: "basteln",
									label: "Basteln",
									childs: []
								},
								{
									tag: "werken",
									label: "werken",
									childs: []
								}
							]
						},
						{
							tag: "theater",
							label: "Theater",
							childs: [
								{
									tag: "anspiele",
									label: "Anspiele",
									childs: []
								},
								{
									tag: "theaterstuecke",
									label: "Theaterstücke",
									childs: []
								}
							]
						},
						{
							tag: "konzeptionen",
							label: "Konzeptionen",
							childs: []
						},
						{
							tag: "sontiges",
							label: "Sonstiges",
							childs: []
						}
					]
				},
				{
					tag: "jugendliche",
					label: "Jugendliche",
					childs: [
						{
							tag: "spiele",
							label: "Spiele",
							childs: [
								{
									tag: "indoor",
									label: "Indoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "kennenlernspiele",
											label: "Kennenlernspiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										},
										{
											tag: "spieleshows",
											label: "Spieleshows",
											childs: []
										}
									]
								},
								{
									tag: "outdoor",
									label: "Outdoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "gelaendespiele",
											label: "Geländespiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										}
									]
								}
							]
						},
						{
							tag: "themen-und-impulse",
							label: "Themen",
							childs: [
								{
									tag: "andachten",
									label: "Andachten",
									childs: []
								},
								{
									tag: "thematische-einheiten",
									label: "Thematische Einheiten",
									childs: []
								}, 
								{
									tag: "predigten",
									label: "Predigten",
									childs: []
								}
							]
						},
						{
							tag: "kreativ",
							label: "Kreativ",
							childs: [
								{
									tag: "basteln",
									label: "Basteln",
									childs: []
								},
								{
									tag: "werken",
									label: "werken",
									childs: []
								}
							]
						},
						{
							tag: "theater",
							label: "Theater",
							childs: [
								{
									tag: "anspiele",
									label: "Anspiele",
									childs: []
								},
								{
									tag: "theaterstuecke",
									label: "Theaterstücke",
									childs: []
								}
							]
						},
						{
							tag: "konzeptionen",
							label: "Konzeptionen",
							childs: []
						},
						{
							tag: "sontiges",
							label: "Sonstiges",
							childs: []
						}
					]
				},
				{
					tag: "junge-erwachsene",
					label: "Junge Erwachsene",
					childs: [
						{
							tag: "spiele",
							label: "Spiele",
							childs: [
								{
									tag: "indoor",
									label: "Indoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "kennenlernspiele",
											label: "Kennenlernspiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										},
										{
											tag: "spieleshows",
											label: "Spieleshows",
											childs: []
										}
									]
								},
								{
									tag: "outdoor",
									label: "Outdoor",
									childs: [
										{
											tag: "action",
											label: "Action",
											childs: []
										},
										{
											tag: "ruhig",
											label: "Ruhig",
											childs: []
										}, 
										{
											tag: "gelaendespiele",
											label: "Geländespiele",
											childs: []
										},
										{
											tag: "erlebnispaedagogik",
											label: "Erlebnispädagogik",
											childs: []
										}
									]
								}
							]
						},
						{
							tag: "themen-und-impulse",
							label: "Themen",
							childs: [
								{
									tag: "andachten",
									label: "Andachten",
									childs: []
								},
								{
									tag: "thematische-einheiten",
									label: "Thematische Einheiten",
									childs: []
								}, 
								{
									tag: "predigten",
									label: "Predigten",
									childs: []
								}
							]
						},
						{
							tag: "kreativ",
							label: "Kreativ",
							childs: [
								{
									tag: "basteln",
									label: "Basteln",
									childs: []
								},
								{
									tag: "werken",
									label: "werken",
									childs: []
								}
							]
						},
						{
							tag: "theater",
							label: "Theater",
							childs: [
								{
									tag: "anspiele",
									label: "Anspiele",
									childs: []
								},
								{
									tag: "theaterstuecke",
									label: "Theaterstücke",
									childs: []
								}
							]
						},
						{
							tag: "konzeptionen",
							label: "Konzeptionen",
							childs: []
						},
						{
							tag: "sontiges",
							label: "Sonstiges",
							childs: []
						}
					]
				}
			]
		};
		
		function init() {
			childs = getChildsForLevel(0);
			buildCat(1, childs);
			buildCat(2, []);
			buildCat(3, []);
			buildCat(4, []);
		}
		
		function buildCat(level, childs) {
			select = document.getElementById('cat' + level);
			select.innerHTML = childs2Html(childs);
		}
		
		function childs2Html(childs) {
			var html = '<option value="">Alle</option>';
			for(var i = 0; i < childs.length; i++) {
				html += '<option value="' + childs[i].tag+ '">' + childs[i].label+ '</option>';
			}
			return html;
		}
			
		function eventCatChanged(level) {
			document.getElementById('form').action = getFormAction();
			
			if (level > 0) {
				nextLevel = level + 1;
				childs = getChildsForLevel(nextLevel);
				buildCat(nextLevel, childs);
			}
		}
		
		function getChildsForLevel(level) {
			return getChildsForLevelRecursive(json.childs, 1, level);
		}
		
		function getChildsForLevelRecursive(childs, currentLevel, level) {
			if (currentLevel >= level) {
				return childs;
			}

			for (var i = 0; i < childs.length; i++) {				
				if (childs[i].tag == document.getElementById('cat' + currentLevel).value) {
					return getChildsForLevelRecursive(childs[i].childs, (currentLevel+1), level);
				}
			}
		}
		
		function getFormAction() {
			tags = '';
			for (var i = 1; i <= 4; i++) {
				if (!document.getElementById('cat' + i).value) {
					continue;
				}

				if (i > 1) {
					tags += '+';
				}
				tags += document.getElementById('cat' + i).value;
			}
			
			return 'http://www.ideasharing.de/tag/' + tags + '/';
		}

