function articoli_controlla() {
	var frm = document.articoli_form1;
	if (frm.articoli_titolo.value == ""){
		alert('Dato immesso non valido');
		frm.articoli_titolo.focus();
		return false;
	}
	if (frm.Data.value == ""){
		alert('Inserire una data');
		frm.Data.focus();
		return false;
	}
	if(frm.data_scad.value != ""){
		if(frm.articoli_home.checked == false){
			alert("La data di scadenza è solo per gli articoli da visualizzare in Home-page");
			frm.data_scad.focus();
			return false;
		}	
	}
	frm.data_scad.disabled = false;
	frm.Data.disabled = false;
	
	frm.submit();
	return true;
	
}

function espandi(livello){
	if(document.getElementById(livello).style.display==""){
		document.getElementById(livello).style.display="none";
	}
	else{
		document.getElementById(livello).style.display="";
	}
}

function controlla_commento(){
	var frm = document.getElementById('articoli_form');
	if (frm.articolo_commento.value == ""){
		alert('Inserire un testo');
		frm.articolo_commento.focus();
		return false;
	}
	frm.submit();
	return true;
}

function cancella_data(){
	document.getElementById('data_scad').value = '';
}


function stampa(rnd){
      if(document.getElementById("commenti_"+rnd)!=null){
        var testo_commenti = document.getElementById("commenti_"+rnd).innerHTML;
      }else{
        var testo_commenti = "";
      }
  	  var testo=document.getElementById("printing_"+rnd).innerHTML + testo_commenti;
      var nuovo= testo ;
  	  var risulta=window.open('');
    	risulta.document.write(nuovo);
    	risulta.print();
    	risulta.document.close();
  }
						