$(function() { 
    $("input[name='payment_method']").attr("checked", false);
    $('.payment_method_custom #custom_input').hide();
    $('.payment_method_paymentsense_direct fieldset table').hide();
    $('.brand-text').hide();
    //paymentasenseInputOptionVisibility();
    /*$('.payment_method_paymentsense_direct .payment_box').hide();
    $('.payment_method_custom #custom_input').hide();
    $('#custom_input').css('display','none');*/

    $('#make').change(function() {
        if(this.value=="Other")
            $('.brand-text').show();
    });

    $('.post-type-archive-product .box a').text('Get an Instant <br> Quote');
     // paymentasenseInputOptionVisibility(1);
    changeinputcustom();
});

function changeinputcustom()
{
    $('#payment_method_paymentsense_direct').change(function() {
        paymentasenseInputOptionVisibility();
    });
    $('#payment_method_gocardless').change(function() {
        paymentasenseInputOptionVisibility();
    });
    $('#payment_method_custom').change(function() {
        paymentasenseInputOptionVisibility();
    });
}

function paymentasenseInputOptionVisibility(){
    if($('#payment_method_paymentsense_direct').is(':checked')) { 
        $('.payment_method_paymentsense_direct .payment_box').show();
        $('.payment_method_custom #custom_input').hide();
        $('.payment_method_paymentsense_direct fieldset table').show();
    }
    else{
        $('.payment_method_paymentsense_direct .payment_box').hide();
        $('.payment_method_custom #custom_input').show();
    }
}