function fctTree(strFilter,intEbene,strXML) {
	strK2="0.0.0.0"
	strK3="0.0.0.0"
	strK4="0.0.0.0"
	strK5="0.0.0.0"
	pstrFilter = strFilter;
	pintEbene = intEbene;
	cstrXML=strXML;
	if (document.implementation && document.implementation.createDocument) {
	   xmlTree = document.implementation.createDocument("", "", null);
	   xmlTree.onload = fctTreeListe;
   	}
	else if (window.ActiveXObject) {
   	   xmlTree = new ActiveXObject("microsoft.xmldom");
	   xmlTree.onreadystatechange = function(){
	   		if (xmlTree.readyState == 4) fctTreeListe();
	   }
   	}
	else {
   	   alert("Your browser can\'t handle this script");
   	   return;
   	}
   	xmlTree.load("daten/" + cstrXML + ".xml");
}

function fctTreeListe() {
	strHTML = ""
	objRoot=xmlTree.getElementsByTagName("main");
	for (i=0;i<objRoot[0].childNodes.length;i++) {
	  if(objRoot[0].childNodes[i].nodeType!=3) {
		var objElement = objRoot[0].childNodes[i]; 
		with (objElement) {
		if(getAttribute("filter").indexOf(pstrFilter)>=0) {
		strHTML += fctHTML(getAttribute("knot"),getAttribute("index"),getAttribute("text"),getAttribute("file"),getAttribute("ebene"))
		if(getAttribute("index")==strK2 || pintEbene>=2) {
		for (j=0;j<objElement.childNodes.length;j++) {
	  	  if(objElement.childNodes[j].nodeType!=3) {
		  	var objSub1 = objElement.childNodes[j]; 
			with (objSub1) {
			if(getAttribute("filter").indexOf(pstrFilter)>=0) {
			strHTML += fctHTML(getAttribute("knot"),getAttribute("index"),getAttribute("text"),getAttribute("file"),getAttribute("ebene"))
			if(getAttribute("index")==strK3 || pintEbene>=3) {
			for (k=0;k<objSub1.childNodes.length;k++) {
	  	  	  if(objSub1.childNodes[k].nodeType!=3) {
		  	  	var objSub2 = objSub1.childNodes[k]; 
				with (objSub2) {
				if(getAttribute("filter").indexOf(pstrFilter)>=0) {
				strHTML += fctHTML(getAttribute("knot"),getAttribute("index"),getAttribute("text"),getAttribute("file"),getAttribute("ebene"))
				if(getAttribute("index")==strK4 || pintEbene>=4) {
				for (l=0;l<objSub2.childNodes.length;l++) {
	  	  	  	  if(objSub2.childNodes[l].nodeType!=3) {
		  	  		var objSub3 = objSub2.childNodes[l]; 
					with (objSub3) {
					if(getAttribute("filter").indexOf(pstrFilter)>=0) {
					strHTML += fctHTML(getAttribute("knot"),getAttribute("index"),getAttribute("text"),getAttribute("file"),getAttribute("ebene"))
					if(getAttribute("index")==strK5) {
					for (m=0;m<objSub3.childNodes.length;m++) {
	  	  	  	  	  if(objSub3.childNodes[m].nodeType!=3) {
		  	  			var objSub4 = objSub3.childNodes[m]; 
						with (objSub4) {
						if(getAttribute("filter").indexOf(pstrFilter)>=0) {
						strHTML += fctHTML(getAttribute("knot"),getAttribute("index"),getAttribute("text"),getAttribute("file"),getAttribute("ebene"))
						}}
					  }
		  	  	  	}}}}
				  }
		  	  	}}}}
		  	  }
			}}}}
		  }
		}}}}
	  }
	}
	document.getElementById("list").innerHTML = strHTML
}

function fctHTML(cintKnoten,cstrIndex,cstrText,cstrFile,cintEbene) {
	if (cstrXML=="Index") {
	    if(cstrFile.indexOf("fct")==0) {
	   		strTarget=""
	   		strFile = "javascript:" + cstrFile
		}
		else {
	   		strTarget=" target=Main"
	   		strFile = cstrFile
		}
	}
	else { 
	   strTarget = " target=_blank"
	   strFile = "http://" + cstrFile
	}
	if(cintKnoten=="1" || cintEbene=="1") {
		arrIndex = cstrIndex.split(".")
		strIMG = "standard/" + cstrXML + "_Folderclosed.gif";
		if(strK2==cstrIndex || strK3==cstrIndex || strK4==cstrIndex || strK5==cstrIndex) { 
			strIMG = "standard/" + cstrXML + "_Folderopen.gif";
			if (arrIndex[3]>0) arrIndex[3]=0;
			else if (arrIndex[2]>0) arrIndex[2]=0;
			else if (arrIndex[1]>0) arrIndex[1]=0;
			else if (arrIndex[0]>0) arrIndex[0]=0;
		}
		var strIndexParameter = arrIndex[0] + ',' + arrIndex[1] + ',' + arrIndex[2] + ',' + arrIndex[3];
		if(cintKnoten!="1") {
			strIndexParameter='0,0,0,0';
			strIMG = "standard/" + cstrXML + ".gif";
			 cstrText = '<A class=ND href="javascript:fctText(' + strIndexParameter + ',' + unescape("%27") + cstrFile + unescape("%27") + ')"><IMG src="' + strIMG +'" border=0>&nbsp;' + cstrText + '</A>'
		}
		else {
			 cstrText = '<A class=ND href="javascript:fctText(' + strIndexParameter + ',' + unescape("%27") + cstrFile + unescape("%27") + ')">' + cstrText + '</A>'
			 cstrText = '<A class=ND href="javascript:fctKnoten(' + strIndexParameter + ')"><IMG src="' + strIMG +'" border=0></A>&nbsp;' + cstrText
		}
	}
	else {
		if(cstrFile!="") cstrText = '<A class=ND href="' + strFile + '"' + strTarget + '><IMG src="standard/' + cstrXML +'.gif" border=0>&nbsp;' + cstrText + '</A>'
	}
	for (x=1;x<cintEbene;x++) cstrText = "&nbsp;&nbsp;" + cstrText;		
	return cstrText + '<br>'
}

function fctText(cint01,cint02,cint03,cint04,cstrFile) {
	fctKnoten(cint01,cint02,cint03,cint04)
	if(cstrFile!="") parent.Main.document.location = cstrFile;
}

function fctKnoten(cint01,cint02,cint03,cint04) {
	strK2 = cint01 + ".0.0.0"
	strK3 = cint01 + "." + cint02 + ".0.0"
	strK4 = cint01 + "." + cint02 + "." + cint03 + ".0"
	strK5 = cint01 + "." + cint02 + "." + cint03 + "." + cint04
	fctTreeListe()
}

function fctProdukte(pstrProdukt) {
	document.getElementById("txtProdukt").value = pstrProdukt;
	strFile="produktgruppe.htm";
//	if(pstrProdukt!="Snacks") strFile="produktgruppe.htm";
//	else strFile="produkte_imbiss.htm";
	parent.Main.document.location = strFile;
}
