function externalLinks() { 
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
anchor.target = "_blank"; 
}
}
var popupWin = null;
function openWin(target, width, height)
{
	var popupTop = (screen.height - height)/2;
	var popupLeft = (screen.width - width)/2;

	if(popupWin == null || popupWin.closed)
	{
		popupWin = window.open(target,'windowName','scrollbars=yes,resizable=yes,top=' + popupTop + ',left=' + popupLeft + ',status=no,width=' + width + ',height=' + height);
	}
	else
	{
		popupWin.location = target;
		setTimeout("popupWin.focus()",500)
	}
}
var newWin = null;
function openWin2(target, width, height)
{
	var popupTop = (screen.height - height)/2;
	var popupLeft = (screen.width - width)/2;

	if(newWin == null || newWin.closed)
	{
		newWin = window.open(target,'window2','scrollbars=yes,resizable=yes,top=' + popupTop + ',left=' + popupLeft + ',status=no,width=' + width + ',height=' + height);
	}
	else
	{
		newWin.location = target;
		setTimeout("newWin.focus()",500)
	}
}

function inviaMessaggio(message)
{

	if(message!="")
	   alert(message);
}


function ceckRegistrazioneFaq(form)
{
  if(trim(form.mail.value)=="")
  {
    alert("Inserire l'indirizzo e-mail");
    return false;
  }else if(checkEmailAddress(form.mail)==false)
  {
     return false
  }else if((form.idArgomenti.selectedIndex == -1)||(form.idArgomenti.selectedIndex == 0))
  {
    alert("Selezionare almeno un' area di interesse");
    return false;
  }
  form.submit();
  return true;
}

function ceckQuesito(form)
{
  giorno =  form["dataNascitaG"].value;
  mese  =   form["dataNascitaM"].value;
  anno  =   form["dataNascitaA"].value;
  campiValidi=false;
  if((giorno!="")||(mese!="")||(anno!=("")))
  {
     if(giorno=="")
     {
       alert("Inserire il Giorno ");
       campiValidi=false;
       return campiValidi;
     }
     if(mese=="")
     {
       alert("Inserire il Mese " );
       campiValidi=false;
       return campiValidi;
     }
     if(anno=="")
     {
       alert("Inserire Anno ");
       campiValidi = false;
       return campiValidi;
     }

     campiValidi=isDate1(form["dataNascitaG"],giorno,mese,anno);
     if(campiValidi==false)
     {
        alert("Data Nascita non valida");
       return campiValidi;
     }

  }
   if(trim(form.e_mail.value)=="")
  {
    alert("Inserire l'indirizzo e-mail");
    return false;
  }else if(checkEmailAddress(form.e_mail)==false)
  {
     return false
  }else if((form.argomento.selectedIndex == -1)||(form.argomento.selectedIndex == 0))
  {
    alert("Selezionare almeno un Argomento");
    return false;
  }else if(trim(form.testo.value)=="")
  {
   alert("Inserire il quesito");
   return false;
  }else if((trim(form.testo.value).length)>(5000/2))
  {
    alert("Il quesito non puo' contenere pi? di 2500 caratteri")
    return false;
  }else if(trim(form.nome.value)=="")
  {
   alert("Inserire il nome");
   return false;
  }else if(trim(form.cognome.value)=="")
  {
   alert("Inserire il cognome");
   return false;
  }else if(trim(form.luogo_nascita.value)=="")
  {
   alert("Inserire il luogo di nascita");
   return false;
  }

  form.submit();
  return true;
}

function ceckModificaQuesito(form)
{
  if(trim(form.e_mail.value)=="")
  {
    alert("Inserire l'indirizzo e-mail");
    return false;
  }else if(checkEmailAddress(form.e_mail)==false)
  {
     return false
  }else if(trim(form.testo.value)=="")
  {
   alert("Inserire il quesito");
   return false;
  }
  else if((trim(form.testo.value).length)>(5000/2))
  {
    alert("Il quesito non puo' contenere pi? di 2500 caratteri")
    return false;
  }
  form.submit();
  return true;
}



function ceckRisposta(form)
{
  if(trim(form.testo.value)=="")
  {
   alert("Inserire la risposta");
   return false;
  }
  if(trim(form.titolo.value)=="")
  {
   alert("Inserire il titolo");
   return false;
  }
  else if((trim(form.testo.value).length)>(5000/2))
  {
    alert("La risposta non puo' contenere pi? di 2500 caratteri")
    return false;
  }
  if(form.canale.selectedIndex==1)
  {
    if(trim(form.mittente.value)=="")
    {
      alert("Inserire l'indirizzo e-mail del mittente");
      return false;
    }else if(checkEmailAddress(form.mittente)==false)
    {
      return false
    }
    if(trim(form.destinatario.value)=="")
    {
      alert("Inserire l'indirizzo e-mail del destinatario");
      return false;
    }else if(checkEmailAddress(form.destinatario)==false)
    {
      return false
    }
    if(trim(form.oggeto.value)=="")
    {
      alert("Inserire l'oggetto della e-Mail");
      return false;
    }

  }
  form.submit();
  return true;
}
function ceckComunicazione(form)
{
  if(trim(form.titolo.value)=="")
  {
    alert("Inserire il titolo");
    return false;
  }else if((form.argomento.selectedIndex == -1)||(form.argomento.selectedIndex == 0))
  {
    alert("Selezionare almeno un Argomento");
    return false;
  }else if(trim(form.testo.value)=="")
  {
   alert("Inserire il testo");
   return false;
  }
  else if((trim(form.testo.value).length)>(5000/2))
  {
    alert("La comunicazione non puo' contenere pi? di 2500 caratteri")
    return false;
  }
  form.submit();
  return true;
}

function ceckModificaComunicazione(form)
{
  if(trim(form.testo.value)=="")
  {
   alert("Inserire il testo");
   return false;
  }
  else if((trim(form.testo.value).length)>(5000/2))
  {
    alert("La comunicazione non puo' contenere pi? di 2500 caratteri")
    return false;
  }
  form.submit();
  return true;
}

function ceckCodiceAttivazione(form)
{
  if(trim(form.mailCodiceAttivazione.value)=="")
  {
    alert("Inserire l'indirizzo e-mail");
    return false;
  }else if(checkEmailAddress(form.mailCodiceAttivazione)==false)
  {
     return false;
  }
  else
    form.submit();
}

function checkEmailAddress(field)
{

	// Note: The next expression must be all on one line...
	//       allow no spaces, linefeeds, or carriage returns!
        var goodEmail = field.value.match((/^[a-z0-9_\.-]+\@[a-z0-9_\.\-]+\.[a-z]{2,4}$/i));
        if (goodEmail==null)
	{

	   alert("L'indirizzo e-mail non e' valido\n Inserire un indirizzo e-mail valido");
	   field.focus();
	   field.select();
           return false;
	}
	else
	 return true;
}


