function termine_einblenden() {

	var theDate = new Date;
	var akt_tag = theDate.getDate();
	var akt_monat = theDate.getMonth()+1;
	var akt_jahr = theDate.getFullYear()-2000;
	var aktuell_dat = "";
	//	alert(akt_tag);
	//	alert(akt_monat);
	//	alert(akt_jahr);
	
	if (akt_jahr < 10) aktuell_dat += '0' + String(akt_jahr); else aktuell_dat += String(akt_jahr);
	if (akt_monat < 10) aktuell_dat += '0' + akt_monat; else aktuell_dat += akt_monat;
	if (akt_tag < 10) aktuell_dat += '0' + akt_tag; else aktuell_dat += akt_tag;
	
	var max_zeilen = 3;
	var termine_anzeigen = true;

	var hoehe;
	hoehe = window.getSize().size.y;
	
	if (hoehe <= 440) termine_anzeigen = false;
	if (hoehe > 400) max_zeilen = 1;
	if (hoehe > 485) max_zeilen = 2;
	if (hoehe > 550) max_zeilen = 3;
	if (hoehe > 650) max_zeilen = 4;

	if (termine_anzeigen) {
		output = "";
		
//		alert(window.getSize().size.y);
//		alert(hoehe);
//		alert(window.getHeight());
//		alert(document.body.offsetHeight);
//		alert(window.innerHeight);
		
		if (hoehe  > 550) output += '<p>&nbsp;<\/p>';
		
		output += '<table class="oben"><tr><td>Termine<\/td><\/tr><\/table>';
		output += '<table class="mitte">';
		
		var lauf = 0;
		var zeile = 0;
		
		while (termin[lauf] != null && zeile < max_zeilen) { 
			var hilf = termin[lauf].split(";");
			var hilf2 = hilf[0].split(".");
			var termin_dat = hilf2[2] + hilf2[1] + hilf2[0];
			var anzeige_dat = hilf2[0] + "." + hilf2[1] + ".";
			//	alert(termin_dat);   
			//	alert(aktuell_dat); 
			if (aktuell_dat < termin_dat) {
				output += '<tr><td class="links">' + anzeige_dat + '<\/td><td>' + hilf[1] + '<\/td><\/tr>';
				zeile += 1;
			}
			if (aktuell_dat > termin_dat) {
				output += '<tr><td class="links">aktuell<\/td><td>' + hilf[1] + '<\/td><\/tr>';
				zeile += 1;
			}
			if (aktuell_dat == termin_dat) {
				output += '<tr><td class="links">heute<\/td><td>' + hilf[1] + '<\/td><\/tr>';
				zeile += 1;
			}
			lauf += 1;
		}
		
		output += '<\/table>';
		output += '<table class="unten"><tr><td><a onfocus="this.blur();" onclick="fest(\'aktuelles1\');return true;" target="haupt" href="../../aktuelles/aindex.htm">Details und weitere Termine<\/a><\/td><\/tr><\/table>';
		
		if (hoehe  > 550) output += '<p>&nbsp;<\/p>';
		
		document.getElementById("termine").innerHTML = output;  	  
	}
  
	if (hoehe > 675) {
		if (document.styleSheets[0].cssRules) {
			cssRules = document.styleSheets[0].cssRules;
			suche = "div.stretcher"
		} else {
			cssRules = document.styleSheets[0].rules;
			suche = "DIV.stretcher"
		}
		
		for(i=0; i<cssRules.length; i++) {
			if(cssRules[i].selectorText == suche){
				cssRules[i].style.display = "block";
			}
		}
//		Element.cleanWhitespace('content');
//		init();
		}
	
}

function fest(hilf) {
//	alert(hilf);
//	alert (document.write);
//	alert (hilf.className);
//	alert(hilf);

	if (!top.navigation.myAccordion && hilf) {
//		alert(hilf);
		hilf = hilf.substr(0, hilf.length - 1) + "0";
//		alert(hilf);
	}
//	alert(document.getElementById(hilf).className);
				
	if (document.getElementById) {
		if (document.getElementById(hilf)) {
			if (document.getElementById(hilf).className != "aktiv") {
	
	//  		alert(hilf);
		
				if (document.getElementsByTagName) {
					var alla = document.getElementsByTagName("a");
					for (var s=0; s < alla.length; s++) {
						//	aname = alla[s].getAttribute("id");
						//	if (aname.substr(0,2) == "b-") {
						if (alla[s].className == "aktiv") {
							alla[s].className = "normal";
						}
					}
						//	alert(b_aktuell);
					
					
					if (hilf) {
						if (document.getElementById) {
			//				alert(document.getElementById(hilf).className);
							document.getElementById(hilf).className = "aktiv";
						}
					}
				}
				
			}
		}
		else if (!hilf) {
			if (document.getElementsByTagName) {
				var alla = document.getElementsByTagName("a");
				for (var s=0; s < alla.length; s++) {
					//	aname = alla[s].getAttribute("id");
					//	if (aname.substr(0,2) == "b-") {
					if (alla[s].className == "aktiv") {
						alla[s].className = "normal";
					}
				}
					//	alert(b_aktuell);
			}
		}
	}
}

var tdaktuell="td1";

function fest2(hilf) {
	if (document.getElementById && document.getElementsByTagName) {
		var alltd = document.getElementsByTagName("td");
		for (var s=0; s < alltd.length; s++) {
//              tdname = alla[s].getAttribute("id");
//              if (tdname.substr(0,2) == "b-") {
			if (alltd[s].className == "aktiv") {
				alltd[s].className = "normal";
			}
		}
//          alert(b_aktuell);
		document.getElementById(hilf).className = "aktiv";
		tdaktuell = hilf;
//          alert(tdaktuell);

		if (bereichnummer == 1000) {
			festhaupt = bereichname + "0";
			top.navigation.fest(festhaupt);
			if (top.navigation.myAccordion) top.navigation.myAccordion.showThisHideOpen();
		} else {
			festhaupt = bereichname + tdaktuell.substr(2,2);
//			alert(festhaupt);
			top.navigation.fest(festhaupt);
			if (top.navigation.myAccordion) top.navigation.myAccordion.display(bereichnummer);
		}		
	}
}

function hoverin(hilf) {
	if (document.getElementById) {
		document.getElementById(hilf).className = "aktiv";
	}
	
}

function hoverout(hilf) {
	if (document.getElementById) {
		if (hilf != tdaktuell) document.getElementById(hilf).className = "normal";
	}
}

function frame2unternavigation() {
	if (!n) n=1;
	
	if (self.unternavigation.bereichnummer == 1000) {
		festhaupt = self.unternavigation.bereichname + "0";
		top.navigation.fest(festhaupt);
		if (top.navigation.myAccordion) top.navigation.myAccordion.showThisHideOpen();
	} else {
		festhaupt = self.unternavigation.bereichname + n;
		top.navigation.fest(festhaupt);
		if (top.navigation.myAccordion) top.navigation.myAccordion.display(self.unternavigation.bereichnummer);
	}		
	
//		alert(festhaupt);
	n = "td" + n;
	self.unternavigation.fest2(n);
			
}

