{if $full_page}
{include file="page_header.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<form method="post" action="" name="listForm">
<div class="list-div" id="listDiv">
{/if}
{foreach from=$category_list item=list key = key name=foo}
<table width="100%" cellspacing="0" cellpadding="0" class="list-table" {if $smarty.foreach.foo.index>0} style="display:none;border-top:1px #d6dfe7 solid;"{else}style="border-top:1px #d6dfe7 solid;"{/if} id="language_{$key}-table">

	<tr class="thead">
	<th align="left">分类名称</th>
	<th>排序</th>
	<th align="left">操作</th>
	</tr>
	{foreach from=$list item=category}
	{if $category.name <> ''}
	<tr align="center" {if $category.is_leaf eq 1}onclick="rowClicked(this,{$key})"{/if} class="{$category.level}">
	<td align="left" class="first-cell" >
	{if $category.is_leaf eq 0}
	<img src="images/menu_minus.gif" width="9" height="9" border="0" style="margin-left:{$category.level}em" />
	{else}
	<img src="images/menu_arrow.gif" width="9" height="9" border="0" style="margin-left:{$category.level}em" />
	{/if}
	<span><a href="product.php?act=list&category_id={$category.category_id}">{$category.name}</a></span>
	</td>
	<td width="10%" align="center"><span onclick="listTable.edit(this, 'edit_sort_order', {$category.category_id})">{$category.sort_order}</span></td>
	<td width="20%" align="left" class="operation">
	<a href="category.php?act=edit&amp;id={$category.category_id}" class="op_edit" title="编辑"></a>
	<a href="javascript:;" onclick="listTable.remove({$category.category_id}, '您确认要删除吗?')" class="op_del" title="删除"></a>
	{if $category.is_leaf eq 0}
	<a href="category.php?act=move&id={$category.category_id}" title="转移产品" class="op_move"></a>
	{/if}	  
	</td>
	</tr>
	{/if}
	{/foreach}
</table>
{/foreach}
{if $full_page}
</div>
</form>
{literal}
<script language="JavaScript">
<!--
var imgPlus = new Image();
imgPlus.src = "images/menu_plus.gif";

function rowClicked(obj,language_id)
{
    var tbl = document.getElementById("category_"+language_id+"-table");
    var lvl = parseInt(obj.className);
    var fnd = false;
    for (i = 0; i < tbl.rows.length; i++)
    {
        var row = tbl.rows[i];
        if (tbl.rows[i] == obj)
        {
            fnd = true;
        }
        else
        {
            if (fnd == true)
            {
                var cur = parseInt(row.className);
                if (cur > lvl)
                {
                    row.style.display = (row.style.display != 'none') ? 'none' : (Browser.isIE) ? 'block' : 'table-row';
                }
                else
                {
                    fnd = false;
                    break;
                }
            }
        }
    }
    for (i = 0; i < obj.cells[0].childNodes.length; i++)
    {
        var imgObj = obj.cells[0].childNodes[i];
        if (imgObj.tagName == "IMG" && imgObj.src != 'images/menu_arrow.gif')
        {
            imgObj.src = (imgObj.src == imgPlus.src) ? 'images/menu_minus.gif' : imgPlus.src;
        }
    }
}
//-->
</script>
{/literal}
{insert_scripts files="tab.js"}
{include file="page_footer.htm"}
{/if}