function checkForm(frm)
{
	var nome = document.getElementById('name');
	var email = document.getElementById('email');
	var message = document.getElementById('message');
	var filtro_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	
	if (nome && nome.value == '') {
		nome.focus();
		alert('Inserisci Nome e Cognome!');
		
		return false;
	}
	
	if (email && email.value == '') {
		email.focus();
		alert('Inserisci il tuo indirizzo e-mail!');
		
		return false;
	} else if (email && !filtro_mail.test(email.value)) {
		email.focus();
		alert('Inserisci un indirizzo e-mail valido!');
		
		return false;
	}
	
	if (message && message.value == '') {
		message.focus();
		alert('Inserisci un messaggio da inviare!');
		
		return false;
	}
	
	return true;
}

function checkLogin(frm)
{
	var email = frm.elements['username'];
	var password = frm.elements['password'];
	var filtro_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	
	if (email && email.value == '') {
		email.focus();
		alert('Inserisci il tuo indirizzo e-mail!');
		
		return false;
	} else if (email && !filtro_mail.test(email.value)) {
		email.focus();
		alert('Inserisci un indirizzo e-mail valido!');
		
		return false;
	}
	
	if (password && password.value == '') {
		password.focus();
		alert('Inserisci la tua password!');
		
		return false;
	}
	
	return true;
}