<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{-:@EDIT_INFO_BASE-} - {-:$_SITE['name']-}</title>
{-import: file="c,m" type="css" baseurl="(__THEME__)/home/css/" basepath="(THEME_PATH)/home/css/"-}
<meta name="keywords" content="{-:$_SITE['keywords']-}" />
<meta name="description" content="{-:$_SITE['description']-}" />
</head>

<body>
{-include:header-}
<div class="m w_960">
	<div class="w_240 f_l">
		<dl class="adl">
			<dt><strong>{-:@SETTING-}</strong></dt>
			<dd><ul class="aul_5">
				<li><i class="ai ai_16 ai_16_user"></i> <a href="{-url:home@member/edit_info_base-}">{-:@BASE_INFO-}</a></li>
				<li><i class="ai ai_16 ai_16_info"></i> <a href="{-url:home@member/edit_info_addon-}">{-:@ADDON_INFO-}</a></li>
			</ul></dd>
		</dl>
	</div><!--/.w_240-->
	<div class="w_10 h_10 o_h f_l">&nbsp;</div>
	<div class="w_710 f_l">
		<dl class="atab_1 adiv">
			<dt><strong class="on">{-:@BASE_INFO-}</strong><strong><a href="{-url:home@member/edit_info_addon-}">{-:@ADDON_INFO-}</a></strong></dt>
			<dd class="p_20">
				<form id="edit_info_base" action="" method="post"><table class="formTable">
					<tr>
						<td class="inputTitle">{-:@USERID-}</td>
						<td class="inputTitle">{-:@USER_TYPE-}</td>
					</tr>
					<tr>
						<td class="inputArea">
							<label>{-:$_MI['m_userid']-}</label>
						</td>
						<td class="inputArea">
							<label>{-:$_MI['mm_name']-}</label>
						</td>
					</tr>
					<tr>
						<td class="inputTitle">{-:@USERNAME-}</td>
						<td></td>
					</tr>
					<tr>
						<td class="inputArea">
							<label><input id="m_username" class="required i" type="text" size="30" name="m_username" value="{-:$_MI['m_username']-}" /></label>
						</td>
						<td class="inputTip"><span id="m_username_tip"></span></td>
					</tr>
					<tr>
						<td class="inputTitle">{-:@PASSWORD-}</td>
						<td></td>
					</tr>
					<tr>
						<td class="inputArea">
							<label><input id="m_password" class="required i" type="password" size="30" name="m_password" /></label>
						</td>
						<td class="inputTip"><span id="m_password_tip"></span></td>
					</tr>
					<tr>
						<td class="inputTitle">{-:@NEW_PASSWORD-}</td>
						<td></td>
					</tr>
					<tr>
						<td class="inputArea">
							<label><input id="m_new_password" class="i" type="password" size="30" name="m_new_password" /></label>
						</td>
						<td class="inputTip"><span id="m_new_password_tip"></span></td>
					</tr>
					<tr>
						<td class="inputTitle">{-:@NEW_PASSWORD_REPEAT-}</td>
						<td></td>
					</tr>
					<tr>
						<td class="inputArea">
							<label><input id="m_new_password_repeat" class="i" type="password" size="30" name="m_new_password_repeat" /></label>
						</td>
						<td class="inputTip"><span id="m_new_password_repeat_tip"></span></td>
					</tr>
					<tr>
						<td class="inputTitle">{-:@EMAIL-}</td>
						<td></td>
					</tr>
					<tr>
						<td class="inputArea">
							<label><input id="m_email" class="required i" type="text" size="40" name="m_email" value="{-:$_MI['m_email']-}" /></label>
						</td>
						<td class="inputTip"><span id="m_email_tip"></span></td>
					</tr>
					{-if:$_G['interaction']['captcha']-}
					<tr>
						<td class="inputTitle">{-:@CAPTCHA-}</td>
						<td></td>
					</tr>
					<tr>
						<td colspan="2" class="inputArea">
						<label>
							<input type="text" name="vcode" autocomplete="off" value="" class="required i v_code_input" size="5" maxlength="5" />
							<img src="{-url:home@common/captcha_img?name=vcode-}" onclick="this.src += '&' + Math.random();" style="cursor:pointer;" />
							<span class="fc_gry">{-:@CAPTCHA_TIP-}</span>
						</label>
						</td>
					</tr>{-:/if-}
					<tr>
						<td colspan="2" class="operation">
						<label>
							<input name="timeKey" type="hidden" value="{-php:echo time();-}" />
							<input name="m_userid" type="hidden" value="{-:$_MI['m_userid']-}" />
							<span class="btn_b submit" to="#edit_info_base" action="{-url:home@member/edit_info_base_do-}">{-:@SUBMIT-}</span>
							<input class="btn_l" type="reset" value="{-:@RESET-}" />
						</label>
						</td>
					</tr>
				</table></form>
			</dd>
		</dl>
	</div><!--/.w_710-->
	<div class="c"></div>
