<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false" Inherits="SocoShop.Page.ProductDetail" %>
<%@ Import namespace="SocoShop.Entity" %>
<%@ Import namespace="SocoShop.Business" %>
<%@ Import namespace="SocoShop.Common" %>
<%@ Import namespace="SkyCES.EntLib" %>
<%@ Import namespace="System.Diagnostics" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
	/* 
		本页面代码由天易模板生成于 2011/3/6 19:11:39.
	*/
	Stopwatch sw = new Stopwatch();
	sw.Start();
	base.OnInit(e);
	sw.Stop();
	 decimal processTime=Convert.ToDecimal(sw.ElapsedMilliseconds) / 1000;
	StringBuilder document = new StringBuilder();
	document.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
	document.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\" >\r\n");
	document.Append("<head>\r\n");
	document.Append("    <title>"+Title+"</title>\r\n");
	document.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n");
	document.Append("<meta content=\""+Keywords+"\" name=\"keywords\"/>\r\n");
	document.Append("<meta content=\""+Description+"\" name=\"description\"/>\r\n");
	document.Append("<meta content=\""+Copyright+"\" name=\"copyright\"/>\r\n");
	document.Append("<meta content=\""+Author+"\" name=\"author\"/>\r\n");
	document.Append("<link href=\"/Plugins/Template/Red/style/global.css\" type=\"text/css\" rel=\"Stylesheet\"/>  \r\n");
	document.Append("<link href=\"/Plugins/Template/Red/style/Style.css\" type=\"text/css\" rel=\"Stylesheet\"/>  \r\n");
	document.Append("<link href=\"/Plugins/Template/Red/style/user.css\" type=\"text/css\" rel=\"Stylesheet\"/>     \r\n");
	document.Append("<script language=\"javascript\" type=\"text/javascript\" src=\"/Admin/Js/Common.js\" ></"+"script>\r\n");
	document.Append("</head>\r\n");
	document.Append("<body>\r\n");
	document.Append("    <div class=\"top\">\r\n");
	document.Append("    <div class=\"tips\"><p>\r\n");
	if(Sessions.UserID==0)
{
	document.Append("您好，欢迎您回来！[ <a href=\"/User/Login.aspx\">请登录</a> ]，新用户？[ <a href=\"/User/Register.aspx\">免费注册</a> ]\r\n");
	}
