//Browsercheck
var dom = document.getElementById?1:0;
var ns4 = document.layers?1:0;

//Menü: Layerfunktionen

var act; //Eintrag aktiver Hauptmenüpunkt -> Quellcode Seitenhead!
var first; var sec;

function showMenu(name,number){

	if(act)document.getElementById('subact').style.visibility = 'hidden';

	var groups = 3; //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)", 100);
}

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(act)document.getElementById('subact').style.visibility = 'visible';
	}
	else if(ns4) document[active].visibility = 'hide';
}

//Menü: andere Funktionen


//Festschreiben der Untergrundfarbe Menüpunkt
function chgCol(id,now){
	if (id != act){
		var subtxt = id + "txt";
		var bgtxt = "m"+id;
		var col1 = (now)?'transparent':'#C5D3DB';
		document.getElementById(bgtxt).style.background = col1;
		var col2 = (now)?'#1F5C98':'#DB6932';
		document.getElementById(subtxt).style.color = col2;
	}
}


//Popups
function druck(url){
	var url = url;
	var name= "druckansicht"
	var params = "width=685,height=580,left=10,top=10,resizable=1,status=0,scrollbars=1,toolbar=1,location=0,directories=0,menubar=1";
	window.open(url, name, params);
}

//Wichtig: Definition Zieladressen der Mikrosites!
function go(url){
	var url = url; //Parameter: "nax", "rat", "tag", "extra"
	if (url == "extra") {url = "extranet/index.htm"; var name = "extra";}
	else if (url == "nax") {url = "nax/index.htm"; var name = "netz";}
	else if (url == "rat") {url = "rat/index.htm"; var name = "rat";}
	else if (url == "tag") {url = "tag/index.htm"; var name = "tag";}
	var params = "width=825,height=560,left=10,top=10,resizable=1,status=0,scrollbars=1,toolbar=1,location=1,directories=1,menubar=1";
	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;	
}


//Layer zeigen/verstecken
function showMe(name) {
	if(dom){
		document.getElementById(name).style.visibility = 'visible';
	} else if(ns4){
		document[name].visibility = 'show';
	}
}

function hideMe(name) {
	if(dom){
		document.getElementById(name).style.visibility = 'hidden';
	} else if(ns4){
		document[name].visibility = 'hide';
	}
}

//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;

