jQuery(document).ready(function($){$("input, select").conditional({data:"envira-conditional",toggle:"envira-conditional-toggle",value:"envira-conditional-value",displayOnEnabled:"envira-conditional-display"})}),function($){"use strict";$.fn.conditional=function(t){var a=$.extend({data:"conditional",value:"conditional-value",toggle:"conditional-toggle",displayOnEnabled:"conditional-display"},t);return this.each(function(){if("undefined"==typeof $(this).data(a.data))return!0;var t,i,n,e,o;$(this).on("change",function(){switch(t=$(this).data(a.data).split(","),i=$(this).data(a.displayOnEnabled),"undefined"==typeof i&&(i=!0),n=$(this).data(a.value),"undefined"==typeof n&&(n=""),e=$(this).data(a.toggle),"undefined"==typeof n&&(e=""),o=!1,$(this).attr("type")){case"checkbox":o=i?$(this).is(":checked"):$(this).is(":checked")?!1:!0;break;default:console.log($(this).attr("type")),console.log(i),console.log("toggle: "+e),o=i?""!==n?String($(this).val())!==String(n)?!1:!0:""===$(this).val()||"0"===$(this).val()?!1:!0:""!==n?$(this).val()!==n?!0:!1:""===$(this).val()||"0"===$(this).val()?!0:!1}for(var d=0;d<t.length;d++)o?($("#"+t[d]).fadeIn(300),e&&$("#"+e).fadeOut(300)):($("#"+t[d]).fadeOut(300),e&&$("#"+e).fadeIn(300))}),$(this).trigger("change")}),this}}(jQuery);