function formulartest(eingabe,d_typ)
{
var leer = " ";
var txt = eingabe;
if (d_typ != "1" && d_typ != "3" && d_typ != "4" && txt.charAt(0) == txt.charAt(1) && txt.charAt(0) == txt.charAt(2))
	{
	return false;
	}
else
	{
	if (d_typ == "0")
		{
		if (!txt.match(/^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/))
			{
			return false;
			}
		else
			{
			return true;
			}
		}


	if (d_typ == "1" || d_typ == "2" ||  d_typ == "3" || d_typ == "4" || d_typ == "5" || d_typ == "3")
		{
		var temp;
		var z_laenge = 1;
		var zeichen_oka = true;var akt_zeichen_po  = 0;var akt_zeiche  = "";
		if (d_typ == "1")
			{
			var erlaubte_zeiche = "1234567890";
			}
		if (d_typ == "2")
			{
			var erlaubte_zeiche = "1234567890 -+()";
			}


		if (d_typ == "3")
			{
			var erlaubte_zeiche = "1234567890";
			if (txt.charAt(0) == "-")
				{
				temp = txt.substring(1,txt.length);
				txt = temp;
				alert(txt);
				}
			}

		if (d_typ == "4")
			{
			var erlaubte_zeiche = "1234567890.";
			if (txt.charAt(0) == "-")
				{
				temp = txt.substring(1,txt.length);
				txt = temp;
				}
			temp = txt.indexOf(".",0)
			if(temp != "-1")
				{
				temp++
				if(txt.indexOf(".",temp) != "-1")
					{
					txt = "x";
					}
				}
			}

		if (d_typ == "5")
			{
			var erlaubte_zeiche = "1234567890";
			if (txt.charAt(2) == "." && txt.charAt(5) == "." && txt.length == 10)
				{

				temp = txt.substring(0,2);
				if (parseFloat(txt.substring(0,2)) > 31)
					{
					temp = "x";
					}

				temp += txt.substring(3,5);
				if (parseFloat(txt.substring(3,5)) > 12)
					{
					temp = "x";
					}				

				temp += txt.substring(6,10);
				if (parseFloat(txt.substring(6,10)) > 2050)
					{
					temp = "x";
					}					

				txt = temp;
				z_laenge = 8;
				}
			else
				{
				z_laenge = 100;
				}
			}

		if (d_typ == "1" || d_typ == "2")
			{
			z_laenge = 5;
			}
			
			
		while (zeichen_oka && (akt_zeichen_po < txt.length))
			{
			akt_zeiche  = txt.charAt(akt_zeichen_po);
			zeichen_oka = (erlaubte_zeiche.indexOf(akt_zeiche) != -1);
			akt_zeichen_po++;
			}
		if (! zeichen_oka || txt.length < z_laenge)
			{
			return false;
			}
		else
			{
			if (d_typ == "1" &&  txt.length != z_laenge)
				{
				return false;
				}
			else
				{
				return true;
				}
			}
		}
		if (d_typ == "6")
			{
			var zeichen_oka = true;
			var akt_zeichen_po  = 0;
			var akt_zeiche = "";
			var buchstaben_char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&.+- ";
			while (zeichen_oka && (akt_zeichen_po < txt.length))
				{
				akt_zeiche  = txt.charAt(akt_zeichen_po);
				zeichen_oka = (buchstaben_char.indexOf(akt_zeiche) != -1);
				akt_zeichen_po++;
				}
			if (! zeichen_oka)
				{
				return false;
				}
			else
				{
				return true;
				}
			}
		}
	}
