"undefined"!=typeof jQuery&&!function(a){function b(a,b,e){3===e.length&&c(a,e[2])?f(b,e[0]):2===e.length&&null!==d(a)?f(b,e[0]):i(b,e[0])}function c(b,c){var e=d(b);return a.isArray(e)?e.indexOf(c)!==-1:e===c}function d(a){var b,c=e(a);return b="checkbox"===c||"radio"===c?a.filter(":checked").val():a.val(),b?b:null}function e(a){return a[a.prop?"prop":"attr"]("type")}function f(a,b){"enable-if"===b?h(a):"show-if"===b?g(a).show():"hide-if"===b&&g(a).hide()}function g(a){var b=a.closest(".awpcp-admin-form-field");return b.length?b:a}function h(a){a.prop?a.prop("disabled",!1):a.removeAttr("disabled")}function i(a,b){"enable-if"===b?j(a):"show-if"===b?g(a).hide():"hide-if"===b&&g(a).show()}function j(a){a.prop?a.prop("disabled",!0):a.attr("disabled","disabled")}a.fn.usableform=function(){return a(this).each(function(){var c=a(this),d=c.find("[data-usableform]");d.each(function(){var d=a(this),e=d.attr("data-usableform").split(":"),f=c.find('[name="'+e[1]+'"]');f.length>1&&(f=f.not(":hidden")),f.change(function(){b(a(this),d,e)}),b(f,d,e)})})}}(jQuery);