<{import file="common.html" title="重置密码"}>
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/login.css"/>
<div class="cnav">
	<a class="back">&nbsp;</a>找回密码<a href="javascript:;" class="thome">主页</a>
</div> 
<div class="main">
	<div class="loginBox"> 
		<form method="post"> 
			<div id="error_msg" style="display:none;"></div>
			<div class="tbtr"><i>新密码</i><p><input type="password" name="password" id="password" placeholder="重置新密码"/></p></div>
			<div class="tbtr"><i>确认密码</i><p><input type="password" name="repasswd" id="repasswd" placeholder="确认新密码"/></p></div>
			<div class="tbtr" style="border-bottom:none; margin-top:10px;">
				<input type="submit" name="vcode" class="login_submit" value="保存"/>
			</div> 
		</form>
	</div>
</div>
<{import file="footer.html"}>
<script type="text/javascript">
$(function(){
	$("form").submit(function(){
		password = $("#password").val(); 
		if(password == ''){ 
			$.alert('密码不能为空');
			return false; 
		} 
		repasswd = $("#repasswd").val(); 
		if(repasswd == ''){
			$.alert('重复密码不能为空'); 
			return false; 
		} 
		
		if(password != repasswd){ 
			$.alert('两次密码输入不一致');
			return false;
		} 
		$.ajax({
			type:'POST',
			url:'member.php?m=index&a=forget_reset_submit',
			data:{password:password, repasswd:repasswd}, 
			success:function(result){ 
				var data = jQuery.parseJSON(result); 
				if(data.error == 0){
					$.alert('修改成功');
					location.href="wap.php?m=member&a=login";
				}else{ 
					$.alert(data.msg);
				}
			},
			error:function(){
				$.alert('错误');
			}
		});
		return false; 
	}); 
});
</script>