function compilato(input) {
	 return (input.value.length != 0); 
}

function isNumber(data)  {
	var numStr = " 0123456789-";
	var thisChar;
	var counter = 0;
	for (var i=0; i < data.length; i++)  {
		thisChar = data.substring(i,i+1);
		if (numStr.indexOf(thisChar) != -1)
			counter++;
	}
	if (counter == data.length) 
		return true; // il numero è valido
	else
		return false; // il numeor è errato
	

}

function verificaForm() {
	
		if (!compilato(document.forms[0].Vorname))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		if (!compilato(document.forms[0].Nachname))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}
	
		if (!compilato(document.forms[0].Strasse))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		if (!compilato(document.forms[0].Land))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		if (!compilato(document.forms[0].PLZ))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		if (!compilato(document.forms[0].Ort))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		if (!compilato(document.forms[0].email))  {

			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
			alert(msg);
			return false;
		}

		else  {
			str = document.forms[0].email.value;
			reg = /\w+@[a-zA-Z0-9_-]+\.([a-zA-Z]{2,3})|\w+@[a-zA-Z0-9_-]+\.([a-zA-Z]{2,3}\.[a-zA-Z]{2,3})/;

			if ( str.search(reg) == -1 ) {
				document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
				alert(msg);
				return false;
			}
		}
		
//		if (!compilato(document.forms[0].Telefon))  {
//
//			document.forms[0].Vorname.focus();
			msg = "The form cannot be sent because you have not compiled or you have compiled badly a field of the form.\n";
			msg += "Please you correct the error and it sends the form!Thanks.\n";
//			alert(msg);
//			return false;
//		}
}
