function hideRecaptchaError(t){jQuery("span#recaptcha-error").hide()}jQuery(document).ready(function(t){t('form.answer-survey input[type="submit"]').prop("disabled",!1),t("form.answer-survey label.control-label > span.required").each(function(){var e=t(this).parent().next();t('input[type="checkbox"]',e).each(function(){t(this).prop("required",!0)})});var e=t("form.answer-survey").position();t("form.answer-survey").each(function(){t(this).validate({errorPlacement:function(e,a){var n=a.closest(t(".control-group")),r=t("> label",n);e.insertBefore(r)},submitHandler:function(a){var n=t(".overlay",a);t("div.g-recaptcha").length<=0||""!=t("#g-recaptcha-response").val()?(n.show(),t.post(wwm_awesome_surveys.ajaxurl,t(a).serializeArray(),function(e){return null==e?(t(a).empty().append('

An unknown error occured (data object is null)

'),null):void(e.success?(msg="undefined"!=typeof e.data.thank_you?e.data.thank_you:''+e.data+"",t(a).empty().append('

'+msg+"

"),void 0!=typeof e.data.url&&e.data.url&&(void 0!=typeof e.data.urltimeout&&e.data.urltimeout>0?setTimeout(function(){window.location.href=e.data.url},1e3*e.data.urltimeout):window.location.href=e.data.url)):alert(e.data.error))},"json").fail(function(e){t(a).empty().append('

There was an error. The error status code is: '+e.status+" The error message is: "+e.statusText+"

")}).always(function(){window.scroll(e.left,-e.top),n.hide()})):t("span#recaptcha-error").length>0&&t("span#recaptcha-error").show()}})}),t("form.answer-survey textarea[data-rule-maxlength][data-add_countdown]").each(function(){maxLength=t(this).data("rule-maxlength"),"undefined"!=typeof maxLength&&t('
'+maxLength+" "+wwm_awesome_surveys.countDownMessage+"
").insertAfter(t(this))}).keyup(function(){maxLength=t(this).data("rule-maxlength"),curLength=t(this).val().length,remaining=maxLength-curLength,t(".remaining-chars",t(this).parent()).empty().append(remaining)})}),jQuery("document").ready(function(t){t("[data-rule-conditional_on]").each(function(){t(this).closest(".control-group").hide()}),t('form#pfbc select, form#pfbc input[type="radio"], form#pfbc input[type="checkbox"]').on("change",function(){var e=/(question)|(\[|\])/g;if("checkbox"===t(this).attr("type"))t(this).parent().each(function(){var a=!1;loopqIndex=t(":first-child",this).attr("name").replace(e,""),loopselectedValue=t(":first-child",this).val(),a=t(":first-child",this).is(":checked"),t('[data-rule-conditional_on="['+loopqIndex+"["+loopselectedValue+']]"').each(function(){t(this).closest(".control-group").each(function(){t("input",t(this)).each(function(){t(this).prop("checked",!1).trigger("change"),("text"===t(this).attr("type")||"number"===t(this).attr("type")||"email"===t(this).attr("type"))&&t(this).val("")}),t("textarea",t(this)).each(function(){t(this).val("")})}),t(this).closest(".control-group").toggle(a)})});else{var a=t(this).attr("name").replace(e,""),n=t(this).val(),r=!1;t('[data-rule-conditional_on^="['+a).each(function(){t(this).closest(".control-group").each(function(){t("input",t(this)).each(function(){t(this).prop("checked",!1).trigger("change"),("text"===t(this).attr("type")||"number"===t(this).attr("type")||"email"===t(this).attr("type"))&&t(this).val("")}),t("textarea",t(this)).each(function(){t(this).val("")})}),t(this).closest(".control-group").hide()}),t('[data-rule-conditional_on="['+a+"["+n+']]"').each(function(){r=!1,t('[name="question['+a+']"]').each(function(){t(this).is(":checked")&&(r=!0)}),t('[name="question['+a+']"]').val()==n&&(r=!0),t(this).closest(".control-group").toggle(r)})}})});