
    // CZ :: STATISCHE VARIABLEN DER KLASSE CTREE
    
    cntTrees = 0;
 
 
    // CZ :: INTERNE KONSTANTEN   
   
    cShut = 0;
    cOpen = 1;
    
    maxNodes = 100;
    
    
    
    
    // ---------------------------------------------------- //
    //  CZ :: KLASSE ZUR DEFINITION DER STRUKTUR DES BAUMS  //
    // ---------------------------------------------------- //
    
    function CNode () {
      
      this.sText = "";
      this.sIcon = "";
      this.sLink = "";
          
      this.sFrame = "";
      this.sClass = "";
      this.sState = cShut;
      
      this.nLevel = 0;      
    }
    
    
    
    
    // ----------------------------------- //
    //  CZ :: DEFINITION DER KLASSE CTREE  //
    // ----------------------------------- //
    
    function CTree () {

      // CZ :: BEZEICHNER
      
      this.ID = "";
      
     
      // CZ :: METHODEN
      
      this.open = open;
      this.shut = shut;
      
      this.addNode = addNode;
      this.stepIn  = stepIn;
      this.stepOut = stepOut;
      
      this.showTree = showTree;   
      
      
      // CZ :: EIGENSCHAFTEN
      
      this.sImgNone = "";
      this.sImgPlus = "";
      this.sImgMinus = "";
      this.sImgNoNest = "";
            
      this.sImgHeight = 15;
      this.sImgWidth  = 15;
             
      
      // CZ :: EVENT HANDLER
      
      this.onTreeClicked = onTreeClicked;
    
      
      // CZ :: INTERNE VARIABLEN
      
      this.cntLine = 0;
      this.curNestLvl = 0;
      
    
      // CZ :: ABBILDUNG DER MENU STRUKTUR
      
      this.aNodes = new Array (maxNodes);
      cntTrees ++;   
    }
    
    
    
    
    // ----------------------- //
    //  CZ :: ÖFFNET DEN BAUM  //
    // ----------------------- //
    
    function open () {
      
      
      // CZ :: LAYER SCHREIBEN FÜR DEN IE ...
      
      if (document.all)
        document.write (
          '<div style = "position:absolute;" id = "L' + this.ID + 
          '" name = "L' + this.ID + '">');
      
      
      // CZ :: ... UND DEN NETSCAPE NAVIGATOR
       
      else if (document.layers)  
       document.write ('<layer id = "L' + this.ID + '" name = "L' + this.ID + '">');
    }
    
    
    
    
    // -------------------------- //
    //  CZ :: SCHLIESST DEN BAUM  //
    // -------------------------- //
    
    function shut () {
    
      if (document.all)
        document.write ('</div>');
        
      else if (document.layers)
        document.write ('</layer>');  
    }
    
    
    
    
    // ----------------------------------------- //
    //  CZ :: FÜGT EINEN EINTRAG ZUM BAUM HINZU  //
    // ----------------------------------------- // 
    
    function addNode (sText, sClass, sHyperLink, sTargetFrame, sIcon) {
      
      
      // CZ :: MENU STRUKTUR MAPPEN
      
      this.aNodes [this.cntLine] = new CNode ();      
      
      this.aNodes [this.cntLine].sText = sText;
      this.aNodes [this.cntLine].sIcon = sIcon;
      this.aNodes [this.cntLine].sLink = sHyperLink;
      
      this.aNodes [this.cntLine].sFrame = sTargetFrame;
      this.aNodes [this.cntLine].sClass = sClass;
      this.aNodes [this.cntLine].sState = cShut;
        
      this.aNodes [this.cntLine].nLevel = this.curNestLvl;
      this.cntLine ++;
    }
   
   
   
   
    // ---------------------------------------------- //
    //  CZ :: METHODEN ZUR SCHACHTELUNG DER STRUKTUR  //
    // ---------------------------------------------- //
   
    function stepIn () { this.curNestLvl ++; }
   
    function stepOut () { this.curNestLvl --; }


        

    // --------------------------------------- //
    //  CZ :: ZEICHNET DEN BAUM VON GRUND AUF  //
    // --------------------------------------- //
              
    function showTree () {
   
      
      // CZ :: VARIABLE ZU SPEICHERUNG DES BAUMS
    
      var sTree = '<table border = "0" cellpadding = "0" cellspacing = "0">';
      
   
      // CZ :: JEDEN EINZELNEN EINTRAG ZEICHNEN
      
      for (i = 0; i < this.cntLine; i ++) {
        
        
        // CZ :: AKTUELLE ZEILE AUS STRUKTUR HOLEN
           
        var line = this.aNodes [i];
        
        var bIsNestedNode = false;
        var bIsLastNode = (i == this.cntLine - 1) ? true : false; 
      
      
        // CZ :: LIEGT EIN ÜBERPUNKT VOR ?
        
        if (!bIsLastNode && this.aNodes [i + 1].nLevel > line.nLevel)
          bIsNestedNode = true;
                                  
        sTree += 
          '<tr><td>' +
          '<table border = "0" cellpadding = "0" cellspacing = "0">' +
          '<tr>';
        
        
        // CZ :: DER TIEFE ENTSPRECHEND EINRÜCKEN
        
        for (j = 0; j < line.nLevel; j ++) {
                  
          sTree +=
            '<td>' +
            '<img border = "0" hspace = "0" vspace = "0"' +
            '  height = "' + this.sImgHeight + '"' +
            '  width  = "' + this.sImgWidth  + '"' +
            '  src = "' + this.sImgNone + '">' +
            '</td>';
        }
                    
        sTree += '<td valign = "center" align = "center">'; 
      
                
        // CZ :: LIEGT EINE VERZWEIGUNG VOR ?
      
        if (bIsNestedNode) {


          // CZ :: ANKER SETZEN
          
          sTree +=
            '<a border = "0"' +
            '  href = "javascript:' + this.ID + '.onTreeClicked (' + i + ')">';

      
          if (line.sState == cShut) {
          
            sImgTemp = this.sImgPlus;
            
            
            // CZ :: SUCHE NACH NÄCHSTEM ANZUZEIGENDEN EINTRAG
            
            var k;
            
            for (k = i + 1; k < this.cntLine; k ++)
              if (this.aNodes [k].nLevel <= line.nLevel)
                break;
                
            i = k - 1;    
          }
                    
          else
            sImgTemp = this.sImgMinus;
                           
        }  
        
        else
          sImgTemp = this.sImgNoNest; 
      
      
        // CZ :: +/- SYMBOL SCHREIBEN
       
        sTree +=
          '<img border = "0" hspace = "0" vspace = "0"' +
          '  height = "' + this.sImgHeight + '"' +
          '  width  = "' + this.sImgWidth  + '"' +
          '  src = "' + sImgTemp + '">';
      
      
        // CZ :: GEGEBENENFALLS DEN ANKER UM DAS +/- SYMBOL SCHLIESSEN
             
        if (bIsNestedNode)
          sTree += '</a>';
      
         
         
        // CZ :: ICON SCHREIBEN
      
        sTree += '</td><td>';
        sTree +=        
          '<img border = "0" hspace = "0" vspace = "0"' +
          '  height = "' + this.sImgHeight + '"' +
          '  width  = "' + this.sImgWidth  + '"' +
          '  src = "' + line.sIcon + '">';


        // CZ :: TEXT SCHREIBEN
        
        if (line.sLink != "")
          sTree +=
            '</td><td class = "' + line.sClass + '">' + 
            '<a class = "' + line.sClass + '" href = "' + line.sLink + 
            '" target = "' + line.sFrame + '">' + line.sText + '</a>';
        
        else
          sTree +=
            '</td><td class = "' + line.sClass + '">' + line.sText;
        
        sTree += '</td></tr></table></td></tr>';
      }     
      
      sTree += '</table>';
      
            
      // CZ :: FÜR DEN INTERNET EXPLORER ...
      
      if (document.all)
        document.all ['L' + this.ID].innerHTML = sTree; 
      
      
      // CZ :: ... UND FÜR DEN NETSCAPE
      
      else if (document.layers) {
        
        document.layers ['L' + this.ID].document.open  ();  
        document.layers ['L' + this.ID].document.write (sTree);
        document.layers ['L' + this.ID].document.close ();
      }          
    }

    
   
    
    // ------------------------------------------------ //
    //  CZ :: EVENT HANDLER ZUR ANPASSUNG DER STRUKTUR  //
    // ------------------------------------------------ //
    
    function onTreeClicked (id) {
    
    
      // CZ :: TOGGLE +/-
      
      if (this.aNodes [id].sState == cShut)
        this.aNodes [id].sState = this.aNodes [id].cOpen;
      else
        this.aNodes [id].sState = cShut;
        
      this.showTree ();  
    }
