mi da errore alla riga

val[a] = document.frmInsUsato.["pagamento_"+a+"rata"].value;

dicendo

previsto identificatore....