<%@ Page Language="C#" AutoEventWireup="true" Inherits="TopWinCMS.WebUI.Member_Reg"
    CodeBehind="Reg.aspx.cs" %>

<%@ Register Src="../UserControl/Footer.ascx" TagName="Footer" TagPrefix="uc2" %>
<%@ Register Assembly="TopWinCMS.WebControls" Namespace="TopWinCMS.WebControls" TagPrefix="cc1" %>
<%@ Register Assembly="ComboBox" Namespace="TopWin.WebControls.Old" TagPrefix="cc2" %>
<%@ Register Src="../UserControl/Header.ascx" TagName="ChannelHeader" 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">
    <title>
        <%=System.Configuration.ConfigurationManager.AppSettings["SiteName"]%>→ 会员中心 → 填写资料
    </title>
    <link href="{StylePath}/Base.css" rel="stylesheet" type="text/css" media="all" />

    <script language="javascript" type="text/javascript" src="../JS/Ajax/Ajax.js"></script>

    <script language="javascript" type="text/javascript">
        function CheckUserName()
        {
            var u = document.getElementById('<%=TB_Name.ClientID%>').value;
            if (u == "")
            {
                document.getElementById("div_Name").innerHTML = "5-20个字符(包括小写字母、数字、下划线、中文)，一个汉字也算一个字符<br />欢迎使用中文会员名。一旦注册成功会员名不能修改。";
                return;
            }

            var Ajax = new AjaxClass();
            Ajax.RequestUrl = "/AjaxPostBack.ashx?Action=CheckUserName";
            Ajax.Method = "post";
            Ajax.IsAsyn = true;
            Ajax.ContentType = "application/x-www-form-urlencoded";
            Ajax.StateChangeEvent = function()
            {
                if (Ajax.XmlHttp.readyState == 4)
                {
                    if (Ajax.XmlHttp.status == 200)
                    {
                        var i = Ajax.XmlHttp.responseText;
                        if (i > 0)
                        {
                            document.getElementById("div_Name").innerHTML = "很遗憾这个用户名，已经被占用。";
                        }
                        else
                        {
                            document.getElementById("div_Name").innerHTML = "恭喜你，这个用户名可以注册。";
                        }
                    }
                }
            };

            var parameters = "&UserName=" + escape(u);

            Ajax.Content = parameters;
            Ajax.SendRequest();
        }

        function XianShi(tempControl)
        {
            var theBox = tempControl;
            xState = theBox.checked;


            if (xState == true)
            {
                document.getElementById("Gaoji").style.display = "block";
            }
            else
            {
                document.getElementById("Gaoji").style.display = "none";
            }
        }
    </script>

    <style>
        td
        {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:ChannelHeader ID="ChannelHeader1" runat="server" />
    <table width="984" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td width="947">
                <img src='../Images/arrow.gif' />
                您现在的位置： <a href="../">
                    <%=System.Configuration.ConfigurationManager.AppSettings["SiteName"]%></a> →
                会员中心 → 填写资料
            </td>
        </tr>
    </table>
    <br />
    <table border="0" cellpadding="0" cellspacing="0" width="984" align="center">
        <tr>
            <td valign="top" width="225">
                <table border="0" cellpadding="0" cellspacing="0" width="96%">
                    <tr>
                        <td class="li" height="22">
                            注 册 步 骤
                        </td>
                    </tr>
                    <tr>
                        <td height="34" class="3b_1" onmouseover="this.className='3b_2'" onmouseout="this.className='3b_1'">
                            <table cellpadding="2" style="width: 100%">
                                <tr>
                                    <td>
                                        &nbsp;一、阅读并同意协议
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;二、填写注册资料
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;三、完成注册
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top" width="759" align="center">
                <table width="100%" border="0" cellspacing="8" id="ZhuCe" runat="Server">
                    <tbody>
                        <tr>
                            <td height="30" colspan="2" style="font-size: 24px" align="center">
                                填写注册资料
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right; width: 150px">
                                用户名：
                            </td>
                            <td width="598">
                                <asp:TextBox ID="TB_Name" runat="server"></asp:TextBox>
                                <input id="BT_Check" type="button" value="检查用户名" onclick="CheckUserName();" class="btn" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="TB_Name"
                                    ErrorMessage="请输入用户名"></asp:RequiredFieldValidator>
                                <div id="div_Name">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right; height: 16px">
                                密码：
                            </td>
                            <td style="height: 16px">
                                <asp:TextBox ID="TB_PSW1" runat="server" TextMode="Password"></asp:TextBox>
                                &nbsp; <span style="color: #ff0033">*
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TB_PSW1"
                                        ErrorMessage="密码不能为空。" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                确认密码：
                            </td>
                            <td style="height: 16px">
                                <asp:TextBox ID="TB_PSW2" runat="server" TextMode="Password"></asp:TextBox>
                                &nbsp; <span style="color: #ff0033">*
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="TB_PSW1"
                                        ControlToValidate="TB_PSW2" ErrorMessage="密码不一致。" SetFocusOnError="True"></asp:CompareValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                电子邮箱：
                            </td>
                            <td style="height: 16px">
                                <asp:TextBox ID="TB_email" runat="server"></asp:TextBox>
                                &nbsp; <span style="color: #ff0033">*
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TB_email"
                                        ErrorMessage="电子邮箱不能为空。"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TB_email"
                                        ErrorMessage="电子邮箱格式错误。" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                验证码：
                            </td>
                            <td style="height: 16px">
                                <asp:TextBox ID="TB_PassCode" runat="server"></asp:TextBox>
                                <img src="../PassCode.ashx" alt="点击刷新验证码。" style="cursor: pointer;" onclick="this.src='../PassCode.ashx?n='+ Math.random();" />
                                <div id="div_PassCode">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: right;">
                                &nbsp;
                            </td>
                            <td style="height: 16px">
                                &nbsp;
                                <cc1:ButtonX ID="BT_Reg" runat="server" CssClass="btn" OnClick="BT_Reg_Click" Text="注册"
                                    ToDo="ClickOnce" />
                                &nbsp;<a href="Agreement.aspx" target="_blank">《注册协议》</a>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" style="text-align: right; width: 110px">
                                高级选项：
                            </td>
                            <td height="0">
                                <input type="checkbox" name="checkbox" value="checkbox" onclick="XianShi(this);" />
                                <span class="bluetxt">显示高级用户设置选项</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table border="0" cellpadding="0" cellspacing="8" width="100%" align="center" id="Gaoji"
                    style="display: none">
                    <tr style="text-align: right; width: 150px">
                        <td style="text-align: right;">
                            昵称：
                        </td>
                        <td width="598">
                            <asp:TextBox ID="TB_PetName" runat="server"></asp:TextBox>
                            <span style="color: #ff0033">&nbsp; *</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            真实姓名：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_TrueName" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            密码问题：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Question" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            密码答案：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Answer" runat="server" Width="250px"></asp:TextBox>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            身份证号码：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_IdCard" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            移动电话号码：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Mobile" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            固定电话号码：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Phone" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            地址：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Address" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            生日：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Birthday" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            性别：
                        </td>
                        <td>
                            <asp:RadioButtonList ID="RBL_Sex" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="0">保密</asp:ListItem>
                                <asp:ListItem Value="1">男</asp:ListItem>
                                <asp:ListItem Value="2">女</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            主页：&nbsp;
                        </td>
                        <td>
                            <asp:TextBox ID="TB_HomePage" runat="server" Width="250px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            &nbsp;QQ：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_QQ" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            MSN：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_MSN" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            ICQ：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_ICQ" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            Yahoo：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Yahoo" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            Skype：
                        </td>
                        <td style="height: 16px">
                            <asp:TextBox ID="TB_Skype" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right; height: 62px">
                            自我介绍：
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Introduce" runat="server" Height="63px" TextMode="MultiLine"
                                Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" id="CG" runat="server">
                    <tr>
                        <td align="center">
                            恭喜您。您成功得注册！<br />
                            【<a href="/">返回首页</a>】
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 18px">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
    </table>
    <uc2:Footer ID="Footer1" runat="server" />
    </form>
</body>
</html>
