<%@ Page language="c#" Codebehind="Show.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.Show" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="NavBar" Src="Modules/NavBar.ascx" %>
<%@ Register TagPrefix="uc1" TagName="TopSaleProduct" Src="Modules/CatTopSalePdts.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Bulletin" Src="Modules/Bulletin.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UserNewlyViewProducts" Src="Modules/UserNewlyViewProducts.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"-->
		<!--#include file="../../inc/show_head.inc"-->
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>inc/tab.js" type="text/javascript"></script>
		<link rel="stylesheet" href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/style/tabs.css" />
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>inc/ui.core.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>inc/ui.tabs.js" type="text/javascript"></script>
		<link href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/style/jqzoom.css" type="text/css" rel="stylesheet" />
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/custom_show.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/custom_tab.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>inc/getParmByUrl.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/custom_pre_next.js" type="text/javascript"></script>
		<script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/jquery.jqzoom.min.js" type="text/javascript"></script>
        <script src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/inc/jcarousellite_1.0.1.js" type="text/javascript"></script>
		<script type="text/javascript">
		    var extend = '<%=config.html %>';
			var baseUrl="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>";
			var preProduct="<%=GetResourceString("PreProduct")%>";
			var nextProduct="<%=GetResourceString("NextProduct")%>";
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
            $(".jqzoom").jqueryzoom({
				            xzoom: 300, //zooming div default width(default width value is 200)
				            yzoom: 300, //zooming div default width(default height value is 200)
				            offset: 10, //zooming div default offset(default offset value is 10)
				            position: "right", //zooming div position(default position value is "right")
 				            preload:1,
				            lens:1
			            });
            });
       </script>
		<script type="text/javascript">
		<!--
		function checkRemark()
		{
		var form=document.getElementById("reviewForm");
		if (form.body.value=="")
		{	alert("<%=GetResourceString("BulletinCommentRequest")%>");
			form.body.focus();
			return false;
		}
		if (form.username.value=="")
		{	alert("<%=GetResourceString("BulletinNameRequest")%>");
			form.username.focus();
			return false;
		}
		form.submit.disabled=true;
		return true;
		}
		function showLen(obj)
		{
			document.getElementById("bodyLen").value=obj.value.length;
		}
		function addtocart(pid)
		{
			if('<%=config.ShopStop%>' == 'True')
			{
				temp=window.open('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>ShoppingCart.aspx?pid='+pid,'shopcat','width=700,height=850,scrollbars=yes,top=0,left=0,resizable=yes');
				temp.focus();
			}
			else
			{
				alert('<%=config.ShopStopWords%>');
				return false;
			}
		}
		function gotoUrl(url)
		{
			this.location = url;
		}
		function myOpenWindow()
		{
			temp=window.open('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>ShoppingCart.aspx','shopcat','width=700,height=850,scrollbars=yes,top=0,left=0,resizable=yes');
			temp.focus();
		}
		function changeCustom(str1,str2)
		{
		    document.getElementById(str1).value=str2;
		    document.getElementById(("C_" + str1)).innerHTML=str2;
		    document.getElementById(("result_C_" + str1)).innerHTML=str2;
		}
		-->
		</script>
	</HEAD>
	<body>
		<div id="container">
			<uc1:Header id="Header1" runat="server"></uc1:Header>
			<!--位置导航开始-->
			<div class="path"><%=GetCurrentPosition()%></div>
			<!--位置导航结束-->
			<div id="content">
				<div id="content_left_side">
					<!--类别导航开始-->
					<uc1:LeftNav id="LeftNav" runat="server"></uc1:LeftNav>
					<!--类别导航结束-->
					<div class="slad"><%=XpShop.WebUI.WebUtils.GetAD(47)%> </div>
					<uc1:TopSaleProduct id="TopSaleProduct1" runat="server"></uc1:TopSaleProduct>
					<uc1:UserNewlyViewProducts id="UserNewlyViewProducts" runat="server"></uc1:UserNewlyViewProducts>
				</div>
				<div id="content_middle_side">
					<div id="product">
							<!--商品图片开始-->
							<div class="picture">
							    <div class="picture_img">
								    <div class="clear jqzoom">
										<img id="thumbnail_img" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>upload/<%=product.ProductImg%>" alt="<%=product.Name%>" jqimg="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%=product.ProductImg%>" />
								    </div>
								    <div class="clear"></div>
								</div>
								<a id="product_img" href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>upload/<%=product.ProductImg%>' class="highslide" onclick="return hs.expand(this, {captionId: 'caption1'})"><div style=" background:url(/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/Images/<%=GetResourceString("ButtonViewBig")%>) no-repeat; height:21px; width:99px; border:1px; margin:0px auto; margin-top:10px;"></div></a>
								<div class="subimg clear">
							        <div class="a"><div class="prev prev1 disabled" style=" margin-top:20px;">&nbsp;</div></div>
							        
                                    <div class="carousel main">
                                        <div class="jCarouselLite">
								            <ul class="thumbnail_ul">
									            <%=BindRelatedImgs()%>
								            </ul>
								        </div>
                                    </div>
                                    <div class="b"><div class="next next1" style=" margin-top:20px;">&nbsp;</div></div>
                                    
                                    <script type="text/javascript">
                                        $(document).ready(function(){
                                             $(".carousel").jCarouselLite({btnNext: ".next1",btnPrev: ".prev1",visible: 4,circular: false,scroll:1,speed:300});
                                        });
                                    </script>                                      
                                     <div style="clear:both;"></div>
							    </div>
							</div>
							<!--商品图片结束-->
							<!--商品信息开始-->
							<div class="info">
								<form name="pDetails" action='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>shoppingcart.aspx?pid=<%=product.ProductID%>' method="post">
								<span class="ptitle">>><%=product.Name%></span>
								<table align="left" cellpadding="0" cellspacing="0" border="0" class="subinfo">
									<tr>
										<th><%=GetResourceString("ProductBrand")%>：</th>
										<td><%=GetBrandName()%></td>
									</tr>
									<tr>
										<th><%=GetResourceString("ProductUnit")%>：</th>
										<td><%=product.Unit%></td>
									</tr>
									<tr>
										<th><%=GetResourceString("MarketPrice")%>：</th>
										<td><%=string.Format("{0:f}",product.MarketPrice)%></td>
									</tr>
									<% if(XpShop.WebUI.WebUtils.MemberShowPrice()) {%>
									<tr>
										<th><%=GetResourceString("MemberPrice")%>：</th>
										<td><%=string.Format("{0:f}",product.MemberPrice)%></td>
									</tr>
									<% }else{%>
									<tr>
										<td colspan="2" style="height:40px; font-size:15px; color:#d6201c; font-weight:bold;">升级为会员即可享受超低会员价</td>
									</tr>
									<%} %>
									<tr>
										<th><%=GetResourceString("ProductNo")%>：</th>
										<td><%=product.ProductNo%></td>
									</tr>
									<tr>
										<th><%=GetResourceString("ProductRating")%>：</th>
										<td><%=GetRating()%></td>
									</tr>
									<% if(config.MarkUnit == 1) {%>
									<tr>
										<th><%=GetResourceString("Credit")%>：</th>
										<td><%=product.Score%></td>
									</tr>
									<% }%>
									<asp:Repeater ID="rptProductFields" Runat="server">
										<ItemTemplate>
											<tr>
												<th><%# DataBinder.Eval(Container.DataItem, "FieldName") %>：</th>
												<td><%# DataBinder.Eval(Container.DataItem, "FieldValue") %>
												</td>
											</tr>
										</ItemTemplate>
									</asp:Repeater>
									
									<asp:Repeater ID="customChoice" Runat="server">
										<ItemTemplate>
											<tr>
												<th><%# DataBinder.Eval(Container.DataItem, "FieldName") %>：</th>
												<td valign="top" align="left">
												    <%# GetCustomChoice(int.Parse(DataBinder.Eval(Container.DataItem, "CustomIndex").ToString()), int.Parse(DataBinder.Eval(Container.DataItem, "FieldID").ToString()))%>
                                                </td>
											</tr>
										</ItemTemplate>
									</asp:Repeater>										
									
									<asp:Repeater ID="rptCuetomFields" Runat="server">
										<ItemTemplate>
											<tr>
												<th><%# DataBinder.Eval(Container.DataItem, "FieldName") %></th>
												<td valign="top">
													<table width="100%" cellpadding="0" cellspacing="0" border="0">
														<asp:Repeater ID="rptFieldItems" Runat="server" DataSource='<%# GetFieldItems(DataBinder.Eval(Container.DataItem, "ProductCustomFieldID").ToString()) %>'>
															<ItemTemplate>
																<tr>
																	<td valign="top"><input id="cbxMultiple" type='<%# GetButtonType(DataBinder.Eval(Container.DataItem, "FieldID").ToString()) %>' value='<%# DataBinder.Eval(Container.DataItem, "CustomFieldItemID") %>' name='Field<%# DataBinder.Eval(Container.DataItem, "FieldID") %>' <%# DataBinder.Eval(Container.DataItem, "Selected").ToString() == "1" ? "checked" : "" %>><%# DataBinder.Eval(Container.DataItem, "ItemName") %> <%# DataBinder.Eval(Container.DataItem, "Price").ToString() != "0" ? "( 加收 " + DataBinder.Eval(Container.DataItem, "Price") + " 元)" : "" %></td>
																</tr>
															</ItemTemplate>
														</asp:Repeater>
													</table>
												</td>
											</tr>
										</ItemTemplate>
									</asp:Repeater>
								</table>
								<div class="clear"></div>
								<div class="resultcontent">								       
							        <div>
							           <div id="choiceResult"></div>
							           <%=GetResourceString("MyQuantity")%>：<input type="text" id="txtQuantity" class="num_bg" name="txtQuantity" value='<%=product.Min %>' size="4" />
						            </div>			
						            <div class="btn_css">
								    <input type="submit" style='border:none; cursor:pointer; margin-right:16px; height:42px; width:122px; background:url(/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/Images/<%=GetResourceString("ButtonBuy")%>) no-repeat;' value="" />
								    <input type="button" style='border:none; cursor:pointer; height:25px; width:114px; margin-bottom:0px; *margin-bottom:6px; background:url(/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Template/<%=config.TemplateFolder%>/Images/<%=GetResourceString("ButtonFav")%>) no-repeat;' value="" onclick="<%if(config.html==""){%>gotoUrl('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Actions.aspx?action=Favorite&ProductID=<%=product.ProductID%>&ReturnUrl=<%=Request.Url%>')<%}else{%>gotoUrl('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Actions.aspx?action=Favorite&ProductID=<%=product.ProductID%>&ReturnUrl=products/Product_<%=product.ProductID%>.html')<%}%>" />
								    </div> 
								</div>
								<div style="clear:both;text-align:right; padding-top:20px;">
								    <!--显示上一页,下一页开始-->
								    <div id="pre_next_product">
								        <div id="preProduct"></div>
								        <div id="nextProduct"></div>
								    </div>
								    <!--显示上一页,下一页结束-->
								</div>
							</form>
						</div>
						<!--商品信息结束-->	
						<div class="clear"></div>
						<!--Tab菜单开始-->
					    <div id="tabContainer" class="clear">
						    <ul class="menuconainer"> 
							    <li class="menuitem tabon"><%=GetResourceString("Details")%></li> 
							    <li class="space">&nbsp;</li>
							    <li class="menuitem tabout"><%=GetResourceString("ProductComment")%></li> 
							    <li class="space">&nbsp;</li>
							    <li class="menuitem tabout"><%=GetResourceString("Comment")%></li>
						    </ul>
						    <div class="itemcontainer">
						        <div class="tabitem">
							        <!--详细信息开始-->
									<%=product.Description%>
									<!--详细信息结束-->
						        </div> 
						        <div class="tabitem">
						            <!--用户评论开始-->
									<table width="95%" cellpadding="1" cellspacing="1" border="0" align="center" bgcolor="#cccccc">
									<asp:Repeater ID="rptReviews" Runat="server">
										<ItemTemplate>
											<tr>
												<td width="25%" bgcolor="#F6F6F6" align="center"><%=GetResourceString("Poster")%>: <a href='mailto:<%# (DataBinder.Eval(Container.DataItem, "HideEmail").ToString() == "0") ? DataBinder.Eval(Container.DataItem, "Email") : "#" %>'><%# DataBinder.Eval(Container.DataItem, "UserName") %></a></td>
												<td width="75%" bgcolor="#ffffff">
													<table width="100%">
														<tr>
															<td><%# DataBinder.Eval(Container.DataItem, "Body") %><br>
																<font color="#C1C1C1">
																	<%# DataBinder.Eval(Container.DataItem, "AddTime") %>
																</font>
															</td>
														</tr>
														<tr>
															<td><hr noshade color="#333333" size="1" style="border-style: dotted; border-width: 1" width="100%">
															</td>
														</tr>
														<tr>
															<td><b><%=GetResourceString("Reply")%>：</b><br>
																<%# DataBinder.Eval(Container.DataItem, "Reply") %>
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</ItemTemplate>
									</asp:Repeater>
									</table>
									<!--用户评论结束-->
						        </div>
						        <div class="tabitem">
						            <!--发表评论开始-->
									<% if(product.CanReview){%>
									<form id="reviewForm" action='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>Review.aspx?ProductID=<%=product.ProductID%>' method="post" onsubmit="return checkRemark();">
									<table width="95%" cellpadding="5" cellspacing="0" border="0" align="center">
										<tr>
											<td width="80" align="right"><%=GetResourceString("Content")%>：</td>
											<td><textarea name="body" cols="40" rows="4" onkeydown="showLen(this)" onkeyup="showLen(this)"></textarea> <input type="text" id="bodyLen" size="4" style="border-width:0;background:transparent;"/></td>
										</tr>
										<tr>
											<td width="80" align="right">Email：</td>
											<td><input type="text" id="i_email" name="email" size="15"><input type="checkbox" id="i_hideEmail" name="hideemail" checked><%=GetResourceString("HideEmailAddress")%></td>
										</tr>
										<tr>
											<td width="80" align="right"><%=GetResourceString("Name")%>：</td>
											<td>
												<input type="text" id="i_username" name="username" value="" maxlength="15" size="10"></td>
										</tr>
										<tr>
											<td width="80" align="right"><%=GetResourceString("RelatedProducts")%>：</td>
											<td>
											<select name="ddlPublisher" id="ddlPublisher">
												<option value="0"><%=GetResourceString("SelectProductLevel")%></option>
												<option value="5">5</option>
												<option value="4">4</option>
												<option value="3">3</option>
												<option value="2">2</option>
												<option value="1">1</option>
											</select>
												<input type="submit" name="submit" value="<%=GetResourceString("Submit")%> "></td>
										</tr>
									</table>
									</form>
									<% } else {%>
									暂不接受评论
									<% } %>
									<!--发表评论结束-->
						        </div> 
						    </div>
					        <div class="clear"></div>
					    </div>
					    <!--Tab菜单结束-->
						<!--相关商品开始-->
						<div class="show_mmframe1" style="margin:10px auto;">
                            <div class="tl">
                                <%=GetResourceString("RelatedProducts")%>
			                </div>
                            <div class="mm"> 
                                <%BindRelatedProducts(6);%>
							    <div class="related">
						            <ul>
					                    <asp:Repeater ID="rptRelatedProducts" Runat="server">
						                    <ItemTemplate>
						                        <li>
						                            <table cellpadding="0" width="100%">
						                                <tr>
						                                    <td valign="top" width=30%>
						                                    <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target="_self" ><img width="71" height="106" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>"></a>
						                                    </td>
						                                    <td width="69%">
						                                        <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target="_self" ><%#DataBinder.Eval(Container.DataItem,"Name")%></a>
						                                        <div class="marketprice"><%--<%=GetCurrency()%>--%><%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:f}")%></div>
			                                                    <div class="memberprice"><% if(XpShop.WebUI.WebUtils.MemberShowPrice()) {%><%--<%=GetCurrency()%>--%><%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:f}")%><% }%></div>
						                                    </td>
						                                </tr>
						                            </table>
						                        </li>
						                    </ItemTemplate>
					                    </asp:Repeater>
						            </ul>
							    </div>
                                <div class="clear"></div>
                            </div>
				        </div>
						<!--相关商品结束-->
						<asp:Literal id="ltrAD" runat="server"></asp:Literal>					
					</div>
				</div>
				<div style="clear:both;"></div>
			</div>
			<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
			<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		</div>
	</body>
</HTML>
