<!--
/*
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
' Copyright (C) 2006/2008 Mariano Di Maria.
' Tutti i diritti riservati.
' http://www.elabografica.com  -  Email: info@elabografica.com
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
	
'-------------------------------------------------------
' NOME:			supporto.js
'
' DESCRIZIONE:	Client side scripts
' DATA:			28/04/2008
'-------------------------------------------------------
*/

//  mappa regioni

function Regione(value) {
 document.Regioni.Regione.value=value;
}
// -->


// Gestore focus su textbox
function FocusTextBox(OBJ,BACKGROUND,TESTO){
	//Se IE5+ o NS6+
	if (document.documentElement){
		OBJ.style.backgroundColor=BACKGROUND;
		OBJ.style.color=TESTO;
	}
}
//-->

// CHIUDE LA FINESTRA

<!--

function winclose(URL){
	var wind;
	wind = window.close(URL);
					}	

// -->


// Pop-Up

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

// AGGIUNGE AI PREFERITI PER IE E FF
<!--
function addbookmark(){
if (window.sidebar) {
    // versione FF
    window.sidebar.addPanel(document.title, location.href,'');
} else if( window.external ) {
    // versione IE
    window.external.AddFavorite( location.href, document.title);
}
}
//-->

// MESSAGGIO POPUP
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


// CONTROLLA LA COMPILAZIONE DEI CAMPI DEL FORM DI ADESIONE
function risultatof(adesione)
{


// Crea le variabili
var campo1	= document.adesione.Nome
var campo2	= document.adesione.Cognome
var campo3	= document.adesione.Ragione_Sociale
var campo4	= document.adesione.Piva
var campo5	= document.adesione.Indirizzo
var campo6	= document.adesione.Citta
var campo7	= document.adesione.Provincia
var campo8	= document.adesione.CAP
var campo9	= document.adesione.email
var campo10 = document.adesione.Telefono
var campo11 = document.adesione.Contratto
var campo12 = document.adesione.Categoria
var campo13 = document.adesione.Testo




//// campo1 = document.adesione.Nome -----------------------------------------------

  
  if (campo1.value == "")
  {
    alert("Inserire il Nome\.");
    campo1.focus();
    return (false);
  }

  if (campo1.value.length < 4)
  {
    alert("Compilare correttamente il campo Nome\.");
    campo1.focus();
    return (false);
  }

//// campo2 = document.adesione.Cognome -----------------------------------------------

  //if (document.adesione.Nome.value == "")
  
  if (campo2.value == "")
  {
    alert("Inserire il Cognome\.");
    campo2.focus();
    return (false);
  }

  if (campo1.value.length < 4)
  {
    alert("Compilare correttamente il campo Cognome\.");
    campo2.focus();
    return (false);
  }

//// campo3 = document.adesione.Ragione_Sociale -------------------------------------
  
    if (campo3.value == "")
  {
    alert("Inserire la ragione sociale\.");
    campo3.focus();
    return (false);
  }

  if (campo3.value.length < 3)
  {
    alert("Compilare correttamente il campo ragione sociale\.");
    campo3.focus();
    return (false);
  }


//// campo4 = document.adesione.Piva -------------------------------------
  
    if (campo4.value == "")
  {
    alert("Inserire la partita IVA o il Codice Fiscale\.");
    campo4.focus();
    return (false);
  }

  if (campo4.value.length < 11)
  {
    alert("Compilare correttamente il campo Partita Iva/C.F.\.");
    campo4.focus();
    return (false);
  }


//// campo5 = document.adesione.Indirizzo -------------------------------------
  
    if (campo5.value == "")
  {
    alert("Inserire l'indirizzo\.");
    campo5.focus();
    return (false);
  }

  if (campo5.value.length < 4)
  {
    alert("Compilare correttamente l'indirizzo\.");
    campo5.focus();
    return (false);
  }

//// campo6 = document.adesione.Citta -------------------------------------
  
    if (campo6.value == "")
  {
    alert("Inserire la città\.");
    campo6.focus();
    return (false);
  }

  if (campo6.value.length < 2)
  {
    alert("Compilare correttamente il campo Città\.");
    campo6.focus();
    return (false);
  }

//// campo7 = document.adesione.Provincia -------------------------------------
  
    if (campo7.value == "")
  {
    alert("Inserire la sigla della provincia\.");
    campo7.focus();
    return (false);
  }

  if (campo7.value.length < 2)
  {
    alert("Compilare correttamente il campo provincia\.");
    campo7.focus();
    return (false);
  }

//// campo8 = document.adesione.CAP -------------------------------------
  
    if (campo8.value == "")
  {
    alert("Inserire il CAP\.");
    campo8.focus();
    return (false);
  }

  if (campo8.value.length < 4)
  {
    alert("Compilare correttamente il campo CAP\.");
    campo8.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = campo8.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("I dati inseriti nel campo non sono validi\.");
    campo8.focus();
    return (false);
  }

//// campo9 = document.adesione.email ----------------------------------------

    if (campo9.value == "")
  {
    alert("Inserire la tua E-mail\.");
    campo9.focus();
    return (false);
  }

  if (campo9.value.length < 5)
  {
    alert("Compilare correttamente il campo E-mail\.");
    campo9.focus();
    return (false);
  }


  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@_-?!&.";
  var checkStr = campo9.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Compilare correttamente i dati nel campo\.");
    campo9.focus();
    return (false);
  }


