print("$frmPartElementText[$idx]");
 print("\t</td>\n");
 print("\t<td>");
 $fieldName = $frmPartElementNames[$idx];
 $fieldType = $frmPartElementTypes[$idx];
 if (IsSet($_POST[$fieldName])) {
   $fieldValue = $_POST[$fieldName];
 } else {
   $fieldValue = "";
 }
 if ($fieldName == "partDrawingFilePath") {
   writeInputFile($fieldName);
 } else if ($fieldName == "partPreviewImage") {
   writeInputFile($fieldName);
 } else if ($fieldName == "partCustomerName") {
   writeSelectAndAdd($fieldName, $customerNames, 180, "addCustomer", "Add Customer", "javascript:showAddCustomer();");
 } else {
   writeTextBox($fieldName, $fieldValue);
 }
 print("\t</td>");
 
 /* Add the operations list for the first row with
    a column span of size $frmPartElementCount */
 /* A list of operations that have been added for this part */
 if ($idx == 0) {
   print("\t<td>");
   print("Operations added:<br>");
   print("\t</td>");
 }
 if ($idx == 1) {
   print("\t<td valign=\"top\" rowspan=\"$frmPartElementCount\">");
    } else {
      print("<table border=\"$mainTableBorder\" width = \"$masterTableWidth\">\n");
    }

    for ($idx = 0; $idx < $frmOperationTHElementCount; $idx++) {
      print("\t<tr width = \"$operationTHTableRowWidth\">\n");
      print("\t<td width = \"200\">");
      print("$frmOperationTHElementText[$idx]");
      print("\t</td>\n");
      print("\t<td width = \"200\">");
      $fieldName = $frmOperationTHElementNames[$idx];
      $fieldType = $frmOperationTHElementTypes[$idx];
      if ($fieldName == "operationTHHolderName") {
        writeSelectAndAdd($fieldName, $holderNames, 180, "addHolder", "Add New Holder", "javascript:showAddHolder();");
      } else if ($fieldName == "operationTHToolName") {
        writeSelectAndAdd($fieldName, $toolNames, 180, "addTool", "Add New Tool", "javascript:showAddToolSkipSubmit();");
      } else{
        writeTextBox($fieldName, $fieldValue);
      }
      print("\t</td>");
      print("\t</tr>\n");
    }

    print("\t<tr>\n");
    print("\t<td>");
    writeButton("insertHolder", "Insert Tool-Holder", "javascript:addNewToolHolderToList();");

    print("<input type=\"text\" id=\"holderStore\">\n</input>\n");
    print("<input type=\"text\" id=\"toolStore\">\n</input>\n");

    print("\t</td>");
    }
    */
      print("<table border=\"$mainTableBorder\">\n");
    for ($idx = 0; $idx < $frmOperationElementCount; $idx++) {
      print("\t<tr width = \"$operationTableRowWidth\">\n");
      print("\t<td width = \"200\">");
      print("$frmOperationElementText[$idx]");
      print("\t</td>\n");
      print("\t<td width = \"300\">");
      $fieldName = $frmOperationElementNames[$idx];
      $fieldType = $frmOperationElementTypes[$idx];
      $fieldValue = "";
      if ($frmOperationElementDBNames[$idx] == "Name") {
        writeSelect($fieldName, $frmOperationNameValues);
      } else if ($frmOperationElementDBNames[$idx] == "Machine") {
        writeSelectAndAdd($fieldName, $machineNames, 180, "createMachine", "Add Machine", "javascript:showAddMachine();");
      } else {
        writeTextBox($fieldName, $fieldValue);
      }
      /* Add the tools list for the first row with
         a column span of size $frmOperationElementCount */
      /* A list of tools that have been added for this operation */
      print("\t</td>");
      print("\t</tr>\n");
    }

    print("\t<td valign=\"center\">");
    print("Tools and Holders added:<br>");
    print("\t</td>");
    print("\t<td valign=\"center\">");
    writeSelectMultiline("opToolHolderList", 10, 275);
        writeSelectAndAdd($fieldName, $supplierNames, 250, "addSupplier", "Add Supplier", "javascript:showAddSupplierSkipSubmit();");
      } else {
        writeTextBox($fieldName, $fieldValue);
      }

      /* Add the inserts list for the first row with
         a column span of size $frmToolElementCount */
      /* A list of inserts that have been added for this tool */
      if ($idx == 0) {
        print("\t<td>");
        print("Inserts for the part:<br>");
        print("\t</td>");
      }
      if ($idx == 1) {
        print("\t<td valign=\"top\" rowspan=\"$frmToolElementCount\">");
        writeSelectAndAdd("insertSelect", $insertPartNumbers, 250, "createInsert", "Create Insert", "javascript:showAddInsert();");
	writeButton("addInsert", "Add Insert", "javascript:addInsertToList();");
        print("<select id = \"insertList\" size = \"$frmToolElementCount\" style=\"width:250\">\n");
        print("</select>");
        print("<br>");
        print("\t</td>");
      }
      print("\t</td>");
      print("\t</tr>\n");
    } 

    print("\t<tr>\n");
    print("\t<td>");
    writeSubmit("addTool", "Insert Tool");

   /* A hidden textbox to store the tools for posting */