var DIR_IMAGES = "../img/main/";var IMG_PLUS   = DIR_IMAGES + "pfeil_rechts.jpg";var IMG_MINUS  = DIR_IMAGES + "pfeil_unten.jpg";var IMG_LEER   = DIR_IMAGES + "leer.gif";var imgPlus  = new Image();imgPlus.src  = IMG_PLUS;var imgMinus = new Image();imgMinus.src = IMG_MINUS;var imgLeer  = new Image();imgLeer.src = IMG_LEER;var objLocalTree = null;var INDENT_WIDTH  = 5;var PICTUR_WIDTH  = 0;var PLUSMINUS_TXT = "Ein-/Ausklappen";var HAS_PICTURE = false;var TEXT_PASSIVE = "textItemList";var TEXT_ACTIVE  = "textbold";function hdtTree() {    //Public Properties    this.root = null;           //the root node of the tree      //Public Collections    this.nodes = new Array;     //array for all nodes in the tree       //Constructor    //assign to local copy of the tree    objLocalTree = this;}hdtTree.prototype.createRoot = function(strText, strURL, strTarget) {    //create a new node    this.root = new hdtTreeNode(strText, strURL, strTarget);        //assign an ID for internal tracking    this.root.id = "root";        //add it into the array of all nodes    this.nodes["root"] = this.root;        //make sure that the root is expanded    this.root.expanded = true;    //make sure that the root is not highlighted    this.root.highlight = false;        //return the created node    return this.root;}function hdtTreeNode(strText, strURL, strTarget) {    //Public Properties    this.text   = strText;          //the text to display    this.url    = strURL;           //the URL to link to    this.target = strTarget;        //the target for the URL        //Private Properties    this.indent = 0;                //the indent for the node        //Public States    this.expanded = false;          //is this node expanded?        this.highlight = false;         // ist das highlight an?     //Public Collections       this.childNodes = new Array;    //the collection of child nodes}hdtTreeNode.prototype.addChild = function (strText, strURL, strTarget) {    //create a new node    var objNode = new hdtTreeNode(strText, strURL, strTarget);        //assign an ID for internal tracking: root_1_1...    objNode.id = this.id + "_" + this.childNodes.length;        //assign the indent for this node    objNode.indent = this.indent + 1;        //add into the array of child nodes    this.childNodes[this.childNodes.length] = objNode;        //add it into the array of all nodes    objLocalTree.nodes[objNode.id] = objNode;        //return the created node    return objNode;}hdtTree.prototype.buildDOM = function(domLevel) {    //call method to add root to document, which will recursively    //add all other nodes    this.root.addToDOM(domLevel);}hdtTreeNode.prototype.addToDOM = function (objDOMParent) {    //create the URL    var strHTMLLink = "<a class=\"" + TEXT_PASSIVE + "\" href=\"" + this.url + "\"";    if (this.target)strHTMLLink += " target=\"" + this.target + "\"><span class=\"" + TEXT_PASSIVE + "\">";        //create the layer for the node    var objNodeDiv = document.createElement("div");    objNodeDiv.setAttribute("id", "master_" + this.id);        //add it to the DOM parent element    objDOMParent.appendChild(objNodeDiv);    	if(this.id != "root") {		//create string buffer		var d = new hdtDocument;				//begin the table		d.writeln("<table bgcolor=\"#EEEEEE\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr bgcolor=\"#EEEEEE\" >");				//no indent needed for root or level under root		if (this.indent > 1) {			d.write("<td bgcolor=\"#EEEEEE\" width=\"");			d.write(this.indent * INDENT_WIDTH);			d.write("\">");			d.write("<img src=\"");			d.write(imgLeer.src);			d.write("\" border=\"0\" width=\"");			d.write(this.indent * INDENT_WIDTH);			d.write("\" height=\"1\" alt=\"\" id=\"\" />");			d.write("</td>");		}				//there is no plus/minus image for the root		if (this.indent > 0) {					d.write("<td bgcolor=\"#EEEEEE\" width=\"");			d.write(INDENT_WIDTH);			d.write("\" valign=\"top\" align=\"center\">");						//if there are children, then add a plus/minus image			if (this.childNodes.length > 0) {				d.write("<a href=\"javascript:objLocalTree.toggleExpand('");				d.write(this.id);				d.write("')\"><img src=\"");				d.write(this.expanded ? imgMinus.src : imgPlus.src);				d.write("\" border=\"0\" hspace=\"1\" id=\"");				d.write("imgPM_" + this.id);				d.write("\" alt=\"");				d.write(PLUSMINUS_TXT);				d.write("\" title=\"");				d.write(PLUSMINUS_TXT);				d.write("\" /></a>");			} else {				// Zelle ist leer				d.write("<img src=\"");				d.write(imgLeer.src);				d.write("\" border=\"0\" width=\"9\" height=\"1\" alt=\"\" id=\"\" />");			}						d.write("</td>");		}			//finish by drawing the text		d.write("<td bgcolor=\"#EEEEEE\">" + strHTMLLink + this.text + "</span></a></td>");		d.writeln("</tr></table>");		  		//assign the HTML to the layer		objNodeDiv.innerHTML = d;    }    //create the layer for the children    var objChildNodesLayer = document.createElement("div");    objChildNodesLayer.setAttribute("id", "divChildren_" + this.id);    objChildNodesLayer.style.position = "relative";    objChildNodesLayer.style.display = (this.expanded ? "block" : "none");    objNodeDiv.appendChild(objChildNodesLayer);        //call for all children (rekursiv)    for (var i=0; i < this.childNodes.length; i++)        this.childNodes[i].addToDOM(objChildNodesLayer);}hdtTree.prototype.toggleHighlight = function(strNodeID) {    //get the node    var objNode             = this.nodes[strNodeID];	var myElements          = document.getElementById("master_" + objNode.id);	var myCell              = myElements.getElementsByTagName("table");	var myCellTable         = myCell.item(0);	var myCellTableElements = myCellTable.getElementsByTagName("tr");	var myCellTR            = myCellTableElements.item(0);	var myCellTRElements    = myCellTR.getElementsByTagName("td");	var myCellTD            = myCellTRElements.item(myCellTRElements.length -1);	var myCellSPElements    = myCellTD.getElementsByTagName("span");	var myCellSP            = myCellSPElements.item(0);	var myCellAElements     = myCellTD.getElementsByTagName("a");	var myCellA             = myCellAElements.item(0);	    if (objNode.highlight) {    	objNode.highlight = false;        //myCellTD.style.backgroundColor = "#000";    	//myCellSP.setAttribute("class", TEXT_PASSIVE);    	//myCellA.setAttribute("class", TEXT_PASSIVE);    	myCellSP.style.fontWeight = "normal";	} else {       	objNode.highlight = true;        // myCellSP.style.backgroundColor = "#AAA";    	//myCellSP.setAttribute("class", "textany"); //TEXT_ACTIVE   fontWeight    	myCellSP.style.fontWeight = "bold";    	//myCellA.setAttribute("class", "textany"); //TEXT_ACTIVE    }}hdtTree.prototype.toggleExpand = function(strNodeID) {    //get the node    var objNode = this.nodes[strNodeID];        //determine whether to expand or collapse    if (objNode.expanded)        objNode.collapse();    else        objNode.expand();}hdtTreeNode.prototype.collapse = function () {    //check to see if the node is already collapsed    if (!this.expanded) {            //throw an error        throw "Node is already collapsed";    } else {            //change the state of the node        this.expanded = false;                //change the plus/minus image to be plus        document.images["imgPM_" + this.id].src = imgPlus.src;                //hide the child nodes        document.getElementById("divChildren_" + this.id).style.display = "none";    }}hdtTreeNode.prototype.expand = function () {    //check to see if the node is already expanded    if (this.expanded) {            //throw an error        throw "Node is already expanded";        } else {            //change the state of the node        this.expanded = true;                //change the plus/minus image to be minus        document.images["imgPM_" + this.id].src = imgMinus.src;                //show the child nodes        document.getElementById("divChildren_" + this.id).style.display = "block";    }}/*>>>>>>>Die folgende Funktion setzt nachtraeglich die Attribute "alt" und "title" auf "Ein-/Ausklappen".	Beispiel-Aufruf: setHDTTreeAltTitleAttributesToPlusMinusText();	Rueckgabewert: keiner<<<<<<<*/setHDTTreeAltTitleAttributesToPlusMinusText = function(){	var links = document.getElementsByTagName("a");	for(var index = 0; index < links.length; ++index){		var link = links.item(index);		if(link.href.substring(0, 36) == 'javascript:objLocalTree.toggleExpand'){		  link.setAttribute('title', PLUSMINUS_TXT);		  link.setAttribute('alt'  , PLUSMINUS_TXT);		}	}}