
	var a;
    a=0;
	
 function controllo()
			
			{
			val="";

			if(document.ThisForm.cognome.value=="")
				{
				val=val + "cognome,";
				}
			if(document.ThisForm.nome.value=="")
				{
				val=val+" nome,";
				}
			if(document.ThisForm.inputfile.value=="")
				{
				val=val+" curriculum,";
				}
   	  if(document.ThisForm.email.value=="")
				{
				val=val + "e-mail";
				}
			
			if(val!="")
				{
				a=a+1;
				alert("I campi da riempire sono: "+val);
				return
				}
	    else
	      {
	      a=0
	      } 
			}
			
			function controllo2()
			
			{
			val="";
      	if(document.ThisForm.nome.value=="")
				{
				val=val+" nome,";
				}
			if(document.ThisForm.cognome.value=="")
				{
				val=val + "cognome,";
				}
		
			if(document.ThisForm.messaggio.value=="")
				{
				val=val+" messaggio,";
				}
   	  if(document.ThisForm.email.value=="")
				{
				val=val + "e-mail";
				}
			
			if(val!="")
				{
				a=a+1;
				alert("I campi da riempire sono: "+val);
				return
				}
	    else
	      {
	      a=0
	      } 
			}

	
/*	function telefono()
		
		{ 

		if(document.ThisForm.tel.value=="")
			{ 
			a=a+1
			return
			}
		else
			{
	    a=0
			conta= document.ThisForm.tel.value.length;
	
				if(conta<5 ||isNaN(document.ThisForm.tel.value))
					{
					a=a+1 
					alert("Inserisci correttamente il numero di telefono")
					}
			}
		}

	function cellulare()

		{ 

		if(document.ThisForm.cell.value=="")
			{ 
			a=a+1
			return
			}
		else
			{a=0
			conta= document.ThisForm.cell.value.length;
	
				if(conta<5 ||isNaN(document.ThisForm.cell.value))
				
					{ 
					a=a+1
					alert("Inserisci correttamente il numero di cellulare")
					}
			}
		}
*/
	function verifica()
			{
		
			if(document.ThisForm.email.value=="")
				{
				return
				}		
			pospunto=1;
			poschiocciola=0;
			mailinserita=document.ThisForm.email.value;
			poschiocciola=mailinserita.indexOf("@");
			pospunto=mailinserita.lastIndexOf(".");
			conta= document.ThisForm.email.value.length;
			p=conta-pospunto;
			if(poschiocciola<=0 || pospunto<poschiocciola || p<=1)
				{a=a+1
				alert("mail non conforme");
				document.ThisForm.email.focus();
				return
				}
			
			}

	function tutto()
		
		{
		controllo()
		verifica()
	//	telefono()
	//	cellulare()
		if (a==0){
		document.ThisForm.submit()
	  }
	  }
	
		function tutto2()
		
		{
		controllo2()
		verifica()
	//	telefono()
	//	cellulare()
		if (a==0){
		document.ThisForm.submit()
	  }
	  }	
		

		
		//
		
		
	


