   /***********************************************************/
   /*                   DHTML - MENU                          */
   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   /*                                                         */
   /*  (c) Copyright by Mastertools GmbH                      */
   /*  Dieses Programm ist Urheberrechtlich geschützt und     */
   /*  darf nicht ohne Genemigung des Eigentümers kopiert     */
   /*  oder andersweitig weiterverwendet werden.              */
   /*                                                         */
   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   /*    Entwickelt von :   Mastertools GmbH                  */
   /*    Erstellt am    :   9. Mai 2005                       */
   /*    Web            :   http://www.mastertools.info       */
   /*    E-Mail         :   info@mastertools.info             */
   /***********************************************************/

/* Image for open/close effect */
var arrow = new Array();
arrow['block'] = new Image();
arrow['block'].src = 'template_bilder/unten_12.gif'
arrow['none'] = new Image();
arrow['none'].src = 'template_bilder/rechts_12.gif'

/* CSS Classes */
var sClassTitel = 'menutitel';
var sClassContent = 'untermenu';

/* ID of Menu enclosing div */
var sEnclosing = 'menu';

/* 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].onmouseover = 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 */
  closeNav()
  if (!e) var e = window.event;
  if (e.target) var tg = e.target;
  else if (e.srcElement) var tg = e.srcElement;
  // Safari Patch
  while (tg.nodeType != 1) {
    tg = tg.parentNode;
  }
  // DIV Tag suchen
  while (tg.nodeName != 'DIV' && tg.nodeName != 'BODY') {
    tg = tg.parentNode;
  }
  // DIV Tag umschalten
  if (tg.nodeName == 'DIV') {
    var nextSib = tg.nextSibling;
    while (nextSib.nodeType != 1)
      nextSib = nextSib.nextSibling;
    var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';
    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';
    }
  }
}


function cleanNav() {
  /* Close all */

  closeNav();

  fixIEBug();
}

function fixIEBug() {
  /* Defeat IE6 fixed bug by opening and closing the container Tag */

  var x = document.getElementById(sEnclosing);
  var currentStyle = x.style.display;
  var newStyle = (currentStyle == 'none') ? 'block' : 'none';
  x.style.display = newStyle;
  x.style.display = currentStyle;
}

// (c) Copyright by Mastertools GmbH (www.mastertools.info) //