function showPaymentMethodsFields(value)
{
    switch(value) {
      case 'wire':
        $('#wire').show();
        $('#epassporte').hide();
        $('#paxum').hide();
        break;
      ;
      case 'paxum':
        $('#paxum').show();
        $('#epassporte').hide();
        $('#wire').hide();
        break;
      ;
      case 'epassporte':
        $('#epassporte').show();
        $('#wire').hide();
        $('#paxum').hide();
        break;
      ;
      default:
        $('#wire').hide();
        $('#epassporte').hide();
        $('#paxum').hide();
        break;
      ;
    }
}

function checkCountryForSsn()
{
    var country = $('#country_id');
    if (country) {
        if (country.attr('value') == 'US') {
            $('#ssn_block').show();
            if ($('#tax_id_or_ssn').attr('value') == 'N/A') {
                $('#tax_id_or_ssn').attr('value', '');
            }
        } else {
            $('#ssn_block').hide();
            $('#tax_id_or_ssn').attr('value', 'N/A');
        }
    }
}

function checkState()
{
    var cId = $('#country_id').val();
    if (cId == 'US' || cId == 'CA') {
        $('#state_div1').show();
        $('#state_div2').hide();
        $('#state_name').val('NA');
    } else {
        $('#state_div1').hide();
        $('#state_div2').show();
        if ($('#state_name').val() == 'NA') {
            $('#state_name').val('');
        }
    }
}

function checkWireState()
{
    var cId = $('#wire_bank_country_id').val();
    if (cId == 'US' || cId == 'CA') {
        $('#wire_state_div1').show();
        $('#wire_state_div2').hide();
        $('#wire_bank_state_name').val('NA');
    } else {
        $('#wire_state_div1').hide();
        $('#wire_state_div2').show();
        if ($('#wire_bank_state_name').val() == 'NA' ) {
            $('#wire_bank_state_name').val('');
        }
    }
}
