function verEmail(stringa) {
   if (stringa.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
   return true;
   else return false;
}

function controllo(f) {
var msgErrore = '';
var user=f.user;
var pass=f.pass;

if (user.value == "")
	{ msgErrore+="- Username è obbligatorio.\r"; }
else
	{
	if ((user.value.replace(/\s*/gi,'') == '') || (user.value.replace(/\x13\x10*/gi,'') == ''))
	{ msgErrore+="- Username è obbligatorio e non può essere vuoto.\r"; }
	}

if (pass.value == "")
	{ msgErrore+="- Password è obbligatorio.\r"; }
else
	{
	if ((pass.value.replace(/\s*/gi,'') == '') || (pass.value.replace(/\x13\x10*/gi,'') == ''))
	{ msgErrore+="- Password è obbligatorio e non può essere vuoto.\r"; }
	}

if (msgErrore != '')
	{
	msgErrore = "Si sono verificati i seguenti errori:\r\r" + msgErrore;
	alert(msgErrore);
	return false;
	}
return true;
}
