<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Advert_Add.aspx.cs"  Inherits="Advert_Add" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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">
    <title>广告添加</title>
    <link rel="stylesheet" type="text/css" href="../css/list.css" />
    <link href="../style/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        function setinitvalue(obj) {
            if ($(obj).val() == "") { $(obj).val("1"); }
        }
        
        function check() {
            //            alert($("#rbtPic").Selected.ToString());
            if ($("#rbtLanguage").attr("checked")==!true) {
                document.getElementById("pic").style.display = "none";
            } 
        }
        
        function check() {            
            if (!(document.getElementById("RegularExpressionValidator1").style.display == "none")) {

                $("#txtAdvertUrl").val("");
                $("#txtAdvertUrl").focus();
                return false;
            }
            if ($("#txtSort").val() == "") { $("#txtSort").val("1"); }
            return true;
        }
        
    </script>
    <style type="text/css">
         .hideclass 
         { 
         display:none; 
         } 
    </style>
    <script type="text/javascript" language="javascript">
        $(function () {
            $("#rbtPic").change(function () {
                $("#tr1").removeClass("hideclass");
                $("#tr2").addClass("hideclass");
            })
 
            $("#rbtLanguage").change(function () {
                $("#tr1").addClass("hideclass");
                $("#tr2").removeClass("hideclass");
            })
 
        });
     </script>
</head>
<body onload ="controlInputNumber();" class="_body" style="margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px">
    <form id="form1" runat="server">
        <div class="list1">
		<div class="list2">
			<span>广告添加</span>
		</div>
		<div style="border:1px solid #FFFFFF">
		<table class="list3" width="100%" height="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td class="list3_1" nowrap="nowrap" >
					<span style=" color:Black">广告名称：</span>
				</td>
				<td class="list3_2" nowrap="nowrap" >
					<asp:TextBox ID="txtAdvertName" runat="server"></asp:TextBox><font color="red">*</font>
					<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtAdvertName" ErrorMessage="请输入广告名称！" ToolTip="请输入广告名称！" Display="Dynamic"></asp:RequiredFieldValidator>                       
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap">
					<span style=" color:Black">广告分类：</span>
				</td>
				<td class="list3_2" nowrap="nowrap">
					<asp:DropDownList ID="ddlAdvertType" runat="server" style="margin-left:10px"></asp:DropDownList><font color="red">*</font>
					<asp:RequiredFieldValidator ID="rfvAdvertType" InitialValue="0" runat="server" ControlToValidate="ddlAdvertType" ErrorMessage="请选择广告类型！" ToolTip="请选择广告类型！" Display="Dynamic"></asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap" >
					<span style=" color:Black">广告类型：</span>
				</td>
				<td class="list3_3" nowrap="nowrap" >
                    <asp:RadioButton ID="rbtAdvertPic" runat="server" Text="图片" Checked="true" GroupName="radsex" style="margin-left:10px;"/>&nbsp;&nbsp;
                    <asp:RadioButton ID="rbtFlash" runat="server" Text="Flash" GroupName="radsex" />
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap">
					<span style=" color:Black">宽度：</span>
				</td>
				<td class="list3_2" nowrap="nowrap">
					<asp:TextBox ID="txtWidth" runat="server"></asp:TextBox><span style="color:Black">px</span><font color="red">*</font>
					<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtWidth" ErrorMessage="请输入图片宽度！" ToolTip="请输入图片宽度！" Display="Dynamic"></asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap" style=" width:200px;">
					<span style=" color:Black">高度：</span>
				</td>
				<td class="list3_2" nowrap="nowrap">
				    <asp:TextBox ID="txtHight" runat="server" Text=""></asp:TextBox><span style="color:Black">px</span><font color="red">*</font>
				    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtHight" ErrorMessage="请输入图片高度！" ToolTip="请输入图片高度！" Display="Dynamic"></asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
                 <td class="list3_1" style="width:215px" nowrap="nowrap">
                    <span style=" color:Black">广告图片：</span>
                </td>
                 <td class="list3_2" nowrap="nowrap">
                    <asp:FileUpload ID="file1" runat="server" onchange="checkImage(value)" Style="cursor: pointer;" />
                    <asp:ImageButton ID="ImageButton1" runat="server" OnClick="btnUpPic_Click" CausesValidation="false" ImageUrl="../images/blue/shangc.jpg" style="margin-left:10px;width:59px;height:24px"/>
                            <asp:HiddenField ID="hid" runat="server" Value=""/>                    
                 </td>
            </tr>
			<tr>
				<td class="list3_1" nowrap="nowrap" style=" width:200px;">
					<span style=" color:Black">广告链接：</span>
				</td>
				<td class="list3_2" nowrap="nowrap" >
					<asp:TextBox ID="txtAdvertUrl" runat="server"></asp:TextBox>
					<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtAdvertUrl" ErrorMessage="请输入正确的链接地址，例：http://www.nbjinyan.cn！" 
                        ValidationExpression="^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.[a-zA-Z]{2,4})(\:[0-9]+)?(/[^/][a-zA-Z0-9\.\,\?\'\\/\+&amp;%\$#\=~_\-@]*)*$" 
                        Display="Dynamic"></asp:RegularExpressionValidator>
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap">
					<span style=" color:Black">广告排序：</span>
				</td>
				<td class="list3_2" nowrap="nowrap">
					<asp:TextBox ID="txtSort" runat="server"  Text="1"></asp:TextBox>
				</td>
			</tr>
			<tr>
				<td class="list3_1" nowrap="nowrap" style="line-height:70px">
					<span style=" color:Black">广告描述：</span>
				</td>
				<td class="list3_2" nowrap="nowrap">
					<asp:TextBox ID="txtDescription" runat="server"  Text="" Height="50px"></asp:TextBox>
				</td>
			</tr>
			<tr>
			    <td  colspan="2" style=" height:30px;">
			    <asp:ImageButton ID="tijiao" runat="server" Text="" OnClick="tijiao_Click"  Style="cursor: pointer; margin-left:225px;"  ImageUrl="../images/blue/submit.jpg"  />
			    <asp:ImageButton ID="btn_Return" runat="server" OnClick="btnReturn_Click" ImageUrl="../images/blue/cancel.jpg" Style="cursor: pointer; margin-left:10px"/>
			    </td>
			</tr>
		</table>
		</div>
	</div>
    </form>
</body>
</html>