else
{
	document.Append(""+Sessions.UserName+"：您好，欢迎您回来！[ <a href=\"/User/Index.aspx\">会员中心</a> ] ， [ <a href=\"/User/Logout.aspx\">安全退出</a> ]\r\n");
	 }
	document.Append("</p></div>\r\n");
	document.Append("    <div class=\"logo\">\r\n");
	document.Append("        <h1><img src=\"/Plugins/Template/Red/style/images/logo.gif\"  alt=\"SocoShop\"  /></h1>\r\n");
	document.Append("        <p>\r\n");
	document.Append("            <strong>订购热线</strong><br /> <span>"+ShopConfig.ReadConfigInfo().Tel+"</span>\r\n");
	document.Append("        </p>\r\n");
	document.Append("    </div>\r\n");
	document.Append("    <div class=\"wrap\">\r\n");
	document.Append("        <ul class=\"topmenu\">\r\n");
	document.Append("            <li id=\"Default\"><a href=\"/Default.aspx\">首页</a> </li>\r\n");
	document.Append("            <li  id=\"News\"><a href=\"/Product.aspx\">商品展示</a> </li>\r\n");
	document.Append("            <li id=\"Product\"><a href=\"/Brand.aspx\">品牌专区</a> </li>\r\n");
	document.Append("            <li id=\"Down\"><a href=\"/Activity.aspx\">商家活动</a> </li>\r\n");
	document.Append("            <li id=\"GuestBook\"><a href=\"/User/Index.aspx\">会员中心</a> </li>\r\n");
	document.Append("            <li id=\"Case\"><a href=\"/Help.aspx\">帮助中心</a> </li>\r\n");
	document.Append("            <span><a href=\"/Cart.aspx\"><img src=\"/Plugins/Template/Red/style/images/cart.gif\"/>购物车有 <strong id=\"ProductBuyCount\">"+Sessions.ProductBuyCount+"</strong> 件商品 合计 <strong id=\"ProductTotalPrice\">"+Sessions.ProductTotalPrice+"</strong> 元</a> <a href=\"/CheckOut.aspx\"><img src=\"/Plugins/Template/Red/style/images/checkout.gif\"/></a></span>\r\n");
	document.Append("        </ul>\r\n");
	document.Append("        <div class=\"search\">\r\n");
	document.Append("            <select id=\"classID\"><option value=\"\">所有分类</option>\r\n");
	foreach(ProductClassInfo productClass in allProductClassList)
{
	document.Append("<option value=\""+productClass.ID+"\">"+productClass.ClassName+"</option>\r\n");
	}
	document.Append("</select>   \r\n");
	document.Append("            <input type=\"text\" value=\"\" id=\"keyWord\"  onfocus=\"clearKeyWord()\" onblur=\"fillKeyWord()\" />  \r\n");
	document.Append("            <input type=\"button\" value=\"搜 索\" class=\"button\" onclick=\"return topSearchProduct()\" />  \r\n");
	document.Append("            <span>热门关键词：</span>\r\n");
	foreach(string temp in hotKeyword.Split(','))
{
	document.Append("<a href=\"/Product/Keyword/"+Server.UrlEncode(temp)+".aspx\">"+temp+"</a>\r\n");
	}
	document.Append("        </div>\r\n");
	document.Append("    </div>\r\n");
	document.Append("</div>\r\n");
	document.Append("    <div class=\"main\">\r\n");
	document.Append("        <div class=\"left\">\r\n");
	document.Append("            <div class=\"box\">\r\n");
	document.Append("                <div class=\"boxHead\"><span>商品类别</span></div>\r\n");
	document.Append("                <ul class=\"boxMain productClass\" >\r\n");
	foreach(ProductClassInfo productClass in productClassList)
{
	document.Append("                    <li class=\"first\"><a href=\"/Product-C"+productClass.ID+".aspx\">"+productClass.ClassName+"</a> </li>\r\n");
	document.Append("                    <li class=\"second\">\r\n");
	foreach(ProductClassInfo childProductClass in ProductClassBLL.ReadProductClassChildList(productClass.ID))
{
	document.Append("                        <a href=\"/Product-C"+childProductClass.ID+".aspx\">"+childProductClass.ClassName+"</a>\r\n");
	}
	document.Append("                    </li>\r\n");
	}
	document.Append("                </ul>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"height10\"></div>\r\n");
	document.Append("            <div class=\"box\">\r\n");
	document.Append("                <div class=\"boxHead\"><span>商品标签</span></div>\r\n");
	document.Append("                <div class=\"boxMain tag\">\r\n");
	document.Append("                    <div id=\"ProductTagAjax\" class=\"list\">\r\n");
	foreach(TagsInfo tags in productTagsList)
{
	document.Append("                    <a href=\"/Product/Tags/"+Server.UrlEncode(tags.Word)+".aspx\" style=\"font-size:"+tags.Size+"px; color:"+tags.Color+"\">"+tags.Word+"</a>\r\n");
	}
	document.Append("                    </div>\r\n");
	document.Append("                    <input id=\"Word\" type=\"text\" class=\"input\" />  <input type=\"button\" class=\"button\" value=\"提 交\" onclick=\"addTags()\" />\r\n");
	document.Append("                </div>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"height10\"></div>\r\n");
	if(product.RelationArticle!=string.Empty)
{
	document.Append("            <div class=\"box\">\r\n");
	document.Append("                <div class=\"boxHead\"><span>相关文章</span></div>\r\n");
	document.Append("                <ul class=\"boxMain\" >\r\n");
	foreach(ArticleInfo article in productArticleList)
{
	document.Append("                    <li><a href=\"\r\n");
	if(article.Url==string.Empty)
{
	document.Append("/ArticleDetail-P"+product.ID+"-I"+article.ID+".aspx\r\n");
	}
else
{
	document.Append(""+article.Url+"\r\n");
	 }
	document.Append("\">"+article.Title+"</a> </li>\r\n");
	}
	document.Append("                </ul>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"height10\"></div>\r\n");
	 }
	document.Append("            <div class=\"box\">\r\n");
	document.Append("                <div class=\"boxHead\"><span>浏览过的商品</span></div>\r\n");
	document.Append("                <div class=\"boxMain\">\r\n");
	if(strHistoryProduct!=string.Empty)
{
	foreach(string temp in strHistoryProduct.Split(','))
{
	ProductInfo tempProduct=ProductBLL.ReadProductByProductList(tempProductList,Convert.ToInt32(temp));
	document.Append("                    <ul class=\"smallProduct\">\r\n");
	document.Append("                        <li class=\"photo\"><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\"><img src=\""+tempProduct.Photo.Replace("Original","60-60")+"\" onload=\"photoLoad(this,60,60)\" /></a> </li>\r\n");
	document.Append("                        <li class=\"text\"><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\">"+StringHelper.Substring(tempProduct.Name,15)+"</a> <br />￥"+MemberPriceBLL.ReadCurrentMemberPrice(memberPriceList,Sessions.GradeID,tempProduct)+" </li>\r\n");
	document.Append("                    </ul>\r\n");
	}
	 }
	document.Append("                </div>\r\n");
	document.Append("            </div>\r\n");
	document.Append("        </div>\r\n");
	document.Append("        <div class=\"right\">\r\n");
	document.Append("            <div class=\"productPhoto\">\r\n");
	document.Append("                <div class=\"bigPhoto\"><img src=\""+product.Photo.Replace("Original","340-340")+"\" onload=\"photoLoad(this,340,340)\"  id=\"BigPhoto\" /></div>\r\n");
	document.Append("                <div class=\"photoList\">\r\n");
	document.Append("                    <div class=\"photoListLeft\"><p id=\"PhotoLeft\" ></p></div>\r\n");
	document.Append("                    <div class=\"photoListContent\" id=\"PhotoCount\">\r\n");
	document.Append("                        <div class=\"photoListInner\">\r\n");
	document.Append("                            <div id=\"PhotoList1\" style=\"float:left;\">  \r\n");
	foreach(ProductPhotoInfo productPhoto in productPhotoList)
{
	document.Append("                                <a href=\"javascript:void(0);\"><img src=\""+productPhoto.Photo.Replace("Original","60-60")+"\" onload=\"photoLoad(this,50,50)\" onclick=\"showPhoto('"+productPhoto.Photo.Replace("Original","340-340")+"')\" alt=\""+productPhoto.Name+"\" /></a>     \r\n");
	}
	document.Append("                             </div>\r\n");
	document.Append("                             <div id=\"PhotoList2\" style=\"float:left; padding-left:3px; padding-right:3px;\"></div>\r\n");
	document.Append("                         </div>\r\n");
	document.Append("                    </div>\r\n");
	document.Append("                    <div class=\"photoListRight\"><p id=\"PhotoRight\"></p></div>\r\n");
	document.Append("                </div>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"productInfo\">\r\n");
	document.Append("                <div class=\"name\" style=\""+product.FontStyle+"\r\n");
	if(product.Color!=string.Empty)
{
	document.Append(" ;color:"+product.Color+"\r\n");
	 }
	document.Append("\">"+product.Name+"</div> \r\n");
	document.Append("                <div class=\"height10\"></div>\r\n");
	document.Append("                <div class=\"border1\"></div>\r\n");
	document.Append("                <div class=\"height10\"></div>                \r\n");
	document.Append("                <div>品牌："+ProductBrandBLL.ReadProductBrandCache(product.BrandID).Name+"</div>\r\n");
	document.Append("                <div>分类："+ProductClassBLL.ProductClassNameList(product.ClassID)+"</div>\r\n");
	document.Append("                <div>用户综合评分：<span class=\"grade\"><i style=\"width:"+product.PerPoint*20+"%\"></i></span> <span class=\"point\">"+product.PerPoint+"</span>（已有 <span class=\"commentCount\">"+product.CommentCount+"</span> 人评价）</div>\r\n");
	document.Append("                <div class=\"height10\"></div>\r\n");
	document.Append("                <div class=\"border1\"></div>\r\n");
	document.Append("                <div class=\"height10\"></div>\r\n");
	document.Append("                <div>市场价：<span class=\"maketPrice\">￥"+product.MarketPrice+"</span></div>\r\n");
	document.Append("                <div>销售价：<span class=\"salePrice\">￥"+currentMemberPrice+"<input id=\"CurrentMemberPrice\" value=\""+currentMemberPrice+"\" type=\"hidden\"\" /></span>   节省：￥ "+(product.MarketPrice-currentMemberPrice)+"</div>                \r\n");
	document.Append("                <div>\r\n");
	foreach(UserGradeInfo userGrade in userGradeList)
{
	document.Append(""+userGrade.Name+"价：￥"+MemberPriceBLL.ReadMemberPrice(userGrade,memberPriceList,product)+"  \r\n");
	}
	document.Append("</div>\r\n");
	document.Append("                <div class=\"height10\"></div>\r\n");
	document.Append("                <div class=\"border1\"></div>\r\n");
	document.Append("                <div class=\"height10\"></div>\r\n");
	if(product.StandardType==1)
{
	document.Append("                <input id=\"StandardRecordValueList\" value=\""+standardRecordValueList+"\" type=\"hidden\" />\r\n");
	foreach(StandardInfo standard in standardList)
{
	document.Append("                <div class=\"clear\">"+standard.Name+"：<input id=\"StandardValue_"+standard.ID+"\"  name=\"StandardValue\" type=\"hidden\" /><span id=\"Standard_"+standard.ID+"\">请选择</span></div>\r\n");
	document.Append("                <div class=\"standard\">\r\n");
	
                        string[] valueArray = standard.ValueList.Split(',');
                        string[] photoArray = standard.PhotoList.Split(',');
                    
	for(int i=0;i<valueArray.Length;i++)
{
	if(standard.DisplayTye==1)
{
	document.Append("                    <span class=\"standardBlock\" title=\""+valueArray[i]+"\" onclick=\"selectSingleStandard('"+valueArray[i]+"',"+standard.ID+")\">"+valueArray[i]+"</span>\r\n");
	}
else
{
	document.Append("                    <span class=\"standardBlock\" title=\""+valueArray[i]+"\" onclick=\"selectSingleStandard('"+valueArray[i]+"',"+standard.ID+")\"><img src=\""+photoArray[i]+"\" width=\"25\" height=\"25\" /></span>\r\n");
	 }
	}
	document.Append("                </div>\r\n");
	}
	}
