function fillTable(tableID,list,cols, heading){   
    var theTable = document.getElementById(tableID);
    var row, cell, text;
    var lastInList = list.length;
    var item, rowData;

    for (var i=0; i<lastInList; i++) {
       row = theTable.insertRow(i+heading);      
       rowData = list[i];
       // insert 'cols' cells
       for (var j=0; j<cols; j++)  {
          cell = row.insertCell(j);  
          item = rowData[j];
 
          switch (j) {
	  case 0 : plainText(item,cell); break;
	  case 1 : boldText (item,cell); break;
	  case 2 : plainText(item,cell); break;
	  case 3 : linkText (item,cell); break;
	  default: plainText(item,cell); break;
	  }
       }        
    }
}

function plainText (item,cell)
{
 cell.innerHTML = item;
}

function boldText (item,cell)
{
 cell.innerHTML = "<b>" + item + "</b>";
}

function linkText (item,cell)
{
 cell.innerHTML = "<a href='http://" + item + "'>" + item + "<\a>";
}

