<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>{#$title#}</title>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<link rel="shortcut icon" href="{#$QISHI.site_dir#}favicon.ico" />
<meta name="author" content="骑士CMS" />
<meta name="copyright" content="74cms.com" />
<link href="{#$QISHI.site_template#}css/user.css" rel="stylesheet" type="text/css" />
<script src="{#$QISHI.site_template#}js/jquery.js" type='text/javascript' ></script>
<script src="{#$QISHI.site_template#}js/jquery.validate.min.js" type='text/javascript' language="javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#Form1").validate({
//debug: true,
// onsubmit:false,
//onfocusout :true,
   rules:{
   username:{
    required: true
   },
	   {#if $verify_getpwd=="1"#}
		postcaptcha:{
		IScaptchastr: true,
		required: true,
		remote:{     
		url:"{#$QISHI.site_dir#}include/imagecaptcha.php",     
		type:"post",    
		data:{"postcaptcha":function (){return $("#postcaptcha").val()},"act":"verify","time":function (){return new Date().getTime()}}     
		}
	   },
	   {#/if#}  
	   email: {
	   required:true,
	   email:true
	   }
	},
    messages: {
    username: {
    required: "请输入用户名"
   },
   {#if $verify_getpwd=="1"#}
    postcaptcha: {
    required: "请填写验证码",
	remote: jQuery.format("验证码错误")	
   },
    {#/if#}
   email: {
    required: jQuery.format("请填写电子邮箱"),
	email: jQuery.format("请正确填写电子邮箱")
   } 
  },
  errorPlacement: function(error, element) {
    if ( element.is(":radio") )
        error.appendTo( element.parent().next().next() );
    else if ( element.is(":checkbox") )
        error.appendTo ( element.next());
    else
        error.appendTo(element.parent());
	}
    });
	jQuery.validator.addMethod("IScaptchastr", function(value, element) {
	var str="点击获取验证码";
	var flag=true;
	if (str==value)
	{
	flag=false;
	}
	return  flag || this.optional(element) ;
	}, "请填写验证码");
	/////验证码部分
{#if $verify_getpwd=="1"#}
function imgcaptcha(inputID,imgdiv)
{
	$(inputID).focus(function(){
		if ($(inputID).val()=="点击获取验证码")
		{
		$(inputID).val("");
		$(inputID).css("color","#333333");
		}
		$(inputID).parent("div").css("position","relative");
		//设置验证码DIV
		$(imgdiv).css({ position: "absolute", left:  $(inputID).width(), "bottom": "0px" , "z-index": "10", "background-color": "#FFFFFF", "border": "1px #A3C8DC solid","display": "none","margin-left": "15px"});
		$(imgdiv).show();
		if ($(imgdiv).html()=='')
		{
		$(imgdiv).append("<img src=\"{#$QISHI.site_dir#}include/imagecaptcha.php?t={#$random#}\" id=\"getcode\" align=\"absmiddle\"  style=\"cursor:pointer; margin:3px;\" title=\"看不请验证码？点击更换一张\"  border=\"0\"/>");
		}
		$(imgdiv+" img").click(function()
		{
			$(imgdiv+" img").attr("src",$(imgdiv+" img").attr("src")+"1");
			$(inputID).val("");
			$("#Form1").validate().element("#postcaptcha");	
		});
		$(document).unbind().click(function(event)
		{
			var clickid=$(event.target).attr("id");
			if (clickid!="getcode" &&  clickid!="postcaptcha")
			{
			$(imgdiv).hide();
			$(inputID).parent("div").css("position","");
			$(document).unbind();
			}			
		});
	});
}
imgcaptcha("#postcaptcha","#imgdiv");
//验证码结束
{#/if#}
});
</script>
</head>
<body>
{#include file="user/header.htm"#}
 <div class="reg_box">
   <div class="link_lan reg_box_tit"><strong>找回密码</strong></div>
   {#if $step=="1"#}
<form id="Form1" name="Form1" method="post" action="?act=get_pass">
<div style="padding:20px;">忘记了密码？请输入用户名和注册时填写的邮箱，我们会把重设密码邮件发送到您的邮箱！</div>
  <table width="100%" border="0" cellpadding="2" cellspacing="5" style=" margin-bottom:20px;">
  <tr>
    <td colspan="2"></td>
    </tr>
  <tr>
    <td width="120"   align="right">用户名：</td>
    <td><input name="username" type="text"  id="username"   class="getpass_input"  /></td>
    </tr>
	<tr>
    <td align="right">邮箱：</td>
    <td><input name="email" type="text"  id="email"   class="getpass_input"  /></td>
    </tr>
  {#if $verify_getpwd=="1"#}
	  <tr>
      <td align="right">验证码：</td>
      <td> 
	  
	  <div><div id="imgdiv"></div>
			<input  class="getpass_input" name="postcaptcha" id="postcaptcha" type="text" value="点击获取验证码" style="color:#999999" />
			
			</div>
	  
	  </td>
      </tr>
	  {#/if#}
    <td>&nbsp;</td>
    <td height="50">
	<div style="position:relative">
      <input name="submit" type="submit"  id="submit" value="提交" class="getpass_submit" />
	  </div>
	  </td>
    </tr>
</table>
</form>
{#/if#}
{#if $step=="2"#}
<table width="900" border="0" align="center" cellpadding="20" cellspacing="0" style="margin-bottom:170px;margin-top:50px;">
  <tr>
    <td align="center" style="color:#FF0000">新密码已经成功发送至您的邮箱：{#$email#}</td>
  </tr>
  <tr>
    <td align="center" ><input name="reg2" type="submit" class="but100" id="" value="立即登录"  onclick="window.location='{#"QS_login"|qishi_url#}'" /></td>
  </tr>
</table>
{#/if#}
 </div>
{#include file="user/footer.htm"#}
</body>
</html>