/* Druck- und Popup-Funktion */

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";
		}
	}
}
function meinToggleElement(elementID, force) {
    force=force?true:false;
	el=document.getElementById(elementID);
	el.style.zIndex=50;
	if(!el) return;	
	if(el.style.visibility!='hidden' || force) {
		el.style.visibility='hidden';	
		el.style.position='absolute';
	} else {
		el.style.visibility='visible';		
		el.style.position='static';
	}	
}

function addBookmarkLink(text) {
if (window.external && typeof window.external.AddFavorite != 'undefined') {
	// neue Elemente li und a erstellen
	var newLi = document.createElement("li");
	var newA = document.createElement("a");
	// Attribute und -Werte fuer a erstellen und zuweisen
	var attrHref = document.createAttribute("href");
	attrHref.nodeValue = "javascript:window.external.AddFavorite(window.location.href, document.title)";
	var attrClass = document.createAttribute("class");
	attrClass.nodeValue = "bookmark";
	// Linktext erstellen und a zuweisen
	var textA = document.createTextNode(text);
	newA.appendChild(textA);
	// Attribute a zuweisen
	newA.setAttributeNode(attrHref);
	newA.setAttributeNode(attrClass);
	// a li zuordnen
	newLi.appendChild(newA);
	// li in toolsListe einbinden
	ulKnoten = document.getElementById("toolsCon").getElementsByTagName("ul")[0];
	ulKnoten.insertBefore(newLi, ulKnoten.lastChild);
	}
}

function showLogin(conWidthWide, conWidthSmall, conPosWide, conPosSmall) {
	if(document.getElementById("loginOuterCon").className != "ausgeklappt") {
//alert(document.getElementById("innenRightnav").style.marginBottom);
		document.getElementById("rightnav").style.paddingBottom = document.getElementById("loginOuterCon").offsetHeight + "px";
		document.getElementById("loginOuterCon").className = "ausgeklappt";
		document.getElementById("loginOuterCon").style.position = "absolute";
		document.getElementById("loginOuterCon").style.width = conWidthWide + "px";
		document.getElementById("loginOuterCon").style.left = conPosWide + "px";
		document.getElementById("loginContent").style.height = "auto";
		document.getElementById("loginContent").style.minHeight = "184px";
	}
	else {
		document.getElementById("loginOuterCon").className = "";
		document.getElementById("rightnav").style.paddingBottom = 0;
		document.getElementById("loginOuterCon").style.position = "relative";
		document.getElementById("loginOuterCon").style.width = conWidthSmall + "px";
		document.getElementById("loginOuterCon").style.left = conPosSmall + "px";
		document.getElementById("loginContent").style.height = "184px";
	}
}

function showLoginTRO() {
	if(document.getElementById("loginOuterCon").className != "ausgeklappt") {
alert(document.getElementById("loginOuterCon").offsetHeight);
		document.getElementById("rightnav").style.paddingBottom = document.getElementById("loginOuterCon").offsetHeight + "px";
		document.getElementById("loginOuterCon").className = "ausgeklappt";
		document.getElementById("loginOuterCon").style.position = "absolute";
		document.getElementById("loginOuterCon").style.width = "392px";
		document.getElementById("loginOuterCon").style.left = "-187px";
		document.getElementById("loginContent").style.height = "auto";
		document.getElementById("loginContent").style.minHeight = "184px";
	}
	else {
		document.getElementById("loginOuterCon").className = "";
		document.getElementById("rightnav").style.paddingBottom = 0;
		document.getElementById("loginOuterCon").style.position = "relative";
		document.getElementById("loginOuterCon").style.width = "200px";
		document.getElementById("loginOuterCon").style.left = "0";
		document.getElementById("loginContent").style.height = "184px";
	}
}


