<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Stat.web.Register" %>

<%@ Register src="Control/ccHead.ascx" tagname="ccHead" tagprefix="uc1" %>

<%@ Register src="Control/ccFoot.ascx" tagname="ccFoot" tagprefix="uc2" %>

<!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>用户注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/Skin2/index.css" rel="stylesheet" type="text/css" />
    <script src="jQuery/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="js/Common.js" type="text/javascript"></script>
        <script type="text/javascript">
        
       $(document).ready(function(){        
        $('#txtUname').focus();
        $('#btnSaveUser').bind('click', CheckForm).css("cursor","pointer"); 
        $(":text").css("width","150px");
        $(":password").css("width","150px");  
        $("#txtCheckCode").css("width","83px"); 
        $('#txtUname').bind('blur',IsRegUser);
       });        
        
        function CheckForm() {         
        var uName=$('#txtUname').val(); 
        var uPassword1=$("#txtUserPWD1").val();
        var uPassword2=$("#txtUserPWD2").val();
        var checkCode=$("#txtCheckCode").val();
        var uEmail=$("#txtUEmail").val();
        var uQQ=$("#txtUQQ").val();
        var supan=$("#span_uName").text()
        if(!IsNull(uName, 1, 33)){alert("用户名不能为空！");$('#txtUname').focus(); return;}
        if(supan !="可以使用！"){alert("请先验证 用户名 可用");$('#txtUname').focus(); return;}
        
        if(!CheckLength(uPassword1, 1)){alert("密码不能为空！");$('#txtUserPWD1').focus(); return;}
        if(!CheckLength(uPassword2, 1)){alert("请确认密码！");$('#txtUserPWD2').focus(); return;}        
        if(!CheckEqualsValue(uPassword1,uPassword2)){alert("两次输入的密码不相等！");$('#txtUserPWD2').focus(); return;}         
        if(!isEmail(uEmail)){alert("EMAIL 地址输入有误！");$('#txtUEmail').focus(); return;} 
        if(!CheckEqualsLeng(checkCode,5)){alert("验证码为5位！");$('#txtCheckCode').focus(); return;}                
        if(!checkNum(uQQ)){alert("QQ输入有误！，只能够填写数字！");$('#txtUQQ').focus(); return;}        
       
        $("form:first").submit();
      }
      function IsRegUser()
      {
        var uName=$('#txtUname').val();
         if(!checkNum(uName))
         {
           $.get("/MyAJAX/HdCheckUser.ashx?t=Reg&n="+encodeURI(uName), callBack);
         }
         else{
           $("#span_uName").html("<span style=\"color:#FF0000\">不允许全是数字组合！</span>");
         }
      }
      function callBack(data)
      {
          if(data=="ok")
          {
             $("#span_uName").html("可以使用！");
          }
          else if(data=="0")
          {
            $("#span_uName").html("<span style=\"color:#FF0000\">该用户已经存在！</span>");
          }
          else
          {
            $("#span_uName").html("网络错误，请稍候再试！");
          }
      } 
</script>
</head>
<body>

<uc1:ccHead ID="ccHead1" runat="server" />
<form action="Register.aspx?ac=add" method="post">
<!----------------------------------------- -->
<div class="C_u_ti">
    用户注册</div>
<!----------------------------------------- -->
<div class="C_box1">
<div  class="C_Hl001">
<span ><strong><asp:Literal ID="LtrTitle" runat="server"></asp:Literal></strong></span></div>
<div style="clear:both; text-align:left; padding:15px; line-height:20px;">
<asp:Literal ID="LtrContent" runat="server"></asp:Literal>
</div>
</div><!-- -->
<div class="C_Messge">
欢迎您申请站长统计服务！ 您即将创建一个统计帐号，请认真填写以下信息。<br />
有任何问题，请联系我们，您将得到帮助。
</div>

<div class="box" style="text-align:left; margin-top:20px; margin-bottom:10px;"><strong>必填项目：</strong></div>
<div class="box" >
  <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CEDCED">
    <tr>
      <td height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;用户名：</td>
      <td bgcolor="#FFFFFF">&nbsp;<input id="txtUname" name="txtUname" size="20"  /> &nbsp;<span id="span_uName">*</span></td>
    </tr>
    
    <tr>
      <td height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;用户密码：</td>
      <td bgcolor="#FFFFFF">&nbsp;<input id="txtUserPWD1" name="txtUserPWD1"  type="password" /></td>
    </tr>
    <tr>
      <td height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;确认密码：</td>
      <td bgcolor="#FFFFFF">&nbsp;<input id="txtUserPWD2" name="txtUserPWD2" type="password" /></td>
    </tr>
    <tr>
      <td width="14%" height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;Email邮箱：</td>
      <td width="86%" bgcolor="#FFFFFF">&nbsp;<input ID="txtUEmail" name="txtUEmail"  size="20" />&nbsp;将来如果忘了密码，此电子邮件用于接受新密码。</td>
    </tr>
    <tr>
      <td height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;QQ：</td>
      <td bgcolor="#FFFFFF">&nbsp;<input ID="txtUQQ" name="txtUQQ"  MaxLength="13" />&nbsp;选填</td>
    </tr>
    <tr>
      <td height="29" bgcolor="#FFFFFF">&nbsp;&nbsp;验证码：</td>
      <td bgcolor="#FFFFFF">&nbsp;<input id="txtCheckCode" name="txtCheckCode"  maxlength="5" />&nbsp;
      <img alt="点击刷新验证码" onclick="this.src='plugin/CheckCode.aspx?t='+Math.random();" src="plugin/CheckCode.aspx" class="pointer"/>
                            &nbsp; 看不清楚，单击验证码刷新
      </td>
    </tr>
  </table>
</div>
<div class="box" style="text-align:left; margin-top:20px; margin-bottom:10px;">
单击“我同意”意味着: 您同意并接受以下“服务协议”。
<br /><br />
<input type="button" name="btnSaveUser" id="btnSaveUser" value="我同意  创建我的帐户" />
</div>

<div class="box" style="text-align:left; margin-top:20px; margin-bottom:10px;"><strong>查看协议：</strong></div>
<div class="box" style="text-align:left; margin-top:20px; margin-bottom:10px;">
<textarea style="FONT-SIZE: 12px; MARGIN: 0px auto; WIDTH: 800px; HEIGHT: 250px" readonly="readonly"> 
<asp:Literal ID="ltrCopyRight" runat="server"></asp:Literal>
</textarea>
</div>
</form>
<uc2:ccFoot ID="ccFoot1" runat="server" />

</body>
</html>
