<!--

function cSitemap(pRoot) {
  this.lRoot       = pRoot;
  this.lIds        = new Array();
  this.lParents    = new Array();
  this.lNames      = new Array();
  this.lCtrl       = new Array();
  this.lBottom     = new Array();
  this.lCtrl_l     = new Array();
  this.lData_g     = new Array();
  this.lData       = new Array();
  this.lByName     = new Array();
  this.lByParent   = new Array();
  this.lActives    = new Array();
  this.lIsLink     = new Array();
  this.lIsVisible  = new Array();
  this.lLastEntry  = new Array();
  this.lDepth      = new Array();

  {this.gAdd = function(pId, pParent, pName, pCtrl, pBottom, pCtrl_l, pData_g, pData, pIsLink,  pIsVisible) {
    this.lIds      [pId] = pId     ;
    this.lParents  [pId] = pParent ;
    this.lNames    [pId] = pName   ;
    this.lCtrl     [pId] = pCtrl   ;
    this.lBottom   [pId] = pBottom ;
    this.lCtrl_l   [pId] = pCtrl_l ;
    this.lData_g   [pId] = pData_g ;
    this.lData     [pId] = pData   ;
    this.lIsLink   [pId] = pIsLink    ? true : false;
    this.lIsVisible[pId] = pIsVisible ? true : false;
    this.lDepth    [pId] = (pParent ? this.lDepth[pParent] : 0) + (pIsVisible ? 1 : 0);
    if(pParent) { this.lLastEntry[pParent] = pId; }
    if(!this.lByName  [pName  ]) { this.lByName  [pName  ] = new Array(); } this.lByName  [pName  ][pId] = pId;
    if(!this.lByParent[pParent]) { this.lByParent[pParent] = new Array(); } this.lByParent[pParent][pId] = pId;
  }}

  {this.gByParent   = function(pParent) { return(this.lByParent[pParent] ? this.lByParent[pParent] : new Array()); }}
  {this.gByName     = function(pName  ) { return(this.lByName  [pParent] ? this.lByName  [pName  ] : new Array()); }}
  {this.gGetId      = function(pId    ) { return(this.lIds     [pId    ]                                        ); }}
  {this.gGetParent  = function(pId    ) { return(this.lParents [pId    ]                                        ); }}
  {this.gGetName    = function(pId    ) { return(this.lNames   [pId    ]                                        ); }}

  {this.gSetActive = function(pID) {
    this.lActives[pID] = true;
    if(tParent = this.gGetParent(pID)) { this.gSetActive(tParent); }
  }}

  {this.gReset = function() {
    this.lActives = new Array();
  }}

  {this.gLinks = function(pID) {
    if(this.lCtrl  [pID]) { top.xTop.ctrl         .location = this.lRoot + this.lCtrl  [pID]; }
    if(this.lBottom[pID]) { top.xTop.bottom       .location = this.lRoot + this.lBottom[pID]; }
    if(this.lData_g[pID]) { top.xTop.data_g       .location = this.lRoot + this.lData_g[pID]; }
    if(this.lCtrl_l[pID]) { top.xTop.data_g.ctrl_l.location = this.lRoot + this.lCtrl_l[pID]; }
    if(this.lData  [pID]) { top.xTop.data_g.data  .location = this.lRoot + this.lData  [pID]; }
  }}

  {this.gNavbarLeft = function(pDocument, pID, pIsVisible, pDepth) {
    if(pIsVisible) {
      pDocument.write(
        "<span class=\"" +
         (this.lActives[pID] ? "aktiv" : "inaktiv") +
         "\">" +
          "<a class=\"" +
           "Ebene_" + (pDepth ? pDepth : 1) + "\"" +
           (this.lIsLink[pID] ? (" href=\"#.\" onclick=\"top.document.gSitemap.gLinks('" + pID + "');\"") : " class=\"noLink\"") + ">" +
            "<span class=\"Text\" style=\"height:16px;\">" +
            this.lNames[pID] +
            "</span>" +
          "</a>" +
        "</span>"
      );
    }

    if(this.lActives[pID]) {
      tChildren = this.gByParent(pID);
      for(tID in tChildren) {
        this.gNavbarLeft(pDocument, tID, true, (pDepth ? pDepth + 1 : 1));
      }
    }
  }}

  {this.gNavbarTop = function(pDocument, pID, pIsVisible, pDepth) {
    if(pIsVisible) {
      pDocument.write(
        "<td class=\"" +
         (this.lActives[pID] ? "aktiv" : "inaktiv") +
         "\" width=\"100\" align=\"left\" valign=\"middle\">" +
         (this.lIsLink[pID] ? ("<a href=\"#.\" onclick=\"top.document.gSitemap.gLinks('" + pID + "');\"") : "<a class=\"noLink\"") + ">" +
            "<span class=\"Text\">" +
            this.lNames[pID] +
            "</span>" +
          "</a>" +
        "</td>"
      );
    }

    if(!pDepth) {
      tChildren = this.gByParent(pID);
      for(tID in tChildren) {
        this.gNavbarTop(pDocument, tID, true, (pDepth ? pDepth + 1 : 1));
      }
    }
  }}

  {this.gNavbarBottom = function(pDocument, pID, pIsVisible, pDepth) {
    this.gNavbarTop(pDocument, pID, pIsVisible, pDepth);
  }}

  {this.gSitemap = function(pDocument, pID) {
    pDocument.write(this.pSitemap(pID));
  }}


  {this.pSitemap = function(pID) {
    tResult = "";
    if(this.lIsVisible[pID]) {
      tResult += 
        "<span class=\"" + (this.lParents[pID] && (this.lLastEntry[this.lParents[pID]] == pID) ? "letzter" : "Eintrag") + "\">\n" +
          "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin:0px; padding:0px; border:0px none; width:135px; height:28px; margin-bottom:5px;\">\n" +
            "<tr valign=\"middle\">\n" +
              "<td align=\"center\" class=\"Kasten\">\n" +
                           (this.lIsLink[pID] ? ("<a href=\"#.\" onclick=\"top.document.gSitemap.gLinks('" + pID + "');\"") : "<a class=\"noLink\"") + ">" +
                  this.lNames[pID] +
                "</a>\n" +
              "</td>\n" +
            "</tr>\n" +
          "</table>\n"
      ;
    }
    tChildren = this.gByParent(pID);
    if(tChildren) {
      var tFirst = true;

      for(tID in tChildren) {
        if(this.lIsVisible[pID] && tFirst) {
          tResult += "<span class=\"Inhalt\">";
          tFirst = false;
        }

        tResult += this.pSitemap(tID);

      }

      if(this.lIsVisible[pID] && !tFirst) {
        tResult += "</span>\n";
      }
    }

    if(this.lIsVisible[pID]) {
      tResult += "</span>\n";
    }
    return(tResult);
  }}
}


