<%@ Page language="c#" Codebehind="GiftDetails.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.GiftDetails" %>
<%@ 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="LeftNav2" Src="Modules/LeftNav2.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftSameHotProduct" Src="Modules/LeftSameHotProduct.ascx" %>
<%@ Register TagPrefix="uc1" TagName="AlsoPurchased" Src="Modules/AlsoPurchased.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UserNewlyViewProducts" Src="Modules/UserNewlyViewProducts1.ascx" %>
<%@ Register TagPrefix="uc1" TagName="AlreadyExchaged" Src="Modules/AlreadyExchaged.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><%=gift.GiftName%></title>
		<!--#include file="../../inc/head.inc"-->
		<link rel="stylesheet" href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/tabs.css" />
		<script src="<%=webSite %>inc/tab.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/jcarousellite_1.0.1.js" type="text/javascript"></script>
<%--        <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/gift_show.js" type="text/javascript"></script>--%>
		<script src="<%=webSite %>inc/getParmByUrl.js" type="text/javascript"></script>
        <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/ProductReview.js" type="text/javascript"></script>
        <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/GiftDetails.js" type="text/javascript"></script>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/package.css" rel="stylesheet" type="text/css"/>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/jquery.jqzoom.min.js" type="text/javascript"></script>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/jqzoom.css" type="text/css" rel="stylesheet" />	
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/show.css" type="text/css" rel="stylesheet" />			

        <script type="text/javascript">
			var shopFolder="<%=ShopFolder %>";
		    var extend = '<%=config.html %>';
			var baseUrl="<%=webSite %>";
			var returnUrl='<%=Request.Url.AbsoluteUri %>';
			var preProduct="<%=GetResourceString("PreProduct")%>";
			var nextProduct="<%=GetResourceString("NextProduct")%>";
			var productID = '<%=Request.QueryString["GiftID"] %>';
			var hadFav = '<%=GetResourceString("HadFavourite") %>';
			var favSucc = '<%=GetResourceString("FavouriteSucc") %>';
		    var PageSize = 10;
            var CurrentPage = 1;
            var showpage = false;
			var reviewType = 4;//--回复的类型，1为普通商品，2为拍卖团购商品，4为礼品
            var votewords = '您对我们的回复：<span class="vote_y">满意</span>(<a class="yesnum">{0}</a>)  <span class="vote_n">不满意</span>(<a class="notnum">{1}</a>)';
            var reviewvotewords = '这条评论对您：<span class="vote_y">有用</span>(<a class="yesnum">{0}</a>)  <span class="vote_n">无用</span>(<a class="notnum">{1}</a>)';
            var NotExist = '<%=GetResourceString("ProductNotExist")%>';
		    var NotForSale = '<%=GetResourceString("ProductNotForSale")%>';
		    var NotStorage = '<%=GetResourceString("ProductNotStorage")%>';
		    
		    var isLogin= "<%=CurrentUser!=null %>";
		    var memberScore="<%=CurrentUser!=null ?CurrentUser.Score:0 %>";
		    var giftID="<%=Request.QueryString["GiftID"] %>";
            var gid="<%=gift.GiftID%>";    
		    var score="<%=gift.Score %>";
            var limitedNumber="<%=gift.LimitedNumber%>";
            var remainder ="<%=gift.Storage%>"-"<%=gift.AlreadyExchaged%>"
            var storage="<%=gift.Storage%>";            
		    var Specs = "<%=gift.Spec %>";
		    var SpecDesc = "<%=gift.SpecDesc %>";
		    var SkuMap=<%=gift.SkuMap=="" ? "{}" : gift.SkuMap%>;

		    </script>
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear">
		    <!--位置导航开始-->
		    <div class="path"><%=position%></div>
		    <!--位置导航结束-->
			<div id="content_left">
            	<%--兑换积分排行榜开始--%>
