
function checkEmail(email){
var emailRegExp = new RegExp(            "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");
if (!emailRegExp.test(email)||email.indexOf('.')==-1){
return false;
}else{
return true;
}
}
function test(obj){ 
if(obj=="email"){
var email=jQuery.trim(jQuery("input[name='email']").val());
if(email==""){
jQuery("#mailde .attention").hide();  
 jQuery("#youxiangkong").show();
}else{
if(!checkEmail(email)){
jQuery("#youxiang").hide();
jQuery("#youxiangerro").show();
jQuery("#youxiangright").hide(); 
jQuery("#youxiangkong").hide();


}else{
  jQuery("#youxiangerro").hide();
  jQuery("#youxiangright").show();
  jQuery("#youxiang").hide();

};
}

}
};  
jQuery("#email_address").focus(function(){
    if(jQuery(this).val()==""){
    jQuery("#mailde .attention").hide();
        jQuery("#youxiang").show();
    }
    
  
} ) 
jQuery("#form-validate li input").blur(function(){
jQuery(this).closest("li").removeClass("focus") 
jQuery(this).closest(".show-attention").hide()
})
jQuery("#form-validate li input").focus(function(){
jQuery(this).closest("li").addClass("focus")
})
jQuery("#password").blur(function(){
if(jQuery(this).val()==""){
jQuery("#pwshow .attention").hide();
 jQuery("#pwkong").show();
 
}
else{

if(jQuery(this).val().length<6)
   {
    jQuery("#pwshow .attention").hide();
    jQuery("#pwerro").show();
   }
else
   {
 jQuery("#pwshow .attention").hide();
 jQuery("#pwright").show();
   }

}

} );  
jQuery("#password").focus(function(){
    if(jQuery(this).val()==""){
    jQuery("#pwshow .attention").hide();
        jQuery("#pwok").show();
    }
    
  
} ) 
jQuery("#confirmation").focus(function(){
    if(jQuery(this).val()==""){
    jQuery("#cpw .attention").hide();  
    jQuery("#repw").show();  
    }
    
  
} ) 
jQuery("#confirmation").blur(function(){
if(jQuery("#confirmation").val()!=jQuery("#password").val()|| jQuery("#confirmation").val()==""){
 jQuery("#cpw .attention").hide();  
 
  jQuery("#reerro").show();                                   }
  else{   
    jQuery("#cpw .attention").hide();  
 
  jQuery("#reok").show(); 
  
  }
} )

