function get_data() {

var mydate=new Date()
var year=mydate.getYear()
if (year<2000)
year="19"+year
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
document.modulo.giorno.selectedIndex=daym-1;
document.modulo.mese.selectedIndex=month;
document.modulo.anno.value=year;
}

function calcoladata(day, month, year) {

var montharray = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
document.write(day+" "+montharray[month]+" "+year);
}

function invia(nomeform)
{
      var ieKey=event.keyCode; 
      var nKey=0;
		if (ieKey==13)
                 {
                   nomeform.submit();
                  }
}

function svuotamail()
{
 document.moduloposta.nome.value = "";
 document.moduloposta.indirizzoemail.value = "";
 document.moduloposta.richiesta.value = "";
}



function inviamail()
{
 if ((document.moduloposta.nome.value == "")||(document.moduloposta.indirizzoemail.value == "")||(document.moduloposta.richiesta.value == "")||(document.moduloposta.assenso.checked == false))
    alert("Attenzione! E' necessario compilare almeno i campi del modulo contrassegnati con l'asterisco!")


 else if ((document.moduloposta.indirizzoemail.value.indexOf("@") == -1)||(document.moduloposta.indirizzoemail.value.indexOf(".") == -1))
           { alert("L'indirizzo e-mail inserito non è valido!")    }

 else document.moduloposta.submit();
}

function news_crea_controllo()
{
 if ((document.modulo.titolo.value == "")||(document.modulo.testo.value == ""))
    alert("Attenzione! E' necessario compilare almeno i campi del modulo contrassegnati con l'asterisco!")

 else document.modulo.submit();
}

function popup(pagina,base,altezza)
{
window.open(pagina,"",'"resizable=false,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, width='+base+', height='+altezza+'"');
}

function popup_nobar(pagina,base,altezza)
{
window.open(pagina,"",'"resizable=false,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, width='+base+', height='+altezza+'"');
}

