  function checkAll()
    {
	  var tot_el=document.getElementById('preventivi').elements;
	  for (i=0; i<tot_el.length; i++)
	    {
		  if (tot_el[i].tagName.toLowerCase()=="input" && tot_el[i].type.toLowerCase()=="text")
		    {
			  switch (tot_el[i].id)
				{
				  case "familyname":
				    if (tot_el[i].value=="")
					  {
						alert ('Il campo "Cognome" è obbligatorio.');
						tot_el[i].focus();
						return false;
					  }
				  break;				  
				  case "name":
				    if (tot_el[i].value=="")
					  {
						alert ('Il campo "Nome" è obbligatorio.');
						tot_el[i].focus();
						return false;
					  }
				  break;
				  case "email":
				    if (tot_el[i].value=="")
					  {
						alert ('Il campo "Email" è obbligatorio.');
						tot_el[i].focus();
						return false;
					  }	
					var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
					if (!emailfilter.test(tot_el[i].value)) 
					  {
					    alert ("Inserire un indirizzo Email valido."); 
						tot_el[i].focus();
						return false;
					  }
				  break;
				  case "budget_wd":
				    if (tot_el[i].value=="" || isNaN(parseInt(tot_el[i].value)))
					  {
						alert ('Il campo "Budget Web Design" è obbligatorio e deve essere numerico.');
						tot_el[i].focus();
						return false;
					  }
				  break;
				  case "budget_ws":
				    if (tot_el[i].value=="" || isNaN(parseInt(tot_el[i].value)))
					  {
						alert ('Il campo "Budget Web Services" è obbligatorio e deve essere numerico.');
						tot_el[i].focus();
						return false;
					  }
				  break;
				  case "budget_wm":
				    if (tot_el[i].value=="" || isNaN(parseInt(tot_el[i].value)))
					  {				  
						alert ('Il campo "Bugdet Web Marketing" è obbligatorio e deve essere numerico.');
						tot_el[i].focus();
						return false;
					  }
				  break;							  
				  default:
				  break;
				}
			}
		  else if (tot_el[i].tagName.toLowerCase()=="input" && tot_el[i].type.toLowerCase()=="checkbox")
		    {
			  if (tot_el[i].id=="privacy_ok")
			    {
				  if (!tot_el[i].checked)
				    {
					  alert ('Per richiedere il preventivo, è necessario dare il proprio consenso al trattamento dei dati personali.');
					  tot_el[i].focus();
					  return false;						
					}	
				}
			}
		}
	  return checkform();	
	}
  function checkFocus(el)
    {
	  el.className='campotesto_active';
	}
  function checkBlur(el)
    {
	  el.className='campotesto';
	}		
