<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LinksAdd.aspx.cs" Inherits="admin_Links_LinksAdd" %>

<%@ Register Src="../../Control/Upfile.ascx" TagName="Upfile" 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 runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>添加友情链接</title>
    <link rel="stylesheet" href="../skin/Style.css" type="text/css" />

    <script type="text/javascript" src="../../js/Common.js"></script>

    <script type="text/javascript">
	    function wenzi()
	    {
	        logo.style.display="none";
	    }
	    function logoshow()
	    {
	         logo.style.display="";
	    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                操作提示</h3>
        </div>
        <div class="itemtitle_tect">
            <ul>
                <li>通过友情链接添加，您可以添加文字链接和图片链接两种不同的友情链接；</li>
                <li>请选择正确的链接类型，根据实际需求填写相应栏目。</li>
            </ul>
        </div>
        <div class="clr">
        </div>
        <div class="talbe_border">
            <table cellspacing="0" cellpadding="0" border="0" class="talbe_list">
                <tr>
                    <th colspan="2" class="header tou">
                        添加友情链接</th>
                </tr>
                <tr>
                    <td width="16%" class="left1">
                        链接类型：
                    </td>
                    <td width="84%" class="left2">
                        <input id="radLinkType" name="LinkType" checked type="radio" value="1" onclick="logoshow()"
                            runat="server" />
                        Logo链接 &nbsp; &nbsp;<input id="radLinkType1" name="LinkType" type="radio" value="2"
                            onclick="wenzi()" runat="server" />文字链接
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        网站名称：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtWebName" runat="server" Width="300px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="left1">
                        网站地址：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtWebURL" runat="server" Width="300px">http://</asp:TextBox>
                    </td>
                </tr>
                <tr id="logo" runat="server">
                    <td class="left1">
                        网站Logo：
                    </td>
                    <td>
                        <div style="float: left">
                            <asp:HiddenField ID="HiddUserID" runat="server" />
                            <asp:HiddenField ID="ImgUrl1" runat="server" />
                            <a href="" id="txturldz" target="_blank">
                                <img src="../../../Images/System/wutu1.gif" alt="" name="ImgUrl" border="0" id="ImgUrl"
                                    style="width: 98px; height: 98px;" runat="server" /></a>
                            <input id="txtupload" type="button" value="上传" onclick="return rowTest()" class=" marie" />
                            <div id="rowTest" style="display: none">
                                <iframe name="tag" src="../UpFile/Upload.html?Links" style="width: 550px; height: 130px"
                                    frameborder="0" scrolling="no" onload="this.height=tag.document.body.scrollHeight">
                                </iframe>
                            </div>
                            <div id="Upload">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        网站简介：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtWebIntro" runat="server" Width="300px" Height="99px" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        站长：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtWebAdmin" runat="server" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        邮箱：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtEmail" runat="server" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        排序：
                    </td>
                    <td class="left2">
                        <asp:TextBox ID="txtSequence" runat="server" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="left1">
                        审核：
                    </td>
                    <td class="left2">
                        <asp:RadioButtonList ID="radlVerify" runat="server" RepeatDirection="Horizontal"
                            RepeatLayout="Flow">
                            <asp:ListItem Value="True">是</asp:ListItem>
                            <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                        </asp:RadioButtonList></td>
                </tr>
                <tr>
                    <td colspan="2" bgcolor="#F0F7FD">
                        <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" CssClass="i_button" />
                        <asp:Button ID="btnCancel" runat="server" Text="取消" OnClick="btnCancel_Click" CssClass="i_button" />
                    </td>
                </tr>
            </table>
        </div>
    </form>

    <script type="text/javascript" src="../../js/Common.js"></script>

    <script type="text/javascript">
    $("btnSave").onclick=function()
   {
     if ($("txtWebName").value.replace(/\s/g,'')=="")
     {
        alert("网站名称不能为空！");
        $("txtWebName").focus();
        return false;
     } 
    if($("radLinkType1").checked==false)
    { 
    if(FileUPload(1)==1)
     {
      alert("上传图片不能为空！")
      return false;  
     }
    }  
    if($("txtEmail").value.replace(/\s/g,'')=="")
    {
      alert("邮箱不能为空!")
      $("txtEmail").focus();  
      return false
     }
     else if(!ValidateEmail($("txtEmail").value.replace(/\s/g,'')))
     {
      alert("邮箱的格式输入错误!");
      $("txtEmail").focus();  
      return false
     }
   }
    </script>

</body>
</html>

