//-----------------------------------------------------------------------------
// 10769.js - 10769
// Handle donation form specifics such as giftaid value updating, radio button focussing, etc.
//-----------------------------------------------------------------------------
$(function() {
    $('#other-amount').click(function() {
        $('#other').click();
    });

    $('#other').click(function() {
        $('#other-amount').focus();
    });

    $('#submit-button-1').hover(
        function() {
            $(this).attr('src', 'https://www.savethechildren.org.uk/assets/images/continue-over.gif');
        },
        function() {
            $(this).attr('src', 'https://www.savethechildren.org.uk/assets/images/continue.gif');
        }
    );

    var vars = $.getUrlVars();

    if (vars['Amount'])
    {
        update_giftaid_example($('input[name=inputamount]').val(), 0.282, 10);
    }

    $('input[name=inputamount]').click(function() {
        update_giftaid_example($(this).val(), 0.282, 10);
    });

    $('input[name=inputamount]').keyup(function() {
        update_giftaid_example($(this).val(), 0.282, 10);
    });
});
