jQuery(document).ready(function(){jQuery("input#signup_username").wrap("<div id='username_checker'></div> ");jQuery("#username_checker").append("<span class='loading' style='display:none'></span>");jQuery("#username_checker").append("<span id='name-info'></span> ");jQuery("input#signup_username").bind("blur",function(){jQuery("#username_checker #name-info").css({display:"none"});jQuery("#username_checker span.loading").css({display:"block"});var b=jQuery("input#signup_username").val();jQuery.post(ajaxurl,{action:"check_username",cookie:encodeURIComponent(document.cookie),user_name:b},function(c){var d=jQuery.parseJSON(c);if(d.code=="success"){a(d.message,0)}else{a(d.message,1)}})});function a(c,b){jQuery("#username_checker #name-info").removeClass().css({display:"block"});jQuery("#username_checker span.loading").css({display:"none"});jQuery("#username_checker #name-info").empty().html(c);if(b){jQuery("#username_checker #name-info").addClass("error")}else{jQuery("#username_checker #name-info").addClass("available")}}});