﻿

function associateenumlookupChange_jquery(elementWrapper, AssocatedFieldGroup, AssocateValues, assocationvisibility, ShowOnMatch) {
    var otherOptionFlagIDs = $('#' + AssocatedFieldGroup);
    var selecteditem = elementWrapper.val();

    var Matched = false;

    if (selecteditem != null) {
        $.each(AssocateValues, function() {
            if (jQuery.trim(selecteditem) == jQuery.trim(this)) {
                Matched = true;
            }
        });

        if (Matched && ShowOnMatch || (!Matched && !ShowOnMatch)) {
            $('#' + assocationvisibility).val('true');
            otherOptionFlagIDs.show();
        }
        else {
            $('#' + assocationvisibility).val('false');
            otherOptionFlagIDs.hide();
        }
    }
}

function associateenumlookupChangeCB_jquery(elementWrapper, ContainerBoxID, AssocateValues, assocationvisibility, ShowOnMatch) {
    var otherOptionFlagIDs = $('#' + ContainerBoxID);
    var selecteditem = '';

    var Matched = false;


    if (elementWrapper.is(':checked')) {
        selecteditem = "True";
    } else {
        selecteditem = "False";
    }

    $.each(AssocateValues, function() {
        if (selecteditem == this) {
            Matched = true;
        }
    });



    if (Matched && ShowOnMatch || (!Matched && !ShowOnMatch)) {
        $('#' + assocationvisibility).val('true');
        otherOptionFlagIDs.show();
    }
    else {
        $('#' + assocationvisibility).val('false');
        otherOptionFlagIDs.hide();
    }
}