//// campo10 = document.adesione.Telefono --------------------------------------------
  
   if (campo10.value == "")
  {
    alert("Inserire il numero di telefono\.");
   campo10.focus();
    return (false);
  }

  if (campo10.value.length < 6)
  {
    alert("Compilare correttamente il numero telefonico\.");
    campo10.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = campo10.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Inserire prefisso e numero di telefono senza spazi\.");
    campo10.focus();
    return (false);
  }
  
//// campo11 = document.adesione.Contratto -----------------------------------------------

  

	if ((campo11.value) == (campo11.value.checked))// {campo11=true}

  // if (campo11.value || checked)
  {
    alert("ATTENZIONE! Devi accettare il contratto per poter aderire\.");
    campo11.focus();
    return (false);
  }

//// campo12 = document.adesione.Categoria -----------------------------------------------

  
  if (campo12.value == "")
  {
    alert("ATTENZIONE! Devi selezionare la categoria\.");
    campo12.focus();
    return (false);
  }


//// campo13 = document.adesione.Testo -------------------------------------
  
    if (campo13.value == "")
  {
    alert("Devi inserire la descrizione per l annuncio\.");
    campo13.focus();
    return (false);
  }

  if (campo13.value.length > 136)
  {
    alert("ATTENZIONE! Il testo supera i 180 caratteri spazi inclusi\.");
    campo13.focus();
    return (false);
  }
  

  return (true);
}  



// FORM 1  Vuoi affittare/Vendere il tuo immobile?



function FrontPage_Form1_Validator(theForm)