</div>
{-include:footer-}
<script type="text/javascript" src="{-:*__PUBLIC__-}/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	/*s: form check */
	$('#edit_info_base').submit(function(){
		if('' == $('#m_username').val()){
			$('#m_username').focus();
			alert("{-:@USERNAME_NOT_NULL-}");
			return false;
		}
		if('' == $('#m_password').val()){
			$('#m_password').focus();
			alert("{-:@PASSWORD_NOT_NULL-}");
			return false;
		}
		if($('#m_new_password').val() != $('#m_new_password_repeat').val())
		{
			$('#m_new_password_repeat').focus();
			alert("{-:@PASSWORD_NOT_MATCH-}");
			return false;
		}
		if('' == $('#m_email').val()){
			$('#m_email').focus();
			alert("{-:@EMAIL_NOT_NULL-}");
			return false;
		}
	})

	var userid_min_length = {-:$_G['member']['userid_min_length']-},
		password_min_length = {-:$_G['member']['password_min_length']-};
	/* check change */
	$("#m_email").change(function(){
		var sEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
		if(!sEmail.exec($("#m_email").val())){
			$('#m_email_tip').html("<span class='fc_r'>{-:@EMAIL_FORMAT_ERROR-}</span>");
			$('#m_email').focus();
		}
		else{
			$('#m_email_tip').html('');
		}
	});
	$('#m_username').change(function(){
		var sUsername = /^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[\w])*$/;
		if(!sUsername.exec($("#m_username").val())){
			$('#m_username_tip').html("<span class='fc_r'>{-:@USERNAME_FORMAT_ERROR-}</span>");
			$('#m_username').focus();
		}
		else{
			$.get('{-url:home@member/register_check?type=m_username-}', {m_username : $("#m_username").val()}, function(data){
				$('#m_username_tip').html(data);
			});
		}
	});

	$('#m_new_password').change(function(){
		if($('#m_new_password').val().length > 0){
			if($('#m_new_password').val().length < password_min_length){
				$('#m_new_password_tip').html("<span class='fc_r'>{-:@PASSWORD_TOO_SHORT-} (&gt;" + password_min_length +")</span>");
			}
			else if($('#m_new_password').val() != $('#m_new_password_repeat').val()){
				$('#m_new_password_repeat_tip').html("<span class='fc_r'>{-:@PASSWORD_NOT_MATCH-}</span>");
			}
			else{
				$('#m_new_password_tip').html("<span class='fc_g'>{-:@AVAILABLE-}</span>");
				$('#m_new_password_repeat_tip').html("<span class='fc_g'>{-:@MATCH-}</span>");
			}
		}
	});
	$('#m_new_password_repeat').change(function(){
		if($('#m_new_password').val().length > 0){
			if($('#m_new_password_repeat').val().length < password_min_length){
				$('#m_new_password_repeat_tip').html("<span class='fc_r'>{-:@PASSWORD_TOO_SHORT-} (&gt;" + password_min_length +")</span>");
			}
			else if($('#m_new_password').val() != $('#m_new_password_repeat').val()){
				$('#m_new_password_repeat_tip').html("<span class='fc_r'>{-:@PASSWORD_NOT_MATCH-}</span>");
			}
			else{
				$('#m_new_password_tip').html("<span class='fc_g'>{-:@AVAILABLE-}</span>");
				$('#m_new_password_repeat_tip').html("<span class='fc_g'>{-:@MATCH-}</span>");
			}
		}
	});
	/*e: form check */
});


document.write('<script type="text/javascript" src="{-url:home@common/get_member_info-}&refresh='+Math.random()+'.js"></sc'+'ript>');
document.write('<script type="text/javascript" src="{-url:home@common/task?task={$TASK}-}&refresh='+Math.random()+'.js"></sc'+'ript>');
</script>
{-import:file="c,m" type="js" baseurl="(__THEME__)/home/js/" basepath="(THEME_PATH)/home/js/"-}
{-:$_SITE['stat_code']-}
</body>
</html>
