			function emailCheck(emailStr) {
			var emailPat=/^(.+)@(.+)$/
			var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
			var validChars="\[^\\s" + specialChars + "\]"
			var quotedUser="(\"[^\"]*\")"
			var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
			var atom=validChars + '+'
			var word="(" + atom + "|" + quotedUser + ")"
			// The following pattern describes the structure of the user
			var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
			var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
			var matchArray=emailStr.match(emailPat)
			if (matchArray==null) {
			alert("L'email non é corretta")
			return false
			}
			var user=matchArray[1]
			var domain=matchArray[2]

			// See if "user" is valid 
			if (user.match(userPat)==null) {
				// user is not valid
				alert("L'email non é corretta")
				return false
			}
			var IPArray=domain.match(ipDomainPat)
			if (IPArray!=null) {
				// this is an IP address
				  for (var i=1;i<=4;i++) {
					if (IPArray[i]>255) {
						alert("L'email non é corretta")
					return false
					}
				}
				return true
			}

			// Domain is symbolic name
			var domainArray=domain.match(domainPat)
			if (domainArray==null) {
				alert("L'email non é corretta")
				return false
			}
			var atomPat=new RegExp(atom,"g")
			var domArr=domain.match(atomPat)
			var len=domArr.length
			if (domArr[domArr.length-1].length<2 || 
				domArr[domArr.length-1].length>4) {
			   // the address must end in a two letter or three letter word.
			   alert("L'email non é corretta")
			   return false
			}

			// Make sure there's a host name preceding the domain.
			if (len<2) {
			   var errStr="L'email non é corretta"
			   alert(errStr)
			   return false
			}

			// If we've gotten this far, everything's valid!
			return true;
		}


function formchecker()
		{	
		if(prenotazione.nome.value=="")
		{
			alert("Inserire il nome");
			prenotazione.nome.focus();
			return false;
		}
		
		if(prenotazione.cognome.value=="")
		{
			alert("Inserire il cognome");
			prenotazione.cognome.focus();
			return false;
		}
		
		if(prenotazione.citta.value=="")
		{
			alert("Inserire la città");
			prenotazione.citta.focus();
			return false;
		}

		if(prenotazione.telefono.value=="")
		{
			alert("Inserire il telefono");
			prenotazione.telefono.focus();
			return false;
		}
		
		if(prenotazione.email.value=="")
		{
			alert("Inserire l'e-mail");
			prenotazione.email.focus();
			return false;
		}
		else
		{
			if(emailCheck(prenotazione.email.value)==false) return false;
		}
		
		
		
	
		
		if(!(prenotazione.privacy.checked))
		{
			alert("Autorizzare il trattamento dei dati personali");
			prenotazione.privacy.focus();
			return false;
		}		
		}

