
function InsAdmin(idadmin){
  openCenteredWindow('form_admin.php?call=first&idadmin='+idadmin,'admin',350,400,'no','no','no','no');
}

function InsNews(idnews){
  openCenteredWindow('form_news.php?call=first&idnews='+idnews,'news',450,750,'yes','no','no','no');
}

function InsCase(idcase){
  openCenteredWindow('form_case.php?call=first&idcase='+idcase,'case',400,720,'no','no','no','no');
}

function InsTipo(idtipo){
  openCenteredWindow('form_dest.php?call=first&idtipo='+idtipo,'tipo',250,450,'no','no','no','no');
}

function InsCorso(idcorso,tipo){
  openCenteredWindow('form_corso.php?call=first&idcorso='+idcorso+'&tipo='+tipo,'corso',600,480,'yes','no','no','no');
}

function DeleteItem(valore,tipo){
  if (ConfirmDelete('it')) 
    location.href='cancella.php?tipo='+tipo+'&id='+valore;
}

function InsContatto(idcontatto){
  openCenteredWindow('form_contatto.php?call=first&idcontatto='+idcontatto,'contatto',500,400,'no','no','no','no');
}

function InsComunicato(idcomun){
  openCenteredWindow('form_comunicato.php?call=first&idcomun='+idcomun,'comunicato',450,750,'yes','no','no','no');
}

function InsRassegna(idrassegna){
  openCenteredWindow('form_rassegna.php?call=first&idrassegna='+idrassegna,'rassegna',450,750,'yes','no','no','no');
}

function DisabilitaData(valore){
   document.nuovo.data_scadenza_voce.disabled=valore;
   document.nuovo.noscad.disabled=valore;
}

function CheckStatusOnLoad(){
   if ((document.nuovo.attiva_voce[0].checked==false) && (document.nuovo.attiva_voce[1].checked==false))
         document.nuovo.attiva_voce[1].checked=true;
         
   if (document.nuovo.attiva_voce[1].checked==true)  DisabilitaData(true);
   
   	  
}

function CheckPreventivi(theform){
 var messaggio;
 messaggio='';
 if(theform.nome_azienda.value=='')
   messaggio+="- nome azienda\n";
 if(theform.responsabile.value=='')
   messaggio+="- responsabile\n";
 if(theform.funzione_aziendale.value=='')
   messaggio+="- funzione aziendale\n";
 if(theform.email.value=='')
   messaggio+="- e-mail\n";
 if(theform.telefono.value=='')
   messaggio+="- telefono\n";        
 if(messaggio != ''){
   alert ("I seguenti campi sono obbligatori: \n"+messaggio);
   return false;
 }else{
   var esito=ChkEmail(theform.name,'email','it');
   if(esito){
     var risposta=confirm("Inviare la richiesta?");
     if (risposta) 
       return true;
     else
       return false;	  
   }else
     return false;	   
 }    
}


function CheckLavoraConNoi(theform){
 var messaggio;
 messaggio='';
 if(theform.nome.value=='')
   messaggio+="- nome\n";
 if(theform.cognome.value=='')
   messaggio+="- cognome\n";
 if(theform.indirizzo.value=='')
   messaggio+="- indirizzo\n";
 if(theform.citta.value=='')
   messaggio+="- cittą\n";  
 if(theform.anno_luogo_nascita.value=='')
   messaggio+="- anno e luogo di nascita\n";  
 if(theform.email.value=='')
   messaggio+="- e-mail\n";
 if(theform.telefono.value=='')
   messaggio+="- telefono\n";        
 if(messaggio != ''){
   alert ("I seguenti campi sono obbligatori: \n"+messaggio);
   return false;
 }else{
   var esito=ChkEmail(theform.name,'email','it');
   if(esito){
      var risposta=confirm("Inviare la richiesta?");
      if(risposta)
         return true;
      else
         return false;
   }else
   	  return false;	 	  
 }    
}

function CheckIscrizione(theform){
  var esito=ChkEmail(theform.name,'email_lista','it');
  if(esito){
      var risposta=confirm("Si conferma l'iscrizione?");
      if(risposta)
         return true;
      else
         return false;
   }else
   	  return false;	 	  
}
