<%@ Page language="c#" Codebehind="MyUnion.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.MyUnion" %>
<%@ Register TagPrefix="uc1" TagName="MemberMenu" Src="Modules/MemberMenu.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" %>
<!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("PromotionUnion")%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<script type="text/javascript" src="inc/calendar.js"></script>
	</HEAD>
	<body>
            <div id="container">
                <uc1:Header id="Header1" runat="server"></uc1:Header>
                <!--位置导航开始-->
                <div class="path">
                    <a href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>">
                        <%=GetResourceString("Home")%>
                    </a>>
                    <%=GetResourceString("MemberCenter")%>
                    >
                    <%=GetResourceString("PromotionUnion")%>
                </div>
				<!--位置导航结束-->
                <div id="content">
                    <div id="content_left_side">
                        <!--会员中心导航开始-->
                        <uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
                        <!--会员中心导航结束-->
                    </div>
                    <div id="content_middle_side">
                        <!--内容开始-->
						
	                    <form id="Form1" method="post" runat="server">
                        <div class="mframe">
                            	<div class="tl"> </div>
                            <div class="tr"></div>
                            <div class="tm">
                                <div class="on">
                                    <%=GetResourceString("PromotionUnion")%>
                                </div>
                            </div>
                            <div class="ml"></div>
                            <div class="mr"> </div>
                            <div class="mm">
                                <asp:Repeater ID="rptList" runat="server">
									<ItemTemplate>
										<%# Container.ItemIndex != 0 ? "<br /><hr class=itemhr />" : "" %>										
										<div style="overflow:hidden; width:730px;"><img src='Upload/Union/<%# DataBinder.Eval(Container.DataItem,"Image") %>' /></div>
										<div style="line-height:30px;"><%=GetResourceString("PromotionUnion2")%></div>
										<textarea id='txt_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>' cols="80" rows="3"><a href='<%=GetMyAgentLink() %>'><img src='<%=XpShop.WebUI.WebUtils.GetHost()%>Upload/Union/<%# DataBinder.Eval(Container.DataItem,"Image") %>' border="0" /></a></textarea>
										<input id='btn_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>' type="button" value='<%=GetResourceString("Copy") %>' onclick="copyToClipboard('txt_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>')"/>
									</ItemTemplate>
								</asp:Repeater>
							</div>
                        </div>
		                </form>
                        <!--内容结束-->
                </div>
                <div style="clear: both;"></div>
            </div>
			<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
			<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
			<script type="text/javascript">
				function copyToClipboard(txtID) {
					if(window.clipboardData) {
						window.clipboardData.clearData();
						var txtValue=document.getElementById(txtID).value;
						window.clipboardData.setData("Text",txtValue);
					} else if(navigator.userAgent.indexOf("Opera") != -1) {
						window.location = txtValue;
						} else if (window.netscape) {
						try {
						netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
						} catch (e) {
						alert('<%=GetResourceString("PromotionUnion1") %>');
						return false;
						}
						var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
						if (!clip)
						return;
						var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
						if (!trans)
						return;
						trans.addDataFlavor('text/unicode');
						var str = new Object();
						var len = new Object();
						var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
						var copytext = txtValue;
						str.data = copytext;
						trans.setTransferData("text/unicode",str,copytext.length*2);
						var clipid = Components.interfaces.nsIClipboard;
						if (!clip)
						return false;
						clip.setData(trans,null,clipid.kGlobalClipboard);
					}				
					alert('<%=GetResourceString("CopySuccess") %>!');
				}
		</script>
        </div>
	</body>
</HTML>
