function validateFormReg(user_form){

	Filtro_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

	if(user_form.txtNome.value.length < 2){
		alert("Inserisci il nome");
		user_form.txtNome.focus();
		return false;
	}
	if (!Filtro_email.test(user_form.txtEmail.value)){
		alert("Inserisci un indirizzo e-mail valido");
		user_form.txtEmail.focus();
		return false;
	}	
	if(user_form.txtMsg.value.length < 5){
		alert("Inserisci un messaggio");
		user_form.txtMsg.focus();
		return false;
	}
					
	return true;
}

function validateFormPre(user_form){

	Filtro_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

	if(user_form.txtNome.value.length < 2){
		alert("Inserisci il nome");
		user_form.txtNome.focus();
		return false;
	}
	if(user_form.txtCogn.value.length < 2){
		alert("Inserisci il cognome");
		user_form.txtCogn.focus();
		return false;
	}
	if (!Filtro_email.test(user_form.txtEmail.value)){
		alert("Inserisci un indirizzo e-mail valido");
		user_form.txtEmail.focus();
		return false;
	}
					
	return true;
}

function externalLinks() {
	if (!document.getElementsByTagName) 
		return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "ext")
			anchor.target = "_blank";
	}
}

window.onload = externalLinks;