
// set variables
  var is_mac = window.navigator.platform == "MacPPC";
  var mac_ns = window.navigator.platform == "MacPPC" && navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) > "4";
  
  var mac    = window.navigator.platform == "MacPPC" && navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) == "4";
  var mac_ie = window.navigator.platform == "MacPPC" && navigator.userAgent.match(/MSIE/i);
  var safari = window.navigator.platform == "MacPPC" && navigator.userAgent.match(/Safari/i);
  var ie     = navigator.userAgent.match(/MSIE\s5.*/i);
	var ie6    = navigator.userAgent.match(/MSIE\s6.*/i);
	var ie4    = navigator.userAgent.match(/MSIE\s4.*/i);
  var op     = navigator.userAgent.indexOf('Opera') != -1;
	var ns4    = navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) == "4";	
	var moz    = navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) > "4";
	var ns6    = navigator.userAgent.match(/Netscape6/i);
	var konq   = navigator.userAgent.match(/Konqueror/i);
	var timer  = null;

//
//		Layer-Navigation für NavigationPath
//

// Menunavigation für NavigationPath
// Bei Fragen oder Problemen zum Menu wenden Sie sich bitte an:
// www.maspex.de / Thomas Sternagel / sternagel@maspex.de

// flag für maspex_LayerVisibility
var memory = false;

// bringt die Submenus an der richtigen Stelle zum Vorschein
function maspex_showSubmenu (submenuLayer,posGif,posTd)  
{
  //maspex_LayerVisibility ("save");
  MM_showHideLayers('submenuOffLayer','','show','submenu1','','hide','submenu2','','hide','submenu3','','hide','submenu4','','hide','submenu5','','hide');
  if (document.getElementById) // fuer NN6.x und IE 5.x+6.x
  {
		xpos = document.getElementById(posTd).offsetLeft;
   	document.getElementById(submenuLayer).style.left = correctxPos(xpos);
		document.getElementById(submenuLayer).style.top = document.getElementById("mainMenu").offsetTop+12;
   	document.getElementById(submenuLayer).style.visibility = "visible";
  }
  else if (document.all) // fuer E4.x
  {
		xpos = document.all[posTd].offsetLeft;
		document.all[submenuLayer].style.left = correctxPos(xpos);
		document.all[submenuLayer].style.offsetTop = document.all["mainMenu"].style.offsetTop+12;		
		document.all[submenuLayer].style.visibility = "visible";		
  }
  else if (document.layers) // fuer NN4.x
  {
		xpos = window.document.layers["mainMenu"].document.images[posGif].x;
		alert(xpos);
		window.document.layers[submenuLayer].x = correctxPos(xpos);
		alert(window.document.layers[submenuLayer].x);
		window.document.layers[submenuLayer].y = window.document.layers["mainMenu"].y+12;				
		window.document.layers[submenuLayer].visibility = "show";
  }
}


// die rechten Offset der Submenus einstellen für veschiedene Browser
function correctxPos(wert)  
{
	// Browser checken
	var exclude=true; var agt=navigator.userAgent.toLowerCase();
	
	var ie=false; var ie4=false; var ie5=false; var op5=false; var konqi=false;
	if (document.all&&(agt.indexOf('msie')!=-1)) {
		ie=true; ie4=true; exclude=false;
		if (agt.indexOf('msie 4')==-1) { ie5=true; ie4=false; }
		if (agt.indexOf('opera')!=-1) { ie=false; ie4=false; ie5=false; op5=true; }
	}
	
	var ns6=false; var mz7=false;
	if (document.getElementById&&!ie) {
		ns6=true; exclude=false;
		if (agt.indexOf('netscape6')==-1) {
			ns6=false; mz7=true;
		}
		if (window.opera) { mz7=false; op5=true;}
		else if (agt.indexOf('gecko')==-1) { mz7=false; exclude=true; }
	}
	if (agt.indexOf('opera 4')!=-1) { op5=false; mz7=false; exclude=true; }
	
	var ns4=false;
	if ((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&!ie&&!op5&&!ns6&&!mz7) {
		ns4=true; exclude=false;
	}
	if (agt.indexOf('webtv')!=-1) { ie=false; ie4=false; exclude=true; }
	
	var win=true; var mac=false;
	if (agt.indexOf('mac')!=-1) { win=false; mac=true; }

	var ns61=false; var ns6x=false;
	if (ns6 && agt.indexOf('netscape6/6.0')==-1) {ns6=false; ns6x=true;}
	if (ns6x && agt.indexOf('netscape6/6.1')!=-1) {ns6x=false; ns61=true;}

	// x-Position des Submenus korrigieren in Abhängigkeit von Browser und Formproblem-Flag setzen
	if (ns6) {wert=wert; formproblem=false;}
	if (ns61) {wert=wert+document.getElementById("mainMenu").offsetLeft; formproblem=false;}
	if (ns6x || op5 || mz7 || exclude) {wert=wert+195; formproblem=false;}
	if (moz) {wert=wert-195;}
	if (ie5) {wert=wert+document.getElementById("mainMenu").offsetLeft;}
	if (ie4) {wert=wert+document.all["mainMenu"].offsetLeft}
	if (ns4 && win) {wert=wert+window.document.layers["mainMenu"].x}
	if (ns4 && mac) {wert=wert+195}
		
  // ergänzte x-Positions des Submenus zurückgeben
	return wert;
}		

// "save" speichert, "restore" stellt Layerzustand wieder her.
// wird verwendet um andere die Suchlayer und den Content-Layer (wenn formproblem=true) 
// beim Aufklappen des Submenus zu verstecken, und dann beim Einklappen wieder den Ursprungszustand herzustellen
function maspex_LayerVisibility (wtd) 
{
 // speichert den Sichtbarkeitszustand der Layer
 if (!memory && wtd=="save") 
 {
  memory=true;
 }
 // stellt den gespeicherten Sichtbarkeitszustand der Layer wieder her
 if (memory && wtd=="restore")
 {
  memory=false;
 }
}

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 MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapVisibility(arg) { 
  var i,v,vor,obj;
	if ((obj=MM_findObj(arg))!=null) { v=arg;
    if (obj.style) { obj=obj.style; vor=obj.visibility; v=(vor=='visible')?'hidden':'visible';}
    else {vor=obj.visibility; v=(vor=='show')?'hide':'show';}
    obj.visibility=v; 
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



