the error is at this line
var row=table1.insertRow()because you have two tables whose id are "tt",
var table1=document.all.tt
returns the collection, try to change the id for one of the tables, or try
var row=table1[0].insertRow()also change
var arr=[a,b,c]
===>
var arr=['a','b','c']