!function(e){"use strict";e("document").ready(function(e){function r(e){var r=/^([\w-\+.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;return r.test(e)?!0:!1}var t=e("#commentform");t.attr("aria-live","polite"),t.prepend('
');var a,n=e("#comment-status");e("a.comment-reply-link").click(function(){a=e(this).parents(".comment").attr("id")}),t.submit(function(){var s=t.serialize();e("#commentform .brendah-comment-error").remove(),e("#commentform .brendah-field-error").remove();var m=!1;if(e("#commentform [aria-required=true]").each(function(){var t=e(this).attr("id")+"-error";if(""==e.trim(e(this).val())){var a=e(this).prev("label").html();e(this).attr("aria-describedby",t),e(this).parent().append(' '+a+": "+brendahComments.required+""),m=!0}if("email"==e(this).attr("name")&&""!=e.trim(e(this).val())){var n=e(this).val(),s=r(n);s||(e(this).attr("aria-describedby",t),e(this).parent().append(' '+brendahComments.emailInvalid+""),m=!0)}}),m)return n.html(''+brendahComments.error+"
").focus(),!1;n.html(''+brendahComments.processing+"
");var o=t.attr("action");return e.ajax({type:"post",url:o,data:s,dataType:"json",error:function(){n.html(''+brendahComments.flood+"
").focus()},success:function(r){var s=r.success,m=r.response,o=r.status;s?(n.html(''+o+"
").focus(),e("#comments").has(".comment-list").length>0?null!=a?e("#"+a).prepend(m):e(".comment-list").append(m):(e("#comments").prepend(''+o+"
").focus(),t.find("textarea[name=comment]").val(""))}}),!1})})}(jQuery);