
   /***********************************************************/
   /*                   DHTML - MENU                          */
   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   /*                                                         */
   /*  (c) Copyright by Mastertools GmbH CH-Berikon           */
   /*  Dieses Programm ist Urheberrechtlich geschützt und     */
   /*  darf nicht ohne Genemigung des Eigentümers kopiert     */
   /*  oder andersweitig weiterverwendet werden.              */
   /*                                                         */
   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   /*   Entwickelt von :   Mastertools GmbH Berikon           */
   /*   Erstellt am    :   09.05.2005                         */
   /*   Geändert am    :   15.10.2008 (Menü-Titel mit Link    */
   /*                                  für übersichtseite)    */
   /*   Web            :   http://www.mastertools.info        */
   /*   E-Mail         :   info@mastertools.info              */
   /***********************************************************/

/* Image for open/close effect */
var arrow = new Array();
arrow['block'] = new Image();
arrow['none'] = new Image();

arrow['block'].src = 'images/red.gif'
arrow['none'].src = 'images/red.gif'

/* CSS Classes */
var sClassTitel = 'menutitel';
var sClassContent = 'untermenu';

/* ID of Menu enclosing div */
var sEnclosing = 'menu';

/* target frame name (für Link auf Übersichtsseite bei sClassTitel Links */
var targetFrame = '';  // set to '' if no frames are used

/* start the initNavi function */
window.onload = initNavi;

function initNavi()
{
  /* set the envent handlers and close all sub menus */
  if (top.mainFrame) top.setNav = top.mainFrame.location.href;

  var x = document.getElementsByTagName('div');
  for (var i=0;i<x.length;i++)
  {
    if (x[i].className == sClassTitel) {
      x[i].onclick = clickNav;
    }
  }

  closeNav();
  setNav(location.href, 'currentPage');

}


function closeNav()
{
  /* Close all Div blocks */

  var x = document.getElementsByTagName('div');
  for (var i=0;i<x.length;i++)
  {
    if (x[i].className == sClassContent)
      x[i].style.display = 'none';
    if (x[i].className == sClassTitel) {
      if (x[i].firstChild.nodeName == 'IMG') {
        x[i].firstChild.src = arrow['none'].src;
      }
    }
  }
}

function openNav()
{
  /* Open all Div blocks */
  var x = document.getElementsByTagName('div');
  for (var i=0;i<x.length;i++)
  {
    if (x[i].className == sClassContent)
      x[i].style.display = 'block';
    if (x[i].className == sClassTitel) {
      if (x[i].firstChild.nodeName == 'IMG') {
        x[i].firstChild.src = arrow['block'].src;
      }
    }
  }
}

function clickNav(e)
{
  /* open the clicked Div block and change the icon */
  if (!e) var e = window.event;
  if (e.target) var tg = e.target;
  else if (e.srcElement) var tg = e.srcElement;
  while (tg.nodeType != 1) // Safari Patch
    tg = tg.parentNode;
  if (tg.nodeName == 'IMG')
    tg = tg.parentNode;
  if (tg.nodeName == 'DIV') {
    var nextSib = tg.nextSibling;
    while (nextSib.nodeType != 1)
      nextSib = nextSib.nextSibling;
    var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';
    if (nextSibStatus == 'block') {
      var i;
      var ln;
      for (i=0;i<tg.childNodes.length;i++) {
        if (tg.childNodes[i].nodeName == 'A') {
          if (targetFrame == '') {
            location.href = tg.childNodes[i].href;
          } else {
            parent.frames[targetFrame].location.href = tg.childNodes[i].href;
          }
          break;
        }
      }
    }
    nextSib.style.display = nextSibStatus;
    if (tg.firstChild.nodeName == 'IMG') {
      tg.firstChild.src = arrow[nextSibStatus].src;
    }
}


  fixIEBug();
}

function setNav(page,newID)
{
  var test = page.indexOf('#')+1;
  if (test) page = page.substring(0,test-1);
  var x = document.getElementsByTagName('a');
  var i;
  for (i=0;i<x.length;i++)
  {
    if (x[i].href == page)
    {
      x[i].id = newID;
      break;
    }
  }
  if (i < x.length && newID == 'currentPage')
  {
    var parDiv = x[i];
    while (parDiv.parentNode.tagName == 'DIV')
    {
      parDiv = parDiv.parentNode;
      parDiv.style.display = 'block';
    }
  }
  if (i < x.length && x[i].parentNode.tagName == 'DIV' && x[i].parentNode.className == sClassTitel) {
    parDiv = x[i].parentNode;
    x[i].id = '';
    parDiv.id = newID;
    if (parDiv.nextSibling.nodeType == 3) parDiv = parDiv.nextSibling;
    parDiv.nextSibling.style.display = 'block';
  }
}


function cleanNav()
{
  /* Close all */

  closeNav();

  fixIEBug();
}

function fixIEBug()
{
  /* Defeat IE6 fixed bug by opening and closing the container Tag */

  var x = document.getElementById(sEnclosing);
  if (x) {
    var currentStyle = x.style.display;
    var newStyle = (currentStyle == 'none') ? 'block' : 'none';
    x.style.display = newStyle;
    x.style.display = currentStyle;
  }
}

// (c) Copyright by Mastertools GmbH CH-Berikon  (www.mastertools.info) //
