<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="reg.aspx.cs" Inherits="MyITJob.School.reg" %>

<%@ Register TagPrefix="ascx" TagName="PageTop" Src="~/ascx/PageTop.ascx" %>
<%@ Register TagPrefix="ascx" TagName="PageFooter" Src="~/ascx/PageFooter.ascx" %>
<!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><%=Application["PageTitle"]%>——求职企业注册页面</title>
    <script language="javascript" src="/js/Prototype.js" type="text/javascript"></script>
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="/js/passwordstrength.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
					<ascx:PageTop ID="PageTop" runat="server" />
                        <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td><table width="65%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <img src="../images/reg_01_xz.gif" width="650" height="76" /></td>
                                        </tr>
                                        <tr>
                                            <td background="../images/reg_02.jpg">
                                                <table width='89%' border='0' align='center' cellpadding='2' cellspacing='1' bgcolor="#FFFFFF" class='border'>
                                                    <tr class='tdbgmouseover'>
                                                        <td width="30%" align="right">
                                                            &nbsp;<span style="color: #ff0000">*</span>注册名：</td>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="uname" runat="server" MaxLength="12" onBlur="funcChina();"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="uname"
                                                                ErrorMessage="请输入用户名"></asp:RequiredFieldValidator><span id="uname_span" style="color:Red; display:none;"></span></td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            <span style="color: #ff0000">*</span>密 码：</td>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="pwd" runat="server" onKeyUp="ps.update(this.value);" TextMode="Password" Width="126px" MaxLength="14"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="pwd"
                                                                ErrorMessage="请输入密码"></asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            密码强度：</td>
                                                        <td colspan="2"><script language="javascript">
		                                                          var ps = new PasswordStrength();
		                                                          ps.setSize("200","22");
	                                                          </script>
                                                            </td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            <span style="color: #ff0000">*</span>重复密码：</td>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="pwd1" runat="server" TextMode="Password" Width="126px" MaxLength="14"></asp:TextBox>
                                                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="pwd"
                                                                ControlToValidate="pwd1" ErrorMessage="两次输入密码不符"></asp:CompareValidator></td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            <span style="color: #ff0000">*</span>密码问题：</td>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="question" runat="server" MaxLength="14"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="question"
                                                                ErrorMessage="请输入问题，方便找回密码"></asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            <span style="color: #ff0000">*</span>密码答案：</td>
                                                        <td colspan="2">
                                                            <asp:TextBox ID="answer" runat="server" MaxLength="14"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="answer"
                                                                ErrorMessage="请输入相对应的答案。"></asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr class='tdbgmouseover'>
                                                        <td align="right">
                                                            <span style="color: #ff0000">*</span>验证码：</td>
                                                        <td style="width: 55%">
                                                            <asp:TextBox ID="ucode" runat="server" MaxLength="6"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ucode"
                                                                ErrorMessage="请输入验证码"></asp:RequiredFieldValidator>
                                                            <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label></td>
                                                        <td width="41%">
                                                            <img src="../ascx/RndNumber.aspx" style="border: 1px #666666 solid; cursor: hand;"
                                                                onclick="this.src=this.src+'?'" alt="看不清？换个图片" />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <div align="center">
                                                    <asp:Button ID="Button1" runat="server" Text="注册院校机构" OnClick="Button1_Click" /></div>
                                                    <hr style="width:90%; margin:10 auto;"/>
                                                    <div style="margin-top:10px; text-align:center;">
                                                    <%=Application["PageTitle"] %>《用户服务协议》
                                                        <asp:TextBox ID="TextBox1" runat="server" Height="122px" TextMode="MultiLine" Width="563px"></asp:TextBox></div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <img src="../images/reg_03.jpg" width="650" height="36" /></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <ascx:PageFooter ID="PageFooter" runat="server" /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript"> 
var obj = document.getElementById("uname");
var span = document.getElementById("uname_span");
function funcChina(){ 
    if(/.*[\u4e00-\u9fa5]+.*$/.test(obj.value)){ 
        span.style.display='block';
        span.innerHTML = '注册名不能含有汉字';
        form1.uname.focus();
        return false; 
    }else{    
        var Action='jsaction=123&username='+obj.value;
        var options={
            method:'get', parameters:Action, onComplete:function(changeHTML) 
            { 
                var returnvalue=changeHTML.responseText;
                if (returnvalue == "1"){
                    span.style.display='block';
                    span.innerHTML = '该用户名已经被注册，请重新填写。';
                    form1.uname.focus();
                    return false;                    
                }else{
                    span.style.display='none';
                }
            }
        };
        new Ajax.Request('reg.aspx', options);
    }
} 
</script>