var browser = getBrowser();
var myload = false;

var optionsAr = new Array();
optionsAr[0] = "L21";
optionsAr[1] = "L22";
optionsAr[2] = "L23";
optionsAr[3] = "L24";

if (typeof(highlight) == "undefined") var highlight="none";

//Hauptmenue

function selectentry(x){
	highlight=x;
	var id = getLayerStyleRef(x);
	if (browser.indexOf("ie") >= 0 || browser == "ns6") {
		id.backgroundColor="#2269B5";
	}
	clearEntry();

}

function clearEntry(){
	if (browser.indexOf("ie") >= 0 || browser == "ns6") {
		for (i=0; i<4; i++){
			if (optionsAr[i] != highlight){
				var id = getLayerStyleRef(optionsAr[i]);
				id.backgroundColor="#153B63";
			}
		}
	}
	
}


function ieOver (x) {
	if (x != highlight) {
		var id = getLayerStyleRef(x);
		
			if (browser.indexOf("ie") >= 0 || browser == "ns6") {
			id.backgroundColor="#1B528C";
			return;
			}
	}
}


function ieOver2 (x) {
var id = getLayerStyleRef(x);

	if (browser.indexOf("ie") >= 0 || browser == "ns6") {
	id.backgroundColor="#A0B7CF";
	return;
	}
}

function ieOut (x) {
	if (x != highlight) {
		var id = getLayerStyleRef(x);
		
			if (browser.indexOf("ie") >= 0 || browser == "ns6") {
			id.backgroundColor="#153B63";
			return;
			}
	}
}


function ieOut3 (x) {
var id = getLayerStyleRef(x);

	if (browser.indexOf("ie") >= 0 || browser == "ns6") {
	id.backgroundColor="#B4C6D9";
	return;
	}
}

function initHighlight (x) {
var id = getLayerStyleRef(x);

	if (browser.indexOf("ie") >= 0 || browser == "ns6") {
	id.backgroundColor="#2269B5";
	return;
	}
}
//alert(highlight);

// -------------------------------------------------------------------------
// BROWSER LIBRARY BEGIN
// Version 20001205

function getBrowser()
{
	var notsupported = "notsupported";


	if (navigator.appName == "Netscape")
	{
		var ver = parseInt (navigator.appVersion);
		if (ver == 4) return "ns4";
		if (ver >= 5) return "ns6";
		return (notsupported);
	}

	if (navigator.appName == "Microsoft Internet Explorer")
	{
		if (navigator.appVersion.indexOf ("MSIE 4") >= 0) return ("ie4");
		if (navigator.appVersion.indexOf ("MSIE 5") >= 0) return ("ie5");
		if (navigator.appVersion.indexOf ("MSIE 6") >= 0) return ("ie5");
		return (notsupported);
	}

	return (notsupported);
}


function isMac()
{
	return (navigator.appVersion.indexOf("Mac") != -1);
}


function supportedBrowser()
{
	var notsupported = "notsupported";
	return (getBrowser().indexOf(notsupported) == -1);
}


function getLayerRef (layername)
{
	var b = getBrowser();
	if (b == "ns4")									return (document.layers[layername]);
	if (b == "ie5" || b == "ns6")		return (document.getElementById(layername));
	if (b == "ie4")									return (document.all[layername]);
	return null;
}


function getLayerStyleRef (layername)
{
	var b = getBrowser();
	if (b == "ns4")									return (document.layers[layername]);
	if (b == "ie5" || b == "ns6")		if (document.getElementById(layername)) return (document.getElementById(layername).style);
	if (b == "ie4")									if (document.all[layername]) return (document.all[layername].style);
	return null;
}


function layerWrite(layerRef,txt)
{
	var b = getBrowser();
	if (b == "ns4")
	{
		layerRef.document.open();
		layerRef.document.write(txt);
		layerRef.document.close();
	}
	else
		layerRef.innerHTML=txt;
}

// BROWSER LIBRARY END
// -------------------------------------------------------------------------





// -------------------------------------------------------------------------
// COMPATIBILTY STUFF BEGIN
// Version 20001205

// Browser variables
var supported_browser = supportedBrowser();
var tmp = getBrowser();
var ns4 = (tmp == "ns4");
var ns6 = (tmp == "ns6");
var ie4 = (tmp == "ie4" || tmp == "ie5");
var ie5 = (tmp == "ie5");
var mac = isMac();
var v4 = (ie4 || ie5 || ns4 || ns6);

// COMPATIBILTY STUFF END
// -------------------------------------------------------------------------

// install
selfinstall();


// ****************** neues menue benoetigt dauerhaft folgende einbindungen
// *** flash5.js ***
var FlashMode = isFlash5();

function isFlash5(){
	
	FlashMode =0;
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
			var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
			versionIndex = parseInt( versionString );
			if ( versionIndex >= 5 ) {
					FlashMode = 1;
			}
		}
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
		document.write('</SCRIPT\> \n');
		 
	}
	return FlashMode;
}

function openFlash5Window(inHTMLPath,inFallbackPath,inSWFPath,inName,inLanguage,inWidth,inHeight){
	
	if (FlashMode){
		theParamStr = "FlashParameter=" + inSWFPath +"|" + inLanguage +"|" + inWidth +"|" + inHeight;
		inPath = inHTMLPath + "?" + theParamStr;
	}else{
		inPath = inFallbackPath;
	}
	
	openNewWindow(inPath,inName,inWidth,inHeight);
}

function openNewWindow(inPath,inName,inWidth,inHeight){
	
	theParamStr ='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,width='+inWidth+',height='+inHeight;
	theWindow = window.open(inPath,inName,theParamStr);
}

function writeFlash5FromSearchString(){
	theString = self.location.search;
	if (theString){
		
    	theString = theString.replace("?","");
		theArray = getListFromString(theString);
		thePath = theArray[0];
		theLanguage = theArray[1];
		theWidth = theArray[2];
		theHeight = theArray[3];
		writeFlash5(thePath,theLanguage,theWidth,theHeight);
	}
}

function getListFromString(inString){
	theArray = inString.split("=");
	theString = theArray[1];
	
	theArray = theString.split("|");
	return theArray;
}

function writeFlash5(inPath,inLanguage,inWidth,inHeight){
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
 	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
 	document.write(' WIDTH='+ inWidth + ' HEIGHT=' + inHeight + '> ');
 	document.write('<PARAM NAME=movie VALUE="' + inPath +'"> <PARAM NAME=quality VALUE=high><PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
 	document.write(' <EMBED src="' + inPath +'" quality=high scale=exactfit bgcolor=#FFFFFF  WIDTH='+ inWidth + ' HEIGHT='+ inHeight + ' TYPE="application/x-shockwave-flash" ');
 	document.write('PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');

}
