<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function valida_email() {
if (Emailvalid())
return true;
else
return false;
}
function Emailvalid() {
if (document.form1.email.value == "") {
alert ("\nThe email address you have entered is not valid!")
document.form1.email.focus();
return false;
}
if (document.form1.email.value.indexOf ('@',0) == -1 ||
document.form1.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!")
document.form1.email.select();
document.form1.email.focus();
return false;
}
return true;
}

function controllaform(form,tipoform) {
if (valida_form(form,tipoform))
return true;
else
return false;
}


function valida_form(form,tipoform) {
if (form.nickname.value == "") {
alert ("\nYou forgot to indicate > your name");
form.nickname.focus();
return false;
}
if (form.email.value == "") {
alert ("\nYou forgot to indicate > your email address");
form.email.focus();
return false;
}

if (form.email.value.indexOf ('@',0) == -1 || form.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!");
form.email.focus();
return false;
}

if (form.citta.value == "") {
alert ("\nYou forgot to indicate > your city");
form.citta.focus();
return false;
}
if (form.nazione.value == "") {
alert ("\nYou forgot to indicate > your country");
form.nazione.focus();
return false;
}
if (form.subject.value == "" && tipoform == "nuovo") {
alert ("\nYou forgot to indicate > subject");
form.subject.focus();
return false;
}

if (form.message.value == "") {
alert ("\nYou forgot to indicate > your message");
form.message.focus();
return false;
}

return true;
}


function controllaformracconto(form) {
if (valida_form_racconto(form))
return true;
else
return false;
}

function controllaformfoto(form) {
if (valida_form_foto(form))
return true;
else
return false;
}


function controllaformnewsletter(form,tipoform) {
if (valida_form_newsletter(form,tipoform))
return true;
else
return false;
}


function controllaformnewsletter_canc(form,tipoform) {
if (valida_form_newsletter_canc(form,tipoform))
return true;
else
return false;
}

function valida_form_newsletter_canc(form,tipoform) {

if (form.email.value == "") {
alert ("\nYou forgot to indicate > your email address");
form.email.focus();
return false;
}

if (form.email.value.indexOf ('@',0) == -1 || form.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!");
form.email.focus();
return false;
}

return true;
}

function valida_form_foto(form) {

if (form.nome.value == "") {
alert ("\nYou forgot to indicate > your name");
form.nome.focus();
return false;
}

if (form.cognome.value == "") {
alert ("\nYou forgot to indicate > your surname");
form.cognome.focus();
return false;
}

if (form.email.value == "") {
alert ("\nYou forgot to indicate > your email address");
form.email.focus();
return false;
}

if (form.email.value.indexOf ('@',0) == -1 || form.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!");
form.email.focus();
return false;
}
if (form.eta.value == "") {
alert ("\nYou forgot to indicate > your age");
form.eta.focus();
return false;
}

if (form.nazione.value == "") {
alert ("\nYou forgot to indicate > your country");
form.nazione.focus();
return false;
}

if (form.citta.value == "") {
alert ("\nYou forgot to indicate > your city");
form.citta.focus();
return false;
}

if (form.provincia.value == "") {
alert ("\nYou forgot to indicate > your province");
form.provincia.focus();
return false;
}

if (form.date.value == "") {
alert ("\nYou forgot to indicate > the date");
form.provincia.focus();
return false;
}

if (form.date.value.indexOf ('/',0) == -1) {
alert ("\nThe date you have entered is not valid!");
form.date.focus();
return false;
}

if (form.allegato.value == "") {
alert ("\nYou forgot to indicate > your photos");
form.allegato.focus();
return false;
}

if (form.note.value == "") {
alert ("\nYou forgot to indicate > your notes");
form.note.focus();
return false;
}

return true;
}

function valida_form_racconto(form) {

if (form.nome.value == "") {
alert ("\nYou forgot to indicate > your name");
form.nome.focus();
return false;
}

if (form.cognome.value == "") {
alert ("\nYou forgot to indicate > your surname");
form.cognome.focus();
return false;
}

if (form.email.value == "") {
alert ("\nYou forgot to indicate > your email address");
form.email.focus();
return false;
}

if (form.email.value.indexOf ('@',0) == -1 || form.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!");
form.email.focus();
return false;
}
if (form.eta.value == "") {
alert ("\nYou forgot to indicate > your age");
form.eta.focus();
return false;
}

if (form.nazione.value == "") {
alert ("\nYou forgot to indicate > your country");
form.nazione.focus();
return false;
}

if (form.citta.value == "") {
alert ("\nYou forgot to indicate > your city");
form.citta.focus();
return false;
}

if (form.provincia.value == "") {
alert ("\nYou forgot to indicate > your province");
form.provincia.focus();
return false;
}

if (form.testo.value == "") {
alert ("\nYou forgot to indicate > your text");
form.testo.focus();
return false;
}

return true;
}

function valida_form_newsletter(form,tipoform) {

if (form.antiflood.value == "") {
	alert ("\nInsert the confirmation code.")
	form.antiflood.focus();
	return false;
}

if (form.email.value == "") {
alert ("\nYou forgot to indicate > your email address");
form.email.focus();
return false;
}

if (form.email.value.indexOf ('@',0) == -1 || form.email.value.indexOf ('.',0) == -1) {
alert ("\nThe email address you have entered is not valid!");
form.email.focus();
return false;
}

if (form.eta.value == "") {
alert ("\nYou forgot to indicate > your age");
form.eta.focus();
return false;
}

if (form.nazione.value == "") {
alert ("\nYou forgot to indicate > your country");
form.nazione.focus();
return false;
}

if (form.citta.value == "") {
alert ("\nYou forgot to indicate > your city");
form.citta.focus();
return false;
}

if (form.provincia.value == "") {
alert ("\nYou forgot to indicate > your province");
form.provincia.focus();
return false;
}

return true;
}

function calcola_s(val,max) {
if (val.value.length > max) {
val.value = val.value.substring(0,max);
rest = 0;
alert ("The text is over the  "+max+" characters allowed.");
} else {
rest = max - val.value.length;
}
}

function calcola(val,max) {
if (val.value.length > max) {
val.value = val.value.substring(0,max);
rest = 0;
form.conta.value = rest;
alert ("The text is over the  "+max+" characters allowed.");
} else {
rest = max - val.value.length;
form.conta.value = rest;
}
}

//-->