function anno_c(){
	var today2 = new Date();
	var year2=today2.getFullYear();
	if (year2>1993){
		document.write("1993-"+year2)
	} else {
		document.write(year2)
	}
}

function validEmail(mail) {

		invalidChars = " /:,;"			
		for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
				badChar = invalidChars.charAt(i)
				if (mail.indexOf(badChar,0) > -1) {
				return false
				}
		}
		atPos = mail.indexOf("@",1)			// there must be one "@" symbol
		if (atPos == -1) {
			return false
		}
		if (mail.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
			return false
		}
		periodPos = mail.indexOf(".",atPos)
		if (periodPos == -1) {					// and at least one "." after the "@"
			return false
		}
		if (periodPos+3 > mail.length)	{		// must be at least 2 characters after the "."
			return false
		}
		return true
}

function controlla(nomeForm) {
	var nome = nomeForm.elements["nome"].value;
	var cognome = nomeForm.elements["cognome"].value;
	var citta = nomeForm.elements["citta"].value;
	var indirizzo = nomeForm.elements["indirizzo"].value;
	var email = nomeForm.elements["email"].value;
	var note = nomeForm.elements["note"].value;
	
	if (nome.length < 1) {
		alert("Attenzione, inserire il nome");
		return false;
	}
	if (cognome.length < 1) {
		alert("Attenzione, inserire il cognome");
		return false;
	}
	if (citta.length < 1) {
		alert("Attenzione, inserire la cittą");
		return false;
	}
	if (indirizzo.length < 1) {
		alert("Attenzione, inserire l'indirizzo");
		return false;
	}
	if (!validEmail(nomeForm.email.value)) {
		alert("Attenzione, inserire una email valida");
		return false;
	}
	if (note.length < 1) {
		alert("Attenzione, inserire il messaggio");
		return false;
	}
	else {
		return true;
	}	
}

function popupprodotti(d,id)
{
	window.open(eval("'popupprodotti.asp?dove="+d+"&id="+id+"'"),'prodotti','scrollbars=yes,resizable=no,width=600,height=600,menubar=no,status=no,location=no,toolbar= no');
}

var bookmarkurl="http://www.aloeveraitalia.eu"
var bookmarktitle="ALOE VERA ITALIA"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

	function openNewWin(direct,width,height,scr) {
	     thisString ="width="+width+",height="+height+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scr+",resizable=no,copyhistory=yes";
	     OptionDetail = window.open(direct,'Dir',thisString);
	//    OptionDetail.focus();
	     if ((navigator.userAgent.indexOf("Mozilla/3.")>=0)||(navigator.userAgent.indexOf("Mozilla/4.") >=0))
	     {
	          OptionDetail.focus();
	     }
	}



