<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ad_Edit.aspx.cs" Inherits="TotCms.Web.Admin.Ad_Edit" %>

<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>修改广告</title>
    <link href="style/global.css" rel="stylesheet" type="text/css" />
    <link href="js/calendar.css" rel="stylesheet" type="text/css" />
    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/calendar.js" type="text/javascript"></script>
    <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../js/jquery-ui-1.8.10/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
    <link href="../js/jquery-ui-1.8.10/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
      $(function () {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-win").dialog({
          autoOpen: false,
          width: 530,
          height: 250,
          modal: true,
          close: function () {

          }
        });
      });
      function Upload_Open(id) {
        $("#dialog-win").dialog("open");
        document.getElementById('win_frame').src = 'Upload.aspx?rid='+id;
        $("#dialog-win").dialog('option', 'title', '上传图片');
      }
      function CloseFrame() {
        $("#dialog-win").dialog("close");
      }
</script>
    <script type="text/javascript">
    function getadtype(i){
      for (var t = 1; t <= 3; t++) {
        $('#adtype' + t).hide();
      }
      $('#adtype' + i).show();
    }
    </script>
    <style type="text/css">
      .style1
      {
        width: 100%;
      }
    </style>
</head>
<body onload="getadtype(<%=fadtype %>)">
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    
    <table style="width:100%;" border="0" cellpadding="0" cellspacing="1" 
      class="black_border" id="table_1" runat="server">
      <tr class="suphead">
        <td colspan="2">
                                                                                修改广告</td>
    </tr>
    <tr>
      <td class="fields_text">
        选择栏目：</td>
      <td class="fields_input">
       <asp:Label ID="CategoryTitle" runat="server" Text="Label"></asp:Label>
        <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden"></asp:TextBox>
          <input id="Button4" type="button" value="..." onclick="popupWindow('Category_Tree.aspx','category_tree',400,300,1)" />
        </td>
    </tr>
    <tr>
      <td class="fields_text">
        广告名称：</td>
      <td class="fields_input">
        <asp:TextBox ID="Title" runat="server" CssClass="input_middle"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
          ControlToValidate="Title" ErrorMessage="请填写广告名称"></asp:RequiredFieldValidator>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        广告类型：</td>
      <td class="fields_input">
        <asp:RadioButtonList ID="AdType" runat="server" 
          onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" 
          RepeatDirection="Horizontal" RepeatLayout="Flow">
          <asp:ListItem Value="1" Selected="True">文本</asp:ListItem>
          <asp:ListItem Value="2">图片</asp:ListItem>
          <asp:ListItem Value="3">Flash</asp:ListItem>
        </asp:RadioButtonList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          广告效果：</td>
      <td class="fields_input">
          <asp:RadioButtonList ID="EffectId" runat="server" RepeatDirection="Horizontal" 
              RepeatLayout="Flow">
              <asp:ListItem Value="0">无特效</asp:ListItem>
              <asp:ListItem Value="1">对联广告</asp:ListItem>
              <asp:ListItem Value="2">漂浮广告</asp:ListItem>
              <asp:ListItem Value="3">右下角弹出广告</asp:ListItem>
          </asp:RadioButtonList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        广告过期：</td>
      <td class="fields_input">      
              
        <asp:TextBox ID="ExpiresTime" runat="server"></asp:TextBox>
        <input name="button" type="button" onclick="displayCalendar(document.forms[0].ExpiresTime,'yyyy-mm-dd',this)" value="..." />
          </td>
    </tr>
    <tr>
      <td class="fields_text">
          点击数：</td>
      <td class="fields_input">      
              
          <asp:TextBox ID="Hits" runat="server"></asp:TextBox>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        广告内容：</td>
      <td class="fields_input">      
        <div id="adtype1" style="display:none;">     
        <asp:TextBox ID="Content" runat="server" CssClass="text_content" 
            TextMode="MultiLine"></asp:TextBox></div> 
        <div id="adtype2" style="display:none;"><table align="center" cellpadding="0" cellspacing="0" class="style1">
          <tr>
            <td height="35">
              图片地址：</td>
            <td>
              <asp:TextBox ID="ImgSrc" runat="server" CssClass="input_middle"></asp:TextBox>
              <input name="UpLoad" type="button" id="UpLoad" value="上传" onclick="Upload_Open('ImgSrc')" class="btn-general" />
                  </td>
          </tr>
          <tr>
            <td height="35">
              图片尺寸：</td>
            <td>
              宽度：<asp:TextBox ID="ImgW" runat="server" CssClass="input_mini"></asp:TextBox>
&nbsp;px 高度：<asp:TextBox ID="ImgH" runat="server" CssClass="input_mini"></asp:TextBox>
              px</td>
          </tr>
          
        </table>
        </div>
        <div id="adtype3" style="display:none;"><table align="center" cellpadding="0" cellspacing="0" class="style1">
          <tr>
            <td height="35">
              Flash地址：</td>
            <td>
              <asp:TextBox ID="FlashSrc" runat="server" CssClass="input_middle"></asp:TextBox>
              <input name="UpLoad" type="button" id="Button3" value="上传" onclick="Upload_Open('FlashSrc')" class="btn-general" />
                  </td>
          </tr>
          <tr>
            <td height="35">
              Flash尺寸：</td>
            <td>
              宽度：<asp:TextBox ID="FlashW" runat="server" CssClass="input_mini"></asp:TextBox>
&nbsp;px 高度：<asp:TextBox ID="FlashH" runat="server" CssClass="input_mini"></asp:TextBox>
              px</td>
          </tr>
        </table></div>
      </td>
    </tr>
    <tr>
            <td class="fields_text">
              链接地址：</td>
            <td class="fields_input">
              <asp:TextBox ID="LinkUrl" runat="server" CssClass="input_middle">http://</asp:TextBox>
                  </td>
          </tr>
    <tr>
      <td></td>
      <td align="left" height="45">
        <asp:Button ID="Button1" runat="server" Text="修改广告" onclick="Button1_Click" CssClass="btn-submit" />
        &nbsp;<input id="Button2" type="reset" value="取 消" class="btn-cancel" /></td>
    </tr>
  </table>
    <div class="info">
      <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
      <iframe runat="server" height="0" width="0" id="sendframe"></iframe>
    </div>
    <div id="dialog-win" title="window">
	  <iframe id="win_frame" name="win_frame" src="Blank.htm" width="500" height="170" frameborder="0"></iframe>	
  </div>
    </form>
</body>
</html>
