
// ------------------------------------------------
// STANDARD-FUNKTIONEN
// ------------------------------------------------
function ebene_klapp(divE) {
	if (document.getElementById) {
		var divC = "e" + divE;
		document.getElementById(divC).className = (document.getElementById(divC).className == "closed") ? "opened" : "closed";
	}
}
// ------------------------------------------------
function SeiteOeffnen(link,ziel) {
	window.open(link,ziel); 
}
function SeiteLaden(link,ziel,form,feld,wert) {
	link = link + '&' + feld + '=' + window.document.forms[form].elements[wert].value;
	window.open(link,ziel);
}
function NeuesFenster(seite, titel, extras, breite, hoehe, sbar) {
	var seite=seite+"?titel="+titel;
	if (extras) {
		seite=seite+extras;
	}
	var vonleft = 100;
	var vontop = 50;
	var optional="width="+breite+",height="+hoehe+",left="+vonleft+",top="+vontop+",scrollbars="+sbar+",menubar=no,location=no,status=yes,resizable=yes";
	var F1 = window.open(seite,titel,optional);
}
function AbfrageEvent(link, ziel, frage) {
	var x=window.confirm(frage);
	if (x) {
		window.open(link,ziel);
	}
}
function ParentFenster(url,c) {
	opener.location.href=url;
	if (c) {
		self.close();
	}
}
function Schliessen() {
	window.opener.location.reload();
	self.close();
}
function popupfenster(anzeige,titel,inhalt) {
	document.getElementById("popupfenster").style.visibility=anzeige;
	if( titel != "" ) {
		document.getElementById("popuptitel").innerHTML = titel;
	}
	if( inhalt != "" ) {
		document.getElementById("popupinhalt").innerHTML = inhalt;
	}
}
//------------------------------------------------
function BildTausch(imgID,imgObjName) {
	// imgID - Name des auszutauschenden Bildes
	// imgObjName - Name des Bildes mit dem ausgetauscht wird
	document.images[imgID].src = eval(imgObjName + ".src");
}
function FeldLeeren(FormName,FeldName) {
	// alert(FormName);
	// alert(FeldName);
	window.document.forms[FormName].elements[FeldName].value = "";
	window.document.forms[FormName].elements[FeldName].style.color = "rgb(100,100,100)";
	window.document.forms[FormName].elements[FeldName].style.fontWeight = "normal";
}
// ------------------------------------------------
// SONDER-FUNKTIONEN
// ------------------------------------------------
function Counter() {
  var relSekunden = window.document.Anzeige.Zeit.value;
  var anzSekunden = ((relSekunden > 0) ? relSekunden - 1 : "0");
  window.document.Anzeige.Zeit.value = anzSekunden;
  window.setTimeout("Counter()", 1000);
}
function Hoehenanpassung() {
	var div4 = "navigation"; var div5 = "navigation_logo";
	var hoehe = document.getElementById(div5).offsetHeight;
	document.getElementById(div4).style.height=hoehe+'px';
	
	var div1 = "box_all";
	var div2 = "header"; var div3 = "footer";
	if (!window.Weite && document.body && document.body.offsetWidth) {
		var hoehe = document.body.offsetHeight - (document.getElementById(div3).offsetHeight + document.getElementById(div2).offsetHeight) + 20;
	} else {
		var hoehe = window.innerHeight - (document.getElementById(div3).offsetHeight + document.getElementById(div2).offsetHeight) + 20;
	}
	document.getElementById(div1).style.height=hoehe+'px';
	
//	var div6 = "content_NA";
//	var div7 = "content_BA";
//	var div8 = "content_ZI";
//	var hoehe2 = 100;
//	if ( document.getElementById(div6).offsetHeight > hoehe2 ) {
//		hoehe2 = document.getElementById(div6).offsetHeight;
//	}
//	if ( document.getElementById(div7).offsetHeight > hoehe2 ) {
//		hoehe2 = document.getElementById(div7).offsetHeight;
//	}
//	if ( document.getElementById(div8).offsetHeight > hoehe2 ) {
//		hoehe2 = document.getElementById(div8).offsetHeight;
//	}
//	
//	document.getElementById(div6).style.height=hoehe2+'px';
//	document.getElementById(div7).style.height=hoehe2+'px';
//	document.getElementById(div8).style.height=hoehe2+'px';
}
/* --------------------------------------------------- */
function show(e) {
	if (document.getElementById) {
		for (var i = 1; i <= 7; i++) {
			var divClass = "div" + i;
			if ( i != e ) {
				document.getElementById(divClass).className = "closed";
			} else {
				document.getElementById(divClass).className = "opened";
			}
		}
	}
}
/* --------------------------------------------------- */
function BildAnzeigen(pfad, titel) {
	document.getElementById("image_vollbild").style.visibility="visible";
	document.getElementById("vollbild_txt").style.visibility="visible";
	document.getElementById("vollbild").src = pfad;
	document.getElementById("vollbild").title = titel;
	document.getElementById("vollbild_txt").style.height=document.getElementById("vollbild").style.height + "px";
	if ( titel != "" ) {
		document.getElementById("bild_titel").innerHTML = titel;
	} else {
		document.getElementById("bild_titel").innerHTML = "";
	}
}
function BildSchliessen() {
	document.getElementById("image_vollbild").style.visibility="hidden";
	document.getElementById("vollbild_txt").style.visibility="hidden";
}
//------------------------------------------------
function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

function neuAufbau () {
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
    location.href = location.href;
}

/* Ueberwachung von Netscape initialisieren */
if (!window.Weite && window.innerWidth) {
  window.onresize = neuAufbau;
  Weite = Fensterweite();
  Hoehe = Fensterhoehe();
}

/* Ueberwachung von Internet Explorer initialisieren */
if (!window.Weite && document.body && document.body.offsetWidth) {
  window.onresize = neuAufbau;
  Weite = Fensterweite();
  Hoehe = Fensterhoehe();
}
//------------------------------------------------
