function set_div(t){
   return '<span class="action_po"><span class="action_po_top">'+t+'</span><span class="action_po_bot"></span></span></span>';
}
function addClass(id,c,v){
   var value;
   if(v==''){
	  value = '';
   }else{
	  value = set_div(v); 
   }
   $("#"+id).removeClass();
   $("#"+id).addClass(c);
   $("#"+id).html(value);
}

function checkemail(){
	var email = $("#email").val().trim();
	if(email==''){
	   addClass("emailtip","wrong1","请输入邮箱,找回密码使用，非常重要！");
	}else if(!isEmail(email)){
	   addClass("emailtip","wrong1","您输入的邮箱格式错误");		
	}else{
       $.ajax({url:ajaxurl('&do=authemail&email='+email+'&floor='+Math.floor(Math.random()*1000+1)),type: 'GET',success: function(msg){
			if(msg.trim()==''){
	           addClass("emailtip","chenggong1","");
			}else{
	           addClass("emailtip","wrong1","对不起，该邮箱已被 <strong class=\"green\" style=\"font-size:12px;\">"+msg+"</strong> 注册！");
			}	
	   }});
	}
}

function auth(){
  var post = true; 
  
  if($("#email").val().length<1){
	addClass("emailtip","wrong1","请输入邮箱,找回密码使用，非常重要！");
    post = false;
  }else if(!isEmail($("#email").val())){
	addClass("emailtip","wrong1","您输入的邮箱格式错误");
    post = false;
  }else if($("#emailtip").html().indexOf('对不起，该邮箱已被') != -1){
    post = false;
  } 
    
  return post;  
}