function validateRicercaDocumento(form,tipoData)
{
  var giorno =  form["daGiorno"].value;
  var mese  =   form["daMese"].value;
  var anno  =   form["daAnno"].value;
  var campiValidi=false;
  if((giorno!="")||(mese!="")||(anno!=("")))
  {
     if(giorno=="")
     {
       alert("Inserire il Giorno "+tipoData +" da ");
       campiValidi=false;
       return campiValidi;
     }
     if(mese=="")
     {
       alert("Inserire il Mese "+tipoData +" da ");
       campiValidi=false;
       return campiValidi;
     }
     if(anno=="")
     {
       alert("Inserire Anno "+tipoData +" da ");
       campiValidi = false;
       return campiValidi;
     }

     campiValidi=isDate1(form["daGiorno"],giorno,mese,anno);
     if(campiValidi==false)
     {
        alert("Data "+tipoData +" da non valida");
       return campiValidi;
     }

  }

  giorno1 =  form["alGiorno"].value;
  mese1  =   form["alMese"].value;
  anno1  =   form["alAnno"].value;

  if((giorno1!="")||(mese1!="")||(anno1!=("")))
  {
     if(giorno1=="")
     {
       alert("Inserire il Giorno "+tipoData +" al ");
       campiValidi=false;
       return campiValidi;
     }
     if(mese1=="")
     {
       alert("Inserire il Mese "+tipoData +" al ");
       campiValidi=false;
       return campiValidi;
     }
     if(anno1=="")
     {
       alert("Inserire Anno "+tipoData +" al ");
       campiValidi = false;
       return campiValidi;
     }
     campiValidi=isDate1(form["alGiorno"],giorno,mese,anno);
     if(campiValidi==false)
     {
        alert("Data "+tipoData +" al non valida");
       return campiValidi;
     }
  }
  if((giorno!="")&&(giorno1!=""))
  {

    campiValidi = (inSequenza(giorno,mese,anno,giorno1,mese1,anno1)==0);
    if (campiValidi==false)
    {
      alert ("Intervallo di date "+tipoData +" non valido ");
     return false;
    }
  }
 if(controlla(form["testoRicerca"].value))
 {
		form.submit();
  }

}

function validateRicercaNotizie(form,tipoData)
{
  var giorno =  form["dataPubblicazioneDaGiorno"].value;
  var mese  =   form["dataPubblicazioneDaMese"].value;
  var anno  =   form["dataPubblicazioneDaAnno"].value;
  var campiValidi=false;
  if((giorno!="")||(mese!="")||(anno!=("")))
  {
     if(giorno=="")
     {
       alert("Inserire il Giorno "+tipoData +" da ");
       campiValidi=false;
       return campiValidi;
     }
     if(mese=="")
     {
       alert("Inserire il Mese "+tipoData +" da ");
       campiValidi=false;
       return campiValidi;
     }
     if(anno=="")
     {
       alert("Inserire Anno "+tipoData +" da ");
       campiValidi = false;
       return campiValidi;
     }

     campiValidi=isDate1(form["daGiorno"],giorno,mese,anno);
     if(campiValidi==false)
     {
        alert("Data "+tipoData +" da non valida");
       return campiValidi;
     }
  }

  var giorno1 =  form["dataPubblicazioneAGiorno"].value;
  var mese1  =   form["dataPubblicazioneAMese"].value;
  var anno1  =   form["dataPubblicazioneAAnno"].value;

  if((giorno1!="")||(mese1!="")||(anno1!=("")))
  {
     if(giorno1=="")
     {
       alert("Inserire il Giorno "+tipoData +" al ");
       campiValidi=false;
       return campiValidi;
     }
     if(mese1=="")
     {
       alert("Inserire il Mese "+tipoData +" al ");
       campiValidi=false;
       return campiValidi;
     }
     if(anno1=="")
     {
       alert("Inserire Anno "+tipoData +" al ");
       campiValidi = false;
       return campiValidi;
     }
     campiValidi=isDate1(form["alGiorno"],giorno,mese,anno);
     if(campiValidi==false)
     {
        alert("Data "+tipoData +" al non valida");
       return campiValidi;
     }
  }
  if((giorno!="")&&(giorno1!=""))
  {

    campiValidi = (inSequenza(giorno,mese,anno,giorno1,mese1,anno1)==0);
    if (campiValidi==false)
    {
      alert ("Intervallo di date "+tipoData +" non valido ");
     return false;
    }
  }
  form.submit();
}


function validaNotizia(form,campi,descrizioni)
{
  campiValidi = validateForm(form,campi,descrizioni);

  if (!campiValidi)
     return false

  if (!verificaLink(form))
      return false

      form.submit();
}

function validaAllegato(form,campi,descrizioni)
{
 
  var campiValidi = validateForm(form,campi,descrizioni);
	if (campiValidi)
  {
     form.submit()
     }
}


function validaEvento(form,campi,descrizioni)
{
  if (!validateForm(form,campi,descrizioni))
     return false

  if (!verificaLink(form))
      return false

    // data DA obbligatoria
  var giorno =  form["dataDaGiorno"].value;
  var mese  =   form["dataDaMese"].value;
  var anno  =   form["dataDaAnno"].value;

  if ( trim(giorno)=="" || trim(mese)=="" || trim(anno)=="" )
  {
     if(giorno=="")
     {
       alert("Inserire il giorno nel campo Data'");
       campiValidi=false;
       return false;
     }
     if(mese=="")
     {
       alert("Inserire il mese nel campo Data' ");
       campiValidi=false;
       return false;
     }
     if(anno=="")
     {
       alert("Inserire l'Anno nel campo Data' ");
       campiValidi = false;
       return false;
     }

  }
  else
  {
      campiValidi=isDate1(form["dataDaGiorno"],giorno,mese,anno);
      if(campiValidi==false)
      {
       alert("Data inizio evento non corretta");
       return false
      }
  }


  // data A non obbligatoria, se c'e' la controllo
var giorno =  form["dataAGiorno"].value;
var mese  =   form["dataAMese"].value;
var anno  =   form["dataAAnno"].value;


if ( trim(giorno)!="" || trim(mese)!="" || trim(anno)!="" )
{
   if(giorno=="")
   {
     alert("Inserire il giorno nel campo Data 'al'");
     campiValidi=false;
     return false;
   }
   if(mese=="")
   {
     alert("Inserire il mese nel campo Data 'al'");
     campiValidi=false;
     return false;
   }
   if(anno=="")
   {
     alert("Inserire l'Anno nel campo Data 'al'");
     campiValidi = false;
     return false;
   }
   campiValidi=isDate1(form["dataAGiorno"],giorno,mese,anno);
   if(campiValidi==false)
   {
    alert("Data fine evento non corretta");
    return false
   }
}



    form.submit();
}

