buttonList = new Array();
layerList = new Array();
var section = "none";
var actLayer = "none";

bOK = (document.all || document.layers || document.getElementById);

function resetAllButtons() {
	for (i = 0; i < buttonList.length; i++) {
		flip(buttonList[i],0);
	}
}

function fullResetButtons() {
	var actLayer = "none";
	for (i = 0; i < layerList.length; i++) {
		thisimage = layerList[i];
		if (document[thisimage] && thisimage != section) document[thisimage].src = eval(thisimage+'_off.src');
	}
}

function flip(name,over) {
	if (document.images && (name != section)) {
		image = (over == 1) ? eval(name+"_on.src") : eval(name+"_off.src");
		if (name != actLayer) document[name].src = image;
	}
}

function getLayer(thislayer) {
	if (bOK && active) {
		if (document.layers) {
			layerReturn = eval('document.layers["'+thislayer+'layer"]');
		} else if (document.all) {
			if (eval('document.all["'+thislayer+'layer"]'+'.style')) layerReturn = eval('document.all["'+thislayer+'layer"]'+'.style');
		} else if (document.getElementById) {
			if (document.getElementById(thislayer+'layer')) layerReturn = document.getElementById(thislayer+'layer');
			layerReturn = layerReturn.style;
		}   
	}
	return layerReturn;
}

function showLayer(numshow) {
	if (bOK && active && layerList[numshow]) {
		showThisLayer = getLayer(layerList[numshow]);   
		if (showThisLayer) {
			actLayer = layerList[numshow];
			resetAllButtons();
			hideAllLayers();
			showThisLayer.visibility = (document.layers) ? 'show' : 'visible';
		}
	}
}
	 
function hideLayer(numhide) {
	if (bOK && active && layerList[numhide]) {
		hideThisLayer = getLayer(layerList[numhide]);
		if (hideThisLayer) {
			hideThisLayer.visibility = (document.layers) ? 'hide' : 'hidden';
		}
	}
}

function hideAllLayers() {
	if (bOK && active) {
		for (i = 0; i < layerList.length; i++) hideLayer(i);
		clearTimeout(menuTimer);
	}
}

menuTimer = setTimeout("actLayer='none',clearAll()",5000);

function clearMenus() {
	menuTimer = setTimeout("actLayer='none',clearAll()",5000);
}

function clearAll() {
	var actLayer = "none";
	hideAllLayers();
	fullResetButtons();
}	   

//Funktionen zum Ein-/Ausblenden der Menüs 
	
function startLayer(name,top,left,visibility,z) {
    if (document.layers) {
	visibility = (visibility == 'visible') ? 'show' : 'hide';
	document.writeln('<layer name="'+name+'layer" class=dropdown id="'+name+'layer" top="'+top+'" left="'+left+'" visibility="'+visibility+'" z-index="'+z+'">');
    } else if (document.all || document.getElementById) {
	document.writeln('<div name="'+name+'layer" id="'+name+'layer" class=dropdown style="position: absolute; top: '+top+'px; left: '+left+'px; visibility: '+visibility+'; z-index: '+z+';">');
	}
    if (bOK) {
        document.writeln('<table class=dropdown border="0" cellpadding="0" cellspacing="0">');
        document.writeln('<tr><td nowrap class=menuitem>');
    }
}
	
function writeLayerLine(linkurl,linkdescr,linkimage) {
    if (bOK) {
        document.writeln('<a href="'+linkurl+'" title="'+linkdescr+'" onMouseOver="flip(\''+ linkimage +'\',1);" onMouseOut="flip(\''+ linkimage +'\',0);"><IMG SRC="'+ eval(linkimage+'_off.src') +'" BORDER=0 name="'+linkimage+'" ALT="'+linkdescr+'"></a><br>');
    }
}
	
function endLayer() {
    if (bOK) {
        //document.writeln('<img src="pics/trans.gif" width="1" height="12" border="0" alt=""><br><a href="#" onMouseOver="actLayer=\'none\',clearAll()"><img src="/_global/_img/close.gif" width="72" height="14" border="0" alt=""></a></td></tr>');
        document.writeln('</td></tr>');
        document.writeln('</table>');
    }
    if (document.layers) {
	document.writeln('</layer>');
    } else if (document.all || document.getElementById) {
	document.writeln('</div>');
    }
}
