function ValidaEmail(stringa)
{ 

  var carrattere=""
  var testo =0
  var vannobene = "abcdefghijklmnopqrstuvwxyz_@.ABCDEFGHIJKLMNOPQRSTUVWXYZƒŠŒšœŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789";
  var checkStr = stringa;
  var aposto = true;
  var chiocciola = 0
  var punto = 0
  for (i = 0;  i < checkStr.length;  i++)
	{
	    carattere = checkStr.charAt(i);
	    for (j = 0;  j < vannobene.length;  j++)
	      {
		if (carattere == vannobene.charAt(j))
		{
		  if (carattere=="@")
		     {
			if (testo==0)
				aposto=false;
			chiocciola = chiocciola +1;
			testo = -1;
		     }

		  if (carattere==".")
		     {
			if (testo==0)
			aposto=false;
			punto= punto +1
			testo = -1;
		     }
			testo = testo + 1;
		  break;
		}

		if (j == vannobene.length)
		    {
		      aposto = false;
		      break;
		    }
	       }
	  }
if (!aposto || chiocciola !=1 || punto ==0 || testo < 2 || testo >3 )
   {
	return (false);
   }
return (true);
}