<%--            	<uc1:AlreadyExchaged id="AlreadyExchaged1" runat="server"></uc1:AlreadyExchaged>--%>
				<%--兑换积分排行榜结束--%>
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">
                        <div class="title">积分兑换排行榜</div>
                        <%--<div class="more"><a href="<%=webSite %>auction/products-0-1-2-0-0.<%=config.html%>">更多>>></a></div>--%>
                    </div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <%BindAlreadyExchaged();%>
                        <ul class="ul_content">
                            <asp:Repeater Runat="server" ID="rptGifts">
                                <ItemTemplate>
                	                <li class="index"><%#Container.ItemIndex+1 %></li>
                                    <li style="width:160px; overflow:hidden;">
                                        <a href='<%=webSite %>GiftDetails-<%#DataBinder.Eval(Container.DataItem,"GiftID")%>.<%=config.html %>' target="_blank" ><%#DataBinder.Eval(Container.DataItem,"GiftName")%></a>
                                    </li>
                                </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>				
				
			    <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">积分兑换须知</div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
	                    <ul class="content">
	                        <%=GetHelp(10,10,false,"_blank") %> 
	                    </ul>
	                    <div class="clear"></div>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>
				<%=GetAD(35)%>
			</div>
			
			
			<div id="content_right">
			    <div id="product" class="clear">
				    <div class="pdtinfo-title" style="height:50px;">
                        <div class="pdtname"><%=gift.GiftName%></div>
                    </div>
				    
                    <!--商品图片开始-->
					    <div class="picture">
						    <div id="preview">
		                        <div id="thumbnail_bimg" class="jqzoom">
		                            <% if (dtRelImg.Rows.Count > 0)
                                 {%> 
		                            <img id="thumbnail_img" src="<%=webSite%>upload/ProductImg/<%=dtRelImg.Rows[0]["imgfolder"]%>/<%=dtRelImg.Rows[0]["img2"]%>"  jqimg="<%=webSite %>upload/ProductImg/<%=dtRelImg.Rows[0]["imgfolder"]%>/<%=dtRelImg.Rows[0]["img1"]%>" />
		                            <%}else{%>
		                            <img id="thumbnail_img" src="<%=webSite%>images/none.jpg" jqimg="" />
		                            <%}%>
						        </div>
						    </div>
						    <div class="subimg clear">
						        <div class="a">
						        <div class="prev prev1 disabled">&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">&nbsp;</div>
                                </div>
                                <script type="text/javascript">
                                    $(document).ready(function(){
                                         $(".carousel").jCarouselLite({btnNext: ".next1",btnPrev: ".prev1",visible: 5,circular: false,scroll:1,speed:300});
                                    });
                                </script>                                      
                                 <div style="clear:both;"></div>
                                 <a id="viewbig"><div class="viewimg"></div></a>
						    </div>
					    </div>
					    <!--商品图片结束-->
					    
				    <!--商品信息开始-->
				    <div class="info">
					    <table align="left" cellpadding="5" cellspacing="0" border="0" class="subinfo">
						    <tr>
							    <td style="padding-left:50px; height:30px;"><b>兑换所需积分： <font color="#FF0000"><%=gift.Score%></font></b></td>
						    </tr>
						    <tr>
						        <td style="padding-left:50px; height:30px;"><b>您的可用积分： <font color="#FF0000"><%=CurrentUser != null ? CurrentUser.Score.ToString() : ("<a href='/" + ShopFolder + "Login.aspx?ReturnUrl=" + "/" + ShopFolder + "GiftDetails-" + Request.Form["giftID"] + "." + config.html + "'>(登录后显示积分)</a>")%></font></b></td>
						    </tr>
						    <tr>
							    <td style="padding-left:50px;height:30px;"><b>每人可兑换 <font color="#FF0000"><%=gift.LimitedNumber == 0 ? "至多"+gift.Storage.ToString(): gift.LimitedNumber.ToString()%></font>&nbsp;&nbsp;份礼品</b></td>
						    </tr>							    <tr>
							    <td style="padding-left:50px;height:30px;"><b>已有 <font color="#FF0000"><%=gift.ExchagedMembers%></font>&nbsp;&nbsp;人兑换该礼品</b></td>
						    </tr>
    					    <tr>
							    <td style="padding-left:50px;height:30px;"><b>剩余 <font color="#FF0000"><%=gift.Storage-gift.AlreadyExchaged %></font>&nbsp;&nbsp;份礼品</b></td>
						    </tr>						    
					    </table>
                        <div class="clear" style="height:1px; overflow:hidden;"></div>
                        <div class="xp-spec clear">
					        <%string spec = gift.Spec;%>
					        <%string specDesc = gift.SpecDesc;%>
						    <%string tempName="";string property="";%>
						    <%if(!spec.Equals("") && !specDesc.Equals("")) {%>	
						        <%string[] arrPnames = specDesc.Split(';'); %>
						        <%string[] arrPids = spec.Split(';'); %>
						        <%for(int i=0;i<arrPnames.Length;i++) {%>
						            <%if (tempName!=arrPnames[i].Split(':')[0]) {%>
						                <%if(tempName!="") {%>
					                    </ul></dd></dl>
					                    <%}%>
						                <%tempName=arrPnames[i].Split(':')[0];%>
						                <%property+="<em>"+tempName+"</em>";%>						                    
						            <dl class="xp-prop clear"><dt><%=arrPnames[i].Split(':')[0]%>：</dt><dd><ul data-property="<%=arrPnames[i].Split(':')[0]%>" class="spec-content">
						            <%}%>
						            <li data-value="<%=arrPids[i]%>" title="<%=arrPnames[i].Split(':')[1]%>" class="spec-item hand"><a href="javascript:void(0)"><span><%=arrPnames[i].Split(':')[1]%></span></a><div></div></li>
						        <%} %>
						        <%if(tempName!="") {%>
			                    </ul></dd></dl>
			                    <%}%>
			                    <dl id="ChoiceSpecTip" class="clear">
				                    <dt>请选择：</dt>
				                    <dd>
				                        <%=property %>
				                    </dd>
				                </dl>
						    <%} %>					            
                            <div class="clear">
                            <div style="clear:both;text-align:left; padding-top:5px;padding-left:50px;">
                                <div style="float:left;">
                                    <div style="float:left;"><br />
                                        <form action='<%=webSite %>mycart.aspx' method="post" target="_blank">
                                            <input type=hidden name=pid value=<%=gift.ProductID %> />
                                            <input type=hidden name=gid id=gid value=0 />
                                            <input type=hidden name=ptype value=2 />
                                            <script language="javascript">if(Specs == "" && SpecDesc == ""){$('#gid').val(SkuMap["0:0;0:0"]["skuId"]);}</script>
                                            我要兑换<input type=text id=qty name=qty  size=4 value=1 />件

                                            <input type="submit" class="exchange" id="btnExchange" value="" />
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
			        <!--商品信息结束-->	
                </div>
                <div style="clear:both;"></div>
                <!--Tab菜单开始-->
			    <div id="tabContainer">
				    <ul class="menuconainer"> 
					    <li class="menuitem tabon"><%=GetResourceString("Details")%></li> 
				    </ul>
				    <div class="itemcontainer">
				        <div class="tabitem">
					        <!--详细信息开始-->
					        <%=gift.Description%>
					        <!--详细信息结束-->
				        </div> 
				       
				    </div>
			    </div>
			    <!--Tab菜单结束-->
				
			    <div class="show_mmframe" style="display:none">
                    <div class="tl">
		                兑换评论
		            </div>
                    <div class="tm"></div>
                    <div class="mm">                                    
                        <!--用户评论开始-->
                        <div id="ReviewContent" class="ReviewContent">
                            <div class="item" id="reviewtemplate">
                                <div class="rev">
                                    <div class="userinfo">
                                        <div class="icon" ><img src='#' alt=''/></div>
                                        <div class="username">admin</div>
                                        <div class="groupname">钻石会员</div>
                                        <div class="area">(广东)</div>
                                    </div>
                                    <div class="revinfo">
                                        <div class="revhead">
                                            <div class="revtitle">标题</div>
                                            <div class="revscore"></div>
                                            <div class="revtime">时间</div>
                                        </div>
                                        <div class="revbody">评论内容</div>
                                        <div class="btns">
                                            <div class="btnreply btnbg hand">我要回复</div>
                                            <div class="btnviewrep btnbg hand">关闭回复</div>
                                            <div class="revvote"><div class="ques">这条评论对您有用吗?</div><div class="vote_y btnbg hand">有用(<span class="yesnum">1</span>)</div><div class="vote_n btnbg hand">没用(<span class="notnum">1</span>)</div></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="reply" style="display:block;">
                                    <div id="reptemplate" class="reptemplate" style="display:none;">
                                        <div class="repname">wolanda：</div>
                                        <div class="repbody">回复内容</div>
                                        <div class="reptime">回复时间</div>
                                        <div class="separateline"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--回复框开始-->
                        <div id="ReplySumbit" style="display:none; width:100%;">
                            <form id="frmReply" action="">
                                <textarea id="txtReply" name="txtReply" cols="50" rows="5"></textarea>
                                <input type="hidden" id="hidden_reviewID" name="hidden_reviewID" value="0" />
                                <br />
                                <input type="button" id="btnReply" name="btnSubmit" value="提交回复" /><input type="button" id="btnCancel" value="取消" />
                            </form>
                        </div>
                        <!--回复框结束-->
                        <div class="clear" style="border-top:dotted 1px #666; padding-top:2px;">
                            <div style="border:solid 1px #999; width:70px; height:20px; float:left; text-align:center; line-height:20px;"><a href='<%=webSite %>GiftReview-<%=gift.GiftID%>-4-1.<%=config.html %>'>发表评论</a></div>
                            <div style="border:solid 1px #999; width:100px; height:20px; float:left; text-align:center; line-height:20px; margin-left:5px;"><a href='<%=webSite %>GiftReview-<%=gift.GiftID%>-4.<%=config.html %>'>查看所有评论</a></div>
                            <div class="clear"></div>
                        </div>
                        <!--用户评论结束-->
                    </div>
			    </div>						    
			    <asp:Literal id="ltrAD" runat="server"></asp:Literal>
		        </div>
			</div>
			
			
		</div>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		<!--查看大图提交的表单-->
		<form id="BigImgform" method="post" target="_blank" action="<%=webSite %>BigImg.aspx">
		    <input type="hidden" id="hiddenimgs" name="hiddenimgs" value="" />
		    <input type="hidden" id="productID" name="productID" value="<%=gift.ProductID%>" />
		    <input type="hidden" id="productNo" name="productNo" value="<%=gift.ProductNo%>" />
		    <input type="hidden" id="productName" name="productName" value="<%=gift.GiftName%>" />
	    </form>
	    
	</body>
</html>