// Oggetti Javascript per Documenti

function Documento(ID,Categoria,Descrizione,Dimensione,Nomefile,Ordine,UltimoAggiornamento,Squadra_ID,Squadra_Nome,Squadra_Ordine) {
	this.ID = ID
	this.Categoria = Categoria
	this.Descrizione = Descrizione
	this.Dimensione = Dimensione // in kb
	this.Nomefile = Nomefile
	this.Ordine = Ordine
	this.UltimoAggiornamento = UltimoAggiornamento
	this.Squadra_ID = Squadra_ID
	this.Squadra_Nome = Squadra_Nome
	this.Squadra_Ordine = Squadra_Ordine
}	

function GeneraDocumenti() {
var i
var tabe = new Tabella(1,1)
var arrRV = arrDocumenti
var riga,pd,grigio
	tabe.nome="Documenti"
	tabe.larghezza = 100
	tabe.border=0
	tabe.cellspacing=0
	tabe.cellpadding = 2
	tabe.stile = "ClassEl"
	riga=2
	tabe.intestazioni=true
	tabe.SetValore(1,1,"Cat")
	tabe.SetStile(1,1,"Cella")
	tabe.SetValore(1,2,"File")
	tabe.SetStile(1,2,"Cella")
	tabe.SetValore(1,3,"Descrizione")
	tabe.SetStile(1,3,"Cella")
	tabe.SetValore(1,4,"Kb")
	tabe.SetStile(1,4,"Cella")
	tabe.SetValore(1,5,"Data")
	tabe.SetStile(1,5,"Cella")
	tabe.SetStileRiga(1,"IntRossoBlu")
	for (i=1;i<arrRV.length;i++) {
		if ((riga % 2) == 0) {
			pd="D"
		} else {
			pd="P"
		}
		tabe.SetStileRiga(riga,"t-xxs")
		tabe.SetStile(riga,1,"Doc"+pd)
		tabe.SetValore(riga,1,"<nobr><span class='t-xxs'>" + arrRV[i].Categoria + "</span></nobr>")
		tabe.SetStile(riga,2,"Doc"+pd)
		tabe.SetValore(riga,2,"<nobr><span class='t-xxs'><a href='doc/" +arrRV[i].Nomefile +"'>" + arrRV[i].Nomefile + "</a></span></nobr>")
		tabe.SetStile(riga,3,"Doc"+pd)
		tabe.SetValore(riga,3,"<span class='t-xxsB'>" + arrRV[i].Descrizione + "</span>")
		tabe.SetStile(riga,4,"Doc"+pd)
		tabe.SetValore(riga,4,"<nobr><span class='t-xxs'>" + arrRV[i].Dimensione + "</span></nobr>")
		tabe.SetStile(riga,5,"Doc"+pd)
		tabe.SetValore(riga,5,"<nobr><span class='t-xxs'>" + arrRV[i].UltimoAggiornamento + "</span></nobr>")
		riga++
	} // for
	tabe.Stampa()
}