<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" CodeBehind="getpwd.aspx.vb" Inherits="b2bNet.getpwd" %>
<%On Error Resume Next%>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<script type="Text/JavaScript" language=javascript>  
//CharMode函数  
//测试某个字符是属于哪一类.  
function CharMode(iN){  
if (iN>=48 && iN <=57) //数字  
return 1;  
if (iN>=65 && iN <=90) //大写字母  
return 2;  
if (iN>=97 && iN <=122) //小写  
return 4;  
else  
return 8; //特殊字符  
}  

//bitTotal函数  
//计算出当前密码当中一共有多少种模式  
function bitTotal(num){  
modes=0;  
for (i=0;i<4;i++){  
if (num & 1) modes++;  
num>>>=1;  
}  
return modes;  
}  

//checkStrong函数  
//返回密码的强度级别  

function checkStrong(sPW){  
if (sPW.length<=4)  
return 0; //密码太短  
Modes=0;  
for (i=0;i<sPW.length;i++){  
//测试每一个字符的类别并统计一共有多少种模式.  
Modes|=CharMode(sPW.charCodeAt(i));  
}  

return bitTotal(Modes);  

}  

//pwStrength函数  
//当用户放开键盘或密码输入框失去焦点时,根据不同的级别显示不同的颜色  

function pwStrength(pwd){  
O_color="#eeeeee";  
L_color="#FF0000";  
M_color="#FF9900";  
H_color="#33CC00";  
if (pwd==null||pwd==''){  
Lcolor=Mcolor=Hcolor=O_color;  
}  
else{  
S_level=checkStrong(pwd);  
switch(S_level) {  
case 0:  
Lcolor=Mcolor=Hcolor=O_color;  
case 1:  
Lcolor=L_color;  
Mcolor=Hcolor=O_color;  
break;  
case 2:  
Lcolor=Mcolor=M_color;  
Hcolor=O_color;  
break;  
default:  
Lcolor=Mcolor=Hcolor=H_color;  
}  
}  

document.getElementById("strength_L").style.background=Lcolor;  
document.getElementById("strength_M").style.background=Mcolor;  
document.getElementById("strength_H").style.background=Hcolor;  
return;  
}  
</script> 

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>密码重置--<%=AppConst.SiteName%></title>
</head>
<link href="<%=AppConst.SiteUrl%>/<%=AppConst.Skinpath%>/style.css" rel="stylesheet" type="text/css" />
<body>
<script type="Text/JavaScript" language="javascript">
<!--
//表单验证
function checkpwd()
{
	if(document.formPwd.username.value=="")
	{
		alert("请填写你的用户名！");
		document.formPwd.username.focus();
		return false;
	}
	if (document.formPwd.email.value=="")
	{
        alert("请填写你的电子邮箱！");
        document.formPwd.email.focus();
        return false;
    }
	if (document.formPwd.email.value!="")
	{
	 var strm = document.formPwd.email.value   //提交mail地址的文本框
	 var regm = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;//验证Mail的正则表达式,^[a-zA-Z0-9_-]:开头必须为字母,下划线,数字,
 	 if (!strm.match(regm) && strm!="")
 	  {
     alert("邮箱地址格式错误或含有非法字符!\n请检查！");
 	 document.formPwd.email.select();   
 	 return false;
   	 } 
	}
	if (document.formPwd.realname.value=="")
	{
        alert("请填写你的真实姓名！");
        document.formPwd.realname.focus();
        return false;
    }
	if(document.formPwd.newPassword.value=="")
	{
		alert("请填写你的新密码！");
		document.formPwd.newPassword.focus();
		return false;
	}
	if(document.formPwd.newPasswordTwo.value=="")
	{
		alert("请确认你的新密码！");
		document.formPwd.newPasswordTwo.focus();
		return false;
	}
	if(document.formPwd.newPassword.value!=document.formPwd.newPasswordTwo.value){
		alert("两次填写的密码不一样！");
		document.formPwd.newPassword.focus();
		return false;
	}
}
//-->
</script> 
<form name="formPwd" method="post" action="" onsubmit="return checkpwd()">
  <table style="width:760" cellspacing="0" cellpadding="0" align="center" border="0">
    <tbody>
      <tr>
        <td><table style="width:100%" cellspacing="3" cellpadding="0" border="0">
            <tbody>
              <tr>
                <td style="width:3%"><img height="33" src="images/icon_title5.gif" width="33" /></td>
                <td style="width:97%"><span class="Title_14">通过安全电子邮件重设密码</span></td>
              </tr>
            </tbody>
        </table>
            <table style="width:100%" cellspacing="0" cellpadding="0" border="0">
              <tbody>
                <tr>
                  <td style="background-color:#c0d1e2; height:1"></td>
                </tr>
              </tbody>
            </table></td>
      </tr>
      <tr>
        <td><br>
            <table style="width:650" cellspacing="0" cellpadding="0" align="center" border="0">
              <tbody>
                <tr>
                  <td valign="top"><div style="FLOAT: left; WIDTH: 650px">
                      <fieldset class="app_gimage">
                        <legend>
                      <div style="FONT-WEIGHT: bold; FONT-SIZE: 14px; WIDTH: 180px; HEIGHT: 20px; TEXT-ALIGN: center">
                        <table style="width:100%" cellspacing="0" cellpadding="0" border="0">
                          <tbody>
                            <tr>
                              <td style="width:33"><img height="28" src="images/icon_table3.gif" width="28" /> </td>
                              <td class="Title_14">请先确认您的用户名</td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                        </legend>
                        <br>
                      <table style="width:100%" cellspacing="0" cellpadding="5" border="0" ?>
                        <tbody>
                          <tr>
                            <td style="width:30%" class="Text_induct" valign="center"><div align="right">注册时的用户名：</div></td>
                            <td id="QQNumbertd" align="left"><input id="username" style="WIDTH: 180px"  name="username" />
                            <span class="Red">*</span></td>
                          </tr>
                        </tbody>
                      </table>
                        <br>
                    </fieldset>
                  </div></td>
                </tr>
              </tbody>
            </table>
          <br>
          <table style="width:650" cellspacing="0" cellpadding="0" align="center" border="0">
            <tbody>
              <tr>
                <td valign="top"><div style="FLOAT: left; WIDTH: 650px">
                    <fieldset class="app_gimage">
                    <legend>
                    <div style="FONT-WEIGHT: bold; FONT-SIZE: 14px; WIDTH: 180px; HEIGHT: 20px; TEXT-ALIGN: center">
                      <table style="width:100%" cellspacing="0" cellpadding="0" border="0">
                        <tbody>
                          <tr>
                            <td style="width:33"><img height="28" src="images/icon_table3.gif" width="28" /> </td>
                            <td class="Title_14">请先确认您的电子邮箱</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                      </legend>
                    <br>
                    <table style="width:100%" cellspacing="0" cellpadding="5" border="0" ?>
                      <tbody>
                        <tr>
                          <td style="width:30%" class="Text_induct" valign="center"><div align="right">注册时的电子邮箱：</div></td>
                          <td id="QQNumbertd2" align="left">
                          <input id="email"  style="WIDTH: 180px" name="email" />
                          <span class="Red">*</span></td>
                        </tr>
                      </tbody>
                    </table>
                      <br>
                    </fieldset>
                </div></td>
              </tr>
            </tbody>
          </table>
          <br>
          <table style="width:650" cellspacing="0" cellpadding="0" align="center" border="0">
            <tbody>
              <tr>
                <td valign="top"><div style="FLOAT: left; WIDTH: 650px">
                    <fieldset class="app_gimage">
                    <legend>
                    <div style="FONT-WEIGHT: bold; FONT-SIZE: 14px; WIDTH: 180px; HEIGHT: 20px; TEXT-ALIGN: center">
                      <table style="width:100%" cellspacing="0" cellpadding="0" border="0">
                        <tbody>
                          <tr>
                            <td style="width:33"><img height="28" src="images/icon_table3.gif" width="28" /> </td>
                            <td class="Title_14">请先确认您的真实姓名</td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                      </legend>
                    <br>
                    <table style="width:100%" cellspacing="0" cellpadding="5" border="0" ?>
                      <tbody>
                        <tr>
                          <td style="width:30%" class="Text_induct" valign="center"><div align="right">注册时的真实姓名：</div></td>
                          <td id="QQNumbertd3" align="left"><input id="realname"  style="WIDTH: 180px" name="realname" />
                              <span class="Red">*</span></td>
                        </tr>
                      </tbody>
                    </table>
                      <br>
                    </fieldset>
                </div></td>
              </tr>
            </tbody>
          </table>
          <br>
        <table style="width:650" cellspacing="0" cellpadding="0" align="center" border="0">
              <tbody>
                <tr>
                  <td valign="top"><div style="FLOAT: left; WIDTH: 650px">
                      <fieldset class="app_gimage">
                        <legend>
                      <div style="FONT-WEIGHT: bold; FONT-SIZE: 14px; WIDTH: 180px; HEIGHT: 20px; TEXT-ALIGN: center">
                        <table style="width:100%" cellspacing="0" cellpadding="0" border="0">
                          <tbody>
                            <tr>
                              <td style="width:33"><img height="28" src="images/icon_table7.gif" width="28" /> </td>
                              <td class="Title_14">设置帐号密码</td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                        </legend>
                        <br>
                      <table style="width:100%" cellspacing="0" cellpadding="5" border="0" ?>
                        <tbody>
                          <tr>
                            <td colspan="2"><div style="PADDING-LEFT: 50px">
                                <table border="0">
                                  <tbody>
                                    <tr>
                                      <td style="width:64"></td>
                                      <td id="safeMessageTd"></td>
                                    </tr>
                                  </tbody>
                                </table>
                            </div></td>
                          </tr>
                          <tr>
                            <td style="width:30%" class="Text_induct" valign="center"><div align="right">新密码：</div></td>
                            <td id="newPasswordtd" align="left"><input class="boxinputgrey" id="newPassword" style="WIDTH: 180px" type="password" name="newPassword" onkeyup="pwStrength(this.value)" onblur="pwStrength(this.value)" />
                                <span class="Red">*</span></td>
                          </tr>
                          <tr>
                            <td id="newPasswordImg" valign="top" align="right"></td>
                            <td id="newPasswordText"></td>
                          </tr>
                          <tr>
                            <td class="Text_induct"><div align="right">密码强度：</div></td>
                            <td align="left">

                              <table style="height:23; width:217" border="1" cellspacing="0" cellpadding="1" bordercolor="#cccccc" style='display:inline'>  
                        <tr style="background-color:#eeeeee" align="center">  
                        
                        <td style="width:33%" id="strength_L">弱</td>  
                        
                        <td style="width:33%" id="strength_M">中</td>  
                        
                        <td style="width:33%" id="strength_H">强</td>  
                        </tr>  
                        </table>

                          <tr>
                            <td class="Text_induct"><div align="right">确认新密码：</div></td>
                            <td align="left">
                            <input  name="newPasswordTwo" style="WIDTH: 180px" type="password" />
                                <span class="Red">*</span> </td>
                          </tr>
                        </tbody>
                      </table>
                        <table style="width:100%" cellspacing="0" cellpadding="5" border="0" ?>
                        <tbody>
                          <tr id="cancelMobileBox">
                            <td>&nbsp;</td>
                          </tr>
                        </tbody>
                        </table>
                        <label>
                        <input type="hidden" name="sendok" id="sendok" value="OK" />
                        </label>
                      </fieldset>
                  </div></td>
                </tr>
              </tbody>
            </table>
          <br>
            <table style="width:60%" cellspacing="5" align="center" border="0">
              <tbody>
                <tr>
                  <td><div align="center">
                    <input  id="btnSubmit" type="submit" value="确 定" name="btnSubmit" />
                  </div></td>
                  <td><div align="center">
                    <input  type="button" value="取 消" name="button" />
                  </div></td>
                </tr>
              </tbody>
            </table></td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>
