/*function addfile()
   {
       //reading number of current files and putting the number in a variable

       var filesno=document.getElementById("f_no").getAttribute("value");
       filesno++;//incrementing number of files
       var tb1=document.getElementById("tb");
        var tbody = tb1.tBodies.item(0);//storing the body content of the table into a variable
        var row = document.createElement("TR");//creating a row in a new ariable

        var td1 = document.createElement("TD");//creating  text node "td", with the value of number of files
        td1 .appendChild (document .createTextNode (filesno));

        var td3 = document.createElement("TD");//creating the input control and setting it's attribute
        var file=document.createElement ('<input>');
        file.setAttribute ('type','file');
        file.setAttribute ('name','fileupload'+filesno);
        td3 .appendChild (file );//adding the file control to the table data "td"

        //adding the "TD"s we created above to the row and adding the row to the table body
        row.appendChild(td1);
        row.appendChild(td3);
        tbody.appendChild(row);

        //updating the hidden input with the new number of files
    document.getElementById("f_no").setAttribute("value",filesno);
   }

function removefile()
   {
   //reading the number of rows in the table, ten deleting the last row
   if(tb.rows.length>2){
   tb.deleteRow(tb.rows.length-1);
   document.getElementById("f_no").setAttribute("value",document.getElementById("f_no").getAttribute("value")-1);
   }


   } */
   function addRow(tb)
    {
    
           var filesno=document.getElementById("f_no").getAttribute("value");
           filesno++;
           var table = document.getElementById(tb);
           var rowCount = table.rows.length;
           var row = table.insertRow(rowCount);
           var cell = row.insertCell(0);
        
	       var element2 = document.createElement("input");
	       element2.type = "file";
           element2.setAttribute ('name','fileupload'+filesno);
		   element2.setAttribute ('style','margin-left:12px;');
		  
	       cell.appendChild(element2);
		    
           document.getElementById("f_no").setAttribute("value",filesno);
	}
   function deleteRow(tb)
            {
                var table = document.getElementById(tb);
                if(table.rows.length>1)
                {
                   table.deleteRow(table.rows.length-1);
                   document.getElementById("f_no").setAttribute("value",document.getElementById("f_no").getAttribute("value")-1);
	            }
            }


