/* * Geopay TBC */ function status(n) { $(".logo").addClass("status-logo"), $(".form, .vmc").hide(), $(".heading").addClass("hide-mobile"), n == 0 ? $(".success").show().siblings("section").hide() : n == -500 ? $(".error, .service_error").show().siblings("section").hide() : n == -41 ? ($(".warning").show().siblings("section").hide(), $(".warning .cash_error").show().siblings("span").hide()) : n == -40 ? ($(".warning").show().siblings("section").hide(), $(".warning .number_error").show().siblings("span").hide()) : n == -90 ? ($(".warning").show().siblings("section").hide(), $(".warning .porting_error").show().siblings("span").hide()) : $(".error").show().siblings("section").hide(), $(".back").removeClass("none") } function checkBefore(n, t) { if(n == "reload") window.location = "index.php"; $(".beforeError, .beforeError span").hide(), $("input").removeClass("error"), n == -41 || n == -31 ? ($(".beforeError").show(), $(".beforeError .error41").show(), $(".cash").addClass("error").select()) : n == -40 ? ($(".beforeError").show(), $(".beforeError .error40").show(), $(".phone").addClass("error").focus()) : n == -500 ? ($(".beforeError").show(), $(".ExtraAmount").show(), $(".beforeError .error500").show()): n == -505 ? ($(".beforeError").show(), $(".ExtraAmount").show(), $(".beforeError .error505").show()) : n == -90 ? ($(".beforeError").show(), $(".beforeError .error90").show(), $(".phone").addClass("error").focus()) : n == 21 || n == 22 ? ($(".first_form").hide().siblings("fieldset").fadeIn(), $(".providerID").val(t)) : n == "empty" ? ($(".beforeError").show(), $(".beforeError .empty").show(), $(".phone").val() == "" ? $(".phone").focus() : $(".cash").focus()) : ($(".beforeError").show(), $(".beforeError .uknown").show()), $(".loading").fadeOut(300), $(".check").removeClass("disableA") } typeof String.prototype.trim != "function" && (String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "") }), jQuery(function(n) { function t(n) { var t = RegExp("msie" + (isNaN(n) ? "" : "\\s" + n), "i"); return t.test(navigator.userAgent) } function r(n) { var t = new Date, i; t.setTime(t.getTime() + 2592e6), i = "expires=" + t.toGMTString() + "; path=/", document.cookie = "lang=" + n + "; " + i } function e() { for (var i = "lang=", r = document.cookie.split(";"), n, t = 0; t < r.length; t++) if (n = r[t], n = n.trim(), n.indexOf(i) == 0) return n.substring(i.length, n.length); return "" } function u() { var t = e("lang"); t != "" && (n.each(n("*[data-" + t + "]"), function() { var i = n(this).data(t); $('input[name=Lang]').val(t); n(this).html(i) }), n(".logo").attr("src", n(".logo").data("src-" + t))) } var i, f; n("#Pay").click(function() { n(this).attr("disabled", !0), n("#ProcessUFC").submit() }), n(".phone").mask("599 99-99-99"), (t(10) || t(9) || t(8) || t(7)) && n("body").addClass("ie"), Object.hasOwnProperty.call(window, "ActiveXObject") && !window.ActiveXObject && n("body").addClass("ie"), i = location.hash, i && r(i.split("#")[1]), u(), n(".langs a").click(function() { var t = n(this).data("lang"); r(t), u() }), f = function(n, t, i, r) { var n, u; return n.split(",")[1] && n.replace(",", "."), n = parseFloat(n), isNaN(n) && (n = 1), n ? (n < t ? n = t : n > i && (n = i), n = [Math.round(n * 100) / 100].join(""), u = n.split(".")[1], u ? u.length == 1 ? [n, "0"].join("") : n : [n, ".00"].join("")) : r || "" }, n(".cash").change(function() { var i = f(this.value, .5, 1e3); n(this).val(i) }); n(document).on("keypress", ".change", function() { n(this).change() }); n(".cash").click(function() { n(this).select() }), n(".servicePrice").length != 0 && n(".servicePrice").val() == "0" && (n(".beforeError").show(), n(".beforeError .error500").show()), n(".check").click(function() { var i = n(".phone").val(), t = n(".cash").val(), f = n(".ServiceCodeID").val(), e = n(".servicePrice"), r = e.length > 0 ? e.val() : 0, g = "YW03OTJkNGF1dnF1bWlndGRhNHVnOGxydXE=557f129b8ce83e17971241571c2275c9", u = function() { if (t == "") return parseFloat(r).toFixed(2); var i = (parseFloat(r) + parseFloat(t)).toFixed(2); return n("#TotalPayAmount").val(i), i }; if (n(".ExtraAmount").is(":visible") && f != "") { n(".check_amount").html(u()), n(".first_form").hide().siblings("fieldset").fadeIn(); return } i != "" || t != "" ? (n(this).addClass("disableA"), n("#TotalPayAmount").val(u()), n(".loading").fadeIn(300), n.ajax({ dataType: "json", url: "CheckUser.php", data: { ABCode: i, ServiceCost: r, ServiceId: f, Amount: t, __RequestVerificationToken: g, }, type: "POST" }).done(function(n) { checkBefore(n.statusCode, n.providerTransactionID) })) : checkBefore("empty", ""), n(".check_phone").html(i), n(".check_amount").html(u()), n("input").blur() }), n(".cancel").click(function() { n(this).parents("fieldset").hide().siblings("fieldset").fadeIn() }), n(".change").click(function() { n(".back, .change").addClass("none"), n(".status").hide(), n(".logo").removeClass("status-logo"), n(".form, .vmc").fadeIn(), n(".first_form").show().siblings("fieldset").hide(), n(".heading").removeClass("hide-mobile") }); n(document).on("change keyup", ".phone", function() { n(this).removeClass("error"); var t = n(this).val(); n(".check_phone").html(t) }); n(document).on("change keyup", ".cash", function() { n(this).removeClass("error"); var t = n(this).val(); n(".check_amount").html(t) }); n(document).on("keydown", ".cash, .phone", function(t) { t.keyCode === 13 && (n(".phone").val().length == 0 || n(".phone").val().split("_").length > 1 ? n(".phone").focus() : n(".check").click()), n(".beforeError, .beforeError span").hide() }); FastClick.attach(document.body) })