<%@ 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="MemberHelper" Src="Modules/MemberHelper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="memberfooter" Src="Modules/memberfooter.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>推广联盟,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<script type="text/javascript" src="inc/calendar.js"></script>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/member.css" type="text/css" rel="stylesheet" />
	</HEAD>
	<body>
                <uc1:Header id="Header1" runat="server"></uc1:Header>
                <div class="xp-qgw clear">
                    <!--位置导航开始-->
                    <div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<a href="<%=webSite %>Center.<%=config.html %>"><%=GetResourceString("MemberCenter")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("MyFinance")%></div>
                    <!--位置导航结束-->
                    <div class="member_left">
                        <!--会员中心导航开始-->
                        <uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
                        <!--会员中心导航结束-->
                    </div>
                    <div class="member_middle_right">
                        <!--内容开始-->
                        <div class="mframe">
			                <div class="tl"></div>
			                <div class="tr"></div>
			                <div class="tm">推广联盟</div>
			                <div class="ml"></div>
			                <div class="mr"></div>
			                <div class="mm">
	                            <form id="Form1" method="post" runat="server">
                                    <asp:Repeater ID="rptList" runat="server">
									    <ItemTemplate>
										    <%# Container.ItemIndex != 0 ? "<br /><hr class=itemhr />" : "" %>										
										    <div style="overflow:hidden; width:715px;"><img src='Upload/Union/<%# DataBinder.Eval(Container.DataItem,"Image") %>' /></div>
										    <div style="line-height:30px;">将下面的代码拷贝后粘贴到您的网店、网站、博客或论坛上，用户通过此广告进入本商城购物，业绩将会划归到您的名下</div>
										    <textarea id='txt_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>' cols="80" rows="3"><a href='<%=GetMyAgentLink() %>'><img src='<%=XpShop.Common.Utils.GetHost()%>Upload/Union/<%# DataBinder.Eval(Container.DataItem,"Image") %>' border="0" /></a></textarea>
										    <input id='btn_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>' type="button" value="复制" onclick="copyToClipboard('txt_<%# DataBinder.Eval(Container.DataItem,"UnionID") %>')"/>
									    </ItemTemplate>
								    </asp:Repeater>
		                        </form>
		                    </div>
				            <div class="bl"></div>
				            <div class="br"></div>
				            <div class="bm"></div>
				        </div>
                        <!--内容结束-->
                    </div>
                </div>
			    <uc1:MemberHelper id="Helper1" runat="server"></uc1:MemberHelper>
			    <uc1:memberfooter id="Footer1" runat="server"></uc1:memberfooter>
			    <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("您的firefox安全限制限制您进行剪贴板操作，请打开'about:config'将signed.applets.codebase_principal_support'设置为true'之后重试");
						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('复制成功!');
				}
		</script>
	</body>
</HTML>