function validaAvviso(form,campi,descrizioni)
{
  if (!validateForm(form,campi,descrizioni))
     return false

  if (!verificaLink(form))
      return false

    // data DA obbligatoria
  var giorno =  form["dataDaGiorno"].value;
  var mese  =   form["dataDaMese"].value;
  var anno  =   form["dataDaAnno"].value;

  if ( trim(giorno)=="" || trim(mese)=="" || trim(anno)=="" )
  {
     if(giorno=="")
     {
       alert("Inserire il giorno nel campo Data'");
       campiValidi=false;
       return false;
     }
     if(mese=="")
     {
       alert("Inserire il mese nel campo Data' ");
       campiValidi=false;
       return false;
     }
     if(anno=="")
     {
       alert("Inserire l'Anno nel campo Data' ");
       campiValidi = false;
       return false;
     }

  }
  else
  {
      campiValidi=isDate1(form["dataDaGiorno"],giorno,mese,anno);
      if(campiValidi==false)
      {
       alert("Data inizio avviso non corretta");
       return false
      }
  }


  // data A non obbligatoria, se c'e' la controllo
var giorno =  form["dataAGiorno"].value;
var mese  =   form["dataAMese"].value;
var anno  =   form["dataAAnno"].value;


if ( trim(giorno)!="" || trim(mese)!="" || trim(anno)!="" )
{
   if(giorno=="")
   {
     alert("Inserire il giorno nel campo Data 'al'");
     campiValidi=false;
     return false;
   }
   if(mese=="")
   {
     alert("Inserire il mese nel campo Data 'al'");
     campiValidi=false;
     return false;
   }
   if(anno=="")
   {
     alert("Inserire l'Anno nel campo Data 'al'");
     campiValidi = false;
     return false;
   }
   campiValidi=isDate1(form["dataAGiorno"],giorno,mese,anno);
   if(campiValidi==false)
   {
    alert("Data fine avviso non corretta");
    return false
   }
}



    form.submit();
}


function validateDocumento(form,campi,descrizioni)
{

 //alert(campi)
  var campiValidi = validateForm(form,campi,descrizioni);
//alert(campiValidi)
  var giorno =  form["dataG"].value;
  var mese  =   form["dataM"].value;
  var anno  =   form["dataA"].value;
  if(form.sunto.value.length>2500)
  {
       alert("Il campo Abstract non puo' contenere pi? di 2500 caratteri");
       campiValidi=false;
       form.sunto.focus();
       return false;
  }
  if(form.sunto.value=="")
  {
       alert("Inserire un sunto (campo Abstract)");
       campiValidi=false;
       form.sunto.focus();
       return false;
  }
  if((giorno!="")||(mese!="")||(anno!=("")))
  {

     if(giorno=="")
     {
       alert("Inserire il giorno nel campo Data'");
       campiValidi=false;
       return false;
     }
     if(mese=="")
     {
       alert("Inserire il mese nel campo Data' ");
       campiValidi=false;
       return false;
     }
     if(anno=="")
     {
       alert("Inserire l'Anno nel campo Data' ");
       campiValidi = false;
       return false;
     }
     if(campiValidi==true)
     {
         campiValidi=isDate1(form["dataG"],giorno,mese,anno);
         if(campiValidi==false){
            alert("Data  validita' non corretta");
            return false;
          }
     }
  }
  if (campiValidi==true)
    form.submit();
}



function confermaRimozioneAllegati(form)
{
    if (confirm('Confermi la rimozione degli allegati selezionati?'))
        form.submit()
}



function validateForm(form,fields,descr)
{
//alert('validateForm')
	    if(fields == "")
                return true;
	    fields = fields.split(',');
        descr=descr.split(',');
	      for(var i = 0; i < fields.length; i++)
	      {
//	      alert(form[fields[i]]+','+fields[i])
                switch(form[fields[i]].type)
	      	{
	      		case 'select-one':      if(form[fields[i]].selectedIndex == 0) { alert("Selezionare il campo  "+ descr[i].toUpperCase()); return false; }; break;
	      		case 'select-multiple': if(form[fields[i]].selectedIndex == 0) { alert("Il campo  " + fields[i].toUpperCase() + " ? obbligatorio."); return false; }; break;
	      		case 'checkbox':        if(!form[fields[i]].checked) { alert("Indicare il " + fields[i].toLowerCase() + "."); return false; }; break;
	      		case 'file':        
	      		if(form[fields[i]].value == "") { 
	      		alert("Indicare il " + fields[i].toLowerCase() + "."); 
	      		return false; 
	      		};
	      		break;
	      		default:
                            form[fields[i]].value = trim(form[fields[i]].value);
                            if(form[fields[i]].value == "")
                            {
                                alert("Il campo " + descr[i].toUpperCase() + " ? obbligatorio.");
                                return false;
                            }
		    }
	      }
	return true;
}

function validateFormSubmit(form,fields,descr)
{
  if(validateForm(form,fields,descr))
    form.submit();
  return false;
}

function cancellaContenutoMail()
{
    if(confirm("Sei sicuro che vuoi eliminare l'elemento dalla newsletter?"))
    {
        document.forms[0].metodo.value = 'cancellaContenutoMail'
        document.forms[0].submit();
        return false
    }
}

function checkModificaContenutoMail()
{
    var form = document.forms[0]
    if(form.testo.value == "")
    {
        alert("Il testo non puo' essere vuoto");
        form.testo.focus();
        return
    }
    if(form.giorno.value=="")
    {
        alert("Il giorno non puo' essere vuoto");
        form.giorno.focus();
        return false;
    }
    if(form.mese.value=="")
    {
        alert("Il mese non puo' essere vuoto");
        form.mese.focus();
        return false;
    }
    if(form.anno.value=="")
    {
        alert("L'anno non puo' essere vuoto");
        form.anno.focus();
        return false;
    }

    if(isDate1(form.giorno, form.giorno.value, form.mese.value, form.anno.value)==false)
    {
        return false
    }
    var dataAttuale = new Date();

    var data = new Date();
    data.setDate(parseInt(form.giorno.value));
    data.setMonth(parseInt(form.mese.value)-1);
    data.setYear(parseInt(form.anno.value));
    data.setHours(0);
    data.setMinutes(0);
    data.setSeconds(0);
    data.setMilliseconds(0);

    //var data = new Date(parseInt(form.giorno.value), parseInt(form.mese.value) - 1,parseInt(form.anno.value) );
    if(data.getTime() < dataAttuale.getTime())
    {
	alert("Data Inserita:"+data);
	alert("Data Attuale:"+dataAttuale);
	alert("La data inserita deve essere posteriore alla data attuale");
        form.giorno.focus()
        return false
    }

    form.metodo.value = 'modificaContenutoMail'
    form.submit();
    return false
}

