/* Druck- und Popup-Funktion */

function openWindow(theURL,w,h,sc) { 
  
    var winName=""; 
    anchop=window.screen.width; 
    altop=window.screen.height;

    var l=(anchop - w)/2; 
    var t=(altop - h)/2;
    
    var windowprops ="top=" + t + ",left= " + l + ",toolbar=no,location=no,status=no,menubar=no,scrollbars=" + sc + ",resizable=yes,width=" + w + ",height=" + h;

    var ventana=window.open(theURL,winName,windowprops);  
    ventana.focus();
   
}

function printloc(snippet) {
	var popupwin = open(snippet+'&print=true', 'popup', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=440,left=0,top=0');
}
function OpenWindow(popup){
	window.open(popup,'Kontakt','width=730,height=600,scrollbars=1,resizable=yes,toolbar=yes,menubar=yes,location,status=yes,screenX=0,screenY=0');
	return;
}
function popup(url, fname, breite, hoehe) {
	var MAINWIN = open(url, fname, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+breite+'px,height='+hoehe+'px,copyhistory=no');
	MAINWIN.focus();
}

function showListe(x) {
	for (var i=2; i<document.forms[0].elements.length; i++) {
		document.forms[0].elements[i].style.display = "none";
	}
	if (x == "nix") {
		document.forms[0].reset();
		document.forms[0].elements[2].style.display = "inline";
		return;
	}
	else {
		document.forms[0].elements[x].style.display = "inline";
	}
}

function Go(y) {
	if (y == "nix") {
		return;
	}
	if(y.substr(0, 4) == "http") {
		var fenster = window.open(y, 'pop','');
		fenster.focus();
		return;
	}
	else {
		window.location.href = y;
	}
}

function showGS(x) {
	for (var i=27; i<42; i++) {
		document.forms[0].elements[i].style.display = "none";
	}
	document.forms[0].elements["liste" + x].style.display = "inline";
	document.getElementById("bereich").htmlFor = "liste" + x;
}

/* Untermenues Ebene 1 fuer den IE; Quelle http://www.htmldog.com/articles/suckerfish/hover/ */

var sfHover = function() {
	if(document.getElementById("me1")) {
		var sfEls = document.getElementById("header").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/* Hover-Fkt fuer andere Elemente als a fuer den IE; Quelle http://www.htmldog.com/articles/suckerfish/hover/ */

sfHover = function() {
	if(document.getElementById("buttonSet")) {
		var sfEls = document.getElementById("buttonSet").document.getElementsByTagName("INPUT");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// Boersen 

// Blendet Elemente mit entsprechendem Klassennamen aus und falls ID uerbegeben wird diese ein
function toggleElement(id) {
	// Ausblenden
	// Array mit allen Tags erstellen
	var tags = document.getElementsByTagName("*");
	// Array ueber Index nach Klassenattribut mit dem Wert "hideElement" durchsuchen
	for (var i=0, len=tags.length; i<len; i++) {
		if (tags[i].className == "hideElement") {
			// Gefundene Elemente ausblenden
			tags[i].style.display = "none";
		}
	}
	// Einblenden
	if(id) {
		var browsername = navigator.appName;
		var browserversion = parseInt (navigator.appVersion);
		var erkannt;
		erkannt=false;
	
		if (browsername == "Microsoft Internet Explorer" && browserversion >=4) {
			document.getElementById("details"+id).style.display = "block";
		}
		else {
		document.getElementById("details"+id).style.display = "table-row";
		}
	}
}