<{import file="index/reg_header.html" title="重置密码"}>
<style type="text/css">  
.main_bar{ padding:80px 0 150px 0; } 
.main{ width:380px; } 
/* 顶部 */
.bname{ width:380px; float: left; }
.bname span{ width:100%; text-align:center; font-size:20px; font-weight:bold; color:#333; padding:0 0 20px 0; float:left; } 
</style>
<div class="main_bar">
	<div class="main"> 
		<div class="bname"><span>重置密码</span></div>
		<form method="post">
			<div class="binput"><div id="error_msg" style="display:none;"></div></div>
			<div class="rbox"> 
				<div class="rbox_input">
					<span>新&nbsp;密&nbsp;码</span>
					<input type="password" name="password" id="password" placeholder="新设置的密码"/> 
				</div> 
				<div class="rbox_input">
					<span>重复密码</span>
					<input type="password" name="repasswd" id="repasswd" placeholder="重复新设置的密码"/> 
				</div> 
				<div class="rbox_sub"><input type="submit" name="submit" class="submit_reg" value="重置密码"/></div>	
			</div> 
		</form> 
	</div>
</div>  
<{include file="index/footer.html"}>
<script type="text/javascript">
$(function(){
	$("form").submit(function(){
		password = $("#password").val(); 
		if(password == ''){ $("#error_msg").show().html('密码不能为空'); return false; } 
		
		repasswd = $("#repasswd").val(); 
		if(repasswd == ''){ $("#error_msg").show().html('重复密码不能为空'); return false; } 
		
		if(password != repasswd){
			$("#error_msg").show().html('两次密码输入不一致'); 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="member.php?m=index&a=login";
				}else{ 
					alert(data.msg);
				}
			},
			error:function(){
				alert('错误');
			}
		});
		return false; 
	}); 
});
</script>