function validation(){ 
with(document.form1) {		
		
	if(name.value=="") {
	alert("The name field has not been completed.");
	name.focus();
	return false;
	}
	
	
	if(surname.value=="") {
	alert("The surname field has not been completed.");
	surname.focus();
	return false;
	}
	
	//email
	if(email.value=="") {
	alert("The e-mail field has not been completed.");
	email.focus();
	return false;
	}
	var stato=true;
	if(email.value.indexOf(" ")!=-1) {
	email.focus();
	stato=false;
	}
	var chiocciola=email.value.indexOf("@");
	if(chiocciola<2) {
	email.focus();
	stato=false;
	}
	var punto=email.value.indexOf(".", chiocciola);
	if(punto<chiocciola+3) {
	email.focus();
	stato=false;
	}
	var lung=email.value.length;
	if(lung-punto<3) {
	email.focus();
	stato=false;
	}
	
		
	//if(stato) {
		//alert("E-mail valida");
	//}else{	

	if(stato==false) {
		alert("Sorry, invalid e-mail address.");
	return stato;
	}
	//fine email
	
	
	if(message.value=="") {
	alert("The text field does not contain any message.");
	message.focus();
	return false;
	}
	
	
	if(radiobutton[0].checked==true) {
	alert("Accettare le condizioni.");
	radiobutton[0].focus();
	return false;
	}						              

}

//alert("Il modulo è completo, grazie");
return true;
}	

function validation2(){ 
with(document.form2) {		
		
	if(name.value=="") {
	alert("The name field has not been completed.");
	name.focus();
	return false;
	}
	
	
	if(surname.value=="") {
	alert("The surname field has not been completed.");
	surname.focus();
	return false;
	}
	
	//email
	if(email.value=="") {
	alert("The e-mail field has not been completed.");
	email.focus();
	return false;
	}
	var stato=true;
	if(email.value.indexOf(" ")!=-1) {
	email.focus();
	stato=false;
	}
	var chiocciola=email.value.indexOf("@");
	if(chiocciola<2) {
	email.focus();
	stato=false;
	}
	var punto=email.value.indexOf(".", chiocciola);
	if(punto<chiocciola+3) {
	email.focus();
	stato=false;
	}
	var lung=email.value.length;
	if(lung-punto<3) {
	email.focus();
	stato=false;
	}
	
		
	//if(stato) {
		//alert("E-mail valida");
	//}else{	

	if(stato==false) {
		alert("Sorry, invalid e-mail address.");
	return stato;
	}
	//fine email
						              

}

//alert("Il modulo è completo, grazie");
return true;
}	