<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="NavBar" Src="Modules/NavBar.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Bulletin" Src="Modules/Bulletin.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTop2Level" Src="Modules/LeftNavTop2Level.ascx" %>
<%@ Page language="c#" Codebehind="Compare.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.Compare" %>
<!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><%=GetResourceString("Compare")%> －－ <%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->		
		<script type="text/javascript">
            var _compareArgs = window.location.search.replace("?method=compare","");
            function removecompare(id){
               if(id==-1)
               {
                    var url = "";
               }
               else
               {
                   var url=_compareArgs;
                   var re = new RegExp ("&pids="+id, "gi") ;
                   url = url.replace(re, "");
               }
               window.location= "Compare.aspx?method=compare" + url;
            }
        </script>
	</HEAD>
	<body>
	    <div id="container">
		<table id="compare"  cellpadding="0" cellspacing="0" align="center">
		    <tr bgcolor="#f3eded">
		        <th scope="col"><%=GetResourceString("ProductPicture")%></th>
		        <th scope="col"><%=GetResourceString("ProductName")%></th>
		        <th scope="col"><%=GetResourceString("NO.")%></th>
		        <th scope="col"><%=GetResourceString("ProductUnit")%></th>
                <th scope="col"><%=GetResourceString("Weight")%></th>
                <th scope="col"><%=GetResourceString("MarketPrice")%></th>
                <th scope="col"><%=GetResourceString("MemberPrice")%></th>
                <th scope="col"><%=GetResourceString("Credit")%></th>
                <th scope="col"><%=GetResourceString("DiscountOrNot")%></th>
		        <th scope="col"><%=GetResourceString("Buy")%></th>
                <th scope="col"><a href='javascript:removecompare(-1);'><%=GetResourceString("RemoveAll")%></a></th>
		    </tr>
		    <asp:Repeater ID="rptCompare" runat="server">
			    <ItemTemplate>
			        <tr">
			            <td style="width:95px;">
                            <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="_blank">
                                &nbsp;<img width="90" height="90" src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>" style="border:0px">
                            </a>
                        </td>
                        <td style="width:200px; text-align:left;">&nbsp;<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="_blank" ><%#DataBinder.Eval(Container.DataItem,"Name")%></a></td>
                        <td>&nbsp;<%#DataBinder.Eval(Container.DataItem, "ProductNo")%></td>
                        <td>&nbsp;<%#DataBinder.Eval(Container.DataItem, "Unit")%></td>
                        <td>&nbsp;<%#DataBinder.Eval(Container.DataItem, "Weight")%><%#DataBinder.Eval(Container.DataItem, "Weight") != "" ? "g" : ""%></td>
                        <td><s>&nbsp;￥<%# DataBinder.Eval(Container.DataItem, "MarketPrice", "{0:f2}")%></s></td>
                        <td>&nbsp;￥<%# DataBinder.Eval(Container.DataItem, "MemberPrice", "{0:f2}")%></td>
                        <td>&nbsp;<%#DataBinder.Eval(Container.DataItem, "Score")%></td>
                        <td>&nbsp;<%#DataBinder.Eval(Container.DataItem, "IsDiscount").ToString() == "1" ? "Yes" : "No"%></td>
                        <td>
                            <div style="text-align:center;"><a href="#" onclick='addtocart(<%#DataBinder.Eval(Container.DataItem,"ProductID")%>)'>
                                <%=GetResourceString("Buy")%>
                            </a></div>
                        </td>
                        <td><a href='javascript:removecompare(<%#DataBinder.Eval(Container.DataItem,"ProductID")%>);'><%=GetResourceString("Remove")%></a></td>
                    </tr>
			    </ItemTemplate>
			</asp:Repeater>
		</table>
		</div>
	</body>
</HTML>
