

  function outputItems(json) {

var itemList = "";

 tableHeader = '<table width="100%" border="0" cellspacing="1" cellpadding="5">' +
                  '<tr>' +
                    '<th width="19%" scope="col">Incident</th>' +
                    '<th width="6%" scope="col">Date</th>' +
                    '<th width="6%" scope="col">Time</th>' +
                    '<th width="22%" scope="col">Address block</th>' +
                  '</tr>';

    for (i=0;i<json.count;i++) {
      itemList += make_item(json.value.items[i], i);
    }

  tableFooter = '</table>';

  return tableHeader + itemList + tableFooter;
}

function make_item(item, item_id) {

return '<tr>' +
         '<td>' + not_null(item.incident) +'</td>' +
         '<td>' + not_null(item.date) +'</td>' +
         '<td>' + not_null(item.time) +'</td>' +
         '<td>' + not_null(item.address) +'</td>' +
         '</tr>';

}

function not_null(item) {
   if(item == undefined){
    return '';
    } else {
    return item;
    }
}
