window.onload = function() {
    if (window.jQuery) {  
        // jQuery is loaded  
        console.log("Yeah!");
        jQuery(document).ready(function () {

            if (jQuery("#edit-poc-selection-beneficial-ownership-bo-corporate-transparency-act-cta").is(':checked')) {
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(0)").show();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(1)").hide();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(2)").hide();
            }

             jQuery("#edit-poc-selection-beneficial-ownership-bo-corporate-transparency-act-cta").click(function () {
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(0)").show();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(1)").hide();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(2)").hide();
                jQuery("#edit-bsa-subject").val("");
                jQuery("#edit-subject").val("");
             });

             jQuery("#edit-poc-selection-bank-secrecy-act-bsa").click(function () {
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(0)").hide();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(1)").show();
                jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(2)").hide();
                jQuery("#edit-boi-subject").val("");
                jQuery("#edit-subject").val("");
            });

            jQuery("#edit-poc-selection-general").click(function () {
                    jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(0)").hide();
                    jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(1)").hide();
                    jQuery('#edit-flexbox-03').find(".webform-flex--1:eq(2)").show();
                    jQuery("#edit-bsa-subject").val("");
                    jQuery("#edit-boi-subject").val("");
            });
         });

    } else {
        // jQuery is not loaded
        console.log("Doesn't Work");
    }
}

