
/* +++ the Solution for M$ Browsers +++ */

sfHover = function() {
	var sfEls = document.getElementById("primaryNavigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			if (this.className.search("sfhover\\b") == -1) {
				this.className+=" sfhover";
			}
			var currentNode = this;
			while (currentNode.parentNode.parentNode.tagName == "LI") {
				if (currentNode.parentNode.parentNode.className.search("active-js\\b") == -1) {
					currentNode.parentNode.parentNode.className+=" active-js";
				}
				currentNode = currentNode.parentNode.parentNode;
			}
		}
		sfEls[i].onmouseout=function() {
			var currentNode = this;
			while (currentNode.parentNode.parentNode.tagName == "LI") {
				currentNode.parentNode.parentNode.className=currentNode.parentNode.parentNode.className.replace(new RegExp(" active-js\\b"), "");
				while (currentNode.parentNode.parentNode.className.charAt(0) == " ") {
					currentNode.parentNode.parentNode.className = currentNode.parentNode.parentNode.className.slice(1, currentNode.parentNode.parentNode.className.length);
				}
				if (currentNode.parentNode.parentNode.className == "" || currentNode.parentNode.parentNode.className == " ") {
					currentNode.parentNode.parentNode.removeAttribute("class");
				}
				currentNode = currentNode.parentNode.parentNode;
			}
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			this.className=this.className.replace(new RegExp("sfhover\\b"), "");
			if (this.className == "" || this.className == " ") {
				this.removeAttribute("class");
			}
		}
	}
}

/* +++ the Solution for good Browsers +++ */

sfHoverFF = function() {
	var sfEls = document.getElementById("primaryNavigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			var currentNode = this;
			while (currentNode.parentNode.parentNode.tagName == "LI") {
				if (currentNode.parentNode.parentNode.className.search("active-js\\b") == -1) {
					currentNode.parentNode.parentNode.className+=" active-js";
				}
				currentNode = currentNode.parentNode.parentNode;
			}
		}
		sfEls[i].onmouseout=function() {
			var currentNode = this;
			while (currentNode.parentNode.parentNode.tagName == "LI") {
				currentNode.parentNode.parentNode.className=currentNode.parentNode.parentNode.className.replace(new RegExp("active-js\\b"), "");
				while (currentNode.parentNode.parentNode.className.charAt(0) == " ") {
					currentNode.parentNode.parentNode.className = currentNode.parentNode.parentNode.className.slice(1, currentNode.parentNode.parentNode.className.length);
				}
				if (currentNode.parentNode.parentNode.className == "" || currentNode.parentNode.parentNode.className == " ") {
					currentNode.parentNode.parentNode.removeAttribute("class");
				}
				currentNode = currentNode.parentNode.parentNode;
			}
			if (this.className == "" || this.className == " ") {
				this.removeAttribute("class");
			}
		}
	}
}

/* +++ now triggering the right one +++ */

if (window.attachEvent) {
	window.attachEvent("onload", sfHover);
} else {
	window.addEventListener("load", sfHoverFF, false);
}


function initialDomModify() {

	// removeLastMainNavBack()
	var liItems = document.getElementById('breadCrumbs').getElementsByTagName('LI');
	liItems[0].style.border = "none";
}

function checkForm() 
{
 var strFehler='';
 
 if (document.Rundbrief.Vorname.value=="") 
    strFehler += "Das Feld Vorname ist leer!\n";
 
 if (document.Rundbrief.Nachname.value=="") 
    strFehler += "Das Feld Nachname ist leer!\n";

 if (!validEmail(document.Rundbrief.EMail.value)) 
 {
    strFehler += "Die E-Mail-Adresse ist nicht korrekt!\n";
 }
 
 if(!document.Rundbrief.Datenschutz.checked)
    strFehler += "Bitte bestätigen sie die Erklärung zum Datenschutz!\n";

 if (strFehler.length>0)  
 {
  alert("Festgestellte Probleme: \n\n"+strFehler);
  return(false);
 }
 else
 {
  alert("Sie haben sich für unser Rundbriefabonnement angemeldet.\nSie erhalten in Kürze eine Bestätigungsemail!");
 }
}

function validEmail(email) {
 var strReg = "^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
 var regex = new RegExp(strReg);
 return(regex.test(email)); 
}

function FensterOeffnen (Adresse) 
{
 MeinFenster = window.open(Adresse, "Datenschutzr", "width=400,height=400,scrollbars=yes");
 MeinFenster.focus();
}


