<%@ Control Language="c#" AutoEventWireup="true" Codebehind="LeftNav.ascx.cs" Inherits="XpShop.WebUI.Modules.LeftNav" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%BindLeftNav(false);%>
<div class="xp-subcat-menu">
    <div class="tl"></div>
    <div class="tr"></div>
    <div class="tm"><div class="title"><%=categoryname%></div></div>
    <div class="mm">
        <ul class="subcat_menu">
            <asp:Repeater ID="rptSubNav" runat="server">
				<ItemTemplate>
					<li>
					    <div class="topCat clear">
					        <div class="topCat_l"></div>
					        <div class="topCat_r hand" id='cid_<%# DataBinder.Eval(Container.DataItem,"CategoryNo")%>'></div>
					        <div class="topCat_m">
					            <a href='<%=webSite %>categorys-<%# DataBinder.Eval(Container.DataItem,"CategoryID")%>.<%=config.html%>'><%# DataBinder.Eval(Container.DataItem,"Name")%></a>
					        </div>
					    </div>	
					    <ul style="display:none;" class="clear">
					        <asp:Repeater Runat="server" ID="rptSubCategory" DataSource='<%# GetSubCategory(DataBinder.Eval(Container.DataItem,"CategoryNo").ToString())%>'>
						        <ItemTemplate>
							        <li>
								        <a href='<%=webSite %>categorys-<%# DataBinder.Eval(Container.DataItem,"CategoryID")%>.<%=config.html%>'><%# DataBinder.Eval(Container.DataItem,"Name")%></a>
							        </li>
						        </ItemTemplate>
					        </asp:Repeater>
				        </ul>			
				    </li>
				</ItemTemplate>
			</asp:Repeater>
        </ul>
    </div>
</div>

<script type="text/javascript">
	$(document).ready(function(){
		$(".topCat").each(function(){
		    var catul = $(this).next();
		    $(this).children(".topCat_r").addClass("jia").toggle(function(){
		        $(this).removeClass("jia").addClass("jian");
		        catul.show();
		    },function(){
		        $(this).removeClass("jian").addClass("jia");
		        catul.hide();
		    });
		});
	});
</script>