function checkRicercaContenutoMail()
{
    var form = document.forms[0]
    if(form.giorno.value=="")
    {
        alert("Il giorno non puo' essere vuoto");
        form.giorno.focus();
        return false;
    }
    if(form.mese.value=="")
    {
        alert("Il mese non puo' essere vuoto");
        form.mese.focus();
        return false;
    }
    if(form.anno.value=="")
    {
        alert("L'anno non puo' essere vuoto");
        form.anno.focus();
        return false;
    }
    if(form.giornoA.value=="")
    {
        alert("Il giorno non puo' essere vuoto");
        form.giorno.focus();
        return false;
    }
    if(form.meseA.value=="")
    {
        alert("Il mese non puo' essere vuoto");
        form.mese.focus();
        return false;
    }
    if(form.annoA.value=="")
    {
        alert("L'anno non puo' essere vuoto");
        form.anno.focus();
        return false;
    }

    if(isDate1(form.giorno, form.giorno.value, form.mese.value, form.anno.value)==false ||
       isDate1(form.giornoA, form.giornoA.value, form.meseA.value, form.annoA.value)==false )
    {
        return false
    }

    form.submit();
    return false
}
function getNewsletter(form, giorno, mese, anno)
{
    form.giorno.value = giorno;
    form.mese.value = mese;
    form.anno.value = anno;
    form.submit();
    return false
}
function cancellaContenuti()
{
    var checkboxes = document.forms[0].idContenutiMails
    if(checkboxes)
    {
        var unoSelezionato = false
        if(checkboxes.type=="checkbox")
            unoSelezionato = checkboxes.checked
        else
        {
            for(var i=0; i<checkboxes.length; i++)
            {
                if(checkboxes[i].checked)
                {
                    unoSelezionato = true
                    break;
                }
            }
        }
        if(!unoSelezionato)
        {
            alert("Si deve selezionare almeno un elemento da eliminare");
            return
        }
        else
        {
            if(confirm("Si vogliono eliminare gli elementi selezionati?"))
            {
                document.forms[0].metodo.value = 'cancellaContenutiMail';
                document.forms[0].submit();
                return false
            }
        }
    }
}
function checkInserimentoResponsabile()
{

    var form = document.forms[0]
               
 	 if(!form.qualifica.value.match(/^[A-Za-zאטילעש.'\s]+$/i)){
	alert("campo qualifica non valido o vuoto!!!!");
	form.qualifica.focus();
    return false
	}
	if(!form.nome.value.match(/^[A-Za-zאטילעש'\s]+$/i)){
	alert("campo nome non valido o vuoto!!!!");
	form.nome.focus();
    return false
	}
	if(!form.cognome.value.match(/^[A-Za-zאטילעש'\s]+$/i)){
	alert("campo cognome non valido o vuoto!!!!");
	form.cognome.focus();
    return false
	}
	if(form.codiceFiscale.value == "")
    {
        alert("Il campo codice fiscale e' obbligatorio");
        form.codiceFiscale.focus();
        return false
    }
	else if(form.codiceFiscale.value.length!=16)
    {
        alert("Il campo codice fiscale non e' corretto");
        form.codiceFiscale.focus();
        return false
    }
   if(form.comuneNascita.value == "")
    {
        alert("Il campo comune di nascita e' obbligatorio");
        form.comuneNascita.focus();
        return false
    }
	if(form.provinciaNascita.value == "")
    {
        alert("Il campo provincia di nascita e' obbligatorio");
        form.provinciaNascita.focus();
        return false
    }
	if(form.giornoNascita.value=="")
        {
            alert("Il giorno di Nascita non puo' essere vuoto");
            form.giornoNascita.focus();
            return false;
        }
        if(form.meseNascita.value=="")
        {
            alert("Il mese di Nascita non puo' essere vuoto");
            form.meseNascita.focus();
            return false;
        }
        if(form.annoNascita.value=="")
        {
            alert("L'anno di Nascita non puo' essere vuoto");
            form.annoNascita.focus();
            return false;
        }

        if(isDate1(form.giornoNascita, form.giornoNascita.value, form.meseNascita.value, form.annoNascita.value)==false)
        {
           alert("Data Nascita non Valida");
           return false;
        }
    if(form.telefono.value == "")
    {
        alert("Il campo telefono e' obbligatorio");
        form.telefono.focus();
        return false
    }
	if(form.fax.value == "")
    {
        alert("Il campo fax e' obbligatorio");
        form.fax.focus();
        return false
    }
	if(form.email.value == "")
    {
        alert("Il campo e-mail e' obbligatorio");
        form.email.focus();
        return false
    }
    else if(checkEmailAddress(form.email)==false)
    {  
        alert("");
        form.email.focus();
        return false
    }	
    if(form.delibera.value != "")
    {
        if(form.giorno.value=="")
        {
            alert("Il giorno di Delibera non puo' essere vuoto");
            form.giorno.focus();
            return false;
        }
        if(form.mese.value=="")
        {
            alert("Il mese di Delibera non puo' essere vuoto");
            form.mese.focus();
            return false;
        }
        if(form.anno.value=="")
        {
            alert("L'anno di Delibera non puo' essere vuoto");
            form.anno.focus();
            return false;
        }

        if(isDate1(form.giorno, form.giorno.value, form.mese.value, form.anno.value)==false)
        {
           alert("Data Delibera non Valita");
           return false;
        }
    }
    else
    {
        form.giorno.value = form.mese.value = form.anno.value = ""
    }
    
    //form.idSettore.value=idSettore;
    form.submit();
    return false;
}



function checkEliminaResponsabile(pathInaSaia,idSettore,login,idResponsabile)
{
    if(confirm("Si vuole eliminare il responsabile?"))
    {
    	//alert(idSettore);
    	//alert(login);
    	//alert(idResponsabile);
	 //gestione migrazione INA-SAIA
    if (idSettore == 6){
        //alert("Ina");
		var height = 430;
	   	var width = 660;
	    var popupTop = (screen.height - height)/2;
		var popupLeft = (screen.width - width)/2;
  
		if(popupWin == null || popupWin.closed){															  
	    	popupWin = window.open(pathInaSaia+'gestioneAreaResponsabileResponsabile.do?metodo=popupEliminaResponsabile&servizio=gestioneAreaResponsabileResponsabile&idResponsabile='+idResponsabile+'&login='+login,'windowName','scrollbars=yes,resizable=yes,top=' + popupTop + ',left=' + popupLeft + ',status=no,width=' + width + ',height=' + height);		    
		}else{
			popupWin.location = pathInaSaia+"gestioneAreaResponsabileResponsabile.do?metodo=popupEliminaResponsabile&servizio=gestioneAreaResponsabileResponsabile&idResponsabile="+idResponsabile+"&login="+login;
			setTimeout("popupWin.focus()",500)
		}     

		//window.opener.location.href="ricercaAreaResponsabile.do?metodo=paginaRicercaResponsabiliPerSettore&servizio=gestioneAreaResponsabileResponsabile";
		
        return false;
    }
        
       	document.forms[0].action='gestioneAreaResponsabileResponsabile.do';
		document.forms[0].metodo.value = 'eliminaResponsabile';
		document.forms[0].servizio.value='gestioneAreaResponsabileResponsabile';		
        document.forms[0].submit();
        
        return false
    }
}
/*********************************************************************
SCRIPT TESTATO 21-02-2001 CON:
- EXPLORER Versione 5.00
- NETSCAPE Versione 4.7 - Inglese

Author system_09@yahoo.it
**********************************************************************
BISESTILE:
Un Anno e' bisestile se questo/4 da come resto 0.
Partendo da questo l'anno bisestile si ripete ogni 4 anni, quindi
Febbraio, un mese con 28 giorni, in questa occasione ne ha 29
Esempio anno bisestile: 2000, 1996, 1992, 1988, ...
*********************************************************************/

function bisestile (anno)
{
	return ( (anno % 4 == 0 && anno % 100 != 0) || (anno % 400 == 0) );
}

function isLogical (gg, mm, aaaa)
{
	var MM	 = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12);
	var GG	 = new Array(00,31,28,31,30,31,30,31,31,30,31,30,31);


	// Il giorno non deve essere < 1 || > 31
	if ( (gg < 1) || (gg > 31) ) return 1;
	// Il mese non deve essere < 1 && > 12
	else if ( (mm < 1)  || (mm > 12) ) return 2;
	// Se vero l'anno Utente e' Bisestile e il mese e' Febbraio
	else if ( bisestile(aaaa)  && (mm == 2) )
	{
		if ( gg > 29 ) return 5;
		return 0;
	}
	else if (gg > GG[mm])
	{
		if (mm == 2 && gg == 29 ) return 4;
		else return 5;
	}
	else if(aaaa < 1900 || aaaa > 2050)
	{
        return 3;	
	}
	else return 0;
}

function checkCourseTitle(title){
if(title.value == ""){
  alert('Il campo "Titolo" deve essere valorizzato sempre');
  return false;
}
else 
  return true;
}
/*************************************************************
Funzione che scandisce la stringa carattere per carattere
e verifica che ognuno di questi sia un numero.
Ritorna TRUE se e' numerico
stringa.charAt(P) - estrae un solo carattere nella posizione P
ACCORGIMENTO: !parseFloat(0-zero) == NaN [Not a Number]
************************************************************/
function isNumeric (form)
{
	var number = 0;
	for (var i = 0; i < form.length; i++)
	{
		number = form.charAt(i);
		if ( (number != "0") && (!parseFloat(number)) ) return false;
	}
	return true;
}
/*************************************************************
Funzione che verifica la lunghezza della stringa, il formato,
la corretteza logica...
************************************************************/
function isDate2 (DATA, errors)
{
    var gg 		 = DATA.value.substring(0,2); //	'02'
	var token11  = DATA.value.substring(2,3); //	'/ '
	var mm 		 = DATA.value.substring(3,5); //	'08'
	var token21  = DATA.value.substring(5,6); //	'/ '
	var aaaa	 = DATA.value.substring(6,10);//	'1971'
		
	 if (DATA.value == "")
	{
		errors += "Il campo data deve essere valorizzato\n";
		DATA.focus();
	}

    if (DATA.value.length != 10)
	{
		errors += "Il formato di data richiesto e': gg/mm/aaaa\n";
		DATA.focus();
	}
	else if (token11 != "/")
	{
		errors += "Il formato di data richiesto e': gg/mm/aaaa\n";
		DATA.focus();
	}
	else if (token21 != "/")
	{
		errors += "Il formato di data richiesto e': gg/mm/aaaa\n";
		DATA.focus();
	}
	else if (token11 != token21)
	{
		errors += "Il formato di data richiesto e': gg/mm/aaaa\n";
		DATA.focus();
	}
	else if	(!isNumeric(gg))
	{
		errors += "Il giorno inserito non e' un valore numerico.\n";
		DATA.focus();
	}
	else if	(!isNumeric(mm))
	{
		errors += "Il mese inserito non e' un valore numerico.\n";
		DATA.focus();
	}
	else if	(!isNumeric(aaaa))
	{
		errors += "L'anno inserito non e' un valore numerico.\n";
		DATA.focus();
	}
	else
	{
		var g = parseInt(gg,10);
		var m = parseInt(mm,10);
		var a = parseInt(aaaa,10);

		var error=isLogical(g,m,a);
		if (error == 1)
		{
			errors += "Il giorno inserito non e' valido: " + gg +"\n";
			DATA.focus();
		}
		else if (error == 2)
		{
			errors += "Il mese inserito non e' valido: " + mm +"\n";
			DATA.focus();
		}
		else if (error == 3)
		{
			errors += "L'anno inserito non e' valido: " + aaaa +"\n";
			DATA.focus();
		}
		else if (error == 4)
		{
			errors += "Data non corretta poiche' l'anno non e' bisestile: " + aaaa +"\n";
			DATA.focus();
		}
		else if (error == 5)
		{
			errors += "Data non corretta poiche' il giorno: " + gg + " non e' coerente con il mese: " + mm +"\n";
			DATA.focus();
		}
	}
	return errors;
}

function checkDates(dataInizio,dataFine)
{
    var ggI 		 = dataInizio.value.substring(0,2); //	'02'
	var mmI 		 = dataInizio.value.substring(3,5); //	'08'
	var aaaaI	     = dataInizio.value.substring(6,10);//	'1971'
	var ggF 		 = dataFine.value.substring(0,2); //	'02'
	var mmF 		 = dataFine.value.substring(3,5); //	'08'
	var aaaaF	     = dataFine.value.substring(6,10);//	'1971'
	
	var errorsF = "";
    var errors  = "";
  
  if(dataInizio.value == "" && dataFine.value == "")
  {
    errors += "I campi data inizio e data fine sono obbligatori\n";
    alert(errors);
    errors = "";
    return false;
  }
  errors += isDate2(dataInizio,errors);
  if(errors != "")
    alert('Data Inizio:'+errors);
  errorsF += isDate2(dataFine,errorsF);
  if(errorsF != "")
     alert('Data Fine:'+errorsF);
  if (errors != "" || errorsF != "")
      return false;
  else 
  {        
   if(aaaaI > aaaaF)
   {
    errors += "La data di inizio ? successiva a quella di fine\n";
    alert(errors);
    errors = "";
    return false;
   }  
   else if(  aaaaI == aaaaF)
   {
    if(mmI == mmF && ggI == ggF)
    {
      errors += "La data di inizio coincide con quella di fine\n";
      alert(errors);
      errors = "";
      return false;
    }
    if( mmI > mmF || ( mmI == mmF && ggI > ggF))
    {
      errors += "La data di inizio ? successiva a quella di fine\n";
      alert(errors);
      errors = "";
      return false;
    }
  }
  return true;    
 }
}

function isDateByDate (DATA)
{

	var gg 		= DATA.value.substring(0,2); //	'02'
	var token11  = DATA.value.substring(2,3); //	'/ '
	var mm 		= DATA.value.substring(3,5); //	'08'
	var token21  = DATA.value.substring(5,6); //	'/ '
	var aaaa	= DATA.value.substring(6,10);//	'1971'

	if (DATA.value.length != 10)
	{
		alert("Il formato di data richiesto e': gg/mm/aaaa");
		DATA.focus();
		return false;
	}
	else if (token11 != "/")
	{
		alert("Il formato di data richiesto e': gg/mm/aaaa");
		DATA.focus();
		return false;
	}
	else if (token21 != "/")
	{
		alert("Il formato di data richiesto e': gg/mm/aaaa");
		DATA.focus();
		return false;
	}
	else if (token11 != token21)
	{
		alert("Il formato di data richiesto e': gg/mm/aaaa");
		DATA.focus();
		return false;
	}
	else if	(!isNumeric(gg))
	{
		alert("Il giorno inserito non e' un valore numerico.");
		DATA.focus();
		return false;
	}
	else if	(!isNumeric(mm))
	{
		alert("Il mese inserito non e' un valore numerico.");
		DATA.focus();
		return false;
	}
	else if	(!isNumeric(aaaa))
	{
		alert("L'anno inserito non e' un valore numerico.");
		DATA.focus();
		return false;
	}
	else
	{
		var g = parseInt(gg,10);
		var m = parseInt(mm,10);
		var a = parseInt(aaaa,10);

		var error=isLogical(g,m,a);
		if (error == 1)
		{
			alert("Il giorno inserito non e' valido: " + gg);
			DATA.focus();
			return false;
		}
		else if (error == 2)
		{
			alert("Il mese inserito non e' valido: " + mm);
			DATA.focus();
			return false;
		}
		else if (error == 4)
		{
			alert("Data non corretta poiche' l'anno non e' bisestile: " + aaaa);
			DATA.focus();
			return false;
		}
		else if (error == 5)
		{
			alert("Data non corretta poiche' il giorno: " + gg + " non e' coerente con il mese: " + mm);
			DATA.focus();
			return false;
		}
		else return true;
	}
	return true;
}

/*************************************************************
Funzione che verifica la lunghezza della stringa, il formato,
la corretteza logica...
************************************************************/
function isDate1 (campo,gg,mm,aaaa)
{
        if(!isNumeric(gg))
	{
		alert("Il giorno inserito non e' un valore numerico.");
		campo.focus();
		return false;
	}
	else if	(!isNumeric(mm))
	{
		alert("Il mese inserito non e' un valore numerico.");
		campo.focus();
		return false;
	}
	else if	(!isNumeric(aaaa))
	{
		alert("L'anno inserito non e' un valore numerico.");
		campo.focus();
		return false;
	}
		var error=isLogical(gg,mm,aaaa);
		if((aaaa<1800)||(aaaa>2500))
		{
		  campo.focus();
		  return false;
		}
		if (error == 1)
		{
			alert("Il giorno inserito non e' valido: " + gg);
			campo.focus();
			return false;
		}
		else if (error == 2)
		{
			alert("Il mese inserito non e' valido: " + mm);
			campo.focus();
			return false;
		}
		else if (error == 4)
		{
			alert("Data non corretta poiche' l'anno non e' bisestile: " + aaaa);
			campo.focus();
			return false;
		}
		else if (error == 5)
		{
			alert("Data non corretta poiche' il giorno: " + gg + " non e' coerente con il mese: " + mm);
			campo.focus();
			return false;
		}
	    return true;
}

function inSequenza (sg,sm,sa,sg1,sm1,sa1)
{
        var g = parseInt(sg,10);
        var m = parseInt(sm,10);
        var a = parseInt(sa,10);
        var g1 = parseInt(sg1,10);
        var m1 = parseInt(sm1,10);
        var a1 = parseInt(sa1,10);
	if((m == m1) && (a == a1) && (g == g1))
              return 0;
	else if (a > a1)
             return 1;
	else if ((a == a1) && (m > m1))
             return 2;
	else if ((a == a1) && (m == m1) && (g > g1))
             return 3;
	else return 0;
}





function checkLogin(form)
{

  if (form.utente.value == "")
  {
	alert ("Il campo Utente ? obbligatorio");
	form.utente.focus();
	return false;
  }
  else if (form.password.value == "")
  {
       	alert ("Il campo Password ? obbligatorio");
       	form.password.focus();
       	return false;
  }
  form.submit();
}


 function trim(strText)
 {
    if ( strText==null )
          return strText;

    if ( strText=="" )
          return strText;

    // this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}



    function checkMese(mese)
    {
          mese = trim(mese);

          if( ( mese == null) || ( mese == "")  )
          {
            alert("Specificare il mese di riferimento.");
            return false;
          }
          else if (!isNumeric(mese))
          {
                alert("Mese di riferimento non valido.");
                return false;
          }
          else
          {
                mese = parseInt(mese);
                if( isNaN(mese) )
                {
                    alert("Mese di riferimento non valido.");
                    return false;
                }

                if( (mese<1) || (mese > 12) )
                {
                    alert("Mese di riferimento non valido.");
                    return false;
                }
          }

          return true;
    }


    function checkAnno(anno)
    {
            anno = trim(anno);

            if( (anno==null) || (anno=="")  )
            {
                  alert("Specificare l'anno di riferimento.");
                  return false;
            }
            else if (!isNumeric(anno))
            {
                  alert("Anno di riferimento non valido.");
                  return false;
            }
            else
            {
                  anno = parseInt(anno);
                  if( isNaN(anno) )
                  {
                      alert("Anno di riferimento non valido.");
                      return false;
                  }

                  if( anno<1945 || anno > 2200 )
                  {
                      alert("Anno di riferimento non valido.");
                      return false;
                  }

            }

            return true;
    }




function verificaLink(form)
{
      if( trim(form.testoLink.value)!="" &&  trim(form.linkEsterno.value)=="")
     {
       alert("Valorizzare il campo Link Esterno");
       return false;
     }
      else if( trim(form.linkEsterno.value)!="" && trim(form.testoLink.value)=="")
     {
       alert("Valorizzare il campo Testo link");
       return false;
     }

      return true
}




  function verificaNumeri(e){
    var tipoBrowser = navigator.appName;
    if (tipoBrowser=="Microsoft Internet Explorer")  {
      if(e.keyCode != 46 && e.keyCode < 48 || e.keyCode > 57) {
        return false;
      } else {
        return true;
      }
    } else {
      if(e.which < 48 || e.which > 57) {
        return false;
      } else{
        return true;
      }
    }
  }
function verificaLunghezza(lunghezza,textarea)
{
    if(textarea.value.length>lunghezza)
    {
      alert("Campo Testo troppo lungo");
       return false;
    }
    else
     return true;

}
///////////////////////////////////////////////////
//modifica 10/09/2003 controllo delle parole chiave di intermedia text

var app = new Array();
app["ABOUT"]="1";app["ACCUM"]="1";app["AND"]="1";
app["BT"]="1"; app["BTG"]="1";app["BTI"]="1";app["BTP"]="1";
app["NT"]="1";app["NTG"]="1";
app["NTI"]="1"; app["NTP"]="1";app["OR"]="1";app["PT"]="1";app["RT"]="1";app["SQE"]="1";app["SYN"]="1";
app["TR"]="1";app["TRSYN"]="1";app["TT"]="1";app["WITHIN"]="1";

var caratteri = new Array();
caratteri[0]=",";caratteri[1]="&";caratteri[2]="_"; caratteri[3]="?";caratteri[4]="{";caratteri[5]="}";
caratteri[6]="(";caratteri[7]=")";caratteri[8]="[";caratteri[9]="]";caratteri[10]="-";caratteri[11]=";";caratteri[12]="~";
caratteri[13]="|";caratteri[14]="$";caratteri[15]="!";
caratteri[16]=">";caratteri[17]="*";caratteri[18]="%";caratteri[19]="\"";caratteri[20]="\\";caratteri[21]="=";


function messaggio(parolaRiservata,tipo)
{
	var testoTipo = ""
	if(tipo==1)
		testoTipo = "La parola "+ parolaRiservata+" &egrave;  riservata";
        else
	{
		testoTipo = "Il carattere "+ parolaRiservata+" &egrave;  riservato";
	}
	var DQUOTE = '\"';
	var title = "Ministero dell'Interno";
	var s1 = "<TITLE>"+ title + "</TITLE>"  +
	"<BODY BGCOLOR='#b8c4dc'><TABLE BORDER=0><TR>" +
	"<TD colspan='5' WIDTH='100%' HEIGHT='100%' VALIGN=TOP ALIGN=LEFT>"+
	"<FONT SIZE=3>";
	var s2 = "<center><FONT COLOR='ffffff'><h2> "+testoTipo+" </h2> <h3>Elenco delle parole riservate che non possono essere usate</h3></FONT></center>";
	var s3 = "</TD></TR><TR>"+
	"<tr><td width='25%'>ABOUT</td><td width='25%'>ACCUM</td><td width='25%'>,</td><td width='25%'>AND</td><td width='25%'>&amp;</td></tr>"+
	"<tr><td width='25%'>BT</td><td width='25%'>BTG</td><td width='25%'>BTI</td><td width='25%'>BTP</td><td width='25%'>?</td></tr>"+
	"<tr><td width='25%'>{</td><td width='25%'>}</td><td width='25%'>(</td><td width='25%'>)</td><td width='25%'>[</td></tr>"+
	"<tr><td width='25%'>]</td><td width='25%'>-</td><td width='25%'>&iexcl;</td><td width='25%'>~</td><td width='25%'>NT</td></tr>"+
	"<tr><td width='25%'>NTG</td><td width='25%'>NTI</td><td width='25%'>NTP</td><td width='25%'>OR</td><td width='25%'>|</td></tr>"+
	"<tr><td width='25%'>PT</td><td width='25%'>RT</td><td width='25%'>$</td><td width='25%'>!</td><td width='25%'>SQE</td></tr>"+
	"<tr><td width='25%'>SYN</td><td width='25%'>&gt;</td><td width='25%'>TR</td><td width='25%'>TRSYN</td><td width='25%'>TT</td></tr>"+
	"<tr><td width='25%'>*</td><td width='25%'>%</td><td width='25%'>_</td><td width='25%'>WITHIN</td><td width='25%'>\\</td></tr></FONT>"+
	"<tr><td width='25%'>=</td><td width='25%'>\"</td><td width='25%'>&nbsp;</td><td width='25%'>&nbsp;</td><td width='25%'>&nbsp;</td></tr></FONT>"+
	"<TD colspan='5' VALIGN=TOP ALIGN=RIGHT>"+
	"<FORM><INPUT TYPE='BUTTON' VALUE='Chiudi'"+
	"onClick='self.close()'>" +
	"</FORM></TD></TR></TABLE></BODY>";
	popup = window.open("","popDialog","height=400,width=400,scrollbars=no")
	popup.document.write(s1+s2+s3)
	popup.document.close()
}


function controlla(stringaRicerca)
{
	var trovataParola=false
	var sArray = stringaRicerca.split(" ");

	for(var i=0;i<caratteri.length;i++)
	{
		if(stringaRicerca.indexOf(caratteri[i])!=-1)
          	{
                  messaggio(caratteri[i],0);
                  trovataParola=true;
                  break;
          	}
	}

	for(var i=0;i<sArray.length;i++)
	{
		if(app[sArray[i].toUpperCase()]==1)
		{
		  messaggio(sArray[i],1);
		  trovataParola=true;
		  break;
		}
	}
	if(trovataParola==true)
           return false;
	else
		return true;
}
function inviaFormRicercaFultext(form,texto)
{
	if(controlla(texto))
	{
		form.submit();
	}
}

function validateFormProgettiCie(form,fields,descr)
{
      if(fields == "")
            return true;

      fields = fields.split(',');
      descr=descr.split(',')

      for(var i = 0; i < fields.length; i++)
      {
        switch(form[fields[i]].type)
      	{
      		case 'select-one':
      			if (form[fields[i]].selectedIndex == 0)
      			{
  					alert("Riempire il campo reletivo alla sezione  "+ descr[i].toUpperCase())
  					return false
      			}
      			break
      		case 'select-multiple':
      			if (form[fields[i]].selectedIndex == 0)
      			{
      				alert("Il campo  " + fields[i].toUpperCase() + " ? obbligatorio.")
      				return false
      			}
      			break
      		case 'checkbox':
      			if(!form[fields[i]].checked)
      			{
      				alert("Indicare il " + fields[i].toLowerCase() + ".")
      				return false
      			}
      			break
      		default:
				form[fields[i]].value = trim(form[fields[i]].value);
	            if(form[fields[i]].value == "")
                {
                	alert("Il campo " + descr[i].toUpperCase() + " ? obbligatorio.")
                	return false
				}
		}
	}
	return true
}

function validateFormProgettiCieDatiGenerali(form,fields,descr)
{

	      if(fields == "")
                return true;
	      fields = fields.split(',');
          descr=descr.split(',')
		  var app = true;
	      for(var i = 0; i < fields.length; i++)
	      {
                switch(form[fields[i]].type)
	      	{
	      		case 'select-one':      if(form[fields[i]].selectedIndex == 0) { alert("Riempire il campo reletivo alla sezione  "+ descr[i].toUpperCase()); app=false;return  }; break;
	      		case 'select-multiple': if(form[fields[i]].selectedIndex == 0) { alert("Il campo  " + fields[i].toUpperCase() + " ? obbligatorio.");app=false;return}; break;
	      		case 'checkbox':        if(!form[fields[i]].checked) { alert("Indicare il " + fields[i].toLowerCase() + ".");app=false; return}; break;
	      		default:
                            form[fields[i]].value = trim(form[fields[i]].value);
                          if(form[fields[i]].value == "")
                            {
                                alert("Il campo " + descr[i].toUpperCase() + " ? obbligatorio.");

                            }
		}
	}

	var numeroTotaleDiRighe = document.progettoCieForm.acquistato.length;
	var app2 = true;
	for(var i=0;i<numeroTotaleDiRighe;i++)
	{
		var objAcquistato = document.progettoCieForm.acquistato[i];


		var objInstallato = document.progettoCieForm.installato[i];



		if(objAcquistato.value =="-")
		{
			alert("Riempire il campo relativo alla sezione ACQUISTO E INSTALLAZIONE DEGLI APPARATI DI EMISSIONE CIE E CONNESSIONE AL CNSD")
			app= false;
			return
		}
		if(objInstallato.value =="-")
		{
			alert("Riempire il campo relativo alla sezione ACQUISTO E INSTALLAZIONE DEGLI APPARATI DI EMISSIONE CIE E CONNESSIONE AL CNSD")
			app= false;
			return
		}
	}



	if(app == true)
		document.progettoCieForm.submit();

}

/****************************************************************
Funzione che verifica la lunghezza ed il formato del codice istat
****************************************************************/
function isValidCodIstat (codistat) {

	if (codistat.value.length != 6) {
		alert("Il codice istat deve avere lunghezza pari a sei.");
		codistat.focus();
		return false;
	} else if (!isNumeric(codistat.value)) {
		alert("Il codice istat deve essere formato solo da numeri.");
		codistat.focus();
		return false;
	}
	return true;
}
/****************************************************************
Funzione che controlla il formato alfabetici
****************************************************************/

function goodchars(e, goods)  {
 var key, keychar;
 key = getkey(e);
 if (key == null) return true;

 // get character
 keychar = String.fromCharCode(key);
 keychar = keychar.toLowerCase();
 goods = goods.toLowerCase();

 // check goodkeys
 if (goods.indexOf(keychar) != -1)
  return true;

 // control keys
 if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
    return true;

 // else return false
 return false;
 }
 /****************************************************************
Funzione che verifica i caratteri inseriti
****************************************************************/
function isValid() {
 	var form = document.forms[0];
	
	if(!form.qualifica.value.match(/^[A-Za-zאטילעש']+$/i)){
	alert("campo quesito non valido o vuoto!!!!");
	form.qualifica.focus();
    return false
	}
	if(!form.nome.value.match(/^[A-Za-zאטילעש']+$/i)){
	alert("campo nome non valido o vuoto!!!!");
	form.nome.focus();
    return false
	}
	if(!form.cognome.value.match(/^[A-Za-zאטילעש']+$/i)){
	alert("campo cognome non valido o vuoto!!!!");
	form.cognome.focus();
    return false
	}
	if(form.codiceFiscale.value == "")
    {
        alert("Il campo codice fiscale e' obbligatorio");
        form.codiceFiscale.focus();
        return false
    }
    else if(form.codiceFiscale.value.length!=16)
    {
        alert("Il campo codice fiscale non e' corretto");
        form.codiceFiscale.focus();
        return false
    }
	if(form.comuneNascita.value == "")
    {
        alert("Il campo comune di nascita e' obbligatorio");
        form.comuneNascita.focus();
        return false
    }
	if(form.provinciaNascita.value == "")
    {
        alert("Il campo provincia di nascita e' obbligatorio");
        form.provinciaNascita.focus();
        return false
    }
    if(form.giornoNascita.value=="")
    {
        alert("Il giorno di Nascita non puo' essere vuoto");
        form.giornoNascita.focus();
        return false;
    }
    if(form.meseNascita.value=="")
    {
         alert("Il mese di Nascita non puo' essere vuoto");
         form.meseNascita.focus();
         return false;
    }
    if(form.annoNascita.value=="")
    {
         alert("L'anno di Nascita non puo' essere vuoto");
         form.annoNascita.focus();
         return false;
    }

    if(isDate1(form.giornoNascita, form.giornoNascita.value, form.meseNascita.value, form.annoNascita.value)==false)
        {
           alert("Data Nascita non Valida");
           return false;
        }
	if(form.telefono.value == "")
    {
        alert("Il campo telefono e' obbligatorio");
        form.telefono.focus();
        return false
    }
	if(form.fax.value == "")
    {
        alert("Il campo fax e' obbligatorio");
        form.fax.focus();
        return false
    }
	if(form.email.value == "")
    {
        alert("Il campo e-mail e' obbligatorio");
        form.email.focus();
        return false
    }
	else if(checkEmailAddress(form.email)==false)
    {
        return false
    }
	
        
    if(form.delibera.value != "")
    {
        if(form.giorno.value=="")
        {
            alert("Il giorno di Delibera non puo' essere vuoto");
            form.giorno.focus();
            return false;
        }
        if(form.mese.value=="")
        {
            alert("Il mese di Delibera non puo' essere vuoto");
            form.mese.focus();
            return false;
        }
        if(form.anno.value=="")
        {
            alert("L'anno di Delibera non puo' essere vuoto");
            form.anno.focus();
            return false;
        }

        if(isDate1(form.giorno, form.giorno.value, form.mese.value, form.anno.value)==false)
        {
           alert("Data Delibera non Valida");
           return false;
        }
    }
    else
    {
        form.giorno.value = form.mese.value = form.anno.value = ""
    }
	
	
	form.metodo.value = 'modificaResponsabile'
    form.submit();
    return false;
	  
}

function prova()
{
	alert("aaa");
}
