}
        break;
    case 'add':
        if ((int) $pro->add_category($_POST['category'], $_POST['parent_id'], $_POST['template_id']) == $pro->err_duplicate) {
            alert(sprintf($sc_Duplicate, $sc_category));
        }
        break;
    case 'delete':
        if (!$pro->delete_category($_POST['id'])) {
            alert(sprintf($sc_CannotDelete, $_POST['txt_name']));
        }
        break;
    case 'edit':
        $edit_id = $_POST['id'];
        $disabled = $_POST['close_win'] > 0 ? 'disabled' : '';
        $pro->get_categories($edit_id, false);
        if ($pro->next_record()) {
            $edit_name = $pro->f('category_name');
            $edit_parent = $pro->f('parent_id');
        }
        $pro->get_attach_categories($edit_id, true);
        while ($pro->next_record()) {
            $att_arr[] = $pro->f('id');
        }
        break;
}
$trash = '<img src="' . $GO_THEME->images['delete'] . '" border="0">';
$spliter = '<tr><td colspan="100" height="1"><img src="' . $GO_THEME->images['cccccc'] . '" border="0" height="1" width="100%" /></td></tr>';
$pro->get_attach_categories();
while ($pro->next_record()) {
    $att_arr[] = -5;
		<td width="40%" nowrap><?php 
echo $sc_category_name;
?>
 </td>
		<td></td>
	</tr>
<?php 
$pro2 = new products();
if ($pro->num_rows() > 0) {
    $pro->seek();
}
$i = 0;
while ($pro->next_record()) {
    $id = $pro->f('category_id');
    $name = $pro->f('category_name');
    $pro2->get_categories($pro->f('category_id'));
    $count = $pro2->num_rows();
    $click_del = "javascript:click_del(document.frmCategory, {$id} , \"{$name}\" , \"" . sprintf($count == 0 ? $sc_ConfirmDeleteCategory2 : $sc_ConfirmDeleteCategory, $name) . "\")";
    //			<a href="<?php echo "javascript:set_edit(document.frmCategory,'$id','$name',0,'$count')"  ">
    ?>
	
	<tr class="HiLi">
		<td align="center"> <?php 
    echo ++$i;
    ?>
 </td>
		<td nowrap>
			<a href="<?php 
    echo "javascript:click_txt(document.frmCategory,'edit',document.frmCategory.id,'{$id}','{$count}')";
    ?>
"> 
         $part_number = $_POST['part_number'];
         $VAT = $_POST['VAT'];
         $cate = $_POST['attachment_categories'];
     }
 case 'add':
     if (!isset($change_case)) {
         $change_case = 'add_change';
     }
     $catedrop = new dropbox();
     if ($is_attachment == true) {
         $pro->get_attach_categories();
         while ($pro->next_record()) {
             $catedrop->add_value($pro->f('id'), $pro->f('name'));
         }
     } else {
         $pro->get_categories(-2);
         $first = true;
         $hasa = false;
         while ($pro->next_record()) {
             if (first) {
                 $first_cate_id = $pro->f('category_id');
                 //						$category_id = $pro->f('category_id');
                 $first = false;
             }
             if ($category_id == $pro->f('category_id')) {
                 $hasa = true;
             }
             $catedrop->add_value($pro->f('category_id'), $pro->f('category_name'));
         }
         if (!$hasa) {
             $category_id = $first_cate_id;
echo $sc_category;
?>
</td>
	  </tr>
	
<?php 
$pro->get_categories(0);
$num = $pro->num_rows();
$attach = new products();
$attach->get_attach_categories();
$att_num = $attach->num_rows();
for ($i = 1; $pro->next_record(); $i++) {
    $id = $pro->f('category_id');
    $click = "javascript:click_txt(document.frmProList,'expand',document.frmProList.id,'{$id}','')";
    $pro2 = new products();
    $pro2->get_categories($id);
    $num2 = $pro2->num_rows();
    if ($num2 > 0) {
        $no_exp = true;
        if (count($exp) > 0) {
            if (in_array($id, $exp)) {
                $img = $image['mnode'];
                if ($i == $num && $att_num == 0) {
                    $img = $image['mlastnode'];
                }
                $a = "<a href=\"javascript:click_txt(document.frmProList,'shrink',document.frmProList.id,'" . $pro->f('category_id') . "','')\">";
                $aE = '</a>';
            } else {
                $img = $image['pnode'];
                if ($i == $num && $att_num == 0) {
                    $img = $image['plastnode'];