else
{
	document.Append("                <div class=\"clear\"></div>\r\n");
	document.Append("                <div class=\"standard\">\r\n");
	foreach(StandardRecordInfo standardRecord in standardRecordList)
{
	document.Append("                    <span class=\"multiStandardBlock\" title=\""+standardRecord.ValueList+"\" onclick=\"selectMultiStandard('"+standardRecord.ProductID+"')\">"+standardRecord.ValueList+"</span>\r\n");
	}
	document.Append("                </div> \r\n");
	 }
	document.Append("                <div class=\"height10\"></div> \r\n");
	document.Append("                <div class=\"buy clear\">\r\n");
	if(leftStorageCount>0)
{
	document.Append("                数量：<input type=\"text\" class=\"input count\" id=\"BuyCount\" value=\"1\" onblur=\"countPrice(this.value,"+leftStorageCount+")\" /> 小计：￥<span id=\"currentTotalMemberPrice\">"+currentMemberPrice+"</span><input class=\"bigbutton\" value=\"放入购物车\"  type=\"button\" onclick=\"addToCart("+product.ID+",'"+product.Name+"',"+product.StandardType+")\"/>  <input class=\"bigbutton\" value=\"立即购买\"  type=\"button\" onclick=\"buyNow("+product.ID+",'"+product.Name+"',"+product.StandardType+")\"/>\r\n");
	}
