- document.getElementById('payment_amount_row').style.display = 'none';
- document.getElementById('invoice_row').style.display = 'block';
- document.getElementById('amount').value = '';
+ $('#payment_amount_row').hide();
+ $('#invoice_row').show();
+ $('#apply_box_row').hide();
+ $('#apply_box').val('yes');
+ $("#<% $opt{prefix} %>payment_option option[value='select']").remove();
+ var selectExists = ($("#<% $opt{prefix} %>invoice option[value='select']").length > 0);
+ if(!selectExists) {
+ $("#<% $opt{prefix} %>invoice").prepend("<option value='select'>Select an invoice to pay</option>");
+ $("#<% $opt{prefix} %>invoice").val($('option:first', "#<% $opt{prefix} %>invoice").val());
+ }
+ $('#amount').val('');
+ }
+ else if ( what.value == 'specific' ) {
+ $('#payment_amount_row').show();
+ $('#invoice_row').hide();
+ $('#apply_box_row').show();
+ $("#<% $opt{prefix} %>payment_option option[value='select']").remove();
+ $('#amount').val('0.00');
+ document.getElementById('amount').disabled = false;
+ if (document.getElementById('ajax_surcharge_cell')) {
+ document.getElementById('ajax_surcharge_cell').innerHTML = '<FONT SIZE="+1">A credit card surcharge of <% $money_char %>0.00 is included in this payment</FONT>';
+ }