var nn=document.layers?true:false;
var n6=document.getElementById?true:false;
var ie=document.all?true:false;
if ((ie) && (n6)) n6 = false;

var sichtbar = "visible";
var unsichtbar = "hidden";

if(window.navigator.systemLanguage && !window.navigator.language) {
	function hoverIE() {
    	if (document.getElementById("Navigation")) {
			var LI = document.getElementById("Navigation").firstChild;
			do {
				if (sucheUL(LI.firstChild)) {
					LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
				}
				LI = LI.nextSibling;
			}
			while(LI);
		}
	}

	function sucheUL(UL) {
		do {
			if(UL) UL = UL.nextSibling;
			if(UL && UL.nodeName == "UL") return UL;
		}
		while(UL);
		return false;
	}

	function sucheA(A) {
/*		do {
			if(A) A = A.nextSibling;
			if(A && A.nodeName == "A") return A;
		}
		while(A);
		return false;
*/
		return A.getElementsByTagName("A")[0];
	}
	
	var BGOrgi = "";
	var ColorOrgi = "#0A6BB3";
	var FWOrgi = "bold";
	function einblenden() {
		var UL = sucheUL(this.firstChild);
		var A = sucheA(this);
		UL.style.display = "block";
		BGOrgi = this.style.backgroundColor;
		ColorOrgi = A.style.color;
		FWOrgi = A.style.fontWeight;
		this.style.backgroundColor = "#FFFFFF";
		A.style.color = "#8B8B8B";
		A.style.fontWeight = "bold";
/*		alert(A);*/
	}
	
	function ausblenden() {
		sucheUL(this.firstChild).style.display = "none";
		this.style.backgroundColor = BGOrgi;
		sucheA(this).style.color = ColorOrgi;
		sucheA(this).style.fontWeight = FWOrgi;
	}
	window.onload=hoverIE;
}

/****************************************
***	Funktion: GetXmlHttpObject
*** Fuer die Benutzung von AJAX
****************************************/

var xmlHttp;
var xmlHttp = null;

