function setInqAddressDropdownForIQ(key_bank){
    var all_crditors_contacts_IQ =  getAllCreditorContactsByName()
    var bank_address_dropDown_html = '<select class="inq-address-dropdown" style="width:calc(100% - 10px);">';
     bank_address_dropDown_html += '<option data-value="" value="">Please select</option>';
     
    if(all_crditors_contacts_IQ){
        for(var index in all_crditors_contacts_IQ){
            if(all_crditors_contacts_IQ[index]){
            var value = all_crditors_contacts_IQ[index];
            value = value.replace(/\s\s+/g, ' ');
            var checked = "";
            var temp_bank = index;

            var bankNameArray = temp_bank.split('-');
            $.each(bankNameArray, function (i, value1) {
                var index1 = value1;
                if (index1 != null && index1 >= 1 && index1 <= 100) {
                    temp_bank = temp_bank.replace("-" + index1, "");
                    return false;
                }
            });

            if($.trim(index) == $.trim(key_bank)){
                checked = 'selected';
            }
            bank_address_dropDown_html += '<option data-key="'+key_bank+'" data-value="'+value+'" value="'+value+'" '+checked+'>'+temp_bank+" - "+value+'</option>';
           }   
        }
        bank_address_dropDown_html += '</select>'; 
    }
    
    return bank_address_dropDown_html;
}

function setInqAddressDropdownForSmartCredit(key_bank){
    var all_crditors_contacts =  creditorContactsSmartCredit()
    var bank_address_dropDown_html = '<select class="inq-address-dropdown" style="width:calc(100% - 10px);">';
     bank_address_dropDown_html += '<option data-value="" value="">Please select</option>';
     var all_crditors_contacts_sc = {};
     for(var c in all_crditors_contacts){
         var obj = all_crditors_contacts[c];
         all_crditors_contacts_sc[obj.bank_name] = obj.address.replace(/<(?:.|\n)*?>/gm, '')
     }
    if(all_crditors_contacts_sc){
        for(var index in all_crditors_contacts_sc){
            if(all_crditors_contacts_sc[index]){
            var value = all_crditors_contacts_sc[index];
            value = value.replace(/\s\s+/g, ' ');
            var checked = "";
            var temp_bank = index;

            var bankNameArray = temp_bank.split('-');
            $.each(bankNameArray, function (i, value1) {
                var index1 = value1;
                if (index1 != null && index1 >= 1 && index1 <= 100) {
                    temp_bank = temp_bank.replace("-" + index1, "");
                    return false;
                }
            });

            if($.trim(index) == $.trim(key_bank)){
                checked = 'selected';
            }
            bank_address_dropDown_html += '<option data-key="'+key_bank+'" data-value="'+value+'" value="'+value+'" '+checked+'>'+temp_bank+" - "+value+'</option>';
           }   
        }
        bank_address_dropDown_html += '</select>'; 
    }
    
    return bank_address_dropDown_html;
}

function setPublicAddressDropdownForSmartCredit(key_bank = ""){
    var all_crditors_contacts =  creditorContactsSmartCredit()
    var bank_address_dropDown_html = '<select class="public-address-dropdown" name="public_address_dropdown" style="text-align:left">';
     bank_address_dropDown_html += '<option data-value="" value="">Please select</option>';
     var all_crditors_contacts_sc = {};
     for(var c in all_crditors_contacts){
         var obj = all_crditors_contacts[c];
         all_crditors_contacts_sc[obj.bank_name] = obj.address.replace(/<(?:.|\n)*?>/gm, '')
     }
    if(all_crditors_contacts_sc){
        for(var index in all_crditors_contacts_sc){
            if(all_crditors_contacts_sc[index]){
            var value = all_crditors_contacts_sc[index];
            value = value.replace(/\s\s+/g, ' ');
            var checked = "";
            var temp_bank = index;

            var bankNameArray = temp_bank.split('-');
            $.each(bankNameArray, function (i, value1) {
                var index1 = value1;
                if (index1 != null && index1 >= 1 && index1 <= 100) {
                    temp_bank = temp_bank.replace("-" + index1, "");
                    return false;
                }
            });

            if($.trim(index) == $.trim(key_bank)){
                checked = 'selected';
            }
            bank_address_dropDown_html += '<option data-key="'+temp_bank+'" data-value="'+value+'" value="'+temp_bank+'" '+checked+'>'+temp_bank+" - "+value+'</option>';
           }   
        }
        bank_address_dropDown_html += '</select>'; 
    }
    
    return bank_address_dropDown_html;
}