<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_UpdateAdZone, WebApp_deploy" title="增加修改广告模板" debug="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<style type="text/css">
    .tableForm th{font-weight:normal;}
   </style>
    <table class="adminheading">
         <tr>
            <th>网站广告管理</th>                  
            <td align="right">
            <div style="width:590px">
                <a href="Admin_manageadzone.aspx">管理广告版位</a>&nbsp;|&nbsp;
                <a href="Admin_updateadzone.aspx?add=1">增加广告版位</a>&nbsp;|&nbsp;
                <a href="Admin_managead.aspx">管理广告</a>&nbsp;|&nbsp;
                <a href="Admin_updateAd.aspx">添加新广告</a>&nbsp;|&nbsp;
                <a  href="Admin_Managejs.aspx">js模板管理</a>&nbsp;|&nbsp;
                <a href="Admin_ManageUploadFile.aspx">广告上传文件管理</a>
             </div>
             </td>
             <td class="rtdw"></td> 
         </tr>
   </table>
   
   <table class="nick" cellpadding="1" cellspacing="1" border="0">
        <tr><td colspan="2" class="tit">广告模板</td></tr>         
        <tr>
            <td class="ltd">版位名称：</td>
            <td class="rtd">
                <input id="ZoneName" runat="server" maxlength="60" name="ZoneName" size="60" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="ZoneJSName"  ErrorMessage="不能空"/></td>
        </tr>
        <tr>
            <td class="ltd">生成JS文件名：</td>
            <td class="rtd">
                <input id="ZoneJSName" runat="server" maxlength="100" name="ZoneJSName" size="60" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="ZoneJSName"  ErrorMessage="不能空"/>
                <asp:Label ID="Label1" runat="server" ForeColor="Red" /></td>
        </tr>
        <tr>
            <td class="ltd">
                版位描述：</td>
            <td class="rtd">
                <textarea id="ZoneIntro" runat="server" cols="50" name="ZoneIntro" rows="3"/>
            </td>
        </tr>
        <tr>
            <td class="ltd">版位类型：<!--<br />选择放置于此版位的广告类型。--></td>
            <td class="rtd">
                <asp:RadioButtonList ID="ZoneType" runat="server"  RepeatDirection="Horizontal" >
                    <asp:ListItem Selected="True" Value="1">矩形横幅</asp:ListItem>
                    <asp:ListItem Value="6">文字代码</asp:ListItem>
                    <asp:ListItem Value="2">弹出窗口</asp:ListItem>
                    <asp:ListItem Value="3">随屏移动</asp:ListItem>
                    <asp:ListItem Value="4">固定位置</asp:ListItem>
                    <asp:ListItem Value="5">漂浮移动</asp:ListItem>  
                    <asp:ListItem Value="7">下拉广告</asp:ListItem>                  
                </asp:RadioButtonList></td>
        </tr>
        <tr>
            <td class="ltd">版位设置：<!--<br />对版位的详细参数进行设置。--></td>
            <td class="rtd">
                <table id="ZoneSetting" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <div id="ZoneType0_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%">
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2" style="height: 17px">
                                            版位参数设置--<strong style="color:Red">矩形横幅</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td align="middle" colspan="2" style="height: 17px">
                                            边框厚度<input id="Baner_Border" maxlength="2" name="Baner_Border" size="5" value="0" runat="server" />(0表示不加边框)
                                        </td>
                                    </tr>
                                </table>
                            </div>
                             <div id="ZoneType1_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2">
                                            版位参数设置--<strong style="color:Red">文字代码</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td align="middle" colspan="2">
                                            此类型无版位参数设置！</td>
                                    </tr>
                                </table>
                            </div>
                            <div id="ZoneType2_Setting" style="display:none;">                               
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2">
                                            版位参数设置--<strong style="color:Red">弹出窗口</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 24px">
                                            弹出方式：</td>
                                        <td style="height: 24px">
                                            &nbsp;<asp:DropDownList ID="Pop_PopType" runat="server" Width="127px">
                                                <asp:ListItem Value="1">前置</asp:ListItem>
                                                <asp:ListItem Value="2">后置</asp:ListItem>
                                                <asp:ListItem Value="3">网页对话筐</asp:ListItem>
                                                <asp:ListItem Value="4">背投广告</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 26px">
                                            弹出位置（左）：</td>
                                        <td style="height: 26px">
                                            <input id="Pop_Left" maxlength="4" name="Pop_Left" size="5" value="100" runat="server" />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="Pop_Left"
                                                ErrorMessage="不能空" Display="Dynamic"/>
                                            <asp:RangeValidator ID="RangeValidator12"
                                                    runat="server" ControlToValidate="Float_Left" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer" Display="Dynamic"/></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 26px">
                                            弹出位置（上）：</td>
                                        <td style="height: 26px">
                                            <input id="Pop_Top" maxlength="4" name="Pop_Top" size="5" value="100" runat="server" />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="Pop_Top"
                                                ErrorMessage="不能空" Display="Dynamic"/>
                                            <asp:RangeValidator ID="RangeValidator11" runat="server" ControlToValidate="Pop_Top"
                                                ErrorMessage="整数" MaximumValue="1500" MinimumValue="0" Type="Integer" Display="Dynamic"/></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 30px">
                                            时间间隔：</strong><br />
                                            在时间间隔内不重复弹出。</td>
                                        <td style="height: 30px">
                                            <input id="Pop_CookieHour" maxlength="2" name="Pop_CookieHour" size="5" value="0" runat="server" />
                                            小时 <font color="blue">设为0时总是弹出</font>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="Pop_CookieHour"
                                                ErrorMessage="不能空"></asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator10"
                                                    runat="server" ControlToValidate="Pop_CookieHour" ErrorMessage="整数" MaximumValue="24"
                                                    MinimumValue="0" Type="Integer"></asp:RangeValidator></td>
                                    </tr>
                                </table>
                           </div>
                           <div id="ZoneType3_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2">
                                            版位参数设置--<strong style="color:Red">随屏移动</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            广告位置（左）：</td>
                                        <td>
                                            <input id="Move_Left" maxlength="4" name="Move_Left" size="5" value="15" runat="server" />距离浏览器左侧
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="Move_Left"
                                                ErrorMessage="不能空"/><asp:RangeValidator ID="RangeValidator9"
                                                    runat="server" ControlToValidate="Move_Left" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer"/>
                                        </td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            广告位置（上）：</td>
                                        <td>
                                            <input id="Move_Top" maxlength="4" name="Move_Top" size="5" value="200" runat="server" />距离浏览器顶部
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="Move_Top"
                                                ErrorMessage="不能空"></asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator8"
                                                    runat="server" ControlToValidate="Move_Top" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer"></asp:RangeValidator></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            移动平滑度：</td>
                                        <td>
                                            <input id="Move_Delta" maxlength="7" name="Move_Delta" size="7" value="0.015" runat="server" />
                                            （取值在0.001至1之间）
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="Move_Delta"
                                                ErrorMessage="不能空" Display="Dynamic"/>
                                                <asp:RangeValidator ID="RangeValidator7"
                                                    runat="server" ControlToValidate="Move_Delta" ErrorMessage="0.0011~1" MaximumValue="1"
                                                    MinimumValue="0.001" Type="Double" Display="Dynamic"/></td>
                                    </tr>
                                </table>
                            </div>
                            <div id="ZoneType4_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2"  >
                                            版位参数设置--<strong style="color:Red">固定位置</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            广告位置（左）：</td>
                                        <td>
                                            <input id="Fixed_Left" maxlength="4" name="Fixed_Left" size="5" value="100" runat="server" />距离浏览器左侧
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="Fixed_Left"
                                                ErrorMessage="不能空" Display="Dynamic"/>
                                                <asp:RangeValidator ID="RangeValidator6"
                                                    runat="server" ControlToValidate="Fixed_Left" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer" Display="Dynamic"/></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            广告位置（上）：</td>
                                        <td>
                                            <input id="Fixed_Top" maxlength="4" name="Fixed_Top" size="5" value="100" runat="server" />距离浏览器顶部
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Fixed_Top"
                                                ErrorMessage="不能空" Display="Dynamic"/>
                                            <asp:RangeValidator ID="RangeValidator5"
                                                    runat="server" ControlToValidate="Fixed_Top" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer" Display="Dynamic"/></td>
                                    </tr>
                                </table>
                            </div>
                            <div id="ZoneType5_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2" style="height: 17px">
                                            版位参数设置--<strong style="color:Red">漂浮移动</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 24px">
                                            漂浮类型：</td>
                                        <td style="height: 24px">
                                            &nbsp;<asp:DropDownList ID="Float_Type" runat="server">
                                                <asp:ListItem Value="1">变速</asp:ListItem>
                                                <asp:ListItem Value="2">匀速</asp:ListItem>
                                                <asp:ListItem Value="3">上下漂浮</asp:ListItem>
                                                <asp:ListItem Value="4">左右漂浮</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 26px">
                                            开始位置（左）：</td>
                                        <td style="height: 26px">
                                            <input id="Float_Left" maxlength="4" name="Float_Left" size="5" value="100" runat="server" />距离浏览器左侧(1~1500)像素
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Float_Left"  ErrorMessage="不能空" Display="Dynamic"/>
                                            <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="Float_Left" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer" Display="Dynamic"/></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td>
                                            开始位置（上）：</td>
                                        <td>
                                            <input id="Float_Top" maxlength="4" name="Float_Top" size="5" value="100" runat="server" />距离浏览器顶部(1~1500)像素
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Float_Top"  ErrorMessage="不能空"/>
                                            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="Float_Top" ErrorMessage="整数" MaximumValue="1500"
                                                    MinimumValue="0" Type="Integer"/></td>
                                    </tr>
                                </table>
                            </div>
                            <div id="ZoneType6_Setting" style="display:none;">
                                <table bgcolor="#ffffff" border="0" cellpadding="2" cellspacing="1" width="100%" >
                                    <tr align="middle" class="tdbg2">
                                        <td colspan="2" style="height: 17px">
                                            版位参数设置--<strong style="color:Red">下拉广告</strong></td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td style="height: 24px">
                                            下拉显示时间：</td>
                                        <td style="height: 24px">
                                          <input id="DropDown_ShowTime" maxlength="4" name="DropDown_ShowTime" size="5" value="7000" runat="server" />毫秒<span style="color:Blue">(注:1000毫秒=1秒)</span>
                                        </td>
                                    </tr>
                                     <tr class="tdbg">
                                        <td style="height: 30px">
                                            <b>时间间隔：</b><br />
                                            在时间间隔内不重复弹出。</td>
                                        <td style="height: 30px">
                                            <input id="DropDown_CookieHour" maxlength="2" name="DropDown_CookieHour" size="5" value="0" runat="server" />
                                            小时 <span style="color:blue">设为0时每打开一次页面就显示一次</span>
                                            <asp:RequiredFieldValidator ID="rfv_15" runat="server" ControlToValidate="DropDown_CookieHour"
                                                ErrorMessage="不能空"></asp:RequiredFieldValidator>
                                                <asp:RangeValidator ID="rv_13"
                                                    runat="server" ControlToValidate="DropDown_CookieHour" ErrorMessage="整数" MaximumValue="24"
                                                    MinimumValue="0" Type="Integer"></asp:RangeValidator></td>
                                    </tr>
                                   
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="ltd">版位尺寸：<!--<br />
                IAB：互联网广告联合会标准尺寸。<br />
                带<span  style="color:red">*</span>号的为新增加的标准广告尺寸。--></td>
            <td class="rtd">
               <div>
                    &nbsp;宽度:
                    <input maxlength="4" name="ZoneWidth" onkeydown="Zone_EditSize()" size="5" value="468" id="ZoneWidth" runat="server" />像素px(1~1500)
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ZoneWidth"
                        ErrorMessage="不能空"/>
                    <asp:RangeValidator ID="RangeValidator4"
                            runat="server" ControlToValidate="ZoneWidth" ErrorMessage="请输入整数" MaximumValue="1500"
                            MinimumValue="0" Type="Integer" Display="Dynamic"/>
                    &nbsp;&nbsp; 高度:
                    <input maxlength="4" name="ZoneHeight" onkeydown="Zone_EditSize()" size="5" value="60" id="ZoneHeight" runat="server" />像素px(1~1500)
                    <asp:RequiredFieldValidator  ID="RequiredFieldValidator1" runat="server" ControlToValidate="ZoneHeight" ErrorMessage="不能空"/>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="ZoneHeight" ErrorMessage="请输入整数"
                            MaximumValue="1500" MinimumValue="0" Type="Integer" Display="Dynamic"/>
               </div>
            </td>
        </tr>
        <tr>
            <td class="ltd">显示方式：<!--<br />
                有多个广告时按照此设定进行显示<br />（依据广告的权重）。--></td>
            <td class="rtd">
                <asp:RadioButtonList ID="ShowType" runat="server">
                    <asp:ListItem Value="1" Selected="True">按权重随机显示  权重越大显示机会越大</asp:ListItem>
                    <asp:ListItem Value="2">按权重优先显示  显示权重值最大的广告</asp:ListItem>
                    <asp:ListItem Value="3">按顺序循环显示  此方式仅对矩形横幅有效</asp:ListItem>
                </asp:RadioButtonList></td>
        </tr>
        <tr>
            <td class="ltd">版位状态：<!--<br />
                设为"启用"的版位才能在前台显示。--></td>
            <td class="rtd">
                &nbsp;
                <asp:CheckBox ID="Active" runat="server" Text="启用版位" /></td>
        </tr>  
        <tr>
            <td class="btm" colspan="2">
        	<input name="Submit" type="submit" value=" 添 加 " id="Submit1" runat="server" onserverclick="Submit1_ServerClick"  />&nbsp;&nbsp; &nbsp;
        	<input name="Submit" type="submit" value="更 改" id="Submit2" runat="server" onserverclick="Submit2_ServerClick"  />&nbsp;&nbsp; &nbsp;
        	<input type="button" id ="PreviewButton" value="预览版位" onclick="previewADZone()"   />&nbsp;&nbsp; &nbsp;
        	<input type="button"  onclick="window.location.href='Admin_manageadzone.aspx'" value=" 取 消 " />
	    </td>
	</tr>	    
    </table>

    <script type="text/javascript" language="javascript">
     function SelectZone(ctlname){
        for(var i=0;i<=6;i++){
          if((document.getElementById(ctlname+"_"+i)).checked){
             document.getElementById("ZoneType"+i+"_Setting").style.display="";
          }
          else{
           document.getElementById("ZoneType"+i+"_Setting").style.display="none";
          }
        }     
     }
     function previewADZone()
     {
       var jsName=document.getElementById("ctl00_ContentPlaceHolder1_ZoneJSName").value;
       if(jsName!=null && jsName!="")
       {
          var link="../AD/admin_adprevrew.aspx?js="+jsName;
          window.open(link,'','','');
       }
       else
       {          
          alert('未生成版位,请生成版本后再进行预览操作!');
       }      
     }
    </script>  
</asp:Content>

