<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="MyITJob.Admin_Advertise_AddZone" Codebehind="Advertise_AddZone.aspx.cs" %>

<!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 runat="server">
    <title><%=Application["PageTitle"] %>——添加版位</title>
    <link href="../images/Admin_Style.css" rel="stylesheet" type="text/css" />

    <script language="JavaScript" type="text/javascript">
function CheckForm()
{
  if(myform.ZoneName.value==''){
    alert('版位名称不能为空！');
    myform.ZoneName.focus();
    return false;
  }
  if(document.myform.ZoneType[document.myform.ZoneType.length-1].checked == false){
    if(myform.ZoneWidth.value==''){
      alert('版位宽度不能为空！');
      myform.ZoneWidth.focus();
      return false;
    }
    if(myform.ZoneHeight.value==''){
      alert('版位高度不能为空！');
      myform.ZoneHeight.focus();
      return false;
    }
  }
}

function Change_Setting()
{
  if(document.myform.ZoneType[0].checked == false) {
    document.myform.ShowType[2].disabled = true;
    if (document.myform.ShowType[2].checked == true)
    document.myform.ShowType[0].checked = true;
  } else
    document.myform.ShowType[2].disabled = false;
  if(document.myform.ZoneType[document.myform.ZoneType.length-1].checked == false)
    Zone_EnableSize();
  else
    Zone_DisableSize();
  for (var j=0;j<document.myform.ZoneType.length;j++){
    var ot = eval('document.all.ZoneType' + (j + 1) + '_Setting');
    if(document.myform.ZoneType[j].checked==true)
      ot.style.display = '';
    else
      ot.style.display = 'none';
  }
}
function Zone_DisableSize()
{
  document.myform.SizeType[0].disabled = true;
  document.myform.SizeType[1].disabled = true;
  document.myform.ZoneSize.disabled = true;
  document.myform.ZoneWidth.disabled = true;
  document.myform.ZoneHeight.disabled = true;
}
function Zone_EnableSize()
{
  document.myform.SizeType[0].disabled = false;
  document.myform.SizeType[1].disabled = false;
  document.myform.ZoneSize.disabled = false;
  document.myform.ZoneWidth.disabled = false;
  document.myform.ZoneHeight.disabled = false;
}
function Zone_SelectSize(o)
{
  size = o.options[o.selectedIndex].value;
  if (size != '0x0')
  {
    sarray = size.split('x');
    height = sarray.pop();
    width  = sarray.pop();
    document.myform.ZoneWidth.value = width;
    document.myform.ZoneHeight.value = height;
    document.myform.SizeType[0].checked = true;
    document.myform.SizeType[1].checked = false;
  }
  else
  {
    document.myform.SizeType[0].checked = false;
    document.myform.SizeType[1].checked = true;
  }
}
function Zone_EditSize()
{
  document.myform.SizeType[0].checked = false;
  document.myform.SizeType[1].checked = true;
  document.myform.ZoneSize.selectedIndex = document.myform.ZoneSize.options.length - 1;
}
    </script>

