// JavaScript Document

function pruefen ()
{
		if(document.onlinecommunity.first_name.value == "")
	   {
                alert("Please give your first name.");
                document.onlinecommunity.first_name.focus();
                return false;
        }
		
        if(document.onlinecommunity.last_name.value == "")
        {
                alert("Please give your Surname.");
                document.onlinecommunity.last_name.focus();
                return false;
        }
        if(document.onlinecommunity.email.value.indexOf('@') == -1 || document.onlinecommunity.email.value.indexOf('.') == -1)
        {
                alert("Please give the correct Email. ;-)");
                document.onlinecommunity.email.focus();
                return false;
        }
		if(document.onlinecommunity.username.value == "")
        {
                alert("Please choose any Username.");
                document.onlinecommunity.username.focus();
                return false;
        }
		if(document.onlinecommunity.usernconf.value == "")
        {
                alert("Please confirm your chosen Username.");
                document.onlinecommunity.usernconf.focus();
                return false;
        }
		  
		  
		 if(document.onlinecommunity.username.value == document.onlinecommunity.usernconf.value)
		  {  usernconf = true;
			  
		  }
		   else
		{
                alert("Your confirmed Username must correspond to your chosen Username.");
                document.onlinecommunity.usernconf.focus();
                return false;
        }
		
{
	var form = document.onlinecommunity; //Formular in variable merken
  var formok = false; // Flag merkt sich den Status des Formulars
  for (i=0; i < form.length; i++) // Gehe alle Elemente des Formular durch
  {
   //Wenn eines vom typ Checked vorliegt und eingeschaltet ist..
   if(form[i].type == "radio" && form[i].checked)
  {
   formok = true; //Unsere Flag bestätigen, alles ok
   break; // In diesem Fälle, brauchen wir nicht weiter zu prüfen, also mit break die schleife verlassen
   }
   }
   if (!formok) alert ('Please select an option; for example: Register!');
   return formok;
   }
   
   
  }