
setLayer = null; // das gesetzte untermenü
activeLayer = null; // das aktive untermenü bei rollover
timer = null;

function initNavi(l) {
  dhtml_show(l+'Layer'); 
  setLayer = l;
}

function MM_restore(m) { //v3.0
  if (m != setLayer) {
    dhtml_hide(m+'Layer');
    dhtml_show(setLayer+'Layer');
  }
  activeLayer = null;
}

function MM_over() { //v3.0 
  window.clearTimeout(timer);
  if (activeLayer != null) {
    MM_restore(activeLayer);
  }
  var a=MM_over.arguments[0]; 
  if ((a != setLayer) && (setLayer != null)) {
    dhtml_hide(setLayer+'Layer'); 
  }
 if (a != null) { 
    dhtml_show(a+'Layer'); 
 }
 activeLayer = a;
}

function MM_out() {
  timer = setTimeout("MM_check();", 50);
}

function MM_dropdownOver() {
  window.clearTimeout(timer);
}

function MM_check() {
 if (activeLayer != null) {
   MM_restore(activeLayer);
 }
 else {
   timer = setTimeout("MM_check();", 50);
 }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



function getImageX ( image ) {
	// calculate horizontal position of an image
	var xPos = 0;
	if (document.layers) {
		xPos = image.x;
	}
	else {
		do {
			xPos += image.offsetLeft;
			image = image.offsetParent;
		} while ( image );
	}
	return xPos;
}

function getImageY ( image ) {
	// calculate vertical position of an image
	var yPos = 0;
	if (document.layers) {
		yPos = image.y;
	}
	else {
		do {
			yPos += image.offsetTop; 
			image = image.offsetParent;
		} while ( image );
	}
	return yPos;
}

function dhtml_support() {
  return (document.layers || 
          document.all || 
          document.getElementById)
}
function dhtml_obj(id) {
  if (document.layers)
    return document.layers[id];
  else if (document.all)
    return document.all[id];
  else if (document.getElementById)
    return document.getElementById(id);
}
function dhtml_style(id) {
  if (document.layers)
    return dhtml_obj(id);
  else if (document.layers || document.getElementById)
    return dhtml_obj(id).style;
}
function dhtml_hide(id) {
  if (dhtml_support())
    dhtml_style(id).visibility = "hidden";
}
function dhtml_show(id) {
  if (dhtml_support())
    dhtml_style(id).visibility = "visible";
}
function dhtml_getX(id) {
  if (dhtml_support())
    if (document.layers || document.getElementById)
      return dhtml_style(id).left;
    else
      return dhtml_style(id).posLeft;
}
function dhtml_getY(id) {
  if (dhtml_support())
    if (document.layers || document.getElementById)
      return dhtml_style(id).top;
    else
      return dhtml_style(id).posTop;
}
function dhtml_setX(id, n) {
  if (dhtml_support())
    if (document.layers) 
      dhtml_style(id).left = n;
    else if (document.getElementById)
      dhtml_style(id).left = n + "px";
    else
      dhtml_style(id).posLeft = n + "px";
}
function dhtml_setY(id, n) {
  if (dhtml_support())
    if (document.layers)
      dhtml_style(id).top = n;
    else if (document.getElementById)
      dhtml_style(id).top = n + "px";
    else
      dhtml_style(id).posTop = n + "px";
}
function dhtml_moveTo(id, x, y) {
  if (dhtml_support()) {
    dhtml_setX(id, x);
    dhtml_setY(id, y);
  }
}
function dhtml_moveBy(id, deltaX, deltaY) {
  if (dhtml_support()) {
    var x = parseInt(dhtml_getX(id));
    var y = parseInt(dhtml_getY(id));
    x += deltaX;
    y += deltaY;
    dhtml_setX(id, x);
    dhtml_setY(id, y);
  }
}
function dhtml_text(id, text) {
  if (dhtml_support())
    if (document.layers)
      with (document.layers[id].document) {
        open();
        write(text);
        close();
      }
    else
      dhtml_obj(id).innerHTML = text;
}
function dhtml_breite() {
  if (window.innerWidth)
    return window.innerWidth;
  else if (document.body)
    return document.body.clientWidth;
}
function dhtml_hoehe() {
  if (window.innerHeight)
    return window.innerHeight;
  else if (document.body)
    return document.body.clientHeight;
}
function dhtml_style_breite(id) {
  if (document.layers)
    return dhtml_obj(id).document.width;
  else if (document.all || document.getElementById)
    return dhtml_obj(id).offsetWidth;
}
function dhtml_style_hoehe(id) {
  if (document.layers)
    return dhtml_obj(id).document.height;
  else if (document.all || document.getElementById)
    return dhtml_obj(id).offsetHeight;
}

// SUBNAVIGATION END

