<div id="onecat_<?php echo $D->idcategory?>" class="one-page-cat">
	<div id="cat_<?php echo $D->idcategory?>">     
        <div class="titlecat"><a href="<?php echo $C->SITE_URL?>admin/pages/categories/c:<?php echo $D->idcategory?>"><span id="txtcat_<?php echo $D->idcategory?>"><?php echo $D->name?></span></a></div>
        <div class="mrg5T"><span><?php echo $this->lang('admin_pages_categories_txt_subcategories'); ?>: <?php echo $D->numchildren?></span></div>
        <div id="msgerrordelcat<?php echo $D->idcategory?>" class="redbox"></div>
        <div class="mrg5T">
        	<span class="onlyblue hand" id="linkedit_<?php echo $D->idcategory?>"><?php echo $this->lang('admin_pages_categories_txt_edit'); ?></span>
            <span class="onlyblue hand mrg10L" id="linkdel_<?php echo $D->idcategory?>"><?php echo $this->lang('admin_pages_categories_txt_delete'); ?></span>
        </div>
    </div>
    <div id="formcat_<?php echo $D->idcategory?>" class="hide">
        <form id="formcat<?php echo $D->idcategory?>" name="formcat<?php echo $D->idcategory?>" method="post" action="">
        <div class="grey1"><?php echo $this->lang('admin_pages_categories_txt_category'); ?></div>
        <div><input name="namecategory<?php echo $D->idcategory?>" type="text" id="namecategory<?php echo $D->idcategory?>" class="boxinput withbox" value="<?php echo $D->name?>" /></div>
        <div id="msgerrorcat<?php echo $D->idcategory?>" class="redbox"></div>
        <div class="mrg5T mrg5B">
        	<span><input type="submit" name="bupdate<?php echo $D->idcategory?>" id="bupdate<?php echo $D->idcategory?>" value="<?php echo $this->lang('admin_pages_categories_txt_update'); ?>" class="bblue hand"/></span> <span id="bcancel<?php echo $D->idcategory?>" class="onlyblue hand"><?php echo $this->lang('admin_pages_categories_txt_cancel'); ?></span>
        </div>
        
        </form>
    </div>
</div>
<script>
	$('#linkedit_<?php echo $D->idcategory?>').click(function(){
		$('#cat_<?php echo $D->idcategory?>').slideUp('slow', function(){
			$('#formcat_<?php echo $D->idcategory?>').slideDown('slow');
		});
		return false;
	});
	
	$('#bcancel<?php echo $D->idcategory?>').click(function(){
		$('#formcat_<?php echo $D->idcategory?>').slideUp('slow', function(){
			$('#cat_<?php echo $D->idcategory?>').slideDown('slow',function(){
				$('#namecategory<?php echo $D->idcategory?>').val('<?php echo $D->name?>');	
			});
		});
		return false;
	});
	
	$('#bupdate<?php echo $D->idcategory?>').click(function(){
		updateCategory('#msgerrorcat<?php echo $D->idcategory?>', '#bupdate<?php echo $D->idcategory?>', '#cat_<?php echo $D->idcategory?>', '#formcat_<?php echo $D->idcategory?>', <?php echo $D->idcategory?>,0);
		return false;
	});
	
	$('#linkdel_<?php echo $D->idcategory?>').click(function(){
		deleteCategory('#msgerrordelcat<?php echo $D->idcategory?>', '#onecat_<?php echo $D->idcategory?>', <?php echo $D->idcategory?>,0);
		return false;
	});
</script>