</head>
<body>
    <form id="myform" runat="server" onsubmit='return CheckForm();'>
        <div>
            <table align="center" border="0" cellpadding="2" cellspacing="1" class="border" width="100%">
                <tr class="topbg">
                    <td colspan="10" height="22">
                        <table width="100%">
                            <tr class="topbg">
                                <td align="center">
                                    <b>网 站 广 告 管 理</b></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class="tdbg">
                    <td height="30" width="70">
                        <strong>管理导航：</strong></td>
                    <td>
                        <a href="Advertise_AddZone_Manage.aspx">广告版位管理</a> |&nbsp; <a href="Advertise_AddZone.aspx">
                            添加新版位</a> |&nbsp; <a href="Advertise_AddAD_Manage.aspx">网站广告管理</a>
                        |&nbsp; <a href="Advertise_AddAD.aspx">添加新广告</a> |</td>
                </tr>
            </table>
            <br />
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                <tr class='title'>
                    <td height='22' colspan='2' align='center' class='topbg'>
                        <strong>版 位 属 性 设 置</strong></td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>所属频道分类：</strong><br />
                        此分类只用于区分版位所在的位置。</td>
                    <td width='600'>
                        <asp:DropDownList ID="ChannelID" runat="server">
                        </asp:DropDownList>
                        <font color="red"><asp:Literal ID="LT1" runat="server"></asp:Literal></font></td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>版位名称：</strong></td>
                    <td width='600'>
                        <input name='ZoneName' type='text' id='ZoneName' size='60' maxlength='60' value=''
                            runat="server" />
                        <font color='red'>*</font></td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>生成JS文件名：</strong></td>
                    <td width='600'>
                        <asp:TextBox ID="ZoneJSName" runat="server" MaxLength="100" Width="327px"></asp:TextBox>
                        <font color='red'>*</font>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>版位描述：</strong></td>
                    <td width='600'>
                        <textarea name='ZoneIntro' cols='50' rows='3' id='ZoneIntro' runat="server"></textarea>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>版位类型：</strong><br />
                        选择放置于此版位的广告类型。</td>
                    <td width='600'>
                        <table>
                            <tr>
                                <td>
                                    <input type='radio' name='ZoneType' value='1' onclick='Change_Setting();' checked
                                        id="Radio1" runat="server" />
                                    矩形横幅&nbsp;
                                    <input type='radio' name='ZoneType' value='2' onclick='Change_Setting();' id="Radio2"
                                        runat="server" />
                                    弹出窗口&nbsp;
                                    <input type='radio' name='ZoneType' value='3' onclick='Change_Setting();' id="Radio3"
                                        runat="server" />
                                    随屏移动&nbsp;
                                    <input type='radio' name='ZoneType' value='4' onclick='Change_Setting();' id="Radio4"
                                        runat="server" />
                                    固定位置&nbsp;
                                    <input type='radio' name='ZoneType' value='5' onclick='Change_Setting();' id="Radio5"
                                        runat="server" />
                                    漂浮移动&nbsp;
                                    <input type='radio' name='ZoneType' value='6' onclick='Change_Setting();' id="Radio6"
                                        runat="server" />
                                    文字代码&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='200' valign='top'>
                        <strong>版位设置：</strong><br />
                        对版位的详细参数进行设置。</td>
                    <td width='600' valign='top'>
                        <table width='100%' height='40' border='0' cellpadding='2' cellspacing='1'>
                            <tr>
                                <td>
                                    <input name='DefaultSetting' type='radio' value='1' onclick="ZoneSetting.style.display='none'"
                                        checked id="Radio7" runat="server" />
                                    默认设置&nbsp;
                                    <input name='DefaultSetting' type='radio' value='0' onclick="ZoneSetting.style.display=''"
                                        id="Radio8" runat="server" />
                                    自定义设置&nbsp;
                                </td>
                            </tr>
                        </table>
                        <table id='ZoneSetting' width='100%' border='0' cellpadding='0' cellspacing='0' style='display: none'>
                            <tr>
                                <td>
                                    <table id='ZoneType1_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: '>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--矩形横幅</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td colspan='2' align='center'>
                                                            此类型无版位参数设置！</td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                    <table id='ZoneType2_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: none'>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--弹出窗口</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>弹出方式：</strong></td>
                                                        <td>
                                                            <select name='Pop_PopType' id="Select1" runat="server">
                                                                <option value='1' selected>前置窗口</option>
                                                                <option value='2'>后置窗口</option>
                                                                <option value='3'>网页对话框</option>
                                                                <option value='4'>背投广告</option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>弹出位置（左）：</strong></td>
                                                        <td>
                                                            <input name='Pop_Left' type='text' id='Pop_Left' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>弹出位置（上）：</strong></td>
                                                        <td>
                                                            <input name='Pop_Top' type='text' id='Pop_Top' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                    <table id='ZoneType3_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: none'>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--随屏移动</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>广告位置（左）：</strong></td>
                                                        <td>
                                                            <input name='Move_Left' type='text' id='Move_Left' size='5' maxlength='4' value='15'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>广告位置（上）：</strong></td>
                                                        <td>
                                                            <input name='Move_Top' type='text' id='Move_Top' size='5' maxlength='4' value='200'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>移动平滑度：</strong></td>
                                                        <td>
                                                            <input name='Move_Delta' type='text' id='Move_Delta' size='7' maxlength='7' value='0.015'
                                                                runat="server" />
                                                            （取值在0.001至1之间）
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                    <table id='ZoneType4_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: none'>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--固定位置</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>广告位置（左）：</strong></td>
                                                        <td>
                                                            <input name='Fixed_Left' type='text' id='Fixed_Left' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>广告位置（上）：</strong></td>
                                                        <td>
                                                            <input name='Fixed_Top' type='text' id='Fixed_Top' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                    <table id='ZoneType5_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: none'>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--漂浮移动</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>漂浮类型：</strong></td>
                                                        <td>
                                                            <select name='Float_Type' id="Select2" runat="server">
                                                                <option value='1' selected>变速漂浮</option>
                                                                <option value='2'>匀速漂浮</option>
                                                                <option value='3'>上下漂浮</option>
                                                                <option value='4'>左右漂浮</option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>开始位置（左）：</strong></td>
                                                        <td>
                                                            <input name='Float_Left' type='text' id='Float_Left' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td width='200'>
                                                            <strong>开始位置（上）：</strong></td>
                                                        <td>
                                                            <input name='Float_Top' type='text' id='Float_Top' size='5' maxlength='4' value='100'
                                                                runat="server" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                    <table id='ZoneType6_Setting' width='100%' border='0' cellpadding='0' cellspacing='0'
                                        style='display: none'>
                                        <tr>
                                            <td>
                                                <table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
                                                    <tr align='center' class='tdbg2'>
                                                        <td colspan='2'>
                                                            <strong>版位参数设置--文字代码</strong></td>
                                                    </tr>
                                                    <tr class='tdbg'>
                                                        <td colspan='2' align='center'>
                                                            此类型无版位参数设置！</td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>版位尺寸：</strong><br />
                        IAB：互联网广告联合会标准尺寸。<br />
                        带*号的为新增加的标准广告尺寸。</td>
                    <td width='600'>
                        <table>
                            <tr>
                                <td>
                                    <input type='radio' name='SizeType' value='default' checked runat="server" id="Radio9">
                                    <select name='ZoneSize' onchange='Zone_SelectSize(this)' id="ZoneSize" runat="server">
                                        <option value='468x60' selected>IAB - 468 x 60 IMU (横幅广告)</option>
                                        <option value='234x60'>IAB - 234 x 60 IMU (半幅广告)</option>
                                        <option value='88x31'>IAB - 88 x 31 IMU (小按钮)</option>
                                        <option value='120x90'>IAB - 120 x 90 IMU (按钮一)</option>
                                        <option value='120x60'>IAB - 120 x 60 IMU (按钮二)</option>
                                        <option value='728x90'>IAB - 728 x 90 IMU (通栏广告) *</option>
                                        <option value='120x240'>IAB - 120 x 240 IMU (竖幅广告)</option>
                                        <option value='125x125'>IAB - 125 x 125 IMU (方形按钮)</option>
                                        <option value='180x150'>IAB - 180 x 150 IMU (长方形) *</option>
                                        <option value='300x250'>IAB - 300 x 250 IMU (中长方形) *</option>
                                        <option value='336x280'>IAB - 336 x 280 IMU (大长方形)</option>
                                        <option value='240x400'>IAB - 240 x 400 IMU (竖长方形)</option>
                                        <option value='250x250'>IAB - 250 x 250 IMU (正方形弹出)</option>
                                        <option value='120x600'>IAB - 120 x 600 IMU (摩天大楼)</option>
                                        <option value='160x600'>IAB - 160 x 600 IMU (宽摩天大楼) *</option>
                                        <option value='300x600'>IAB - 300 x 600 IMU (半页广告) *</option>
                                        <option value='0x0'>自定义大小</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type='radio' name='SizeType' value='custom' onclick='Zone_EditSize()' id="Radio10"
                                        runat="server">
                                    宽度:
                                    <input name='ZoneWidth' size='5' maxlength='4' onkeydown='Zone_EditSize()' value='468'
                                        id="ZoneWidth" runat="server">
                                    &nbsp;&nbsp;&nbsp;&nbsp; 高度:
                                    <input name='ZoneHeight' size='5' maxlength='4' onkeydown='Zone_EditSize()' value='60'
                                        id="ZoneHeight" runat="server">
                                    <font color='red'>*</font>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>显示方式：</strong><br />
                        当版位中有多个广告时按照此设定进行显示（依据广告的权重）。</td>
                    <td width='600'>
                        <asp:RadioButtonList ID="ShowType" runat="server" RepeatLayout="Flow">
                            <asp:ListItem Selected="True" Value="1">按权重随机显示  权重越大显示机会越大。</asp:ListItem>
                            <asp:ListItem Value="2">按权重优先显示  显示权重值最大的广告。</asp:ListItem>
                            <asp:ListItem Value="3">按顺序循环显示  此方式仅对矩形横幅有效。</asp:ListItem>
                        </asp:RadioButtonList></td>
                </tr>
                <tr class='tdbg'>
                    <td width='200'>
                        <strong>版位状态：</strong><br />
                        设为活动的版位才能在前台显示。</td>
                    <td width='600'>
                        <input name='Active' type='checkbox' id='Active' value='yes' checked runat="server" />
                        活动版位
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td height='40' colspan='2' align='center'>
                        &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="添 加" />&nbsp;&nbsp;
                        <input id="Reset1" type="reset" value='取 消' />
                    </td>
                </tr>
            </table>
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                <tr class='tdbg'>
                    <td class="topbg">
                        <div align="center">
                            Copyright 2009-2019  <%=Application["PageTitle"] %> All Rights Reserved.</div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
