title: Adding a Variable based on IF Statement Not Working?
body: <p>I have several variables that I then add based on the users input. It works with one exception. The user has an option to pay with cash or a credit/card. If they choose the credit card option a $.50 surcharge is added. The problem is I cannot get the surcharge to add to the amount total. </p>
  
  <p>Here is my code (I've removed the other options and left one to reduce the code.):</p>
  
  <pre><code>$(function() {
  
      var surcharge = parseFloat("0"),
                  dsT = parseFloat("0");
  
      $('input[type=radio][name=CAT_Custom_1657686]').on('ifChecked', function(event){
          if (this.value == 'I will pay with cash at purchase pickup') {
               var surcharge = parseFloat("0");
               amountTotal();
          } else {
               var surcharge = parseFloat(".50");
               amountTotal();
          }
      });
  
  
      $("#CAT_Custom_1657649").change(function (){
          var ds = parseFloat("6.00");
             dsQ = $(this).val(),
             dsT = ds * parseFloat(dsQ);
             amountTotal();
      });
  
  
      function amountTotal() {
          var myTotal = surcharge + dsT;
          $("#Amount").val(myTotal);
          console.log(myTotal);
      } 
  
  
      $('input').iCheck({
          checkboxClass: 'icheckbox_square',
          radioClass: 'iradio_square',
          aria: true
      });
  
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/670ejobz/" rel="nofollow">Here is a fiddle link</a> to working code showing the problem.</p>
  
  <p>As you will see I am using the iCheck to style the radio inputs. I don't believe it is causing the problem.</p>
  
  <p>How do I solve this issue?</p>