<%@ page language="VB" masterpagefile="~/Page.master" inherits="WebExam.Web.newUser, App_Web_jvwg1jie" title="新用户" %>

<%@ MasterType VirtualPath="~/Page.master" %>
<asp:Content ID="head" ContentPlaceHolderID="ContentHead" runat="Server">
    <link rel="stylesheet" href="style/selfreg.css" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" runat="Server">

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

    <script type="text/javascript">
     function lifeDateChange(obj){
         var d_len=document.getElementById("<%= DDL_len.ClientID %>");
         if(obj.value=='l')
          d_len.style.display="none";
         else
          d_len.style.display="block";
       
      
       }
      function CheckUserId(obj) 
       { var s=obj.value;if(!checkUserId(s))return ;
         
         if(s!=""){
            document.getElementById("messageDiv").innerHTML="<img src='images/loading2.gif'/>loading...";
            PageMethods.CheckUser(s,checkName); 
         }
         else{
           passUserId=false;
           document.getElementById("messageDiv").innerHTML="";
         }
       } 
      function checkName(result) 
       { 
         if(result.charAt(0)=="0")passUserId=false;else passUserId=true;
         document.getElementById("messageDiv").innerHTML=result.substr(1); 
       } 
      
      
     function ClientValidateUserId(oSrc, args)//验证用户名是否正确
{
  var strr;
  
  strr=args.Value;
  var reg=/[^a-z0-9A-Z_.-\u4e00-\u9fa5]/g;
  var arr=strr.match(reg);
 
 if(arr!=null)
    args.IsValid = false;
  else
    args.IsValid =true ;
}
     function localView() {
     //var userform=document.forms[0]; 
     var pathInput=document.getElementById("<%= Fpath.ClientId() %>");
 var pf =pathInput.value
 if(pf!="")
 {
  
  var re = /\.[^\.]+$/;
 
  var r = pf.search(re);
  var att=pf.substring(r).toLowerCase()
  var imgHtml="<img name='imageViewC' title='照片预览' src='"+pf+ "'>";
  

  switch(att){
   
    case".jpg":
      
      view.innerHTML =imgHtml;
 
      break
   
   default:
      
      alert("仅允许.jpg格式的图片。");
      //userform.Fpath.value="";
      break
  }

  
  
 }
 
 //var t=window.open("","n") 
 //t.document.write(flashHtml)
} 
    </script>

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True" EnableScriptGlobalization="True">
    </asp:ScriptManager>
    <ul class="clear">
        <li class="clear">
            <p class="creat fleft clear">
                设置用户名密码</p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                注册到：</div>
            <div class="input_list font_space fleft">
                <asp:Label ID="L_fullPartName" runat="server" class="name_aready"></asp:Label>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                账号有效期：</div>
            <div class="input_list font_space fleft">
                <asp:DropDownList ID="DDL_len" runat="server" CssClass="fleft">
                </asp:DropDownList>
                <asp:DropDownList ID="DDL_lifeDate" runat="server" onchange="lifeDateChange(this);"
                    CssClass="fleft">
                    <asp:ListItem Value="l" Text="长期"></asp:ListItem>
                    <asp:ListItem Value="d" Text="日"></asp:ListItem>
                    <asp:ListItem Value="m" Text="月"></asp:ListItem>
                    <asp:ListItem Value="y" Text="年"></asp:ListItem>
                </asp:DropDownList>
            </div>
        </li>
        <li class="clear">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div class="name_list font_space fleft">
                        <span class="atten">*</span> 用户名：</div>
                    <div class="input_list font_space fleft">
                        <asp:TextBox ID="TB_userId" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                            onfocus="this.style.borderColor='#99E300';" onchange="CheckUserId(this);" AutoCompleteType="Disabled"></asp:TextBox>
                        <div class="error_explain font_space" id="chkuserid" style="width: 100%">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请填写用户名！"
                                ControlToValidate="TB_userId" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="CustomValidatorUserId" runat="server" ControlToValidate="TB_userId"
                                ErrorMessage="用户名中只能使用汉字、字母、数字、下划线、句点及横线等字符" ClientValidationFunction="ClientValidateUserId"
                                Display="Dynamic"></asp:CustomValidator>
                        </div>
                    </div>
                    <div class="explain_list fleft">
                        <span id="messageDiv" class="explain"></span>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 密 码：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_password" runat="server" TextMode="Password" MaxLength="36" onblur="this.style.borderColor='#A3BFA8';checkPWD(this.value);"
                    onfocus="this.style.borderColor='#99E300';this.style.borderColor='#99E300'" onkeyup="checkPWD(this.value);"
                    Width="230px"></asp:TextBox>
                <div class="error_explain font_space" id="chkPwd">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入6～20位字符的密码"
                        ControlToValidate="TB_password" Display="Dynamic"></asp:RequiredFieldValidator></div>
                <div class="PSW_P_0" id="chkpswd">
                    <div class="PSW_P_W">
                        密码安全程度：<span id="chkpswdcnt">太短</span></div>
                    <div class="PSW_P_BGC">
                        <div class="PSW_P_pC">
                        </div>
                    </div>
                </div>
            </div>
            <div class="explain_list fleft">
                <span class="explain">密码长度6～20位，由英文字母a～z (区分大小写)，数字0～9，特殊字符组成。</span></div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 请再次输入密码：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_password_cf" runat="server" TextMode="Password" MaxLength="36"
                    onblur="this.style.borderColor='#A3BFA8';" onfocus="this.style.borderColor='#99E300';"
                    Width="230px"></asp:TextBox>
                <div class="error_explain font_space" id="pwdConfirm">
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="两次输入的密码不一致"
                        Display="Dynamic" ControlToCompare="TB_password" ControlToValidate="TB_password_cf"></asp:CompareValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="两次输入的密码不一致"
                        ControlToValidate="TB_password_cf" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <p class="creat fleft clear">
                个人资料</p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten"></span> 照 片：</div>
            <div class="input_list font_space fleft">
                <table>
                    <tr>
                        <td id="view">
                            <img id="serverView" height="200" width="150" src="data/usersphoto/nophoto.gif" alt="my photo" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:FileUpload ID="Fpath" runat="server" />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="explain_list fleft">
                <span class="explain">照片要求：宽150像素，高200像素，jpg格式，文件大小小于50K</span></div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 姓 名：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_userName" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';" AutoCompleteType="Disabled"></asp:TextBox>
                <div class="error_explain font_space">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入姓名"
                        ControlToValidate="TB_userName" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 性 别：</div>
            <div class="input_list font_space fleft">
                <asp:RadioButtonList ID="gender" runat="server" BorderStyle="none" Style="border: 0px"
                    RepeatDirection="Horizontal" BorderWidth="0" RepeatLayout="Flow">
                    <asp:ListItem Text="男  " Value="1"></asp:ListItem>
                    <asp:ListItem Text="女" Value="0"></asp:ListItem>
                </asp:RadioButtonList>
                <div class="error_explain font_space" id="genderConfirm">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="请选择性别"
                        ControlToValidate="gender" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 出生日期：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_birthday" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';"></asp:TextBox>
                <asp:ImageButton ID="ImgBntCalc" runat="server" ImageUrl="~/images/Calendar_scheduleHS.png"
                    CausesValidation="False" Style="border-width: 0px;" ImageAlign="AbsBottom" />
                <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TB_birthday"
                    MaskType="Date" Mask="9999/99/99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                    OnInvalidCssClass="MaskedEditError" DisplayMoney="Left" AcceptNegative="Left"
                    ErrorTooltipEnabled="True">
                </ajaxToolkit:MaskedEditExtender>
                <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender1"
                    ControlToValidate="TB_birthday" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
                    Display="Dynamic" TooltipMessage="" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*"
                   
                    MaximumValueMessage="Date is invalid" />
                <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TB_birthday"
                    PopupButtonID="ImgBntCalc" Format="d" />
                <div class="error_explain font_space">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="请正确输入出生日期"
                        ControlToValidate="TB_birthday" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <p class="creat fleft clear">
                密码保护设置 <span class="atten">&nbsp; 为了保障帐号安全，请填写下列信息并牢记。</span></p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">1、</span>邮箱：</div>
            <div class="input_list font_space fleft">
                <input runat="server" id="TB_email" type="text" size="36" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';" /><div class="error_explain font_space"
                        id="altConfirm">
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            runat="server" ErrorMessage="邮箱格式错误" ControlToValidate="TB_email" Display="Dynamic"></asp:RegularExpressionValidator>
                    </div>
            </div>
            <div class="explain_list fleft">
                <span class="explain">万一你忘记密码，可通过此邮箱联系取回。</span></div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">2、</span>密码提示问题：</div>
            <div class="input_list font_space fleft">
                <select style="width: 235px;" id="question" onchange="checkQuestion('<%= TB_question.ClientID %>');">
                    <option value="">[请选择您的密码提示问题] </option>
                    <option value="cus">***自定义密码提示问题***</option>
                    <option value="您的家乡是?">您的家乡是?</option>
                    <option value="您初中的语文老师是?">您初中的语文老师是?</option>
                    <option value="您最尊重的人是?">您最尊重的人是?</option>
                    <option value="您最爱吃的菜是?">您最爱吃的菜是?</option>
                    <option value="您最爱读的书是?">您最爱读的书是?</option>
                    <option value="您最喜欢的一首歌是?">您最喜欢的一首歌是?</option>
                    <option value="您最喜欢的运动是?">您最喜欢的运动是?</option>
                    <option value="您最喜欢的电影是?">您最喜欢的电影是?</option>
                    <option value="您最喜欢的节日是?">您最喜欢的节日是?</option>
                    <option value="您最想去的地方是?">您最想去的地方是?</option>
                    <option value="您最想做的事情是?">您最想做的事情是?</option>
                    <option value="您最难忘的事情是?">您最难忘的事情是?</option>
                </select>
                <div class="error_explain font_space" id="questionConfirm">
                </div>
            </div>
        </li>
        <li style="display: none" id="cus_question">
            <div class="name_list font_space fleft">
                请输入自定义的问题：</div>
            <div class="input_list font_space fleft">
                <input runat="server" id="TB_question" type="text" maxlength="30" size="36" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';" />
            </div>
            <div class="explain_list fleft">
                <span class="explain">问题长度不超过30个字符。</span></div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                答 案：</div>
            <div class="input_list font_space fleft">
                <input runat="server" id="TB_answer" size="36" maxlength="30" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';" />
                <div class="error_explain font_space" id="answerConfirm">
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
            </div>
            <div class="input_list font_space fleft">
                <asp:Button ID="Btn_save" runat="server" Text="确 定" />&nbsp;&nbsp;
                <asp:Label ID="L_msg" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
            </div>
        </li>
    </ul>
    <br />
</asp:Content>
