function checkFormContatti() {

	var f = document.frm;

	txt = f.email.value;

	if (f.nome.value.length < 1) {
		alert("Inserisci il nome!"); f.nome.focus(); return false;
	}
	if (f.cognome.value.length < 1) {
		alert("Inserisci il cognome!"); f.cognome.focus(); return false;
	}
	if (f.tel.value.length < 1) {
		alert("Inserisci il numero di telefono!"); f.tel.focus(); return false;
	}

	if (txt != "")
	{
		if (txt.indexOf("@") < 2)
		{
			alert("L'indirizzo e-mail potrebbe non essere corretto. Riprovare controllando la \'@\'.");
			document.forms[0].email.focus();
			return false;
		} else {
			if (!((txt.lastIndexOf(".") >= (txt.length -4))&&(txt.lastIndexOf(".") < (txt.length -2))))
			{
				alert("L'indirizzo e-mail potrebbe essere non corretto. Riprovare controllando il suffisso");
				document.forms[0].email.focus();
				return false;
			}
		}
	} else {
		alert("Inserisci l'email!");
		return false;
	}

}

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") == "external")
			anchor.target = "_blank";
	}
}

window.onload = externalLinks;
