<%@Page Language="C#" Inherits="IWMS.Admin.AdvGet" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<script type="text/javascript" src="inc/html_preview.js"></script>
	<script type="text/javascript">
	<!--
	<asp:Literal id="ltJs" EnableViewState="false" runat="server"/>
	
	function GenerateCode(){
		var s, url, path;
		var oCodeArea;
		var gid, width, height;
		
		oGroupId = document.getElementById("<%=groupid.ClientID%>");
		oCodeArea = document.getElementById("codeArea");
	
		gid = parseInt(oGroupId.value);
		width = gs[gid][0];
		height = gs[gid][1];
		
		path=window.location.href;
		path=path.substring(0,path.lastIndexOf("/")+1);
		url = path+"frm_adv.aspx?gid="+	gid;
		
		s = "<iframe align=\"center\" width=\""+ width +"\" height=\""+ height +"\" src=\""+ url +"\" frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>";
		oCodeArea.value = s;
	}
	
	function CopyCode(){
		document.getElementById("codeArea").focus();
		document.getElementById("codeArea").select();
		document.execCommand("copy");
	}
	-->
	</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<span class="tt">获取广告代码</span>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<form runat="server">
		<table width="95%" align="center" style="table-layout:fixed">
		<tr>
		<th width="80">
			广告组：
		</th><td>
			<asp:DropDownList id="groupid"	runat="server" />
			<a href="admin_advgroupAdd.aspx">添加广告组</a>
		</td>
		</tr>
		<tr>
		<td>
			&nbsp;
		</td>
		<td>
			
		</td>
		</tr>
		<tr>
		<td>
			&nbsp;
		</td>
		<td>
			 <input type="button" value="生成代码" onclick="GenerateCode();"/> &nbsp; <input type="button" value="拷贝脚本" onclick="CopyCode();"/>
			 <a href="javascript:HtmlPreview('codeArea');">预览</a>
		</td>
		</tr>
		<tr>
		<td>&nbsp;</td>
		<td>
			<textarea id="codeArea" cols="90" rows="6"></textarea>
			<br/>
			<span class="explain">把生成的代码粘贴到html文件内即可以显示指定的内容</span>
		</td>
		</tr>
		</table>
		</form>
		
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
</asp:Content>