window.onload = function(){
addElement();
}
function addElement() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById('theValue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'item_'+num;
  newdiv.setAttribute('id',divIdName);
  newdiv.innerHTML = '<table cellpadding="0" cellspacing="0" class="quoteItem"><tr><td><br \/><a href="#" onclick="removeElement(\''+divIdName+'\')"><img src="img/delete.png" alt="" class="icon" /></a><a href="#" onclick="removeElement(\''+divIdName+'\')">Remove<\/a><\/td><td>Qty<br \/><input type="text" size="5" name="qty_'+divIdName+'" \/><\/td><td>Manufacturer<br \/><input type="text" name="man_'+divIdName+'" \/><\/td><td>Model #<br \/><input type="text" name="mod_'+divIdName+'" \/><\/td><td>Description<br \/><input type="text" name="desc_'+divIdName+'" \/><\/td><td>Condition<br \/><select name="condition_'+divIdName+'"><option value="">Select...<\/option> <option value="brand-new">Brand New<\/option> <option value="like-new">Like New<\/option><option value="slightly-used">Slightly Used<\/option> <option value="fair">Fair Condition<\/option> <option value="poor">Poor Condition<\/option> <\/select> <\/td><\/tr><\/table>';
  ni.appendChild(newdiv);
}				
function removeElement(divNum) {
  var d = document.getElementById('myDiv');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}
