<%@ Page language="c#" Codebehind="CShow.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.CShow" %>
<%@ 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="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Bulletin" Src="Modules/Bulletin.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTop2Level" Src="Modules/LeftNavTop2Level.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><%=product.Name%> －－ <%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<link rel="stylesheet" href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/tabs.css" />
		<script src="<%=webSite %>inc/ui.core.js" type="text/javascript"></script>
		<script src="<%=webSite %>inc/ui.tabs.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/custom_show.js" type="text/javascript"></script>
		<script src="<%=webSite %>inc/getParmByUrl.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/custom_pre_next.js" type="text/javascript"></script>
		<script type="text/javascript">
		    var extend = '<%=config.html %>';
			var baseUrl="<%=webSite %>";
			var preProduct="<%=GetResourceString("PreProduct")%>";
			var nextProduct="<%=GetResourceString("NextProduct")%>";
        </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('<%=webSite %>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('<%=webSite %>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.split(':')[1];
		    document.getElementById(("result_C_" + str1)).innerHTML=str2;
		}
		-->
		</script>
	</HEAD>
	<body>
		<div id="container">
			<uc1:Header id="Header1" runat="server"></uc1:Header>
			<div id="content">
				<div id="content_left_side">
					<!--购物车开始-->
					<uc1:SmallCart id="SmallCart1" runat="server"></uc1:SmallCart>
					<!--购物车结束-->
					<!--类别导航开始-->
					<uc1:LeftNavTop2Level id="LeftNavTop2Level1" runat="server"></uc1:LeftNavTop2Level>
					<!--类别导航结束-->
				</div>
				<div id="content_middle_side">
				    <!--位置导航开始-->
					<div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("ProductDetails")%></div>
					<!--位置导航结束-->
					<div class="mframe">
						<div class="tl"></div>
						<div class="tr"></div>
						<div class="tm">
						    <div class="mframetitle"><%=GetResourceString("Details")%></div>
						</div>
						<div class="ml"></div>
						<div class="mr"></div>
						<div class="mm">
							<div id="product">
								<!--商品图片开始-->
								<div class="picture">
									<div class="clear">
										<a id="product_img" href='<%=webSite %>upload/<%=product.ProductImg%>' class="highslide" onclick="return hs.expand(this, {captionId: 'caption1'})">
											<img id="thumbnail_img" src="<%=webSite %>upload/<%=product.ProductImg%>" />
										</a>
									</div>
									<div class="subimg clear">
										<ul class="thumbnail_ul">
											<%=BindRelatedImgs()%>
										</ul>
									</div>
								</div>
								<!--商品图片结束-->
								<!--商品信息开始-->
								<div class="info">
									<form name="pDetails" action='<%=webSite %>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("ProductNo")%>：</th>
											<td><%=product.ProductNo%></td>
										</tr>
										<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(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("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 valign="top"><%# 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>										
										
										<tr>
											<th><%=GetResourceString("RelatedProducts")%>：</th>
											<td>
												<%BindRelatedProducts(6);%>
												<asp:Repeater ID="rptRelatedProducts" Runat="server">
													<ItemTemplate>
														<a href='<%=webSite %><%if(config.html==""){%>CShow.aspx?PID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%#DataBinder.Eval(Container.DataItem,"ProductID")%>.<%=config.html%><%}%>' target="_self" ><%#DataBinder.Eval(Container.DataItem,"Name")%>(<%#DataBinder.Eval(Container.DataItem,"ProductNo")%>)-<%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:c}")%>元<br></a>
													</ItemTemplate>
												</asp:Repeater>
											</td>
										</tr>
										<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 style="clear:both;text-align:right; padding-top:20px;">
									    <!--显示上一页,下一页开始-->
									    <div id="pre_next_product">
									        <div id="preProduct"></div>
									        <div id="nextProduct"></div>
									    </div>
									    <!--显示上一页,下一页结束-->
									    <div style="float:right;">
										<input type="submit" class="buy" value="" />
										<input type="button" class="fav" value="" onclick="<%if(config.html==""){%>gotoUrl('<%=webSite %>Actions.aspx?action=Favorite&ProductID=<%=product.ProductID%>&ReturnUrl=<%=Request.Url%>')<%}else{%>gotoUrl('<%=webSite %>Actions.aspx?action=Favorite&ProductID=<%=product.ProductID%>&ReturnUrl=products/Product_<%=product.ProductID%>.html')<%}%>" />
										</div>
									</div>
								</form>
							</div>
							<!--商品信息结束-->
							<!--Tab菜单开始-->
							<div class="tab clear">
								<div id="tab1">
									<ul style="height: 30px;"> 
										<li><a href="#tab1panel1"><span><%=GetResourceString("Details")%></span></a></li> 
										<li><a href="#tab1panel2"><span><%=GetResourceString("ProductComment")%></span></a></li> 
										<li><a href="#tab1panel3"><span><%=GetResourceString("Comment")%></span></a></li> 
									</ul>
									<div id="tab1panel1">
										<!--详细信息开始-->
										<%=product.Description%>
										<!--详细信息结束-->
									</div> 
									<div id="tab1panel2">
										<!--用户评论开始-->
										<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 id="tab1panel3">
										<!--发表评论开始-->
										<% if(product.CanReview){%>
										<form id="reviewForm" action='<%=webSite %>Review.aspx?ProductID=<%=product.ProductID%>' method="post" onsubmit="return checkRemark();">
										<table width="95%" cellpadding="0" cellspacing="0" border="0" align="center">
											<tr>
												<td width="40"><%=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>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><%=GetResourceString("Name")%>：</td>
												<td>
													<input type="text" id="i_username" name="username" value="" maxlength="15" size="10"></td>
											</tr>
											<tr>
												<td><%=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>
							<!--Tab菜单结束-->	
							<asp:Literal id="ltrAD" runat="server"></asp:Literal>					
						</div>
					</div>
					<div class="bl"></div>
					<div class="br"></div>
					<div class="bm"></div>
				</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>
