<!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={$CONFIG[charset]}" />
<title>修改密码_会员中心_{$SYSTEM[sitename]}</title>
<link href="{IMG_URL}templates/{TEMPLATE}/css/style.css" type="text/css" rel="stylesheet" rev="stylesheet" media="screen"  />
<link href="{IMG_URL}templates/{TEMPLATE}/css/content.css" type="text/css" rel="stylesheet" rev="stylesheet" media="screen"  />
<!--[if IE 6]> 
	<link href="{IMG_URL}templates/{TEMPLATE}/css/ie6.css" type="text/css" rel="stylesheet" rev="stylesheet" media="screen"  />
<![endif]-->
<script type="text/javascript" src="{IMG_URL}js/config.js"></script>
<script type="text/javascript" src="{IMG_URL}js/lib/jquery.js"></script>
<script type="text/javascript" src="{IMG_URL}js/lib/jquery.form.js"></script>
<script type="text/javascript" src="{IMG_URL}js/lib/cmstop.validator.js"></script>
<script type="text/javascript">
function pwGrade(password) {
	if(password.length <6) {
		return 1;
	}
	var nums	= /[0-9]/;
	var wordsS	= /[a-z]/;
	var wordsB	= /[A-Z]/;
	var wordsO	= /[^0-9a-zA-Z]/;
	var sign = 1;
	
	if(nums.test(password) == true) sign ++;
	if(wordsS.test(password) == true) sign ++;
	if(wordsB.test(password) == true) sign ++;
	if(wordsO.test(password) == true) sign ++;
	
	if(sign > 3)	{ sign =3 }		//强
	return sign;
}
function edit_ok(data) {
	alert(data.message);
}
$.validate.setConfigs({
	xmlPath:'apps/member/validators/'
});
$(document).ready(function() {
	$('#member_editPassword').validate({
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success: edit_ok,
				dataType:'json'
			});
			return false;
		},
		infoHandler:function(jq,message,type){
			jq.siblings('em').remove();
			if(type == 'error') jq.after('<em class="warn"> '+message+'</em>');
		}
	});
	$("input").change(function(){
		$(this).siblings('em').remove();
	});
	
	$("#password").keyup(function() {
		var grade = pwGrade(this.value);
		$("#pwgrade_message").removeClass().addClass('pw-level-'+grade);;
	});
});
</script>
</head>
<body class="person-theme">
	<div class="person-wrap">
		<?php $menu['password'] = 'class="person-current"'; $this->assign('menu',$menu); ?>
		<!--{template 'member/panel/header.html'}-->
		<!-- end 菜单部分 -->
		<div class="clear"></div>
		<div class="person-cont">
			<div class="hr-h10"></div>
			<form action="{url('member/panel/password')}" name="member_editPassword" id="member_editPassword" method="POST" >
				<ul class="formFormat">
					<li><span class="info f-l txt-r"><em>*</em> 原密码：</span>
					<input type="password" name="last_password" id="last_password" value="" class="input-text f-l input-w200"/>
					</li>
					<li><span class="info f-l txt-r"><em>*</em> 新密码：</span>
					<input type="password"  name="password" id="password" value="" class="input-text age f-l input-w200" /></li>
					<li><div id="pwgrade_message" class="pw-level-0">&nbsp;</div></li>
					<li><span class="info f-l txt-r"><em>*</em> 再次输入：</span>
					<input type="password" name="password_check" id="password_check" class="input-text age f-l input-w200" value=""  /></li>
					<li class="ok-wrap"><input type="submit" id="button" value="确 定" class="zl-btn zl-ok f-l" /></li>
				</ul>
			</form>
		</div>
	</div>
<div class="hr-h10"></div>
<!--{template 'system/footer.html'}-->