﻿

<!-- 	/*controllo form*/	
function convalida(){
	var erroremsg="";
	frm = document.forms['contatti'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.Nome.value  == ""){
		erroremsg = erroremsg + "* nome" + "\n";
	}
	
	if (frm.Cognome.value  == ""){
		erroremsg = erroremsg + "* cognome" + "\n";
	}

	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}
	
	if (frm.Commenti.value  == ""){
		erroremsg = erroremsg + "* Note" + "\n";
	}		
	
	if (frm.privacy[1].checked || !frm.privacy[0].checked) {
		erroremsg = erroremsg + "* Informativa sulla privacy" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->


<!-- metodo links
function intercetta() {
    for (var i=0; i<document.links.length; i++)
        if (document.links[i].className=="blank" | document.links[i].className=="menuSecondoLivello_blank" | document.links[i].className=="generaleBlank") {
            document.links[i].target="_blank";
        }
}
window.onload = intercetta;
//-->


<!-- segnala ad un'amica
function validate()
{
	if (document.segnalaAdUnAmica.eaddress.value=="")
	{
		alert("Inserisci un indirizzo e-mail");
		document.segnalaAdUnAmica.eaddress.focus();
		return false;
	}
	return true;
}
function mailThisUrl()
{
	if (validate())
	{
		mail = "mailto:" + document.segnalaAdUnAmica.eaddress.value + '';
		mail += "?subject=Questo sito potrebbe interessarti!&body=" + "Visita http://www.menoflavon.it, troverai informazioni che possono esserti utili.";
		location.href = mail;
	}
}

//-->


<!-- contatti

function ControllaInfo()
{		
	var erroremsg="";
	frm = document.forms['info'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;
	
	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->



<!-- 	/*controllo FORM DEM **************  */	
function convalida(){
	var erroremsg="";
	frm = document.forms['dem'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.Nome.value  == ""){
		erroremsg = erroremsg + "* Nome" + "\n";
	}
	
	if (frm.Cognome.value  == ""){
		erroremsg = erroremsg + "* Cognome" + "\n";
	}
	
	/*if (frm.Professione.value  == ""){
		erroremsg = erroremsg + "* Professione" + "\n";
	}*/
	
	if (frm.Provincia.value  == ""){
		erroremsg = erroremsg + "* Provincia" + "\n";
	}
	
	if (frm.Citta.value  == ""){
		erroremsg = erroremsg + "* Città" + "\n";
	}
	
	if (frm.Indirizzo.value  == ""){
		erroremsg = erroremsg + "* Indirizzo" + "\n";
	}
	
	if (frm.Cap.value  == ""){
		erroremsg = erroremsg + "* Cap" + "\n";
	}
	
	if (frm.Telefono.value  == ""){
		erroremsg = erroremsg + "* Telefono" + "\n";
	}
	
	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}	
	
	/*if (frm.Note.value  == ""){
		erroremsg = erroremsg + "* Note" + "\n";
	}*/		
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}

function betterMo() {
	if (confirm("Sei sicuro di voler cancellare tutti i campi della form?")) {
	document.dem.reset();
	}
}


//-->


