(function(b){var c={allowFloat:false,allowNegative:false};b.fn.numericInput=function(e){var f=b.extend({},c,e);var d=f.allowFloat;var g=f.allowNegative;this.keypress(function(j){var i=j.which;var h=b(this).val();if(i>0&&(i<48||i>57)){if(d==true&&i==46){if(g==true&&a(this)==0&&h.charAt(0)=="-"){return false}if(h.match(/[.]/)){return false}}else{if(g==true&&i==45){if(h.charAt(0)=="-"){return false}if(a(this)!=0){return false}}else{if(i==8){return true}else{return false}}}}else{if(i>0&&(i>=48&&i<=57)){if(g==true&&h.charAt(0)=="-"&&a(this)==0){return false}}}});return this};function a(d){if(d.selectionStart){return d.selectionStart}else{if(document.selection){d.focus();var f=document.selection.createRange();if(f==null){return 0}var e=d.createTextRange(),g=e.duplicate();e.moveToBookmark(f.getBookmark());g.setEndPoint("EndToStart",e);return g.text.length}}return 0}}(jQuery));$(document).ready(function(){var amount=0;$('.recharge').click(function() {amount=Number($(this).val());fee_valueEuro=Number($('#JsFeeDisplayEuro').val());if(fee_valueEuro) {totalFee=Number(amount)+fee_valueEuro;} else {fee_value=Number($('#JsFeeDisplay').val());console.log(fee_value);totalFee=(Number(amount)*fee_value).toFixed(2);} ecard=Number(amount);$('#form_coupon').val(amount);$('#total_fee').html("Total avec frais: "+totalFee+"€");$('#ecard').html(""+ecard+"€");});$('#form_coupon').numericInput({allowFloat:false,allowNegative:false});$('#form_coupon').change(function(){var str=$('#form_coupon').val();console.log('je renter ici') var amount=Number(str);fee_valueEuro=Number($('#JsFeeDisplayEuro').val());if(fee_valueEuro) {totalFee=Number(amount)+fee_valueEuro;} else {fee_value=Number($('#JsFeeDisplay').val());totalFee=Number(amount)*fee_value;} if(isNaN(amount)) {$('#Errors').html("

Le montant doit être en chiffres

");$('#total_fee').empty();$('#form_nextStep').prop('disabled',true);$('#form_nextStep').addClass('disabledButton');$('#ToDisable').addClass('disabledButton');$('#ToDisable').prop('disabled',true);} else {if(amount<20||amount>500) {$('#Errors').html("

Le montant doit être compris entre
20 € et 500 €

");$('#total_fee').empty();$('#form_nextStep').prop('disabled',true);$('#form_nextStep').addClass('disabledButton');$('#ToDisable').addClass('disabledButton');$('#ToDisable').prop('disabled',true);} else {$('#Errors').empty();$('#form_nextStep').prop('disabled',false);totalFee=Number(amount)*fee_value;ecard=Number(amount);$('#total_fee').html("Total avec frais: "+totalFee.toFixed(2)+"€");$('#form_nextStep').removeClass('disabledButton');$('#ToDisable').removeClass('disabledButton');$('#ToDisable').prop('disabled',true);}}});$('#CopyText').click(function(e){e.preventDefault();window.prompt('Appuyez sur ctrl / cmd + C pour copier le texte',$(this).prev('#TextS').text());});$('#form_purchaseAllowed_1').click(function(){$(".checkme").removeAttr('checked').attr('disabled');$(".checkme").prop('disabled',true);});$('#form_purchaseAllowed_0').click(function(){$(".checkme").prop('disabled',false);});$('#form_Amount').change(function(){amount=Number($('#form_Amount').val());if(isNaN(amount)){$('#Errors').html("

Le montant doit être en chiffres

");$('#form_PackIDCheck').prop('disabled',true);}else{$('#form_nextStep').prop('disabled',false);}});$('#username').focusin(function(e){e.preventDefault();$('#help a[href="#btabh-2"]').tab('show');});$('.submitForm').change(function(){$("form").submit();});$('.btn-card-order').click(function(){var btn=$(this);btn.button('loading');});if(document.getElementById('tryCoupon').innerHtml==true) {}});function printpage(){window.print();} function fb_parrainage(){var sharer="https://www.facebook.com/sharer/sharer.php?u=";window.open(sharer+"http://www.trans-cash.fr/fr/parrainage.html",'sharer','width=626,height=436');}