// Toggle in Marginalspalte
window.onload = function() {
	
	// classes
	var myBox = document.getElementsByClassName('toggle');
	var myBoxOpen = document.getElementsByClassName('accordionContent');
	
	// Create the accordian
	var myEffect = new fx.Accordion(myBox, myBoxOpen,{
	
		// add the act class
		onActive: function(toggle, element){
			toggle.addClass('active');
		},
		
		// remove the act class
		onBackground: function(toggle, element){
			toggle.removeClass('active');
		}
	
	});
	/* Tooltips deactivated
	// Tool Tips for extra information
	var as = [];
	$S('a').each(function(a){
		if (a.getAttribute('title')) as.push(a);
	});
	
	new Tips(as, {maxOpacity: 1, maxTitleChars: 25, className: 'titleTip'});
	*/
}

function donothing(){}

function wertepruefung(check)
	{
	for (i=0;i<=(check.length-1);i++)
		{	
  		if (check[i].value == "")
    		{
			document.getElementById("error").innerText = "Bitte fuellen Sie die markierten Felder aus.";
			document.getElementById("error").className = "errorTextvis";
			switch (check[i].className)
				{
				case "firstInputField":
					check[i].className = "firstInputField errorForm";
					break;
				case "inputField dateOfBirthDM":
					check[i].className = "inputField dateOfBirthDM errorForm";
					break;
				case "inputField dateOfBirthYear":
					check[i].className = "inputField dateOfBirthYear errorForm";
					break;
				case "firstInputField zipcode":
					check[i].className = "firstInputField zipcode errorForm";
					break;
				case "firstInputField city":
					check[i].className = "firstInputField city errorForm";
					break;
				case "indent":
					check[i].className = "indent errorForm";
					break;
				}				
			check[i].focus();
			return false;
		    }
		else
			{
			document.getElementById("error").className = "errorText";
			switch (check[i].className)
				{
				case "firstInputField errorForm":
					check[i].className = "firstInputField";
					break;
				case "inputField dateOfBirthDM errorForm":
					check[i].className = "inputField dateOfBirthDM";
					break;
				case "inputField dateOfBirthYear errorForm":
					check[i].className = "inputField dateOfBirthYear";
					break;
				case "firstInputField zipcode errorForm":
					check[i].className = "firstInputField zipcode";
					break;
				case "firstInputField city errorForm":
					check[i].className = "firstInputField city";
					break;
				case "indent errorForm":
					check[i].className = "indent";
					break;
				}				
			}
		}
	return true;
	}
	
function birthdaycheck(d)
	{
		if ((isNaN(d.tag.value)) == true || (d.tag.value > 31))
		{
		document.getElementById("error").innerText = "Bitte geben sie ein realistischen Geburtstag ein.";
		document.getElementById("error").className = "errorTextvis";
		d.tag.className = "inputField dateOfBirthDM errorForm";
		d.tag.value = "";
		d.tag.focus();
		return false;
		}
	else
		d.tag.className = "inputField dateOfBirthDM";

	if ((isNaN(d.monat.value)) == true || (d.monat.value > 12))
		{
		document.getElementById("error").innerText = "Bitte geben sie ein realistischen Geburtsmonat ein.";
		document.getElementById("error").className = "errorTextvis";
		d.monat.className = "inputField dateOfBirthDM errorForm";
		d.monat.value = "";
		d.monat.focus();
		return false;
		}
	else
		d.monat.className = "inputField dateOfBirthDM";
	

	if ((isNaN(d.jahr.value)) == true)
		{
		document.getElementById("error").innerText = "Bitte geben sie ein realistisches Geburtsjahr ein.";
		document.getElementById("error").className = "errorTextvis";
		d.jahr.className = "inputField dateOfBirthYear errorForm";
		d.jahr.value = "";
		d.jahr.focus();
		return false;
		}
	else
		d.jahr.className = "inputField dateOfBirthYear";
	return true;
}