<%@ control language="C#" autoeventwireup="true" inherits="Controls_Register, Huibo.Net" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="Navigation">
    您当前的位置：<span><a href="index.aspx" alt="" title="">首页</a></span><span>&gt;&gt;</span><span>用户中心</span>
</div>
<div class="main2right_a">
    <div class="">
        <!--Navigation结束-->
        <div class="clear" style="border-top: solid 1px #E5DDC7;">
        </div>
        <div class="GoodsSearchWrap">
            <div class="leftpart" style="float: left; width: 90%; _width: 70%;">
                <h4>
                    用户注册</h4>
                <div class="intro">
                    欢迎来到我们网站，如果您是新用户，请填写下面的表单进行注册。</div>
                <div class="form">
                    <div class="login_1">
                        <div class="login_1a">
                            <div class="login_1aleft">
                                用户名：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="username" class="inputstyle" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                密 码：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="PassWord" Width="140px" class="inputstyle" runat="server" TextMode="Password"></asp:TextBox>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                确认密码：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="passwords" Width="140px" class="inputstyle" runat="server" TextMode="Password"></asp:TextBox>&nbsp;
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                密码提示：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="Question" class="inputstyle" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                密码答案：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="Answer" class="inputstyle" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                性 别：</div>
                            <div class="login_1aright">
                                <asp:DropDownList ID="Sex" Width="100px" runat="server">
                                    <asp:ListItem Value="0">男</asp:ListItem>
                                    <asp:ListItem Value="1">女</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                籍 贯：</div>
                            <div class="login_1aright">
                                <asp:DropDownList ID="TPL_prov" class="inputstyle" runat="server">
                                </asp:DropDownList>
                                <asp:DropDownList ID="TPL_city" class="inputstyle" Style="margin-left: 5px;" runat="server">
                                </asp:DropDownList>
                                <AjaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="TPL_prov"
                                    ServicePath="~/Ajax/GetCity.asmx" ServiceMethod="GetProvince" Category="Province"
                                    PromptValue="0" ParentControlID="" LoadingText="加载省份.." PromptText="请选择省份">
                                </AjaxToolkit:CascadingDropDown>
                                <AjaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="TPL_city"
                                    ServicePath="~/Ajax/GetCity.asmx" ServiceMethod="GetCityByProvince" Category="City"
                                    ParentControlID="TPL_prov" LoadingText="加载城市.." PromptText="请选择城市">
                                </AjaxToolkit:CascadingDropDown>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                地 址：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="address" class="inputstyle" runat="server" Width="300px"></asp:TextBox></div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                E_mail：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="useremail" class="inputstyle" runat="server"></asp:TextBox>&nbsp;
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                真实姓名：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="realname" class="inputstyle" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                固定电话：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="usertel" class="inputstyle" runat="server"></asp:TextBox>&nbsp;
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                移动手机：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="mobile" class="inputstyle" runat="server"></asp:TextBox>&nbsp;
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                Q Q：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="userqq" class="inputstyle" runat="server"></asp:TextBox>&nbsp;</div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                                推荐人：</div>
                            <div class="login_1aright">
                                <asp:TextBox ID="recommender" class="inputstyle" runat="server"></asp:TextBox></div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                            </div>
                            <div class="login_1aright">
                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                我已看过并接受《<a style="color: blue" href="UserAgreement.aspx" target="_blank">用户协议</a>》</div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                            </div>
                            <div class="login_1aright">
                                <input type="button" onclick="OnSubmit();" class="btn-register" />
                                <%--<asp:Button ID="Register" class="btn-register" runat="server" Text="" OnClick="Register_Click" />--%>
                            </div>
                        </div>
                        <div class="login_1a">
                            <div class="login_1aleft">
                            </div>
                            <div class="login_1aright">
                                <br />
                                <a href="Login.aspx" title="登录">登录</a>|<a href="UserCenter.aspx?Action=ValidationUser"
                                    title="找回密码">找回密码</a>
                            </div>
                        </div>
                        <input type="hidden" name="RegisterMethod" value="Method" />
                        <script type="text/javascript">
                            function OnSubmit()
                            {
                             if(document.getElementById('<%=username.ClientID %>').value.trim()=='') {
	                            document.getElementById('<%=username.ClientID %>').focus();
                                alert("用户名不能为空，请重新输入！");
	                            return false;
                              }
                              if(document.getElementById('<%=username.ClientID %>').value.trim()=='' || document.getElementById('<%=username.ClientID %>').value.length < 2) {
	                            document.getElementById(<%=username.ClientID %>).focus();
                                alert("用户名长度不能小于2，请重新输入！");
	                            return false;
                              }
                              if(document.getElementById('<%=PassWord.ClientID %>').value.trim()=='' || document.getElementById('<%=PassWord.ClientID %>').value.length < 6) {
	                            document.getElementById('<%=PassWord.ClientID %>').focus();
                                alert("密码长度不能小于6，请重新输入！");
	                            return false;
                              }
                              if(document.getElementById('<%=PassWord.ClientID %>').value != document.getElementById('<%=passwords.ClientID %>').value) {
	                            document.getElementById('<%=PassWord.ClientID %>').focus();
	                            document.getElementById('<%=PassWord.ClientID %>').value = '';
	                            document.getElementById('<%=passwords.ClientID %>').value = '';
                                alert("两次输入的密码不同，请重新输入！");
	                            return false;
                              }
                              if(document.getElementById('<%=Question.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=Question.ClientID %>').focus();
                                alert("密保问题不能为空！");
                                return false;
                              }
                              if(document.getElementById('<%=Answer.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=Answer.ClientID %>').focus();
                                alert("密保答案不能为空！");
                                return false;
                              }
                              
                              if(document.getElementById('<%=address.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=address.ClientID %>').focus();
                                alert("地址不能为空！");
                                return false;
                              }
                              if(document.getElementById('<%=useremail.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=useremail.ClientID %>').focus();
                                alert("邮箱不能为空！");
                                return false;
                              }
                              var patm = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
                              if(!patm.exec(document.getElementById('<%=useremail.ClientID %>').value.trim()))
                              {
                                document.getElementById('<%=useremail.ClientID %>').focus();
                                alert("邮箱格式不正确！");
                                return false;
                              }
                              if(document.getElementById('<%=realname.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=realname.ClientID %>').focus();
                                alert("真实姓名不能为空！");
                                return false;
                              }
                              var patmrealname = /^[\u4e00-\u9fa5]{0,}$/;
                              if(!patmrealname.exec(document.getElementById('<%=realname.ClientID %>').value.trim()))
                              {
                                document.getElementById('<%=realname.ClientID %>').focus();
                                alert("真实姓名只能为汉字！");
                                return false;
                              }
                              if(document.getElementById('<%=usertel.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=usertel.ClientID %>').focus();
                                alert("固定电话不能为空！");
                                return false;
                              }
                              if(document.getElementById('<%=mobile.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=mobile.ClientID %>').focus();
                                alert("手机电话不能为空！");
                                return false;
                              }
                              if(document.getElementById('<%=userqq.ClientID %>').value.trim() == '')
                              {
                                document.getElementById('<%=userqq.ClientID %>').focus();
                                alert("QQ号码不能为空！");
                                return false;
                              }
                              if(document.getElementById('<%=CheckBox1.ClientID %>').checked == true)
                              {
                                document.getElementById("form1").action = "RegisterOK.aspx";
                                document.getElementById("form1").submit();
                                }
                                else
                                {
                                    alert("请阅读注册条约！");
                                    return false;
                                }
                        }
                        </script>

                        <div style="clear: both">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