else
{
	document.Append("                <input class=\"bigbutton\" value=\"缺货登记\"  type=\"button\" onclick=\"bookingProduct("+product.ID+",'"+product.Name+"',"+product.StandardType+")\"/> \r\n");
	 }
	document.Append("                <a href=\"javascript:collectProduct("+product.ID+")\">收藏</a>\r\n");
	document.Append("                </div>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"height10\"></div>\r\n");
	document.Append("            <ul class=\"productPageTag\">\r\n");
	document.Append("                <li class=\"productOn\" onclick=\"show('Introduce')\" id=\"titleIntroduce\">商品介绍</li>\r\n");
	document.Append("                <li class=\"productOff\" onclick=\"show('Accessory')\" id=\"titleAccessory\">赠送配件</li>\r\n");
	document.Append("                <li class=\"productOff\" onclick=\"show('RelationProduct')\" id=\"titleRelationProduct\">关联产品</li>\r\n");
	document.Append("            </ul>\r\n");
	document.Append("            <div class=\"productDetailTitle\"></div>\r\n");
	document.Append("            <div class=\"height10\"></div>\r\n");
	document.Append("            <div class=\"productIntroduce\" id=\"productIntroduce\">\r\n");
	if(attributeRecordList.Count>0)
{
	document.Append("                <ul class=\"productAttribute\">\r\n");
	foreach(AttributeRecordInfo attributeRecord in attributeRecordList)
{
	document.Append("                    <li>"+AttributeBLL.ReadAttributeCache(attributeRecord.AttributeID).Name+"："+attributeRecord.Value+"</li>\r\n");
	}
	document.Append("                </ul>\r\n");
	 }
	document.Append("                <div class=\"height10\"></div>\r\n");
	document.Append("                <div class=\"productContent\">"+product.Introduction+"</div>\r\n");
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"productAccessory\" id=\"productAccessory\" style=\"display:none\">\r\n");
	if(product.Accessory!=string.Empty)
{
	document.Append("                <ul>\r\n");
	foreach(string temp in product.Accessory.Split(','))
{
	ProductInfo tempProduct=ProductBLL.ReadProductByProductList(tempProductList,Convert.ToInt32(temp));
	document.Append("                    <li><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\" class=\"photo\"><img src=\""+tempProduct.Photo.Replace("Original","120-120")+"\" onload=\"photoLoad(this,120,120)\" /></a><br /><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\">"+tempProduct.Name+"</a></li>\r\n");
	}
	document.Append("                </ul>\r\n");
	 }
	document.Append("            </div>\r\n");
	document.Append("            <div class=\"productAccessory\" id=\"productRelationProduct\" style=\"display:none\">\r\n");
	if(product.RelationProduct!=string.Empty)
{
	document.Append("                <ul>\r\n");
	foreach(string temp in product.RelationProduct.Split(','))
{
	ProductInfo tempProduct=ProductBLL.ReadProductByProductList(tempProductList,Convert.ToInt32(temp));
	document.Append("                    <li><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\" class=\"photo\"><img src=\""+tempProduct.Photo.Replace("Original","120-120")+"\" onload=\"photoLoad(this,120,120)\" /></a><br /><a href=\"/ProductDetail-I"+tempProduct.ID+".aspx\">"+tempProduct.Name+"</a></li>\r\n");
	}
	document.Append("                </ul>\r\n");
	 }
	document.Append("            </div>\r\n");
	if(product.AllowComment==(int)BoolType.True)
{
	document.Append("            <div class=\"height10\"></div>\r\n");
	document.Append("            <div class=\"productCommentTitle\"> 网友点评</div>\r\n");
	document.Append("            <div id=\"ProductCommentAjax\"></div>            \r\n");
	document.Append("            <div class=\"postComment\">\r\n");
	document.Append("                <ul>\r\n");
	document.Append("                    <li>评分：\r\n");
	for(int i=1;i<6;i++)
{
	document.Append("                        <input type=\"radio\" name=\"rank\" value=\""+i+"\" />\r\n");
	for(int k=1;k<=i;k++)
{
	document.Append("<img src=\"/Plugins/Template/Red/Style/Images/s1.gif\" />\r\n");
	}
	for(int m=i+1;m<=5;m++)
{
	document.Append("<img src=\"/Plugins/Template/Red/Style/Images/s0.gif\" />\r\n");
	}
	}
	document.Append("                    </li>\r\n");
	document.Append("                    <li class=\"title\">标题：<input type=\"text\" class=\"text\"  id=\"title\"/></li>\r\n");
	document.Append("                    <li>内容：不要发表违规信息，请自觉遵守互联网相关政策法规。 <textarea  id=\"content\"></textarea></li>\r\n");
	document.Append("                    <div class=\"height10\"></div>\r\n");
	document.Append("                    <li><input type=\"button\" class=\"button\" value=\"发表\" onclick=\"postComment()\" /></li>\r\n");
	document.Append("                </ul>\r\n");
	document.Append("            </div>\r\n");
	 }
	document.Append("        </div>\r\n");
	document.Append("    </div>\r\n");
	document.Append("     <div class=\"foot\">\r\n");
	document.Append("    <div class=\"block\">\r\n");
	document.Append("        <div class=\"help\">\r\n");
	foreach(ArticleClassInfo articleClass in helpClassList)
{
	document.Append("            <ul>\r\n");
	document.Append("                <li class=\"title\">"+articleClass.ClassName+"</li>\r\n");
	foreach(ArticleClassInfo childArticleClass in ArticleClassBLL.ReadArticleClassAllChildList(articleClass.ID))
{
	document.Append("                <li> <a href=\"/Help-I"+childArticleClass.ID+".aspx\">"+childArticleClass.ClassName+"</a></li>\r\n");
	}
	document.Append("            </ul>\r\n");
	}
	document.Append("        </div>\r\n");
	document.Append("        <div class=\"clear redLine\"></div>\r\n");
	document.Append("        <p class=\"message\">\r\n");
	int bo=0;
	foreach(ArticleInfo bottom in bottomList)
{
	if(bo>0)
{
	document.Append(" | \r\n");
	 }
	document.Append("        <a href=\"\r\n");
	if(bottom.Url==string.Empty)
{
	document.Append("/ArticleDetail-I"+bottom.ID+".aspx\r\n");
	}
else
{
	document.Append(""+bottom.Url+"\r\n");
	 }
	document.Append("\">"+StringHelper.Substring(bottom.Title,11)+"</a>\r\n");
	bo++;
	}
	document.Append("        </p>\r\n");
	document.Append("        <div class=\"processTime\">页面执行时间："+processTime+"S</div>\r\n");
	document.Append("    </div>    \r\n");
	document.Append("</div>\r\n");
	document.Append("<script language=\"javascript\" type=\"text/javascript\" src=\"/Plugins/Template/Red/Js/Global.js\" ></"+"script>  \r\n");
	document.Append("    <script language=\"javascript\" type=\"text/javascript\" src=\"/Plugins/Template/Red/Js/Scroll.js\" ></"+"script>\r\n");
	document.Append("    <script language=\"javascript\" type=\"text/javascript\" src=\"/Plugins/Template/Red/Js/ProductDetail.js\" ></"+"script>\r\n");
	document.Append("    <script language=\"javascript\">\r\n");
	document.Append("        var productID="+product.ID+";\r\n");
	document.Append("        pageInit("+product.AllowComment+");\r\n");
	document.Append("    </"+"script> \r\n");
	document.Append("<div style=\"text-align:center; font-size:11px; margin-bottom:10px\">Soco商城系统(SocoShop) V1.0<a href=\"http://www.skyces.com\" target=\"_blank\" style=\"text-decoration:none; color:#4C5A62\">Copyright © 天易CES 2009</a></div></body>\r\n");
	document.Append("</html>\r\n");
	Response.Write(document.ToString());
}
</script>