/*获取邮箱验证码*/
function getEmailCode() {
		var email = $("#email").val();
		if(email==""){
			 $("#checkEmail").html("邮箱名不能为空！");
			 $("input[id=email]").focus();
		} else {
			$("#checkEmail").html("邮件发送中！......");
			$.ajax({
				url : "getEmail.do",
				type : "post",
				data : "email=" + email,
				dataType : "json",
				success:function(result){
				if(result.info=="ng"){
				$("#checkEmail").html("邮箱输入错误！");
				$("input[id=username]").focus();
				return false;
				}else{
				$("#checkEmail").html("验证码已发送！请及时查看！");
          $("input[id=rightEmailCode]").val(result.info);
				return true;
				}
				},
				error:function(){
				alert("请求处理中！");
				return false;
				}
			});
		}

	}
/*验证邮箱验证码是否正确*/
function checkEmailCode(){
	var emailCode = $("#inputEmailCode").val();
	var rightEmailCode = $("#rightEmailCode").val();
	if (rightEmailCode==null){
        $("#checkEmailCode").html("邮箱验证码已失效，请重新获取！");
        return false;
	}else {
		if (emailCode==rightEmailCode){
      //style="color: #f00;"
      $("#checkEmailCode").html("ok！");
      $("span[id=checkEmailCode]").style.color="#3EFF7D";
            return true;
		} else {
      $("#checkEmailCode").html("验证码输入错误，请重新输入！");
      $("span[id=checkEmailCode]").style.color=="#f00";

            $("input[id=inputEmailCode]").focus();
            return false;
		}
	}
}
