-end_table();
-start_table("$table_style2 width=40%");
-// Add image upload for New Item - by Joe
-start_row();
-label_cells(_("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
-// Add Image upload for New Item - by Joe
-$stock_img_link = "<img id='item_img' alt = '[";
-if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg"))
-{
- // 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
- $stock_img_link .= $_POST['NewStockID'].".jpg".
- "]' src='$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg?nocache=".rand()."'";
-}
-else
-{
- $stock_img_link .= _("No image"). "]'";
-}
-$stock_img_link .= " width='$pic_width' height='$pic_height' border='0'>";
+stock_categories_list_row(_("Category:"), 'category_id', null, $new_item);
+
+if ($new_item && (list_updated('category_id') || !isset($_POST['units']))) {