function resetform() {
  document.InsertGbook.elements[11]="";
}

function submitForms() {
  if (iscy() && iscog() && isnm() && ismail() && ispw() && ismsg())
  if (confirm("\n La tua firma č pronta per essere inviata. \n\nOK per inviare.    Annulla per annullare."))
  {
    return true;
  }
  else
  {
    alert("\n Hai scelto di annullare l'invio della firma!!!?.");
    return false
  }
  else 
  return false;
}

// controllo sulla cittā
function iscy(){
  var str = document.InsertGbook.elements[4].value;
  if (str == "") {
	alert("\n Il campo della Cittā č vuoto. \n\nPrego inserisci la tua Cittā, grazie!!")
	document.InsertGbook.elements[4].focus();
	return false;
  }
  for (var i = 0; i < str.length; i++) {
	var ch = str.substring(i, i + 1);
	if ((ch < "A" || "Z" < ch)&&(ch < "a" || "z" < ch)&&(ch != " ")&&(ch != "\(")&&(ch != "\)")) {
	  alert("\nControlla che il campo della Cittā sia stato inserito correttamente e \nverifica che non contenga caratteri diversi da lettere.\n\nPer favore inserisci di nuovo la tua Cittā");
	  document.InsertGbook.elements[4].select();
	  document.InsertGbook.elements[4].focus();
	  return false;
	}
  }
 return true;
}

// controllo sul cognome
function iscog() {
	var str = document.InsertGbook.elements[5].value;
   if (str == "")
      {
      alert("\n Il campo del cognome č vuoto. \n\n Prego inserisci il tuo cognome, grazie!!")
      document.InsertGbook.elements[5].focus();
      return false;
      }
   for (var i = 0; i < str.length; i++) 
      {
      var ch = str.substring(i, i + 1);
      if ((ch < "A" || "Z" < ch)&&(ch < "a" || "z" < ch)&&(ch != " "))
         {
         alert("\nControlla che il campo del cognome sia stato inserito correttamente e \nverifica che non contenga caratteri diversi da lettere.\n\nPer favore inserisci di nuovo il cognome");
         document.InsertGbook.elements[5].select();
         document.InsertGbook.elements[5].focus();
         return false;
         } }
   return true;
   }
   
// controllo sul nome
function isnm() {
	var str = document.InsertGbook.elements[6].value;
   if (str == "")
      {
      alert("\n Il campo del nome č vuoto. \n\n Prego inserisci il tuo nome, grazie!!")
      document.InsertGbook.elements[6].focus();
      return false;
      }
   for (var i = 0; i < str.length; i++) 
      {
      var ch = str.substring(i, i + 1);
      if ((ch < "A" || "Z" < ch)&&(ch < "a" || "z" < ch)&&(ch != " "))
         {
         alert("\nControlla che il campo del nome sia stato inserito correttamente e \nverifica che non contenga caratteri diversi da lettere.\n\nPer favore inserisci di nuovo il nome");
         document.InsertGbook.elements[6].select();
         document.InsertGbook.elements[6].focus();
         return false;
         } }
   return true;
   }

// controllo sulla e-mail
function ismail() {
if (document.InsertGbook.elements[7].value == '') {
alert ("\n Il campo E-Mail č vuoto! \n\n Prego inserisci la tua E-Mail, grazie!!")
document.InsertGbook.elements[7].focus();
return false;
}
if (document.InsertGbook.elements[7].value.indexOf ('@',0) == -1 ||
document.InsertGbook.elements[7].value.indexOf ('.',0) == -1) {
alert ("\n L'indirizzo di E-Mail contiene un errore!!! \n\nPrego reinserisci la tua e-m@il, grazie!!")
document.InsertGbook.elements[7].select();
document.InsertGbook.elements[7].focus();
return false;
}
return true;
}

// controllo sul campo pagina web
function ispw() {
if (document.InsertGbook.elements[8].value == "") {
alert ("\n Non hai inserito il tuo sito in maniera esatta!! \n\nPrego inseriscilo con 'http://' prima dell'indirizzo! \n\n Se non hai un sito lascia la scritta 'http://', grazie!!")
document.InsertGbook.elements[8].focus();
return false;
}
return true;
}

// controllo sul campo messaggio
function ismsg() {
if (document.InsertGbook.elements[10].value == "") {
alert ("\n Il campo 'messaggio' č vuoto. \n\nPrego inserisci un messaggio, grazie!! \n\n Se non vuoi inserire del testo \n inserisci la dicitura 'NO TEXT', grazie!!")
document.InsertGbook.elements[10].focus();
return false;
}
return true;
}