{



  if (theForm.nome_cognome.value == "")

  {

    alert("Inserire un valore per il campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value == "")

  {

    alert("Inserire un valore per il campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.via.value == "")

  {

    alert("Inserire un valore per il campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.via.value.length < 3)

  {

    alert("Inserire almeno 3 caratteri nel campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.via.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.provincia.value == "")

  {

    alert("Inserire un valore per il campo \"provincia\".");

    theForm.provincia.focus();

    return (false);

  }



  if (theForm.provincia.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"provincia\".");

    theForm.provincia.focus();

    return (false);

  }



  if (theForm.telefono.value == "")

  {

    alert("Inserire un valore per il campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length > 20)

  {

    alert("Inserire al massimo 20 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefonomobile.value == "")

  {

    alert("Inserire un valore per il campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length > 15)

  {

    alert("Inserire al massimo 15 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.email.value == "")

  {

    alert("Inserire un valore per il campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.tipo_immobile.selectedIndex < 0)

  {

    alert("Selezionare una delle opzioni di \"tipo_immobile\".");

    theForm.tipo_immobile.focus();

    return (false);

  }



  if (theForm.tipo_immobile.selectedIndex == 0)

  {

    alert("La prima opzione di \"tipo_immobile\" non è una selezione valida. Scegliere un'altra opzione.");

    theForm.tipo_immobile.focus();

    return (false);

  }



  if (theForm.tipo_transazione.selectedIndex < 0)

  {

    alert("Selezionare una delle opzioni di \"tipo_transazione\".");

    theForm.tipo_transazione.focus();

    return (false);

  }



  if (theForm.mq.value == "")

  {

    alert("Inserire un valore per il campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.mq.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.mq.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.vani.value == "")

  {

    alert("Inserire un valore per il campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.vani.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.vani.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value == "")

  {

    alert("Inserire un valore per il campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value == "")

  {

    alert("Inserire un valore per il campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.bagni.value == "")

  {

    alert("Inserire un valore per il campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.bagni.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.bagni.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.piano.selectedIndex < 0)

  {

    alert("Selezionare una delle opzioni di \"piano\".");

    theForm.piano.focus();

    return (false);

  }



  var radioSelected = false;

  for (i = 0;  i < theForm.vistamare.length;  i++)

  {

    if (theForm.vistamare[i].checked)

        radioSelected = true;

  }

  if (!radioSelected)

  {

    alert("Selezionare una delle opzioni di \"vistamare\".");

    return (false);

  }



  if (theForm.distanza_dal_mare.value == "")

  {

    alert("Inserire un valore per il campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }



  if (theForm.distanza_dal_mare.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }



  if (theForm.distanza_dal_mare.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }



  var radioSelected = false;

  for (i = 0;  i < theForm.giardino.length;  i++)

  {

    if (theForm.giardino[i].checked)

        radioSelected = true;

  }

  if (!radioSelected)

  {

    alert("Selezionare una delle opzioni di \"giardino\".");

    return (false);

  }



  var radioSelected = false;

  for (i = 0;  i < theForm.terrazzo.length;  i++)

  {

    if (theForm.terrazzo[i].checked)

        radioSelected = true;

  }

  if (!radioSelected)

  {

    alert("Selezionare una delle opzioni di \"terrazzo\".");

    return (false);

  }



  var radioSelected = false;

  for (i = 0;  i < theForm.arredato.length;  i++)

  {

    if (theForm.arredato[i].checked)

        radioSelected = true;

  }

  if (!radioSelected)

  {

    alert("Selezionare una delle opzioni di \"arredato\".");

    return (false);

  }



  var radioSelected = false;

  for (i = 0;  i < theForm.lavatrice.length;  i++)

  {

    if (theForm.lavatrice[i].checked)

        radioSelected = true;

  }

  if (!radioSelected)

  {

    alert("Selezionare una delle opzioni di \"lavatrice\".");

    return (false);

  }



  if (theForm.descrizioneitaliano.value == "")

  {

    alert("Inserire un valore per il campo \"descrizioneitaliano\".");

    theForm.descrizioneitaliano.focus();

    return (false);

  }

  return (true);

}

//-->

// FORM 2

function FrontPage_Form2_Validator(theForm)

{



  if (theForm.cerco.value == "")

  {

    alert("Inserire un valore per il campo \"cerco\".");

    theForm.cerco.focus();

    return (false);

  }



  if (theForm.cerco.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"cerco\".");

    theForm.cerco.focus();

    return (false);

  }



  if (theForm.cerco.value.length > 100)

  {

    alert("Inserire al massimo 100 caratteri nel campo \"cerco\".");

    theForm.cerco.focus();

    return (false);

  }



  if (theForm.in_quale_localita.value == "")

  {

    alert("Inserire un valore per il campo \"in_quale_localita\".");

    theForm.in_quale_localita.focus();

    return (false);

  }



  if (theForm.in_quale_localita.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"in_quale_localita\".");

    theForm.in_quale_localita.focus();

    return (false);

  }



  if (theForm.in_quale_localita.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"in_quale_localita\".");

    theForm.in_quale_localita.focus();

    return (false);

  }



  if (theForm.Prezzo_max.value == "")

  {

    alert("Inserire un valore per il campo \"Prezzo_max\".");

    theForm.Prezzo_max.focus();

    return (false);

  }



  if (theForm.Prezzo_max.value.length < 3)

  {

    alert("Inserire almeno 3 caratteri nel campo \"Prezzo_max\".");

    theForm.Prezzo_max.focus();

    return (false);

  }



  if (theForm.Prezzo_max.value.length > 100)

  {

    alert("Inserire al massimo 100 caratteri nel campo \"Prezzo_max\".");

    theForm.Prezzo_max.focus();

    return (false);

  }



  if (theForm.Mittente.value == "")

  {

    alert("Inserire un valore per il campo \"Mittente\".");

    theForm.Mittente.focus();

    return (false);

  }



  if (theForm.Mittente.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"Mittente\".");

    theForm.Mittente.focus();

    return (false);

  }



  if (theForm.Mittente.value.length > 100)

  {

    alert("Inserire al massimo 100 caratteri nel campo \"Mittente\".");

    theForm.Mittente.focus();

    return (false);

  }



  if (theForm.telefono.value == "")

  {

    alert("Inserire un valore per il campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length > 15)

  {

    alert("Inserire al massimo 15 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.e_mail.value == "")

  {

    alert("Inserire un valore per il campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }



  if (theForm.e_mail.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }



  if (theForm.e_mail.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }

  return (true);

}

//-->

// FORM 3

function FrontPage_Form3_Validator(theForm)

{



  if (theForm.nome_cognome.value == "")

  {

    alert("Inserire un valore per il campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value == "")

  {

    alert("Inserire un valore per il campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.ubicazione_luogo.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"ubicazione_luogo\".");

    theForm.ubicazione_luogo.focus();

    return (false);

  }



  if (theForm.via.value == "")

  {

    alert("Inserire un valore per il campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.via.value.length < 3)

  {

    alert("Inserire almeno 3 caratteri nel campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.via.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"via\".");

    theForm.via.focus();

    return (false);

  }



  if (theForm.provincia.value == "")

  {

    alert("Inserire un valore per il campo \"provincia\".");

    theForm.provincia.focus();

    return (false);

  }



  if (theForm.provincia.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"provincia\".");

    theForm.provincia.focus();

    return (false);

  }



  if (theForm.telefono.value == "")

  {

    alert("Inserire un valore per il campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length > 20)

  {

    alert("Inserire al massimo 20 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefonomobile.value == "")

  {

    alert("Inserire un valore per il campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length > 15)

  {

    alert("Inserire al massimo 15 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.email.value == "")

  {

    alert("Inserire un valore per il campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.tipo_immobile.selectedIndex < 0)

  {

    alert("Selezionare una delle opzioni di \"tipo_immobile\".");

    theForm.tipo_immobile.focus();

    return (false);

  }



  if (theForm.tipo_immobile.selectedIndex == 0)

  {

    alert("La prima opzione di \"tipo_immobile\" non è una selezione valida. Scegliere un'altra opzione.");

    theForm.tipo_immobile.focus();

    return (false);

  }



  if (theForm.mq.value == "")

  {

    alert("Inserire un valore per il campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.mq.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.mq.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"mq\".");

    theForm.mq.focus();

    return (false);

  }



  if (theForm.vani.value == "")

  {

    alert("Inserire un valore per il campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.vani.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.vani.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"vani\".");

    theForm.vani.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value == "")

  {

    alert("Inserire un valore per il campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.camere_da_letto.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"camere_da_letto\".");

    theForm.camere_da_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value == "")

  {

    alert("Inserire un valore per il campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.posti_letto.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"posti_letto\".");

    theForm.posti_letto.focus();

    return (false);

  }



  if (theForm.bagni.value == "")

  {

    alert("Inserire un valore per il campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.bagni.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.bagni.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"bagni\".");

    theForm.bagni.focus();

    return (false);

  }



  if (theForm.piano.selectedIndex < 0)

  {

    alert("Selezionare una delle opzioni di \"piano\".");

    theForm.piano.focus();

    return (false);

  }



  if (theForm.distanza_dal_mare.value == "")

  {

    alert("Inserire un valore per il campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }



  if (theForm.distanza_dal_mare.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }



  if (theForm.distanza_dal_mare.value.length > 4)

  {

    alert("Inserire al massimo 4 caratteri nel campo \"distanza_dal_mare\".");

    theForm.distanza_dal_mare.focus();

    return (false);

  }

  return (true);

}

//-->

// FORM 4

function FrontPage_Form4_Validator(theForm)

{



  if (theForm.nome_cognome.value == "")

  {

    alert("Inserire un valore per il campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.nome_cognome.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"nome_cognome\".");

    theForm.nome_cognome.focus();

    return (false);

  }



  if (theForm.eta.value == "")

  {

    alert("Inserire un valore per il campo \"eta\".");

    theForm.eta.focus();

    return (false);

  }



  if (theForm.eta.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"eta\".");

    theForm.eta.focus();

    return (false);

  }



  if (theForm.eta.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"eta\".");

    theForm.eta.focus();

    return (false);

  }



  if (theForm.residenza.value == "")

  {

    alert("Inserire un valore per il campo \"residenza\".");

    theForm.residenza.focus();

    return (false);

  }



  if (theForm.residenza.value.length < 3)

  {

    alert("Inserire almeno 3 caratteri nel campo \"residenza\".");

    theForm.residenza.focus();

    return (false);

  }



  if (theForm.residenza.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"residenza\".");

    theForm.residenza.focus();

    return (false);

  }



  if (theForm.titolo_studio.value == "")

  {

    alert("Inserire un valore per il campo \"titolo_studio\".");

    theForm.titolo_studio.focus();

    return (false);

  }



  if (theForm.titolo_studio.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"titolo_studio\".");

    theForm.titolo_studio.focus();

    return (false);

  }



  if (theForm.titolo_studio.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"titolo_studio\".");

    theForm.titolo_studio.focus();

    return (false);

  }



  if (theForm.telefono.value == "")

  {

    alert("Inserire un valore per il campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefono.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"telefono\".");

    theForm.telefono.focus();

    return (false);

  }



  if (theForm.telefonomobile.value == "")

  {

    alert("Inserire un valore per il campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefonomobile.value.length > 20)

  {

    alert("Inserire al massimo 20 caratteri nel campo \"telefonomobile\".");

    theForm.telefonomobile.focus();

    return (false);

  }



  if (theForm.telefono_fisso.value == "")

  {

    alert("Inserire un valore per il campo \"telefono_fisso\".");

    theForm.telefono_fisso.focus();

    return (false);

  }



  if (theForm.telefono_fisso.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"telefono_fisso\".");

    theForm.telefono_fisso.focus();

    return (false);

  }



  if (theForm.telefono_fisso.value.length > 30)

  {

    alert("Inserire al massimo 30 caratteri nel campo \"telefono_fisso\".");

    theForm.telefono_fisso.focus();

    return (false);

  }



  if (theForm.email.value == "")

  {

    alert("Inserire un valore per il campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length < 1)

  {

    alert("Inserire almeno 1 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }



  if (theForm.email.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"email\".");

    theForm.email.focus();

    return (false);

  }

  return (true);

}

//-->

// FORM 5

function FrontPage_Form5_Validator(theForm)

{



  if (theForm.Riferimento_immobile.value == "")

  {

    alert("Inserire un valore per il campo \"Riferimento_immobile\".");

    theForm.Riferimento_immobile.focus();

    return (false);

  }



  if (theForm.Riferimento_immobile.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"Riferimento_immobile\".");

    theForm.Riferimento_immobile.focus();

    return (false);

  }



  if (theForm.Riferimento_immobile.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"Riferimento_immobile\".");

    theForm.Riferimento_immobile.focus();

    return (false);

  }



  if (theForm.Nome_Cognome_ragionesociale.value == "")

  {

    alert("Inserire un valore per il campo \"Nome_Cognome_ragionesociale\".");

    theForm.Nome_Cognome_ragionesociale.focus();

    return (false);

  }



  if (theForm.Nome_Cognome_ragionesociale.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"Nome_Cognome_ragionesociale\".");

    theForm.Nome_Cognome_ragionesociale.focus();

    return (false);

  }



  if (theForm.Nome_Cognome_ragionesociale.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"Nome_Cognome_ragionesociale\".");

    theForm.Nome_Cognome_ragionesociale.focus();

    return (false);

  }



  if (theForm.Citta_residenza.value == "")

  {

    alert("Inserire un valore per il campo \"Citta_residenza\".");

    theForm.Citta_residenza.focus();

    return (false);

  }



  if (theForm.Citta_residenza.value.length < 4)

  {

    alert("Inserire almeno 4 caratteri nel campo \"Citta_residenza\".");

    theForm.Citta_residenza.focus();

    return (false);

  }



  if (theForm.Citta_residenza.value.length > 100)

  {

    alert("Inserire al massimo 100 caratteri nel campo \"Citta_residenza\".");

    theForm.Citta_residenza.focus();

    return (false);

  }



  if (theForm.Tel.value == "")

  {

    alert("Inserire un valore per il campo \"Tel\".");

    theForm.Tel.focus();

    return (false);

  }



  if (theForm.Tel.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"Tel\".");

    theForm.Tel.focus();

    return (false);

  }



  if (theForm.Tel.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"Tel\".");

    theForm.Tel.focus();

    return (false);

  }



  if (theForm.fax.value == "")

  {

    alert("Inserire un valore per il campo \"fax\".");

    theForm.fax.focus();

    return (false);

  }



  if (theForm.fax.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"fax\".");

    theForm.fax.focus();

    return (false);

  }



  if (theForm.fax.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"fax\".");

    theForm.fax.focus();

    return (false);

  }



  if (theForm.e_mail.value == "")

  {

    alert("Inserire un valore per il campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }



  if (theForm.e_mail.value.length < 2)

  {

    alert("Inserire almeno 2 caratteri nel campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }



  if (theForm.e_mail.value.length > 50)

  {

    alert("Inserire al massimo 50 caratteri nel campo \"e_mail\".");

    theForm.e_mail.focus();

    return (false);

  }

  return (true);

}

//-->