function getObj(name) {
	if (document.getElementById) {
	      return document.getElementById(name);
	}
	else if (document.all) {
	      return document.all[name];
	}
	else if (document.layers){
      return document.layers[name];
	}
}

var productTableRowCount=1;


function addNewProductFields()
{
  var table = getObj("productFields");
  var regex = /msie/;

  productTableRowCount++;
  
  var deleteProd = "<input type=\"checkbox\" name=\"delProd" + productTableRowCount + "\" onclick=\'hideRow(\"prodRow"+productTableRowCount+"\");\' />";
  var modl = '<select name=\"select2\"><option>- Model # -<\/option><\/select>';
  var srnu = '<input name=\"textfield3322223\" type=\"text\" size=\"15\" />';
  var prdp = '<input name=\"textfield3322222\" type=\"text\" size=\"13\" />';
  var popr = '<input name=\"textfield3322223\" type=\"text\" size=\"15\" />';
  var vend = '<select name=\"select3\"><option>- Distributor -<\/option><\/select>';
             
  if(regex.exec(mode))
  {
    var row = table.insertRow();

    row.id="prodRow"+productTableRowCount;
    
    /*count*/
    var iCell = row.insertCell();
    iCell.innerHTML = productTableRowCount;
    
    /*delete checkbox*/
    iCell = row.insertCell();
    iCell.innerHTML = deleteProd;
    
    /*model*/
    iCell = row.insertCell();
    iCell.innerHTML = modl;
    
    /*serial*/
    iCell = row.insertCell();
    iCell.innerHTML = srnu;
    
    /*Purchase Date*/
    iCell = row.insertCell();
    iCell.innerHTML = prdp;    
        
    /*place of purchase*/
    iCell = row.insertCell();
    iCell.innerHTML = popr;    

    /*distributer*/
    iCell = row.insertCell();
    iCell.innerHTML = vend;
    
  }
  else
  {
    table.innerHTML += '<tr id=\"prodRow'
                       +productTableRowCount+ '\"><td width=\"29\">'
                       +productTableRowCount+ '<\/td><td width=\"50\">'
                       +deleteProd+ '<\/td><td width=\"114\">'
                       +modl+ '<\/td><td width=\"122\">'
                       +srnu+ '<\/td><td width=\"106\">'
                       +prdp+ '<\/td><td width=\"122\">'
                       +popr+ '<\/td><td width=\"145\">'
                       +vend+ '<\/td><\/tr>';
                       
  }
  

}

