<%@ Page language="c#" Codebehind="TagProduct.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.TagProduct" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav2" Src="Modules/LeftNav2.ascx" %>
<%@ Register TagPrefix="uc1" TagName="CatSpecialProduct2" Src="Modules/CatSpecialProduct2.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UserNewlyViewProducts" Src="Modules/UserNewlyViewProducts2.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>		
		<!--#include file="../../inc/encoding.inc"-->
		<title><%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<script src="<%=webSite %>inc/getParmByUrl.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/tag_list.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/list_compare.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/jquery.easydrag.handler.beta2.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/multi_popup.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/AddFav.js" type="text/javascript"></script>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/pop.css" type="text/css" rel="stylesheet" />
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/list.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript">
		    var extend = '<%=config.html %>';
			var baseUrl="<%=webSite %>";
			var shopFolder="<%=webSite %>";
			var compareUrl="<%=webSite %>Compare.aspx";
			var prePage="<%=GetResourceString("PreviousPage")%>";
			var nextPage="<%=GetResourceString("NextPage")%>";
			var tagID = "<%=Request.QueryString["TagID"] == null ? "1" : Request.QueryString["TagID"] %>";
			var cID ="<%=Request.QueryString["CatID"] == null ? "0" : Request.QueryString["CatID"] %>";
			var page="<%=Request.QueryString["page"] == null ? "1" : Request.QueryString["page"] %>";
			var display="<%=Request.QueryString["display"] == null ? "2" : Request.QueryString["display"] %>";
			var sort="<%=Request.QueryString["OrderSort"] == null ? "1" : Request.QueryString["OrderSort"] %>";
			var hadFav = '<%=GetResourceString("HadFavourite") %>';
			var favSucc = '<%=GetResourceString("FavouriteSucc") %>';
			var productID = 0;
        </script>
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear">
			<!--位置导航开始-->
			<div class="path"><%=GetCurrentPosition()%><%=Request.QueryString["TagID"] == "6" ? "新品上架" : "" %></div>
			<!--位置导航结束-->
			<div class="clear">
			    <div id="content_left">
			        <!--分类开始-->
                    <uc1:LeftNav2 id="LeftNav1" runat="server"></uc1:LeftNav2> 
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $('#cid_' + parentNo).click();
	                        $('#cid_' + categoryNo).click();
	                    });
                    </script>   
                    <!--end--> 
					<!--最近浏览的商品开始-->
                    <uc1:UserNewlyViewProducts id="UserNewlyViewProducts1" runat="server"></uc1:UserNewlyViewProducts>
                    <!--最近浏览的商品结束-->
			    </div>
			    <% if(Request.QueryString["display"] == "1") {%>
					<%BindProductList("dlProducts1",10);%>
				<%}else if(Request.QueryString["display"] == "3"){%>
					<%BindProductList("dlProducts2",32);%>
				<%}else{%>
					<%BindProductList("dlProducts3",32);%>
				<%}%>      			
			    <div id="content_right">
			        <!--商品列表开始-->
			        <div class="list_style">
			            <div style="float:left; line-height:36px; margin-right:10px;"><asp:Label ID="lblPdtNum" runat="server"></asp:Label></div>
						<div class="sort_mode">排序方式：</div>
						<%=GetSortMode()%>
						<div class="display_mode">
							<%=GetDisplayMode()%>   
						</div>
						<div class="page_change">
							<asp:Label ID="lblTopPage" CssClass="pagelblpage" runat="server"></asp:Label>
						</div>
			        </div>
				    <div class="plist">
						<% if(Request.QueryString["display"] == "1") {%>
					    <div class="pro_hlist">
						    <asp:DataList id="dlProducts1" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="1" RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" Width="100%" runat="server">
							    <ItemTemplate>													
								    <table cellpadding="3" cellspacing="0" width="100%">
									    <tr>
                                            <td width="20%">
                                                <div class="xp-pdt-img">
                                                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target="_blank" ><img width="160" height="160" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>" alt='' /></a>
                                                </div>
										    </td>
										    <td width="60%" align="left" valign="top">
										        <table cellpadding="3" cellspacing="0" border="0">
											        <tr>
												        <td class="pro_hlist_pname">
												            <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target=_blank ><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a>
											            </td>
											        </tr>
											        <tr>
											            <td><%#DataBinder.Eval(Container.DataItem,"ShortDesc")%></td>
											        </tr>
											        <tr>
											            <td>
                                                            <div class="xp-list-marketprice1">
                                                                <%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:f}")%><%--&nbsp;&nbsp;&nbsp;&nbsp;<span><%#int.Parse(DataBinder.Eval(Container.DataItem,"Quantity").ToString()) > 20 ? "" : ("仅剩<font color=red><b>" + DataBinder.Eval(Container.DataItem,"Quantity") + "</b></font>件")%></span>--%>
                                                            </div>
											                <div class="xp-list-memberprice1">
                                                                <% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%>
                                                            </div>
											                <%--<%=GetResourceString("MarketPrice")%>：<%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem, "MarketPrice", "{0:f}")%>--%>
											            </td>
											        </tr>
										        </table>
										    </td>
										    <td width="20%" valign="bottom">
										        <div class="clear">
							                        <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target="_blank"><div class="details"></div></a>
							                    </div>
							                    <div class="clear" style=" padding:5px 0px 5px 0px !important; padding:0px; margin:0px 0px 0px -3px !important; margin:5px 0px 5px -6px;">
							                        <a><div class="favorite" pid='<%#DataBinder.Eval(Container.DataItem,"ProductID")%>'></div></a>
							                    </div>
							                    <div class="clear" style=" padding:5px 0px 5px 0px !important; padding:0px;">
							                        <%# Compare(DataBinder.Eval(Container.DataItem, "ProductID").ToString(), DataBinder.Eval(Container.DataItem, "ProductName").ToString(), Request.Url.ToString())%>
							                    </div>
										    </td>
									    </tr>
									    <tr>
									        <td colspan="3"><hr size="1" noshade="noshade" style="border:1px #cccccc dotted"/></td>
									    </tr>
								    </table>
							    </ItemTemplate>
						    </asp:DataList>
					    </div>
					    <%}else if(Request.QueryString["display"] == "3"){%>
					    <div class="pro_piclist">
						    <asp:DataList id="dlProducts2" CellPadding="3" CellSpacing="12" GridLines="None" RepeatColumns="4"
							    RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" Width="100%" runat="server">
							    <ItemStyle CssClass="alignCenterTop" />
							    <ItemTemplate>													
								    <table cellpadding="3" cellspacing="0" style="border:1px #CCCCCC solid" align="center">
									    <tr>
										    <td>
											    <div class="xp-pdt-img">
                                                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target="_blank" ><img width="160" height="160" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>" alt='' /></a>
                                                </div>
										    </td>
									    </tr>
								    </table>
							    </ItemTemplate>
						    </asp:DataList>
					    </div>
					    <%}else{%>
					    <div class="pro_wlist">
						    <asp:DataList id="dlProducts3" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="4"
							    RepeatDirection="Horizontal" RepeatLayout="Table" HorizontalAlign="left" Visible="true" runat="server">
							    <ItemStyle CssClass="dl_item"/>
							    <ItemTemplate>													
								    <table cellpadding="3" cellspacing="0" width="100%">
							            <tr>
								            <td>
								                <div class="xp-pdt-img">
                                                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target="_blank" ><img width="160" height="160" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>" alt='' /></a>
                                                </div>
								            </td>
								        </tr>
									    <tr>
						                    <td>
						                        <div class="listheightoverflow"><a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target=_blank ><%#DataBinder.Eval(Container.DataItem,"ProductName")%> <%#DataBinder.Eval(Container.DataItem,"ShortDesc")%></a></div>
						                    </td>
						                </tr>
							            <tr>
							                <td>
							                    <div class="xp-list-memberprice">
                                                    <% if(MemberShowPrice()) {%><%=GetCurrencySign()%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%>
                                                </div>
							                </td>
							            </tr>
							            <tr>
							                <td>
							                    <div style="margin:auto; width:165px;">
							                    <a href='<%=webSite %>products/product-<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%>' target="_blank"><div class="details"></div></a>
							                    <a><div class="favorite" pid='<%#DataBinder.Eval(Container.DataItem,"ProductID")%>'></div></a>
							                    <%# Compare(DataBinder.Eval(Container.DataItem, "ProductID").ToString(), DataBinder.Eval(Container.DataItem, "ProductName").ToString(), Request.Url.ToString())%>
							                    </div>
							                </td>
							            </tr>
								    </table>
							    </ItemTemplate>
						    </asp:DataList>
					    </div>
					    <%}%>
				    </div><!--end plist-->
					<!--商品列表结束-->
					
					<asp:panel id="plPage" visible="true" runat="server">
					<!-- 翻页开始-->
					<div class="page clear">
                        <div class="fpage">
                            <asp:Label ID="lbPage" class="lb-page" runat="server"></asp:Label>
                        </div>                                
					</div>
					<!-- 翻页结束-->
					</asp:panel>
					
					<asp:panel id="plNoProduct" visible="false" runat="server">
						<div style="margin:20px;">
							<h3>抱歉，没有找到符合条件的商品！</h3>
						</div>
					</asp:panel>
						        
			    </div>
			</div>
		</div>
	    <uc1:Helper id="Helper1" runat="server"></uc1:Helper>
	    <uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		
		<!--显示要对比的商品-->
        <div id="compareContent"><h6><a title="清空" id="compareClose" class="close"></a>商品比较</h6><div style="display:block;" class="comPro"><ul id="comProlist"></ul><img src="<%=webSite %>Template/<%=config.TemplateFolder%>/images/compare_15.gif" id="compareImg"></div></div>
		
		<div class="lframe popTip" id="ShowFav" style="display:none;">
	        <div class="tl"></div>
	        <div class="tr"></div>
	        <div class="tm" id="popupHead">
	            <div class="poptitle">商品收藏</div>
	            <div id="closepop" class="hand popclose">关闭</div>
	        </div>
	        <div class="ml"></div>
	        <div class="mr"></div>
	        <div class="mm tipcontent" style="text-align:center;">
		        <br />
		        <br />
		        收藏类别:<select id="ddlFavCat"></select>
		        <input type="button" id="btnAddFav" value="确定" />
		        <input type="button" id="btnFav" style="display:none;" />
		        <br /><br />
	            <a id="NewFC" href="#">添加分类</a>     <a href="#" id="EditFC">修改分类</a>    <a href="#" id="DelFC">删除分类</a>
	            <div id="newFCContent" style="display:none; text-align:center;"><input type="text" id="txtNewFCName" name="txtNewFCName" /><input type="button" id="btnAddFC" value="保存" /></div>
	        </div>
	        <div class="bl"></div>
	        <div class="br"></div>
	        <div class="bm"></div>
        </div>
        
		<script type="text/javascript">
		    $(document).ready(function(){
		        $('.favorite').click(function(){
		            productID = $(this).attr('pid');
		            $('#btnFav').click();
		        });
		    });
		</script>
	</body>
</html>   
