function addRowToTable(count)
{
  var count = parseInt(count) + 1;
  document.getElementById('remove'). style.display="";
  var tbl = document.getElementById('tblSample');
  var lastRow = tbl.rows.length;
  if(lastRow==count) 
  {
	document.getElementById('add').style.display="none";	
  }
  if(lastRow<=count)
  {
  // if there's no header row in the table, then iteration = lastRow + 1
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  // left cell
  var cellLeft = row.insertCell(0);
  cellLeft.className = 'signin_txt';
  cellLeft.align = 'right';
  var textNode = document.createTextNode('Thumbnail Image');	
  cellLeft.appendChild(textNode);
  
  // right cell
  var cellRight = row.insertCell(1);
  var el = document.createElement('input');
  el.type = 'file';
  el.name = 'thumb' + (iteration-1);
  el.id = 'thumb' + (iteration-1);
  el.size = 27;
  cellRight.appendChild(el);
  
  // select cell
  var cellRightSel = row.insertCell(2);
  cellRightSel.appendChild();
 }
}
function removeRowFromTable()
{
   	
  document.getElementById('add').style.display="";
  var tbl = document.getElementById('tblSample');
  var lastRow = tbl.rows.length;
  if (lastRow > 3) tbl.deleteRow(lastRow - 1);
  
  if(lastRow==4)  
  	 document.getElementById('remove').style.display="none";
}
