//Browsercheck
var dom = document.getElementById?1:0;
var ns4 = document.layers?1:0;

//Menü: Layerfunktionen

var bfcvm_actmenu; 		//Eintrag aktiver Hauptmenüpunkt -> Quellcode Seitenhead!
var bfcvm_id_prefix; 	// prefix vor allen IDs des vertikalen Menues (Level 1 und 2)

function showMenu(name,number){

	if (bfcvm_id_prefix) name = bfcvm_id_prefix + name;

	if(bfcvm_actmenu) document.getElementById(name+'act').style.visibility = 'hidden';

	
	var groups = 10; //Anzahl der Hauptmenüpunkte eintragen!
	for (count = 1; count <= groups; count++){

		var content = name + count;
		var active = name + number;
		
		if(dom){
			if(content == active){
				document.getElementById(active).style.visibility = 'visible';
				document.getElementById(active).onmouseover = clearShut,chgCol(active,0);
				document.getElementById(active).onmouseout = setShut;
			}
			else{
				document.getElementById(content).style.visibility = 'hidden';
				chgCol(content,1);
			}
		}
		else if(ns4){
			if(content == active){
				document[active].visibility = 'show';
				document[active].onmouseover = clearShut;
				document[active].onmouseout = setShut;
			}
			else document[content].visibility = 'hide';
		}
	}
	first = name, sec = number;
	clearShut();
}

function setShut(){ 
	timer = setTimeout("shut(first,sec)", 10);
}

function clearShut(){
	if(window.timer) clearTimeout(timer);
}

function shut(first,sec){
	var active = first + sec;
	if(dom){
		document.getElementById(active).style.visibility = 'hidden';
		chgCol(active,1);
		if(bfcvm_actmenu)document.getElementById(first+'act').style.visibility = 'visible';
	}
	else if(ns4) document[active].visibility = 'hide';
}

//Menü: andere Funktionen

//Aktives Submenü (2., 3. und 4. Ebene) auf-/zuklappen
function smen(id,state,id_prefix){
	var zu = "zu" + id;
	var auf = "auf" + id;
	if (id>2){
		if (id_prefix){
			zu = id_prefix+zu;
			auf = id_prefix+auf;
		}
	}
	else{
		if (id_prefix){
			zu = id_prefix+zu;
			auf = id_prefix+auf;
		}
	}
	if(state) {smenclose(zu);smenopen(auf);}
	else {smenclose(auf);smenopen(zu);}
}

function smenopen(id){
	if (document.getElementById(id)!=null)
		document.getElementById(id).style.display = 'block';
}

function smenclose(id){
	if (document.getElementById(id)!=null)
		document.getElementById(id).style.display = 'none';
}

//Festschreiben der Farbe Menüpunkt
function chgCol(id,now){
	if (id != bfcvm_actmenu){
		var subtxt = id + "txt";
		var col = (now)?'#2E5D94':'#D20035';
		document.getElementById(subtxt).style.color = col;
	}
}


//Popups
function openWin(url){
	var url = url;
	var name= "popup"
	var params = "width=490,height=480,left=10,top=12,resizable=0,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0";
	window.open(url, name, params);
}

// Netscape resize fix
function netscapeResizeFix () {

	if (typeof (ns_origWidth) != "number" || typeof (ns_origHeight) != "number") return;
	if (innerWidth != ns_origWidth || innerHeight != ns_origHeight) location.reload();
}

//Imagewechsel
function chgPic(id,me) {
	var thePic = document.prePics[me];
	document.images[id].src = thePic.src;	
}

//other

function BlurLink(){
	lnks=document.getElementsByTagName('a');
	for(i=0;i<lnks.length;i++){
		lnks[i].onfocus=new Function("this.blur()");
	}
}

function nn(){
	alert("...noch nicht aktiv..");
}

//onload selfinstall

if (ns4){
	ns_origWidth = innerWidth;
	ns_origHeight = innerHeight;
	window.onresize = netscapeResizeFix;
	} 

onload=BlurLink;
