var creditCardIssuers = new Array();

function toggleSelectedCreditCard(creditCardNumberTextBox) {
  if (!creditCardNumberTextBox) { return; }
  var cciLength = creditCardIssuers.length;

  $('.m-cc-images i')
    .removeClass('currently-selected')
    .addClass('currently-unselected');

  for (var cciIndex = 0; cciIndex < cciLength; ++cciIndex) {
    var creditCardIssuer = creditCardIssuers[cciIndex] || {};
    var creditCardRegEx = new RegExp(creditCardIssuer.regex, 'i');

    if (creditCardRegEx.test(creditCardNumberTextBox.value)) {
      $('.m-cc-images i.fa-cc-' + creditCardIssuer.name)
        .addClass('currently-selected')
        .removeClass('currently-unselected');

      return;
    }
  }
}