// menu
// browser detection
op5x = /opera 5|opera\/5/i.test(navigator.userAgent)            ? true : false;
iex  = !op5x && /msie/i.test(navigator.userAgent)               ? true : false;	// preventing opera to be identified as ie
ns6x = !op5x && /mozilla\/5/i.test(navigator.userAgent)         ? true : false;	// preventing opera to be identified as mz
ns4x = !op5x && !iex && /mozilla\/4/i.test(navigator.userAgent) ? true : false;

No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;

layer = (iex && No3) ? "document.all['L'+menu].style" : (ns4x && No3) ? "document.layers['L'+menu]" : "document.getElementById('L'+menu).style";

var timer;

// change layers
function Show()
	{
	/*
	if(arguments.length == 0)
		document.images["stift"].src = "logo5.kl3b.jpg";
	else
		document.images["stift"].src = "logo5.kl3b.jpg";
	*/	
	if(layer)
		{
  		if(timer)
  			{
  			clearTimeout(timer);
  			bla = 0;
  			}

  		for(menu=0; menu<Layer.length; menu++)
  			{
  			if(Layer[menu])
  				{
  				eval(layer).visibility = "hidden";
  				}
  			}
  		for(i=0; i<arguments.length; i++)
  			{
  			menu=arguments[i];
  			eval(layer).visibility = "visible";
  			}
		}
	}

function Hide()
	{
	timer = setTimeout("Show()", 300);
	}

// generate layer-data
hovercolor   = ""
bgcolor      = "rgb(153,153,153)"
background   = ""
menu_border  = 1
border_color = "#FFFFFF"
bgcolor2     = "";         		//bgcolor2 for sideentry
background2  = "";                //background2 for sideentry
arrow_pic    = "arrow.gif"

if(!ns4x)
	{
	if(!background)  { background=bgcolor;   } else { background  = "url("+background+")"; }
	if(!background2) { background2=bgcolor2; } else { background2 = "url("+background2+")"; }
	}

function LayerSpecs(Left1,Top1,Left2,Top2,Width)
	{
	if(No3)
		{
  		this.left  = (ns4x) ? Left2 : (op5x) ? Left1 += 4  : Left1 += 3;
  		this.top   = (ns4x) ? Top2 : (op5x) ? Top1 += 6   : Top1 += 5;
  		this.info  = "";
  		T=0;

  		for(i=5; i<arguments.length; i++)
  			{
    		if(!ns4x)
    			{
    			this.info += "<TR><TD width="+Width+">"+arguments[i]+"</TD></TR>";
    			}
    		else
    			{
    			this.info += "<LAYER POSITION=RELATIVE TOP="+T+" WIDTH="+Width+">&nbsp;"+arguments[i]+"</LAYER>";
    			}
    		T+=24;
  			}
		}
	}

function init()
	{

	j = (Layer[0]) ? 0:1;

	for(i=j; i<Layer.length; i++)
		{
		if(ns4x && No3)
			{
			var left = Layer[i].left;
			document.write("<LAYER onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+Farben[i]["hintergrund"]+"' TOP="+Layer[i].top+" LEFT="+left+">"+Layer[i].info+"</LAYER>");
			}
	  	else if(No3)
	  		{
	  		document.write("<SPAN onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' STYLE='position:absolute; visibility:hidden; background-color:"+Farben[i]["hintergrund"]+"; top:"+Layer[i].top+"px; left:"+Layer[i].left+"px;'><table border=0 cellpadding=5 cellspacing=0><tr><td><TABLE>"+Layer[i].info+"</TABLE></td></tr></table></SPAN>");
	  		}
		}

	if(iex)
		{
		document.all["menubar"].style.visibility = "visible";
		}
	else if(ns4x)
		{
		document.layers["menubar"].visibility = "visible";
		}
	else if(op5x || ns6x)
		{
		document.getElementById("menubar").style.visibility = "visible";
		}
	
	
	if(bearbmodus == 1)
		laier_bearbeiten();
	
	}

function wechsel(x,y)
	{
	document.images[x].src = eval(y+".src");
	}
