﻿<!--
添加四级分类 
-->
<input type="hidden" name="act" value="sp_[@action]" /><input type="hidden" name="did" id="did" value="[@did]" />
<dl>
    <dt>当前位置：</dt>
	<dd><a id="nav_a" href="/_sa/Product/Category/?a=[@aid]">一级分类列表</a></dd<dd>&gt;&gt;</dd>
	<dd><a id="nav_b" href="/_sa/Product/Category/?a=[@aid]&b=[@bid]">二级分类列表</a></dd><dd>&gt;&gt;</dd>
	<dd><a id="nav_c" href="/_sa/Product/Category/?a=[@aid]&b=[@bid]&c=[@cid]">三级分类列表</a></dd><dd>&gt;&gt;</dd>
	<dd><a id="nav_d" href="/_sa/Product/Category/?a=[@aid]&b=[@bid]&c=[@cid]&d=[@did]">[@tit]</a></dd>
	<dd>&gt;&gt;</dd>
    <dd id="currentStatus">[@currentStatus]</dd>
</dl>
<dl>
	<dt>所属一级分类：</dt>
	<dd><select id="aid" name="aid" onchange="a_change(this);"></select></dd>
</dl>
<dl>
	<dt>所属二级分类：</dt>
	<dd><select id="bid" name="bid" onchange="b_change(this);"></select></dd>
</dl>
<dl>
	<dt>所属三级分类：</dt>
	<dd><select id="cid" name="cid"></select></dd>
</dl>
<dl>
	<dt>四级分类名称：</dt>
	<dd><input type="text" id="tit" name="tit" value="[@tit]" size="80" /></dd>
</dl>
<dl>
	<dt>排序优先级：</dt>
	<dd><select id="pri" name="pri"></select></dd>
</dl>
<script type="text/javascript">

(function(){
	__init();
	setPriorities($('pri'),[@pri]);
})();
function a_change(o) {
    var opt = o.options[o.selectedIndex];
    var aid = opt.value;
    var bid = product_b_Dropdownlist($('bid'), aid, 0).value;
    if (bid < 1) {
        alert(opt.text + '下没有二级分类。');
        __init();
		return;
    }
	b_change($('bid'))
}
function b_change(o) {
    var opt = o.options[o.selectedIndex];
	var cid = product_c_Dropdownlist($('cid'), opt.value, 0).value;
	if (cid < 1) {
		alert(opt.text + '下没有二级分类。');
		__init();
	}
}
function __init() {

	var a = product_a_Dropdownlist($('aid'), [@aid]);
	$('nav_a').innerHTML = a.text;

	var b = product_b_Dropdownlist($('bid'), a.value, [@bid]);
	$('nav_b').innerHTML = b.text;

	var c = product_c_Dropdownlist($('cid'), b.value, [@cid]);
	$('nav_c').innerHTML = c.text;

	if ([@did] < 1) $('nav_d').innerHTML = '四级分类列表';


	/*
	var aid = product_a_Dropdownlist($('aid'), [@aid]).value;
	var bid = product_b_Dropdownlist($('bid'), aid, [@bid]).value;
	var cid = product_c_Dropdownlist($('cid'), bid, [@cid]).value;*/
}
</script>