function GetXmlHttpObject() {
	var xmlHttp = null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
		if (xmlHttp.overrideMimeType) {
			xmlHttp.overrideMimeType('text/xml;charset=iso-8859-1');
		}
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

var BrowserName = null;
var BuggyBrowsers = "ie4,IE6,ie5,ie5.5"; // Fehler bei der Darstellung der Overlay png
aryBuggyBrowsers = new Array();
aryBuggyBrowsers = BuggyBrowsers.split(",");
browser = getBrowser();

/****************************************
***	Methode: indexOf
*** Erweiterung der Methode indexOf bei Arrays
****************************************/

if(!Array.indexOf) {
	Array.prototype.indexOf = function(el) {
    	for(var i = 0; i < this.length; i++) if(el == this[i]) return i;
	}
}

/****************************************
***	Funktion: ShowOverlay
*** Zeigt den Overlay an, je nach Browser werden die Selectboxen ausgeblendet
****************************************/

var ausblendCount = 0;
var aryAusgeblendeteSelLists = new Array();
function ShowOverlay ( anaus ) {
	if ( anaus ) {
		if ( document.getElementById("overlayBG").style.display != "block" )
		{
			getWahreHoehe();
			if ( aryBuggyBrowsers.indexOf(BrowserName) > -1 ) {
				ausblendCount = 0;
				aryAusgeblendeteSelLists = new Array();
				var selListen = document.getElementById('container').getElementsByTagName('select');
				for (var i=0; i<selListen.length; i++) {
					if ( selListen[i].style.display == "none" )
					{
						aryAusgeblendeteSelLists[ausblendCount] = selListen[i];
						ausblendCount++;
					}
					selListen[i].style.display = "none";
				}
				document.getElementById("overlayBG").style.filter = "Alpha(opacity=60, finishopacity=60, style=0)";
			}
	
			document.getElementById("overlayBG").style.height = wahreHoehe + "px";
			document.getElementById("overlayBG").style.display = "block";
		}
	}
	else {
		if ( aryBuggyBrowsers.indexOf(BrowserName) > -1 ) {
			var selListen = document.getElementById('container').document.getElementsByTagName('select');
			for (var i=0; i<selListen.length; i++) {
				check = 1;
				for ( var x=0; x<aryAusgeblendeteSelLists.length; x++ )
				{
					if ( aryAusgeblendeteSelLists[x] == selListen[i] )
					{
						check = 0;
					}
				}
				if ( check == 1 )
				{
					selListen[i].style.display = "inline";
				}
			}
		}

		document.getElementById("overlayBG").style.display = "none";
		document.getElementById("overlayBG").style.height = "100%";
	}
	return true;
}

/****************************************
*** Scripte für Bildvergrößerung
****************************************/

var aktivBild = 0;
var tmpDivBildAnzeige = "";
var tmpDivBildNavi = "";
var tmpDivDiashow = "";
var tmpDivBildContainer = "";
var tmpDivBildText = "";
var goDiashow = null;
var tmpCheck = true;
var tmpCheckLoad = false;

function zoomBild ( id )
{
	aktivBild = id;
	tmpDivBildNavi = document.getElementById("bildnavi");
	tmpDivDiashow = document.getElementById("diashow");
	
	if ( aktivBild < 0 ) aktivBild = zoomFiles.length-1;
	if ( aktivBild > zoomFiles.length-1 ) aktivBild = 0;
	
	var tmpFile = zoomFiles[aktivBild];
	var tmpText = zoomText[aktivBild];
	
	if ( ( zoomFiles.length > 1 ) && ( tmpDivBildNavi ) )
	{
		if ( zoomFiles.length < 5 )
		{
			tmpDivDiashow.style.display = "none";
		}
		tmpDivBildNavi.style.display = "block";
	}
	
	anzeigeBild ( tmpFile, tmpText );
}

function anzeigeBild ( tmpFile, tmpText )
{
	tmpCheckLoad = false;
	if ( ShowOverlay( true ) )
	{
		ladeAnimation( true );
	}
	
	if ( zoomFiles.length > 1 && tmpCheck )
	{
		for(i=0;i<zoomFiles.length;i++)
		{
			if ( tmpFile == zoomFiles[i] )
			{
				tmpCheck = false;
				zoomBild ( i );
			}
		}
	}
	
	bild = new Image ();
	bild.src = tmpFile;
	
	bild.onload = function() { anzeigeBildDiv ( tmpFile, tmpText ); };
	if ( bild.complete && bild.height > 50 && bild.width > 50 )
	{
		anzeigeBildDiv ( tmpFile, tmpText );
	}
}

function anzeigeBildDiv ( tmpFile, tmpText )
{
	if ( !tmpCheckLoad )
	{
		document.images["bildxl"].alt = tmpText;
		document.images["bildxl"].height = bild.height;
		document.images["bildxl"].width = bild.width;
		
		tmpDivBildContainer = document.getElementById("bildcontainer");
		tmpDivBildAnzeige = document.getElementById("bildanzeige");
		tmpDivBildText = document.getElementById("bildtext");
		if ( bild.width > 600 )
		{
			tmpDivBildAnzeige.style.width = bild.width+20 + "px";
			tmpDivBildAnzeige.style.marginLeft = (bild.width+20)/-2 + "px";
		}
		else
		{
			tmpDivBildAnzeige.style.width = "602px";
			tmpDivBildAnzeige.style.marginLeft = "-301px";
		}
		tmpDivBildContainer.style.width = bild.width + "px";
		tmpDivBildContainer.style.backgroundImage = "url(" + tmpFile + ")";
		tmpDivBildContainer.style.backgroundRepeat = "no-repeat";
		tmpDivBildContainer.style.backgroundPosition = "0px 0px";
		tmpDivBildText.innerHTML = tmpText;
		tmpDivBildAnzeige.style.top = 50+document.documentElement.scrollTop + "px";
		tmpDivBildAnzeige.style.display = "block";
		ladeAnimation( false );
		
		tmpCheckLoad = true;
	}
}

function diashow ()
{
	if ( goDiashow == null )
	{
		document.getElementById("diashowStartStop").innerHTML = "stoppen"
	}
	zoomBild( aktivBild );
	aktivBild += 1;
	goDiashow = setTimeout( "diashow()", 3000 );
}

function diashowStop ()
{
	if ( goDiashow != null ) 
	{
		window.clearTimeout( goDiashow );
		document.getElementById("diashowStartStop").innerHTML = "starten"
		goDiashow = null;
	}
}

function bildanzeigeSchliessen ()
{
	diashowStop ();
	tmpDivBildAnzeige.style.display = "none";
	if ( tmpDivBildNavi )
	{
		tmpDivBildNavi.style.display = "none";
		tmpDivDiashow.style.display = "block";
	}
	tmpCheck = true;
	tmpDivBildAnzeige = "";
	if ( tmpDivPopUp == "" )
	{
		ShowOverlay ( false );
	}
	tmpCheckLoad = false;
}

/****************************************
***	Funktion: getBrowser
*** Identifikation des Browsers
****************************************/

function getBrowser () {
	if (document.ids) {
		BrowserName = "nc4";
	}
	else if ( document.all && !document.getElementById ) {
		BrowserName = "ie4";
	}
	else if ( window.opera && !document.createElement ) {
		BrowserName = "op5";
	}
	else if( window.opera && window.getComputedStyle ) {
		if(document.createRange) {
			BrowserName = "op8";
		}
		else if(window.navigate) {
			BrowserName = "op7.5";
		}
		else {
			BrowserName = "op7.2";
		}
	}
	else if ( window.opera && document.compatMode ) {
		BrowserName = "op7";
	}
	else if ( window.opera && document.releaseEvents ) {
		BrowserName = "op6";
	}
	else if( document.contains && !window.opera ) {
		BrowserName = "kq3";
	}
	else if(window.pkcs11&&window.XML) {
		BrowserName = "f15";
	}
	else if( window.getSelection && window.atob ) {
		BrowserName = "nn7";
	}
	else if( window.getSelection && !document.compatMode ) {
		BrowserName = "nn6";
	}
	else if( window.clipboardData && document.compatMode ) {
		BrowserName = window.XMLHttpRequest? "IE7" : "IE6";
	}
	else if( window.clipboardData ) {
		BrowserName = "ie5";
		if( !document.createDocumentFragment ) {
			BrowserName += ".5";
		}
     	if( document.doctype && !window.print ) {
			BrowserName += "m";
		}
	}
	else if( document.getElementById && !document.all ) {
		BrowserName = "op4";
	}
	else if( document.images && !document.all ) {
		BrowserName = "nn3";
	}
	else if(document.clientWidth&&!window.RegExp) {
		BrowserName = "kq2";
	}
	return BrowserName;
}

/****************************************
***	Funktion: getWahreHoehe
*** Tatsächliche verfügbare Browserfensterhöhe
****************************************/

var wahreHoehe = 0;
function getWahreHoehe ()
{
	if ( window.innerHeight && window.scrollMaxY )
	{
         wahreHoehe = window.innerHeight + window.scrollMaxY;
	}
	else if ( document.body.scrollHeight > document.body.offsetHeight ) 
	{
		wahreHoehe = document.body.scrollHeight;         
	}
	else 
	{
		wahreHoehe = document.body.offsetHeight;         
	}
	if ( wahreHoehe == 0 )
	{
		if ( window.innerHeight )
		{
	         wahreHoehe = window.innerHeight;
		}
		if ( document.documentElement.clientHeight > ( 205 + document.getElementById("inhalt").scrollHeight ) )
		{
	         wahreHoehe = document.documentElement.clientHeight;
		}
		else
		{
			wahreHoehe = 215 + document.getElementById("inhalt").scrollHeight;
		}
	}
}

function getTickerHoehe ( div, anzahl )
{
	var tmpHoehe = 0;
	for( i=1; i <= anzahl; i++)
	{
		var tmp = div + i;
		document.getElementById(tmp).style.display = "block";
		var tmpDivHoehe = document.getElementById(tmp).scrollHeight;
		if ( i > 1 )
		{
			document.getElementById(tmp).style.display = "none";
		}
		if ( tmpDivHoehe > tmpHoehe )
		{
			tmpHoehe = tmpDivHoehe;
		}
	}
	for( i=1; i <= anzahl; i++)
	{
		var tmp = div + "innen" + i;
		document.getElementById(tmp).style.height = (tmpHoehe - 30) + "px"; 
	}
}

/****************************************
*** Scripte für Ladeanimation
****************************************/

var tmpDivLadeAni = "";

function ladeAnimation ( anaus )
{
	tmpDivLadeAni = document.getElementById("ladeani");
	if ( anaus )
	{
		tmpDivLadeAni.style.top = 150+document.documentElement.scrollTop + "px";
		tmpDivLadeAni.style.display = "block";
	}
	else
	{
		tmpDivLadeAni.style.display = "none";
	}
}

/****************************************
***	Funktion: openPopUp
*** PopUps
****************************************/
var tmpDivPopUp = "";
var tmpDivPopUpInhalt = "";
var tmpPopUpBreite = 602;
function openPopUp ( seite, breite )
{
	//alert( seite );
	tmpDivPopUp = document.getElementById("popup");
	tmpDivPopUpInhalt = document.getElementById("popup_content");
	
	tmpDivPopUp.style.top = 50+document.documentElement.scrollTop + "px";
	if ( breite )
	{
		tmpDivPopUp.style.width = breite + "px";
		//tmpDivPopUp.style.maxWidth = breite-20 + "px";
		tmpDivPopUp.style.marginLeft = (breite)/-2 + "px";
		tmpPopUpBreite = breite;
	}
	else
	{
		tmpDivPopUp.style.width = "602px";
		tmpDivPopUp.style.marginLeft = "-301px";
	}
	
	if ( ShowOverlay( true ) )
	{
		ladeAnimation( true );
	}
	tmpDivPopUpInhalt.src = seite;
}

function showPopUp ()
{
	if ( !tmpDivPopUp )
	{
		tmpDivPopUp = document.getElementById("popup");
	}
	if ( !tmpDivPopUpInhalt )
	{
		tmpDivPopUpInhalt = document.getElementById("popup_content");
	}
	tmpDivPopUp.style.height = "";
	tmpDivPopUpInhalt.height = 1;
	if ( ShowOverlay( true ) )
	{
		ladeAnimation( false );
		tmpDivPopUp.style.display = "block";
	}
	
	tmpDivPopUpInhaltRahmen = parent.frames["popup_frame"].document.getElementById("popup_content_rahmen");
	if ( tmpPopUpBreite )
	{
		tmpDivPopUpInhaltRahmen.style.width = (tmpPopUpBreite-2) + "px";
	}
	else
	{
		tmpDivPopUpInhaltRahmen.style.width = "600px";
	}
	
	var tmp = document.getElementById("popup_content").contentWindow.document.body;
	if ( tmp.scrollHeight > tmp.offsetHeight )
	{
		var hoehe = tmp.scrollHeight + 10;         
	}
	else
	{
		var hoehe = tmp.offsetHeight + 10;         
	}
	//alert( document.getElementById("popup_content").contentWindow.innerHeight + "/" + tmpDivPopUpInhaltRahmen.scrollHeight + "/" + tmpDivPopUpInhaltRahmen.offsetHeight );
	tmpDivPopUpInhalt.height = hoehe;
	tmpDivPopUp.style.height = (hoehe+10) + "px";
	tmpDivPopUp.style.minHeight = (hoehe+55) + "px";
}

function closePopUp ()
{
	tmpDivPopUp.style.display = "none";
	tmpDivPopUp.style.height = "";
	tmpDivPopUpInhalt.src = "";
	tmpDivPopUpInhalt.height = 1;
	tmpDivPopUp = "";
	
	if ( tmpDivBildAnzeige == "" )
	{
		ShowOverlay( false );
	}
}

function ieFake ( fake )
{
	if ( ( fake ) && ( fake.blur) )
	{
		fake.blur();
	}
}

var tmpTxt;
function statAnzeige ( mtxt ) 
{
	tmpTxt = txt;
	setTimeout("window.status = tmpTxt;",0);
	return true;
}

var wi = null;
function info ( datei, x, y, scbar ) 
{
	tmpScroll = "yes";
	if (scbar == 0) tmpScroll = "no";
	if (!x) var tmpX = 520;
	else var tmpX = x+20;
	if (!y) var tmpY = 350;
	else var tmpY = y+30;
	if (wi != null) if (!wi.closed) wi.close();
	wi = window.open(datei,'Infofenster','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpScroll + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (wi.opener==null) wi.opener=self;
	return;
}

function feldGr ( feld, inhalt, max ) 
{
	who = feld;
	if (inhalt >= max) 
	{
		alert('Achtung, maximale Feldgröße erreicht!');
		who.value = who.value.substr(0,max-1);
	}
}

function popup_drucken ()
{
	/* IE */
	if ( document.frames )
	{
		document.frames.popup_frame.focus();
		document.frames.popup_frame.drucken();
	}
	/*  FF */
	else
	{
		popup_frame.drucken();
	}
}

function drucken () 
{

	if (window.print) self.print();
	if(document.all && navigator.appVersion.substring(22,23)==4) 
	{
		self.focus();
	    var OLECMDID_PRINT = 6;
	    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
	    var OLECMDEXECOPT_PROMPTUSER = 1;
	    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	    document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
	    WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
	    WebBrowser1.outerHTML = '';
	}

}

function checkMail ()
{
	var tmpFeld = document.newsletter.email;
	var checkMail = tmpFeld.value.indexOf("@");
	var checkMail1 = tmpFeld.value.lastIndexOf(".");
	var checkMail2 = tmpFeld.value.lastIndexOf(" ");
	var checkMailLaenge = tmpFeld.value.length;
	if ( (checkMail2 != -1) || (checkMail1 == -1) || (checkMail < 1) || (checkMail == checkMailLaenge-1) || (checkMail == checkMail1-1) || (checkMail1 > checkMailLaenge-3) || (checkMailLaenge < 6) || (tmpFeld.value == "Bitte eMail-Adresse eintragen ...") || (tmpFeld.value == "") )
	{
		alert("Bitte geben Sie eine gültige eMail-Adresse ein.");
	}
	else
	{
		openPopUp ( "newsletter_anmeldung.php?email=" + tmpFeld.value );
	}
	return false;
}

function checkStichwortSuche ()
{
	var iCheck = true;
	var tmpFeld = document.suche.stichwort;
	var tmpAction = document.suche.action;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	if ( ( tmpFeld.value == '' ) || ( iCheck ) )
	{
		alert( "Bitte geben Sie erst einen Suchbegriff in das Textfeld ein,\nnach dem gesucht werden soll." );
		return false;
	}
	tmpAction = tmpAction.replace(/#suchwort#/g, tmpFeld.value);
	document.suche.action = tmpAction;
	return;
}

function checkAdressenSuche ()
{
	var iCheck = true;
	var tmpFeld = document.adressensuche.stadt;
	var tmpAction = document.adressensuche.action;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	if ( ( tmpFeld.value == '' ) || ( iCheck ) )
	{
		tmpAction = tmpAction;
	}
	else
	{
		tmpAction = tmpAction.replace(/alle/g, tmpFeld.value);
	}
	
	tmpFeld = document.adressensuche.stichwort;
	tmpAction = tmpAction.replace(/#suchwort#/g, tmpFeld.value);
	
	document.adressensuche.action = tmpAction;
	return;
}

function checkTerminSuche ()
{
	var iCheck = true;
	var tmpFeld1 = document.terminsuche.datumvont;
	var tmpFeld2 = document.terminsuche.datumvonm;
	var tmpFeld3 = document.terminsuche.datumvonj;
	var tmpCounter = 0;
	for( j=1; j < 4; j++)
	{
		var tmpFeld = eval("tmpFeld" + j);
		for( i=0; i < tmpFeld.value.length; i++)
		{
			if ( tmpFeld.value.substr(i,1) != ' ' )
			{
				iCheck = false;
				i = tmpFeld.value.length;
			}
		}
		if ( ( tmpFeld.value != '' ) && ( !iCheck ) )
		{
			tmpCounter ++;
		}
	}
	if ( tmpCounter > 0 && tmpCounter < 3 )
	{
		alert("Bitte geben Sie ein komplettes Datum von an (TT.MM.JJJJ)");
		return false;
	}
	
	var iCheck = true;
	var tmpFeld1 = document.terminsuche.datumbist;
	var tmpFeld2 = document.terminsuche.datumbism;
	var tmpFeld3 = document.terminsuche.datumbisj;
	var tmpCounter = 0;
	for( j=1; j < 4; j++)
	{
		var tmpFeld = eval("tmpFeld" + j);
		for( i=0; i < tmpFeld.value.length; i++)
		{
			if ( tmpFeld.value.substr(i,1) != ' ' )
			{
				iCheck = false;
				i = tmpFeld.value.length;
			}
		}
		if ( ( tmpFeld.value != '' ) && ( !iCheck ) )
		{
			tmpCounter ++;
		}
	}
	if ( tmpCounter > 0 && tmpCounter < 3 )
	{
		alert("Bitte geben Sie ein komplettes Datum bis an (TT.MM.JJJJ)");
		return false;
	}
	
	var iCheck = true;
	var tmpFeld = document.terminsuche.stadt;
	var tmpAction = document.terminsuche.action;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	if ( ( tmpFeld.value == '' ) || ( iCheck ) )
	{
		tmpAction = tmpAction.replace(/#ort#/g, "");
	}
	else
	{
		tmpAction = tmpAction.replace(/#ort#/g, "/" + tmpFeld.value);
	}
	
	var iCheck = true;
	var tmpFeld = document.terminsuche.elements["bereichids[]"];
	var tmpArt = "";
	var tmpArtIDs = "";
	for( i=0; i < tmpFeld.length; i++)
	{
		if ( tmpFeld[i].checked )
		{
			if ( tmpArt != "" )
			{
				tmpArt += "_";
				tmpArtIDs += ",";
			}
			tmpArt += terminart[i];
			tmpArtIDs += tmpFeld[i].value;
		}
	}
	if ( tmpArt == '' )
	{
		tmpAction = tmpAction.replace(/#art#/g, "/alle");
		tmpAction = tmpAction.replace(/#artids#/g, "/0");
	}
	else
	{
		tmpAction = tmpAction.replace(/#art#/g, "/" + tmpArt);
		tmpAction = tmpAction.replace(/#artids#/g, "/" + tmpArtIDs);
	}
	
	var iCheck = true;
	var tmpFeld = document.terminsuche.stichwort;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	tmpAction = tmpAction.replace(/#suchwort#/g, tmpFeld.value);
	
	document.terminsuche.action = tmpAction;
	return;
}

function checkAdressSuche ()
{
	var iCheck = true;
	var tmpFeld = document.adresssuche.stadt;
	var tmpAction = document.adresssuche.action;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	if ( ( tmpFeld.value == '' ) || ( iCheck ) )
	{
		tmpAction = tmpAction;
	}
	else
	{
		tmpAction = tmpAction.replace(/alle/g, tmpFeld.value);
	}
	
	var iCheck = true;
	var tmpFeld = document.adresssuche.stichwort;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	tmpAction = tmpAction.replace(/#suchwort#/g, tmpFeld.value);
	
	document.adresssuche.action = tmpAction;
	return;
}

function checkGastgeberSuche ()
{
	var iCheck = true;
	var tmpFeld = document.gastgebersuche.stadt;
	var tmpAction = document.gastgebersuche.action;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	if ( ( tmpFeld.value == '' ) || ( iCheck ) )
	{
		tmpAction = tmpAction.replace(/#ort#/g, "");
	}
	else
	{
		tmpAction = tmpAction.replace(/#ort#/g, "/" + tmpFeld.value);
	}
	
	var iCheck = true;
	var tmpFeld = document.gastgebersuche.elements["bereichids[]"];
	var tmpArt = "";
	var tmpArtIDs = "";
	for( i=0; i < tmpFeld.length; i++)
	{
		if ( tmpFeld[i].checked )
		{
			if ( tmpArt != "" )
			{
				tmpArt += "_";
				tmpArtIDs += ",";
			}
			tmpArt += gastgeberart[i];
			tmpArtIDs += tmpFeld[i].value;
		}
	}
	if ( tmpArt == '' )
	{
		tmpAction = tmpAction.replace(/#art#/g, "/alle");
		tmpAction = tmpAction.replace(/#artids#/g, "/0");
	}
	else
	{
		tmpAction = tmpAction.replace(/#art#/g, "/" + tmpArt);
		tmpAction = tmpAction.replace(/#artids#/g, "/" + tmpArtIDs);
	}
	
	var iCheck = true;
	var tmpFeld = document.gastgebersuche.elements["eigenschaftenids[]"];
	var tmpArt = "";
	var tmpArtIDs = "";
	for( i=0; i < tmpFeld.length; i++)
	{
		if ( tmpFeld[i].checked )
		{
			if ( tmpArt != "" )
			{
				tmpArt += "_";
				tmpArtIDs += ",";
			}
			tmpArt += eigenschaften[i];
			tmpArtIDs += tmpFeld[i].value;
		}
	}
	if ( tmpArt == '' )
	{
		tmpAction = tmpAction.replace(/#eigenschaftenids#/g, "0");
	}
	else
	{
		tmpAction = tmpAction.replace(/#eigenschaftenids#/g, tmpArtIDs);
	}
	
	var iCheck = true;
	var tmpFeld = document.gastgebersuche.stichwort;
	for( i=0; i < tmpFeld.value.length; i++)
	{
		if ( tmpFeld.value.substr(i,1) != ' ' )
		{
			iCheck = false;
			i = tmpFeld.value.length;
		}
	}
	tmpAction = tmpAction.replace(/#suchwort#/g, tmpFeld.value);
	
	document.gastgebersuche.action = tmpAction;
	return;
}

var lay_ticker = "";
var position = 1000;
var txtLang = 0;
var goTicker = null;

function tickerInit ()
{
	lay_ticker = document.getElementById("ticker_content");
	txtLang = lay_ticker.offsetWidth;
	
	tickerStart ( position );
}

function tickerStart ( pos )
{
	if (position < ( txtLang * (-1) ) )
	{
		position = 1000;
	}
	lay_ticker.style.left = position + "px";
	position -= 3
	//alert(position);
	goTicker = setTimeout('tickerStart()',50);
}

function inhaltCheck ( field, txt, url ) 
{
	iCheck = true;

	for(i=0;i<field.value.length;i++) 
	{
		if (field.value.substr(i,1) != ' ') 
		{
			iCheck = false;
			i = field.value.length;
		}
	}
	if (iCheck) 
	{
		alert(txt);
		//return false;
	}
	else 
	{
		document.location.href = url;
	}
}

function divBG ( div, farbe ) 
{
	var tmpDiv = document.getElementById(div);
	if ( tmpDiv )
	{
		tmpDiv.style.backgroundColor = farbe;
	}
}

function divEin ( div ) 
{
	var tmpDiv = document.getElementById(div);
	if ( tmpDiv )
	{
		tmpDiv.style.display = "block";
	}
}
function divAus ( div ) 
{
	var tmpDiv = document.getElementById(div);
	if ( tmpDiv )
	{
		tmpDiv.style.display = "none";
	}
}
function divWechsler ( div, seite, anzahl )
{
	for( i=1;i<=anzahl;i++ )
	{
		divAus ( div + i );
	}
	divEin ( div + seite );
}
var tmpWechsleraktiv = null;
var tmpWechslerSeite = 1;
function divAutoWechsler ( div, anzahl )
{
	divWechsler ( div, tmpWechslerSeite, anzahl );
	tmpWechslerSeite ++;
	if ( tmpWechslerSeite > anzahl )
	{
		tmpWechslerSeite = 1;
	}
	tmpWechsleraktiv = setTimeout("divAutoWechsler('" + div + "', " + anzahl + ")", 10000);
}

function maillink ( wert )
{
	var mail = wert.replace("_","@");
	document.location.href = "mailto:" + mail;
}

function topSprung ()
{
	window.scrollTo(0, 0);
}

/* Font-Size changer */
var normalFontSize = 12;
var actualFontSize = 0;
var contentareaid  = 'inhalt';
var oberegrenze	   = 16;
var unteregrenze   = 11;
var ajaxfile 	   = 'ajax.php';

function setActualFontSize(fs)
{
	if ( fs && fs != "undefined" )
	{
		actualFontSize = fs;
	}
	else
	{
		actualFontSize = normalFontSize;
	}
}

function increaseFont()
{
	if(actualFontSize == 0)
	{
		actualFontSize = normalFontSize;
	}
	if(actualFontSize <= oberegrenze)
	{
		actualFontSize += 1;
	}
	setFontSize();
	return 0;
}

function setFontSize()
{
	setAjaxRequest();
	var element = document.getElementById(contentareaid).style;
	element.fontSize = actualFontSize+'px';
}

function setToNormalFont()
{
	actualFontSize = normalFontSize;
	setFontSize();
	return 0;
}

function decreaseFont()
{
	if(actualFontSize == 0)
	{
		actualFontSize = normalFontSize;
	}
	if(actualFontSize >= unteregrenze)
	{
		actualFontSize -= 1;
	}
	setFontSize();
	return 0;
}

function setAjaxRequest()
{
	if (window.XMLHttpRequest)
	{
		request = new XMLHttpRequest(); // Mozilla, Safari, Opera
	}
	else if (window.ActiveXObject)
	{
		try
		{
			request = new ActiveXObject('Msxml2.XMLHTTP'); // IE 5
		}
		catch (e)
		{
			try
			{
				request = new ActiveXObject('Microsoft.XMLHTTP'); // IE 6
			}
			catch (e) {}
		}
	}
    
	var params = "fontsize="+actualFontSize;

	if (!request)
	{
		alert("Kann keine XMLHTTP-Instanz erzeugen");
		return false;
	}
	else
	{
		var url = ajaxfile;
		request.open('post', url, true);
		request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        request.setRequestHeader("Content-length", params.length);
        request.setRequestHeader("Connection", "close");

		request.send(params);
	}
}
