﻿
    function addRow(tableID) {

        var table = document.getElementById(tableID);

        var rowCount = table.rows.length;
        var row = table.insertRow(rowCount);

        var cell1 = row.insertCell(0);
        var element1 = document.createElement("input");
        element1.type = "file";
        element1.setAttribute("style", "width:300px;");
        element1.setAttribute("id", "file" + rowCount);
        element1.setAttribute("name", "file" + rowCount);
        cell1.appendChild(element1);

        var cell2 = row.insertCell(1);
        var element2 = document.createElement("img");
        element2.setAttribute("src", "/Images/icons/svn_deleted.png");
        element2.setAttribute("id", "img" + rowCount);
        element2.setAttribute("name", "img" + rowCount);        
        element2.setAttribute("onclick", "removeTableRow('"+tableID+"'," + rowCount + ")");
        cell2.appendChild(element2);
    }

    function removeTableRow(tableId, rowCount) {        
        var tbl = document.getElementById(tableId);
        tbl.deleteRow(rowCount);
    }

