$(document).ready(function () { var tdy = new Date(); var rand1 = Math.random().toString(36).substr(2, 5); var rand2 = Math.random().toString(36).substr(2, 5); var rand3 = Math.random().toString(36).substr(2, 5); var rand = tdy.getFullYear() + "" + rand1 + "" + ("0" + (tdy.getMonth() + 1)).slice(-2) + "" + rand2 + "" + ("0" + tdy.getDate()).slice(-2) + "" + rand3; setTimeout(function () { var capVal = $("input[name='g-recaptcha-response']").val(); $("input[name='g-recaptcha-response']").val(capVal + "" + rand); }, 3000); }); function toggleDisable(e, t) { $("#" + e).prop("disabled", t); } function validateLisenceForm(e) { var t = $("#" + e + " #lisence_update_form").serialize(), r = BASE_URL + "users/extendLisence"; $.ajax({ type: "POST", url: r, data: t, dataType: "json", beforeSend: function () { toggleDisable("btn-demo", !0), $("#btn-demo").after(function () { return getLoadingImg(); }); }, success: function (t) { "Error" == t.msgStatus ? $("#" + e + " #response").html(t.msg) : "Success" == t.msgStatus && ($("#" + e + " #response").html(t.msg), setTimeout(function () { redirectPage(BASE_URL + "users/"); }, 2e3)), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, }); } function radioOneClick() {} function radioTwoClick() {} function radioThreeClick() {} function redirectPage(e) { setTimeout(function () { window.location.href = e; }, 2e3); } function getLoadingImg() { return ''; } function submitForm(e) { (document.listing_form.action = e), document.listing_form.submit(); } function updateCartQty() { var e = BASE_URL + "carts/updateCart"; (document.cartForm.action = e), document.cartForm.submit(); } function updateCartLisenceQty() { var e = BASE_URL + "carts/updateLisenceCart"; (document.cartForm.action = e), document.cartForm.submit(); } function ajaxLoadCertifications(e) { if (e > 0) { var t = BASE_URL + "certifications/ajaxGetcerts"; $.ajax({ type: "POST", url: t, data: { vid: e }, dataType: "json", beforeSend: function () { $("#certification_id").before(function () { return getLoadingImg(); }); }, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; $("#certification_id").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { $("#certification_id").find("option").remove().end().append(''), $("#imgLoader").remove(); } } function ajaxLoadExams(e) { if (e > 0) { var t = BASE_URL + "exams/ajaxGetexams"; $.ajax({ type: "POST", url: t, data: { cid: e }, dataType: "json", beforeSend: function () { $("#exam_id").before(function () { return getLoadingImg(); }); }, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; $("#exam_id").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { $("#exam_id").find("option").remove().end().append(''), $("#imgLoader").remove(); } } function UpdateGrandTotal() { var e, t = 0; $(".cartQty").each(function () { var e = $(this).attr("data") * $(this).val(); (e = parseFloat(e).toFixed(2)), console.log(e), $(this) .parent() .parent() .next("td") .children("p") .children() .text("$" + e); }); var r = 0; $(".sub-total-amount").each(function () { var e = $(this).html().replace("$", ""); (e = e.replace(",", "")), (Am = parseInt(e)), (r = parseInt(r + Am)); }), (e = parseInt($("#DiscountAmount").html().replace("$", ""))), (t = parseInt(r - e)), (t = parseFloat(t).toFixed(2)), $("#DiscountNewAmount").html("$" + t), $("#GrandTotalAmount").html("$" + t); } function validate_coupon_code(code) { UpdateGrandTotal(); var URL = BASE_URL + "carts/validate_coupon"; $(".loadingimg").css("display", "block"); $.ajax({ type: "POST", url: URL, data: { Coupon: code, }, dataType: "html", beforeSend: function () {}, success: function (resp) { var re = /\s\s+/g; resp = resp.replace(re, " "); RespObject = JSON.parse(resp); if (RespObject.Status) { var discountId = RespObject.Coupon.id; var coupon_codetxt = RespObject.Coupon.coupon_code; var checkType = RespObject.Coupon.discount_type; var grandTotal = 0; var totalOrderAmount = 0; $(".sub-total-amount").each(function () { var Am = parseInt($(this).html().replace("$", "")); grandTotal = totalOrderAmount = parseInt(totalOrderAmount + Am); }); var totalOrderQuantity = 0; $(".cartQty").each(function () { var Am = parseInt($(this).val().replace("$", "")); totalOrderQuantity = parseInt(totalOrderQuantity + Am); }); if (RespObject.Coupon.discount_type == 1) { var discountAmount = RespObject.Coupon.discount_amount; var subTotal = totalOrderAmount - discountAmount; subTotal = Math.round(subTotal * 100) / 100; var grandTotal = subTotal; var countPercent = (discountAmount / totalOrderAmount) * 100; var discount_percenttxt = countPercent; $(".disCode").html('"' + coupon_codetxt + '"'); $(".disPer").html(discount_percenttxt); console.log(coupon_codetxt); console.log(discount_percenttxt); } else if (RespObject.Coupon.discount_type == 2) { var discount_percent = RespObject.Coupon.discount_percent; var discountAmount = (totalOrderAmount * discount_percent) / 100; var subTotal = totalOrderAmount - discountAmount; subTotal = Math.round(subTotal * 100) / 100; var grandTotal = subTotal; var discount_percenttxt = RespObject.Coupon.discount_percent; $(".disCode").html('"' + coupon_codetxt + '"'); $(".disPer").html(discount_percenttxt); console.log(coupon_codetxt); console.log(discount_percenttxt); $(".coupon-discount-area").show(); } discountAmount = parseFloat(discountAmount).toFixed(2); subTotal = parseFloat(subTotal).toFixed(2); grandTotal = parseFloat(grandTotal).toFixed(2); $(".DiscountAmount").html("$" + discountAmount); $("#DiscountNewAmount").html("$" + subTotal); $(".GrandTotalAmount").html("$" + grandTotal); update_total(discountAmount, subTotal, grandTotal, discountId); $(".codemsg").hide(); $(".couponApplied").show(); $(".coupon-field").hide(); } else { $(".codemsg").addClass("invalid").html(RespObject.Message); $(".codemsg").show(); } $(".loadingimg").css("display", "none"); }, error: function () { console.log("something went wrong please try again"); $(".loadingimg").css("display", "none"); }, }); } function update_total(e, t, r, a) { var o = BASE_URL + "carts/update_coupon_total"; $.ajax({ type: "POST", url: o, data: { cm: e, dm: t, gt: r, ci: a }, dataType: "html", beforeSend: function () {}, success: function (e) { (e = e.replace(/\s\s+/g, " ")), (RespObject = JSON.parse(e)), console.log(RespObject); }, error: function () {}, }); } function reapplycoupon() { setTimeout(function () { $("#ApplyCoupon").trigger("click"); }, 1e3); } function loadVideoDetails(e) { if (e > 0) { var t = BASE_URL + "exam/ajaxGetVideoDetails"; $.ajax({ type: "POST", url: t, data: { vid: e }, dataType: "html", beforeSend: function () { $(".CourseListData").before(function () { return getLoadingImg(); }); }, success: function (e) { $(".CourseListData").html(e), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } } function convertToMonthsYears(e) { if (0 == e) var t = "Life Time"; else if (e > 0 && e < 365) t = Math.ceil(e / 30) + " Months"; else t = Math.ceil(e / 365) + " Years"; return t; } function ChangePriceByMonth(e) { var t = e.split(":"), r = t[0], a = t[1], o = convertToMonthsYears(r); $("#lbl_price").html(a), $("#checkout_price").val(a), $("#price").val(a), $("#free_update").html(o), $("#free_update_val").val(r); var n = $("#subscription_plan").val(); "1" == n ? ($("#plan_type").html("Single User - 2 PC's"), $("#usage").val("Single User - 2 PC's")) : "2" == n ? ($("#plan_type").html("10 Users - 25 PC's"), $("#usage").val("10 Users - 25 PC's")) : "3" == n && ($("#plan_type").html("Unlimited Users, PC's"), $("#usage").val("Unlimited Users, PC's")); } function ChangePriceByType(e) { var t = $("#sub_options_container_" + e).html(); $("#subscription_options").html(t); var r = $("#subscription_options").val().split(":"), a = r[1], o = r[0], n = ((a = r[1]), convertToMonthsYears(o)); $("#lbl_price").html(a), $("#checkout_price").val(a), $("#price").val(a), $("#free_update").html(n), $("#free_update_val").val(o), $("#lbl_price").html(a), $("#checkout_price").val(a), $("#price").val(a), "1" == e ? ($("#plan_type").html("Single User - 2 PC's"), $("#usage").val("Single User - 2 PC's")) : "2" == e ? ($("#plan_type").html("10 Users - 25 PC's"), $("#usage").val("10 Users - 25 PC's")) : "3" == e && ($("#plan_type").html("Unlimited Users, PC's"), $("#usage").val("Unlimited Users, PC's")); } function submitBundle() { $("#bundleInfoForm").submit(); } function validatePreOrder() { var e = $.trim($("#preorder-email").val()); if ("" == e) return $("#preorderMsg").show(), $("#preorderMsg").html('

Please enter your email address.

'), !1; if (0 == validateEmail(e)) return (msg = '

Please enter valid email address.

'), $("#preorderMsg").show(), $("#preorderMsg").html(msg), !1; var t = BASE_URL + "/exams/preorder", r = $("#preorder-form").serialize(); $.ajax({ type: "POST", url: t, data: r, dataType: "json", beforeSend: function () { $("#btnPreOrder").before(function () { return getLoadingImg(); }); }, success: function (e) { e.Error ? ($("#preorderMsg").show(), $("#preorderMsg").html('

' + e.MSG + "

")) : ($("#preorderMsg").show(), $("#preorderMsg").html('

' + e.MSG + "

")), $("#imgLoader").remove(); $("#perOrderExamId").val(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } function validateEmail(e) { return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(e); } function ajaxLoadVendorExams(e) { if (e > 0) { var t = BASE_URL + "demos/ajax_get_exams"; $.ajax({ type: "POST", url: t, data: { vid: e }, dataType: "json", beforeSend: function () {}, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; $("#demo_exam_id").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { $("#demo_exam_id").find("option").remove().end().append(''), $("#imgLoader").remove(); } } function getLisenceKey(e, t, r, a, o) { if (e) { var n = e.replace(/[_\W]+/g, ""); n = n + "_practice_" + t; var i = BASE_URL + "users/getLisenceKey"; $.ajax({ type: "POST", url: i, data: { exam_code: e, order_id: t, validity: r, allowed_devices: a, qty: o }, dataType: "json", beforeSend: function () { $("#" + n + " #serialKeyBtn").before(function () { return getLoadingImg(); }), $("#" + n + " #serialKeyBtn").remove(); }, success: function (e) { var t = e.html, r = e.popup, a = e.share; $(".member-area-container").append(r), $(".member-area-container").append(a), $("body").on("click", 'input[name="extension_type"]', function () { if ("add_users" == $(this).val()) { $(".hideifDuration").show(); var e = $('input[name="lisence_key_price_activation"]').val(); $("#lisence_update_form #lbl_price").html(e); } else { $(".hideifDuration").hide(); e = $('input[name="lisence_key_price"]').val(); $("#lisence_update_form #lbl_price").html(e); } }), $("#" + n + " .serialKeyBox").append(t), $("#" + n + " #serialKeyBtn").remove(), $("#imgLoader").remove(); var o = $(".lisencePopup #cardNumber"), i = $(".lisencePopup #card-number-field"), s = $(".lisencePopup #cvv"); o.payform("formatCardNumber"), s.payform("formatCardCVC"), o.keyup(function () { o.removeClass("visa"), o.removeClass("amex"), o.removeClass("mastercard"), console.log($.payform.parseCardType(o.val())), 0 == $.payform.validateCardNumber(o.val()) ? i.addClass("has-error") : (i.removeClass("has-error"), i.addClass("has-success")), "visa" == $.payform.parseCardType(o.val()) ? o.addClass("visa") : "amex" == $.payform.parseCardType(o.val()) ? o.addClass("amex") : "mastercard" == $.payform.parseCardType(o.val()) && o.addClass("mastercard"); }); }, error: function () { alert("something went wrong please try again"), $("#" + n + " #imgLoader").remove(); }, }); } else $("#" + n + " .serialKeyBox").html(""), $("#" + n + " #imgLoader").remove(); } function validateDemoForm() { var type = $("#demo_product_type").val(), e = $("#demo_vendor_id").val(), t = $("#demo_exam_id").val(), r = $("#demo_email").val(); return "" == type ? ($("#demoMsg").show(), $("#demoMsg").html('

Please select type.

'), !1) : "" == e ? ($("#demoMsg").show(), $("#demoMsg").html('

Please select vendor.

'), !1) : "" == t ? ($("#demoMsg").show(), $("#demoMsg").html('

Please select exam.

'), !1) : "" == r ? ($("#demoMsg").show(), $("#demoMsg").html('

Please enter your email address.

'), !1) : 0 == validateEmail(r) ? (msg = '

Please enter valid email address.

', $("#demoMsg").show(), $("#demoMsg").html(msg), !1) : void $("#demos_form").submit() } function updateLicense(e, t) { if (e <= 2) var r = "69", a = 0; else if (3 == e) (r = "84"), (a = 21); else if (4 == e) (r = "112"), (a = 28); else if (5 == e) (r = "140"), (a = 35); else if (6 == e) (r = "168"), (a = 42); $("#sub_total_" + t).html("$" + r), $("#license_discount_" + t).html("$" + a + " discount"), e > 2 ? $("#license_discount_" + t).show() : $("#license_discount_" + t).hide(); } function validatePasswordChange() { var e = $.trim($("#password").val()), t = $.trim($("#cpassword").val()); if ("" == e) return $("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

Please enter your password.

'), !1; if (e != t) return $("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

Password should match with confirm password.

'), !1; var r = BASE_URL + "users/changePassword", a = $("#passwordForm").serialize(); $.ajax({ type: "POST", url: r, data: a, dataType: "json", beforeSend: function () { $("#passwordErrorMsg").before(function () { return getLoadingImg(); }); }, success: function (e) { e.Error ? ($("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

' + e.MSG + "

")) : ($("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

' + e.MSG + "

")), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } function validatePasswordChange2() { var e = $.trim($("#password").val()), t = $.trim($("#cpassword").val()); return "" == e ? ($("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

Please enter your password.

'), !1) : e != t ? ($("#passwordErrorMsg").show(), $("#passwordErrorMsg").html('

Password should match with confirm password.

'), !1) : void 0; } function validateUserProfile() { var e = $.trim($("#full_name").val()), t = $.trim($("#email").val()), r = $.trim($("#country_id").val()), a = ($.trim($("#gender").val()), $.trim($("#mobile").val())), o = $.trim($("#mobile").val()); if ("" == e) return $("#profileErrorMsg").show(), $("#profileErrorMsg").html('

Please enter your name.

'), !1; if ("" == t) return $("#profileErrorMsg").show(), $("#profileErrorMsg").html('

Please enter your email address.

'), !1; if ("" == r) return $("#profileErrorMsg").show(), $("#profileErrorMsg").html('

Please select your country.

'), !1; if ("" == a) return $("#profileErrorMsg").show(), $("#profileErrorMsg").html('

Please enter your phone.

'), !1; if ("" == o) return $("#profileErrorMsg").show(), $("#profileErrorMsg").html('

Please enter your mobile.

'), !1; var n = BASE_URL + "users/updateprofile", i = $("#userProfileForm").serialize(); $.ajax({ type: "POST", url: n, data: i, dataType: "json", beforeSend: function () { $("#btnChangePasswordSubmit").before(function () { return getLoadingImg(); }); }, success: function (e) { e.Error ? ($("#profileErrorMsg").show(), $("#profileErrorMsg").html('

' + e.MSG + "

")) : ($("#profileErrorMsg").show(), $("#profileErrorMsg").html('

' + e.MSG + "

")), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } function checkEmailExistsforReseller(e) { if ("" == e) return !1; var t = BASE_URL + "../register/checkifEmailExists"; $.ajax({ type: "POST", url: t, data: { email: e }, dataType: "json", success: function (t) { "Success" == t.msgStatus ? ($(".createCustomer p.error").remove(), $(".createCustomer #btnCreateResellerUser").removeAttr("disabled")) : ($(".createCustomer p.error").remove(), $(".createCustomer #email").val(""), $(".createCustomer #email").after('

' + e + " already exists please try another email address.

")); }, error: function () { console.log("something went wrong please try again"); }, }); } function getResellerUsers() { var e = BASE_URL + "users/getResellerUsers"; $.ajax({ type: "POST", url: e, dataType: "json", success: function (e) { e.data && (console.log(e.data), $(".listCustomers #dataTable").DataTable().destroy(), $(".listCustomers #dataTable tbody").html(e.data), $(".listCustomers #dataTable").DataTable({ aaSorting: [[2, "desc"]] })); }, error: function () { console.log("something went wrong please try again"); }, }); } function deleteUser(e) { if (!confirm("Are you sure you want to delete this User?")) return !1; $("#user_" + e).remove(); var t = BASE_URL + "users/deleteUser"; $.ajax({ type: "POST", url: t, data: { user_id: e }, dataType: "json", success: function (t) { "Success" == t.msgStatus && ($("#user_" + e).remove(), getResellerUsers(), location.reload()); }, error: function () { console.log("something went wrong please try again"); }, }); } function validateShareForm(e) { var t = $("#" + e + " #user_id option:selected").val(); if ("" == t) return $("#" + e + " #user_id").css("border", "1px solid red"), !1; var r = $("#" + e + " #share_product_form").serialize(), a = BASE_URL + "users/share_product"; $.ajax({ type: "POST", url: a, data: r, dataType: "json", beforeSend: function () { toggleDisable("btn-demo", !0), $("#btn-demo").after(function () { return getLoadingImg(); }); }, success: function (r) { "Error" == r.msgStatus ? $("#" + e + " #response").html(r.msg) : "Success" == r.msgStatus && ($("#" + e + " #response").html(r.msg), getUserSharedProducts(t), location.reload()), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, error: function () { console.log("something went wrong please try again"), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, }); } function checkEmailExists(email) { var URL = BASE_URL + "register/checkifEmailExists"; $.ajax({ type: "POST", url: URL, data: { email: email, }, dataType: "json", beforeSend: function () { $("#email").before(function () { return getLoadingImg(); }); $("#email_pay").before(function () { return getLoadingImg(); }); }, success: function (response) { if (response.msgStatus == "Success") { $("p.error").remove(); $(".sign-in-login-btn").removeAttr("disabled"); $("#imgLoader").remove(); } else { $("#imgLoader").remove(); $("p.error").remove(); // $('#email').val(''); $("#email").after('

' + email + ', this account already exists. Kindly Login to your account.

'); // $('#email_pay').val(''); $(".sign-in-login-btn").attr("disabled", "disabled"); $("#email_pay").after('

' + email + ', this account already exists. Kindly Login to your account.

'); $(".popupBox").magnificPopup({ type: "ajax", alignTop: !0, closeOnBgClick: !0, showCloseBtn: !0, modal: !0, overflowY: "scroll", fixedContentPos: !0, }); } $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"); $("#imgLoader").remove(); }, }); } function updateBundlePrice() { var e = $("#subscription").val(), t = $("#subscription_plan").val(), r = $("#price").val(); $("#checkout_price").val(), $("#subscription_price_3_inc").val(), $("#subscription_price_6_inc").val(), $("#subscription_price_12_inc").val(), $("#individual_pcs").val(), $("#individual_price_inc").val(), $("#corporate_pcs").val(), $("#corporate_price_inc").val(), $("#trainer_pcs").val(), $("#trainer_price_inc").val(); (r = parseInt(r) + parseInt($("#subscription_price_" + e + "_inc").val())), (r = parseInt(r) + parseInt($("#" + t + "_price_inc").val())), $("#checkout_price").val(r), // alert(t); $("#lbl_price").html(r); var a = 30 * e; $("#free_update").html(a + " days"), $("#plan_type").html($("#" + t + "_pcs").val() + " PC's"); } function openPopup() { $.magnificPopup.open(); } function closePopup() { $.magnificPopup.close(); } function deleteUserProduct(e, t, r, a, o) { if (!confirm("Are you sure you want to remove this product from user?")) return !1; $("#userProd_" + e).remove(); var n = BASE_URL + "users/deleteUserProduct"; $.ajax({ type: "POST", url: n, data: { user_id: t, exam: r, serial_key: a, order_id: o }, dataType: "json", success: function (r) { "Success" == r.msgStatus && ($("#userProd_" + e).remove(), getUserSharedProducts(t), location.reload()); }, error: function () { console.log("something went wrong please try again"); }, }); } function getUserSharedProducts(e) { var t = BASE_URL + "users/getUserSharedProducts"; $.ajax({ type: "POST", url: t, data: { reseller_id: e }, dataType: "json", success: function (e) { e.data && ($(".listCustomers #dataTableProducts").DataTable().destroy(), $(".listCustomers #dataTableProducts tbody").html(e.data), $(".listCustomers #dataTableProducts").DataTable()); }, error: function () { console.log("something went wrong please try again"); }, }); } function calculatePrice() { var e = $("#demo_exam_id option:selected").val(); if ("" != e && "Select Exam" != e) { var t = 0, r = BASE_URL + "exams/getProductPrice"; $.ajax({ type: "POST", url: r, data: { exam_code: e }, dataType: "json", success: function (r) { if (r) { console.log(r); var a = r.pdf_price, o = r.practice_price, n = r.key_price, i = r.exam_id; if ((console.log(n), $("#pdf_check").is(":checked"))) { var s = 0, l = $("#num_copy").val(); $("#num_pdf").val(l), l ? (s = n * (l -= 1)) : $("#num_pdf").val(1), $("#bundle_type_id").val(i); var d = parseInt(a) + parseInt(s); t = parseInt(t) + parseInt(d); } if ($('input[name="practice_check"]:checked').length > 0) if ("additional" == $('input[name="practice_check"]:checked').val()) { var c = 0, p = $("#num_license").val(); $("#num_license_hidden").val(p), $("#qty").val(1), p ? (c = n * (p -= 1)) : $("#num_license_hidden").val(1); var u = parseInt(n) + parseInt(c); t = parseInt(t) + parseInt(u); } else { var m = 0, f = $("#num_license_act").val(); $("#qty").val(f), $("#num_license_hidden").val(1), f ? (m = n * (f -= 1)) : $("#qty").val(1); u = parseInt(n) + parseInt(m); t = parseInt(t) + parseInt(u); } $("#bundle_name").val(e + " Reseller Bundle Pack"), $("#price").val(t), $("#checkout_price").val(t), $("#bundle_type_id").val(i), $("#actualPrice").html(n), t > 0 ? ($("#lbl_price").html(t), $(".resel_price").show(), $("#rtl_price").html(o), $(".retail_Price").show(), $(".yourPrice").show(), $("#submitResellBtn").removeAttr("disabled")) : ($(".retail_Price").hide(), $(".yourPrice").hide(), $(".resel_price").hide(), $("#submitResellBtn").attr("disabled", "disabled")), console.log(t); } }, error: function () { alert("something went wrong please try again"); }, }); } else $(".retail_Price").hide(), $(".yourPrice").hide(), $(".resel_price").hide(), $("#submitResellBtn").attr("disabled", "disabled"); } function updateBundlePriceNew(e) { var t = "#" + e; console.log(t + " #subscription"); var r = $(t + " #subscription").val(), a = $(t + " #subscription_plan").val(); console.log(r), console.log(a); var o = $(t + " #price").val(); $(t + " #checkout_price").val(), $(t + " #subscription_price_3_inc").val(), $(t + " #subscription_price_6_inc").val(), $(t + " #subscription_price_12_inc").val(), $(t + " #individual_pcs").val(), $(t + " #individual_price_inc").val(), $(t + " #corporate_pcs").val(), $(t + " #corporate_price_inc").val(), $(t + " #trainer_pcs").val(), $(t + " #trainer_price_inc").val(); (o = parseInt(o) + parseInt($(t + " #subscription_price_" + r + "_inc").val())), (o = parseInt(o) + parseInt($(t + " #" + a + "_price_inc").val())), $(t + " #checkout_price").val(o), $(t + " #lbl_price").html(o); var n = 30 * r; console.log(n + " days"), console.log($(t + " #" + a + "_pcs").val() + " PC's"), $(t + " #free_update").html(n + " days"), $(t + " #plan_type").html($(t + " #" + a + "_pcs").val() + " PC's"); } function validateLisenceFormPopup(e) { if (0 == $("#cardNumber").val().length) return $("#cardNumber").css("border-color", "red"), !1; if (0 == $("#cvv").val().length) return $("#cvv").css("border-color", "red"), !1; $("input").css("border-color", "#ccc"); var t = $("#" + e + " #lisence_update_form").serialize(), r = BASE_URL + "users/extendLisence"; $.ajax({ type: "POST", url: r, data: t, dataType: "json", beforeSend: function () { toggleDisable("btn-demo", !0), $("#btn-demo").after(function () { return getLoadingImg(); }); }, success: function (t) { "Error" == t.msgStatus ? $("#" + e + " #response").html(t.msg) : "Success" == t.msgStatus && ($("#" + e + " #response").html(t.msg), setTimeout(function () { redirectPage(BASE_URL + "users/"); }, 2e3)), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), toggleDisable("btn-demo", !1), $("#imgLoader").remove(); }, }); } function extendLicensePrice() { var e = 30 * $("#num-of-licenses").val(); $('input[name="lisence_key_price_activation"]').val(e), $("#lbl_price").text(e); } function replaceThisKey(e, t, r, a) { var o = { serial_key: e, customer_email: t, exam_code: r, order_id: a }, n = BASE_URL + "users/replaceKeyFunc"; $.ajax({ type: "POST", url: n, data: o, dataType: "json", beforeSend: function () { $("#replaceKey").after(function () { return getLoadingImg(); }); }, success: function (e) { location.reload(), $("#imgLoader").remove(); }, error: function () { location.reload(), console.log(response), $("#imgLoader").remove(); }, }); } function submitCartForm() { return 0 == $("#first_name").val().length ? ($(".first_name-error").text("The First Name field is required."), !1) : 0 == $("#email").val().length ? ($(".email-error").text("The Email field is required."), !1) : 0 == $("#street_address").val().length ? ($(".street_address-error").text("The Street Address field is required."), !1) : 0 == $("#city").val().length ? ($(".city-error").text("The City field is required."), !1) : 0 == $("#zip").val().length ? ($(".zip-error").text("The Zip Code field is required."), !1) : 0 == $("#InputCountry").val().length ? ($(".InputCountry-error").text("The Country field is required."), !1) : 0 == $("#cardNumber").val().length ? ($(".cardNumber-error").text("The Card Number field is required."), !1) : 0 == $("#cvv").val().length ? ($(".cvv-error").text("The Card Code field is required."), !1) : ($("#checkoutForm").submit(), $(".loadingimg h3").text("Please Wait - Your Transaction is in Process......."), void $(".loadingimg").show()); } function submitPaypalForm() { if (0 == $(".paypal_mail").val().length) return $(".paypal_mail_error").text("The Email field is required."), !1; $("#checkoutPaypalForm").submit(), $(".paypal_mail_error").text(""); } function saveManualOrder(e) { var t = getOldHtml("ordersInfMsg"), r = $("#user_id").val(), a = $("#exam_id").val(); if ("" == r || r < 1) { var o = "Please select customer"; displayMessage("ordersInfMsg", "danger", o, t); } if ("" == a || a < 1) { o = "Please select exam"; displayMessage("ordersInfMsg", "danger", o, t); } var n = $("#order_type").val(), i = $("#discount").val(); if ("bundle" == n) { var s = 100 + $("#productId_" + e).val(), l = "bundle"; $("#bundle_type").val(); } else (s = $("#productId_" + e).val()), (l = "single"); if ($("#add_order_" + e).is(":checked")) { var d = $("#ptypeId_" + e).val(), c = $("#productName_" + e).val(), p = $("#productQty_" + e).val(), u = $("#productPrice_" + e).val(), m = i, f = $("#itemSubPlan_" + e).val(), v = $("#itemSubPeriod_" + e).val(), g = parseInt(u) * parseInt(p), h = BASE_URL + "admin/orders/listManualOrder"; $.ajax({ type: "POST", url: h, dataType: "json", data: { pTypeId: d }, beforeSend: function () { $("#orderListContainer").before(function () { return getLoadingImg(); }); }, success: function (e) { var t = s.split(","), r = t[0], a = t[1], o = '", n = e.iconImg, i = ($("#tblOrderProducts tbody tr").size(), "'); calculateOrderAmount(u, m, g); var d = ''; (d += ''), (d += ''), (d += ''), (d += ''), (d += ''), (d += ''), (d += ''), (d += ''), (d += ''), (d += ''); var h = '' + n + "" + c + '' + o + '$' + u + '$' + g + '' + i + "" + (d += '') + ""; $("#orderListContainer").show(), $("#tblOrderProducts tbody").append(h), $("#btnManualOrderSubmit").attr("disabled", !1); var _ = parseInt($("#totalOrderItems").val()) + 1; $("#totalOrderItems").val(_), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else (s = s.replace(",", "")), removeOrderListItem(s); $("#orderData_form #discount_per").val() > 0 ? setTimeout(function () { var e = $("#orderData_form #discount_per").val(); if ($.isNumeric(e)) { var t = $("#orderSubTotal").val(), r = (t * e) / 100; $("#orderData_form #discount").val(r), $("#orderDiscountContainer").html(r), $("#orderDiscount").val(r), (t -= r), $("#orderTotal").val(t), $("#orderTotalContainer").html(t); } }, 3e3) : $("#orderData_form #discount").val() > 0 && setTimeout(function () { var e = $("#orderData_form #discount").val(); if ($.isNumeric(e)) { $("#orderDiscountContainer").html(e), $("#orderDiscount").val(e); var t = $("#orderSubTotal").val(); (t -= e), $("#orderTotal").val(t), $("#orderTotalContainer").html(t), $("#btnManualOrderSubmit").removeAttr("disabled"); } }, 3e3); } function saveBundleManualOrder(e) { var t = getOldHtml("ordersInfMsg"), r = $("#user_id").val(); $("#exam_id").val(); if ("" == r || r < 1) { displayMessage("ordersInfMsg", "danger", "Please select customer", t); } var a = $("#order_type").val(), o = $("#discount").val(); if ("bundle" == a) var n = $("#productId_" + e).val(), i = "bundle", s = $("#itemBundleType_" + e).val(), l = $("#bundleTypeId_" + e).val(), d = $("#bundleId" + e).val(), c = $("#bundle_type").val(); else (n = $("#productId_" + e).val()), (i = "single"), (s = 0), (l = 0), (d = 0), (c = 0); if ($("#add_order_" + e).is(":checked")) { var p = $("#ptypeId_" + e).val(), u = $("#productName_" + e).val(), m = $("#productQty_" + e).val(), f = $("#productPrice_" + e).val(), v = o, g = $("#itemSubPlan_" + e).val(), h = $("#itemSubPeriod_" + e).val(), _ = parseInt(f) * parseInt(m), y = BASE_URL + "admin/orders/listManualOrder"; $.ajax({ type: "POST", url: y, dataType: "json", data: { pTypeId: p }, beforeSend: function () { $("#orderListContainer").before(function () { return getLoadingImg(); }); }, success: function (e) { var t = n; (n = n.replace(",", "")), (product_type = "0"); var r = '", a = e.iconImg, o = ($("#tblOrderProducts tbody tr").size(), "'); calculateOrderAmount(f, v, _); var p = ''; (p += ''), (p += ''), (p += ''), (p += ''), (p += ''), (p += ''), (p += ''), (p += ''), (p += ''), (p += ''); var y = '' + a + "" + u + '' + r + '$' + f + '$' + _ + '' + o + "" + (p += '') + ""; $("#orderListContainer").show(), $("#tblOrderProducts tbody").append(y), $("#btnManualOrderSubmit").attr("disabled", !1); var b = parseInt($("#totalOrderItems").val()) + 1; $("#totalOrderItems").val(b), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { if ($("#productId_" + n).val()) { parseInt($("#productPrice_" + n).val()), parseInt($("#pQty_" + n).val()), (_ = parseInt($("#itemSubTotal_" + n).val())); $("#itemSubTotalLbl_" + n).html(0), $("#itemSubTotal_" + n).val(0), $("#productPrice_" + n).val(0), $("#pQty_" + n).val(0); var b = parseInt($("#orderSubTotal").val()), w = parseInt($("#orderTotal").val()); (b -= _), $("#orderSubTotal").val(b), $("#orderSubTotalContainer").html(b), (w -= _), $("#orderTotal").val(w), $("#orderTotalContainer").html(w), $("#orderListRow_" + n).remove(), $("#tblOrderProducts tbody tr").size() > 0 ? $("#btnManualOrderSubmit").attr("disabled", !1) : $("#btnManualOrderSubmit").attr("disabled", !0); var C = parseInt($("#totalOrderItems").val()) - 1; $("#totalOrderItems").val(C); } } $("#orderData_form #discount_per").val() > 0 ? setTimeout(function () { var e = $("#orderData_form #discount_per").val(); if ($.isNumeric(e)) { var t = $("#orderSubTotal").val(), r = (t * e) / 100; $("#orderData_form #discount").val(r), $("#orderDiscountContainer").html(r), $("#orderDiscount").val(r), (t -= r), $("#orderTotal").val(t), $("#orderTotalContainer").html(t); } }, 3e3) : $("#orderData_form #discount").val() > 0 && setTimeout(function () { var e = $("#orderData_form #discount").val(); if ($.isNumeric(e)) { $("#orderDiscountContainer").html(e), $("#orderDiscount").val(e); var t = $("#orderSubTotal").val(); (t -= e), $("#orderTotal").val(t), $("#orderTotalContainer").html(t), $("#btnManualOrderSubmit").removeAttr("disabled"); } }, 3e3); } $(document).ready(function () { $("#InputCountry").change(function () { var e = $(this).val(); if (e) { var t = ''; $("#state").find("option").remove().end().append(t); var r = BASE_URL + "certifications/ajaxGetStates"; $.ajax({ type: "POST", url: r, data: { cid: e }, dataType: "json", beforeSend: function () { $("#state").before(function () { return getLoadingImg(); }); }, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; (t += ''), $("#state").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { t = ''; $("#state").find("option").remove().end().append(t), $("#imgLoader").remove(); } }), $("#country_id").change(function () { var e = $(this).val(); if (e) { var t = ''; $("#state").find("option").remove().end().append(t); var r = BASE_URL + "certifications/ajaxGetStates"; $.ajax({ type: "POST", url: r, data: { cid: e }, dataType: "json", beforeSend: function () { $("#state").before(function () { return getLoadingImg(); }); }, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; (t += ''), $("#state").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { t = ''; $("#state").find("option").remove().end().append(t), $("#imgLoader").remove(); } }), $("#InputCountry_pay").change(function () { var e = $(this).val(); if (e) { var t = ''; $("#state_pay").find("option").remove().end().append(t); var r = BASE_URL + "../ certifications/ajaxGetStates"; $.ajax({ type: "POST", url: r, data: { cid: e }, dataType: "json", beforeSend: function () { $("#state_pay").before(function () { return getLoadingImg(); }); }, success: function (e) { for (var t = '', r = 0; r < e.length; r++) t += '"; (t += ''), $("#state_pay").find("option").remove().end().append(t), $("#imgLoader").remove(); }, error: function () { alert("something went wrong please try again"), $("#imgLoader").remove(); }, }); } else { t = ''; $("#state_pay").find("option").remove().end().append(t), $("#imgLoader").remove(); } }); }), $(function () { $(".playVidoeTestimonail").on("click", function () { var e = $(this).attr("id"), t = "https://www.youtube.com/embed/" + $(this).attr("data"); $("#mainVideo").html(''); var r = $("#videoDesc_" + e).val(); $("#mainVideoDesc").html(r); }), $(".cartQty").keydown(function (e) { 46 == e.keyCode || 8 == e.keyCode || ((e.keyCode < 48 || e.keyCode > 57) && e.preventDefault()); }), $(".addonProducts").change(function () { if ($(this).is(":checked")) { var e = $(this).attr("id"); $("#" + e).submit(); } }), $(".cartQty").on("keyup", function (e) { updateCartQty(); }), $("#ApplyCoupon").on("click", function () { ($Coupon = $("#coupon-code")), "" == $Coupon.val() ? $Coupon.focus() : validate_coupon_code($Coupon.val()); }), $("#btnUserProfileSubmit").on("click", function () { validateUserProfile(); }), $("#btnChangePasswordSubmit").on("click", function () { validatePasswordChange(); }); }), $("body").on("click", 'input[name="extension_type"]', function () { if ("add_users" == $(this).val()) { $(".hideifDuration").show(); var e = $('input[name="lisence_key_price_activation"]').val(); $("#lisence_update_form #lbl_price").html(e); } else { $(".hideifDuration").hide(); e = $('input[name="lisence_key_price"]').val(); $("#lisence_update_form #lbl_price").html(e); } }), $("body").on("click", 'input[name="noofusers"]', function () { var e = $(this).val(); if (e > 1) { $(".hideifDuration").show(); var t = $('input[name="lisence_key_price_activation_base"]').val(); (t *= e), $('input[name="lisence_key_price_activation"]').val(t), $("#lisence_update_form #lbl_price").html(t); } else { t = $('input[name="lisence_key_price_activation_base"]').val(); $('input[name="lisence_key_price_activation"]').val(t), $("#lisence_update_form #lbl_price").html(t); } }), $("body").on("keyup", 'input[name="noofusers"]', function () { var e = $(this).val(); if (e > 1) { $(".hideifDuration").show(); var t = $('input[name="lisence_key_price_activation_base"]').val(); (t *= e), $('input[name="lisence_key_price_activation"]').val(t), $("#lisence_update_form #lbl_price").html(t); } else { t = $('input[name="lisence_key_price_activation_base"]').val(); $('input[name="lisence_key_price_activation"]').val(t), $("#lisence_update_form #lbl_price").html(t); } }), $("body").on("submit", "#lisence_update_form", function () { if ((event.preventDefault(), !$("#lisence_update_form").valid())) return !1; validateLisenceForm("lisence_update_form"); }), $(document).ready(function () { $('.member-login input[type="radio"]').click(function () { var e = this.value; "member-register" == e ? ($("#member-login").hide(), $("#member-register").show()) : "member-login" == e && ($("#member-register").hide(), $("#member-login").show()); }); }), $(".popupBox").magnificPopup({ type: "ajax", alignTop: !0, closeOnBgClick: !0, showCloseBtn: !0, modal: !0, overflowY: "scroll", fixedContentPos: !0 }), $("#popupBoxnew").click(function () { $("#showloginDialogue").css("display", "block"); }), (function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? e(require("jquery")) : e(window.jQuery || window.Zepto); })(function (e) { var t, r, a, o, n, i, s = function () {}, l = !!window.jQuery, d = e(window), c = function (e, r) { t.ev.on("mfp" + e + ".mfp", r); }, p = function (t, r, a, o) { var n = document.createElement("div"); return (n.className = "mfp-" + t), a && (n.innerHTML = a), o ? r && r.appendChild(n) : ((n = e(n)), r && n.appendTo(r)), n; }, u = function (r, a) { t.ev.triggerHandler("mfp" + r, a), t.st.callbacks && ((r = r.charAt(0).toLowerCase() + r.slice(1)), t.st.callbacks[r] && t.st.callbacks[r].apply(t, e.isArray(a) ? a : [a])); }, m = function (r) { return (r === i && t.currTemplate.closeBtn) || ((t.currTemplate.closeBtn = e(t.st.closeMarkup.replace("%title%", t.st.tClose))), (i = r)), t.currTemplate.closeBtn; }, f = function () { e.magnificPopup.instance || ((t = new s()).init(), (e.magnificPopup.instance = t)); }; (s.prototype = { constructor: s, init: function () { var r = navigator.appVersion; (t.isLowIE = t.isIE8 = document.all && !document.addEventListener), (t.isAndroid = /android/gi.test(r)), (t.isIOS = /iphone|ipad|ipod/gi.test(r)), (t.supportsTransition = (function () { var e = document.createElement("p").style, t = ["ms", "O", "Moz", "Webkit"]; if (void 0 !== e.transition) return !0; for (; t.length; ) if (t.pop() + "Transition" in e) return !0; return !1; })()), (t.probablyMobile = t.isAndroid || t.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent)), (a = e(document)), (t.popupsCache = {}); }, open: function (r) { var o; if (!1 === r.isObj) { (t.items = r.items.toArray()), (t.index = 0); var i, s = r.items; for (o = 0; o < s.length; o++) if (((i = s[o]).parsed && (i = i.el[0]), i === r.el[0])) { t.index = o; break; } } else (t.items = e.isArray(r.items) ? r.items : [r.items]), (t.index = r.index || 0); if (!t.isOpen) { (t.types = []), (n = ""), r.mainEl && r.mainEl.length ? (t.ev = r.mainEl.eq(0)) : (t.ev = a), r.key ? (t.popupsCache[r.key] || (t.popupsCache[r.key] = {}), (t.currTemplate = t.popupsCache[r.key])) : (t.currTemplate = {}), (t.st = e.extend(!0, {}, e.magnificPopup.defaults, r)), (t.fixedContentPos = "auto" === t.st.fixedContentPos ? !t.probablyMobile : t.st.fixedContentPos), t.st.modal && ((t.st.closeOnContentClick = !1), (t.st.closeOnBgClick = !1), (t.st.showCloseBtn = !1), (t.st.enableEscapeKey = !1)), t.bgOverlay || ((t.bgOverlay = p("bg").on("click.mfp", function () { t.close(); })), (t.wrap = p("wrap") .attr("tabindex", -1) .on("click.mfp", function (e) { t._checkIfClose(e.target) && t.close(); })), (t.container = p("container", t.wrap))), (t.contentContainer = p("content")), t.st.preloader && (t.preloader = p("preloader", t.container, t.st.tLoading)); var l = e.magnificPopup.modules; for (o = 0; o < l.length; o++) { var f = l[o]; (f = f.charAt(0).toUpperCase() + f.slice(1)), t["init" + f].call(t); } u("BeforeOpen"), t.st.showCloseBtn && (t.st.closeBtnInside ? (c("MarkupParse", function (e, t, r, a) { r.close_replaceWith = m(a.type); }), (n += " mfp-close-btn-in")) : t.wrap.append(m())), t.st.alignTop && (n += " mfp-align-top"), t.fixedContentPos ? t.wrap.css({ overflow: t.st.overflowY, overflowX: "hidden", overflowY: t.st.overflowY }) : t.wrap.css({ top: d.scrollTop(), position: "absolute" }), (!1 === t.st.fixedBgPos || ("auto" === t.st.fixedBgPos && !t.fixedContentPos)) && t.bgOverlay.css({ height: a.height(), position: "absolute" }), t.st.enableEscapeKey && a.on("keyup.mfp", function (e) { 27 === e.keyCode && t.close(); }), d.on("resize.mfp", function () { t.updateSize(); }), t.st.closeOnContentClick || (n += " mfp-auto-cursor"), n && t.wrap.addClass(n); var v = (t.wH = d.height()), g = {}; if (t.fixedContentPos && t._hasScrollBar(v)) { var $ = t._getScrollbarSize(); $ && (g.marginRight = $); } t.fixedContentPos && (t.isIE7 ? e("body, html").css("overflow", "hidden") : (g.overflow = "hidden")); var h = t.st.mainClass; return ( t.isIE7 && (h += " mfp-ie7"), h && t._addClassToMFP(h), t.updateItemHTML(), u("BuildControls"), e("html").css(g), t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo || e(document.body)), (t._lastFocusedEl = document.activeElement), setTimeout(function () { t.content ? (t._addClassToMFP("mfp-ready"), t._setFocus()) : t.bgOverlay.addClass("mfp-ready"), a.on("focusin.mfp", t._onFocusIn); }, 16), (t.isOpen = !0), t.updateSize(v), u("Open"), r ); } t.updateItemHTML(); }, close: function () { t.isOpen && (u("BeforeClose"), (t.isOpen = !1), t.st.removalDelay && !t.isLowIE && t.supportsTransition ? (t._addClassToMFP("mfp-removing"), setTimeout(function () { t._close(); }, t.st.removalDelay)) : t._close()); }, _close: function () { u("Close"); var r = "mfp-removing mfp-ready "; if ((t.bgOverlay.detach(), t.wrap.detach(), t.container.empty(), t.st.mainClass && (r += t.st.mainClass + " "), t._removeClassFromMFP(r), t.fixedContentPos)) { var o = { marginRight: "" }; t.isIE7 ? e("body, html").css("overflow", "") : (o.overflow = ""), e("html").css(o); } a.off("keyup.mfp focusin.mfp"), t.ev.off(".mfp"), t.wrap.attr("class", "mfp-wrap").removeAttr("style"), t.bgOverlay.attr("class", "mfp-bg"), t.container.attr("class", "mfp-container"), !t.st.showCloseBtn || (t.st.closeBtnInside && !0 !== t.currTemplate[t.currItem.type]) || (t.currTemplate.closeBtn && t.currTemplate.closeBtn.detach()), t.st.autoFocusLast && t._lastFocusedEl && e(t._lastFocusedEl).focus(), (t.currItem = null), (t.content = null), (t.currTemplate = null), (t.prevHeight = 0), u("AfterClose"); }, updateSize: function (e) { if (t.isIOS) { var r = document.documentElement.clientWidth / window.innerWidth, a = window.innerHeight * r; t.wrap.css("height", a), (t.wH = a); } else t.wH = e || d.height(); t.fixedContentPos || t.wrap.css("height", t.wH), u("Resize"); }, updateItemHTML: function () { var r = t.items[t.index]; t.contentContainer.detach(), t.content && t.content.detach(), r.parsed || (r = t.parseEl(t.index)); var a = r.type; if ((u("BeforeChange", [t.currItem ? t.currItem.type : "", a]), (t.currItem = r), !t.currTemplate[a])) { var n = !!t.st[a] && t.st[a].markup; u("FirstMarkupParse", n), (t.currTemplate[a] = !n || e(n)); } o && o !== r.type && t.container.removeClass("mfp-" + o + "-holder"); var i = t["get" + a.charAt(0).toUpperCase() + a.slice(1)](r, t.currTemplate[a]); t.appendContent(i, a), (r.preloaded = !0), u("Change", r), (o = r.type), t.container.prepend(t.contentContainer), u("AfterChange"); }, appendContent: function (e, r) { (t.content = e), e ? (t.st.showCloseBtn && t.st.closeBtnInside && !0 === t.currTemplate[r] ? t.content.find(".mfp-close").length || t.content.append(m()) : (t.content = e)) : (t.content = ""), u("BeforeAppend"), t.container.addClass("mfp-" + r + "-holder"), t.contentContainer.append(t.content); }, parseEl: function (r) { var a, o = t.items[r]; if ((o.tagName ? (o = { el: e(o) }) : ((a = o.type), (o = { data: o, src: o.src })), o.el)) { for (var n = t.types, i = 0; i < n.length; i++) if (o.el.hasClass("mfp-" + n[i])) { a = n[i]; break; } (o.src = o.el.attr("data-mfp-src")), o.src || (o.src = o.el.attr("href")); } return (o.type = a || t.st.type || "inline"), (o.index = r), (o.parsed = !0), (t.items[r] = o), u("ElementParse", o), t.items[r]; }, addGroup: function (e, r) { var a = function (a) { (a.mfpEl = this), t._openClick(a, e, r); }; r || (r = {}); var o = "click.magnificPopup"; (r.mainEl = e), r.items ? ((r.isObj = !0), e.off(o).on(o, a)) : ((r.isObj = !1), r.delegate ? e.off(o).on(o, r.delegate, a) : ((r.items = e), e.off(o).on(o, a))); }, _openClick: function (r, a, o) { if ((void 0 !== o.midClick ? o.midClick : e.magnificPopup.defaults.midClick) || !(2 === r.which || r.ctrlKey || r.metaKey || r.altKey || r.shiftKey)) { var n = void 0 !== o.disableOn ? o.disableOn : e.magnificPopup.defaults.disableOn; if (n) if (e.isFunction(n)) { if (!n.call(t)) return !0; } else if (d.width() < n) return !0; r.type && (r.preventDefault(), t.isOpen && r.stopPropagation()), (o.el = e(r.mfpEl)), o.delegate && (o.items = a.find(o.delegate)), t.open(o); } }, updateStatus: function (e, a) { if (t.preloader) { r !== e && t.container.removeClass("mfp-s-" + r), a || "loading" !== e || (a = t.st.tLoading); var o = { status: e, text: a }; u("UpdateStatus", o), (e = o.status), (a = o.text), t.preloader.html(a), t.preloader.find("a").on("click", function (e) { e.stopImmediatePropagation(); }), t.container.addClass("mfp-s-" + e), (r = e); } }, _checkIfClose: function (r) { if (!e(r).hasClass("mfp-prevent-close")) { var a = t.st.closeOnContentClick, o = t.st.closeOnBgClick; if (a && o) return !0; if (!t.content || e(r).hasClass("mfp-close") || (t.preloader && r === t.preloader[0])) return !0; if (r === t.content[0] || e.contains(t.content[0], r)) { if (a) return !0; } else if (o && e.contains(document, r)) return !0; return !1; } }, _addClassToMFP: function (e) { t.bgOverlay.addClass(e), t.wrap.addClass(e); }, _removeClassFromMFP: function (e) { this.bgOverlay.removeClass(e), t.wrap.removeClass(e); }, _hasScrollBar: function (e) { return (t.isIE7 ? a.height() : document.body.scrollHeight) > (e || d.height()); }, _setFocus: function () { (t.st.focus ? t.content.find(t.st.focus).eq(0) : t.wrap).focus(); }, _onFocusIn: function (r) { if (r.target !== t.wrap[0] && !e.contains(t.wrap[0], r.target)) return t._setFocus(), !1; }, _parseMarkup: function (t, r, a) { var o; a.data && (r = e.extend(a.data, r)), u("MarkupParse", [t, r, a]), e.each(r, function (r, a) { if (void 0 === a || !1 === a) return !0; if ((o = r.split("_")).length > 1) { var n = t.find(".mfp-" + o[0]); if (n.length > 0) { var i = o[1]; "replaceWith" === i ? n[0] !== a[0] && n.replaceWith(a) : "img" === i ? (n.is("img") ? n.attr("src", a) : n.replaceWith(e("").attr("src", a).attr("class", n.attr("class")))) : n.attr(o[1], a); } } else t.find(".mfp-" + r).html(a); }); }, _getScrollbarSize: function () { if (void 0 === t.scrollbarSize) { var e = document.createElement("div"); (e.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;"), document.body.appendChild(e), (t.scrollbarSize = e.offsetWidth - e.clientWidth), document.body.removeChild(e); } return t.scrollbarSize; }, }), (e.magnificPopup = { instance: null, proto: s.prototype, modules: [], open: function (t, r) { return f(), ((t = t ? e.extend(!0, {}, t) : {}).isObj = !0), (t.index = r || 0), this.instance.open(t); }, close: function () { return e.magnificPopup.instance && e.magnificPopup.instance.close(); }, registerModule: function (t, r) { r.options && (e.magnificPopup.defaults[t] = r.options), e.extend(this.proto, r.proto), this.modules.push(t); }, defaults: { disableOn: 0, key: null, midClick: !1, mainClass: "", preloader: !0, focus: "", closeOnContentClick: !1, closeOnBgClick: !0, closeBtnInside: !0, showCloseBtn: !0, enableEscapeKey: !0, modal: !1, alignTop: !1, removalDelay: 0, prependTo: null, fixedContentPos: "auto", fixedBgPos: "auto", overflowY: "auto", closeMarkup: '', tClose: "Close (Esc)", tLoading: "Loading...", autoFocusLast: !0, }, }), (e.fn.magnificPopup = function (r) { f(); var a = e(this); if ("string" == typeof r) if ("open" === r) { var o, n = l ? a.data("magnificPopup") : a[0].magnificPopup, i = parseInt(arguments[1], 10) || 0; n.items ? (o = n.items[i]) : ((o = a), n.delegate && (o = o.find(n.delegate)), (o = o.eq(i))), t._openClick({ mfpEl: o }, a, n); } else t.isOpen && t[r].apply(t, Array.prototype.slice.call(arguments, 1)); else (r = e.extend(!0, {}, r)), l ? a.data("magnificPopup", r) : (a[0].magnificPopup = r), t.addGroup(a, r); return a; }); var v, g, $, h = function () { $ && (g.after($.addClass(v)).detach(), ($ = null)); }; e.magnificPopup.registerModule("inline", { options: { hiddenClass: "hide", markup: "", tNotFound: "Content not found" }, proto: { initInline: function () { t.types.push("inline"), c("Close.inline", function () { h(); }); }, getInline: function (r, a) { if ((h(), r.src)) { var o = t.st.inline, n = e(r.src); if (n.length) { var i = n[0].parentNode; i && i.tagName && (g || ((v = o.hiddenClass), (g = p(v)), (v = "mfp-" + v)), ($ = n.after(g).detach().removeClass(v))), t.updateStatus("ready"); } else t.updateStatus("error", o.tNotFound), (n = e("
")); return (r.inlineElement = n), n; } return t.updateStatus("ready"), t._parseMarkup(a, {}, r), a; }, }, }); var _, y = function () { _ && e(document.body).removeClass(_); }, b = function () { y(), t.req && t.req.abort(); }; e.magnificPopup.registerModule("ajax", { options: { settings: null, cursor: "mfp-ajax-cur", tError: 'The content could not be loaded.' }, proto: { initAjax: function () { t.types.push("ajax"), (_ = t.st.ajax.cursor), c("Close.ajax", b), c("BeforeChange.ajax", b); }, getAjax: function (r) { _ && e(document.body).addClass(_), t.updateStatus("loading"); var a = e.extend( { url: r.src, success: function (a, o, n) { var i = { data: a, xhr: n }; u("ParseAjax", i), t.appendContent(e(i.data), "ajax"), (r.finished = !0), y(), t._setFocus(), setTimeout(function () { t.wrap.addClass("mfp-ready"); }, 16), t.updateStatus("ready"), u("AjaxContentAdded"); }, error: function () { y(), (r.finished = r.loadError = !0), t.updateStatus("error", t.st.ajax.tError.replace("%url%", r.src)); }, }, t.st.ajax.settings ); return (t.req = e.ajax(a)), ""; }, }, }); var w, C = function (r) { if (r.data && void 0 !== r.data.title) return r.data.title; var a = t.st.image.titleSrc; if (a) { if (e.isFunction(a)) return a.call(t, r); if (r.el) return r.el.attr(a) || ""; } return ""; }; e.magnificPopup.registerModule("image", { options: { markup: '
', cursor: "mfp-zoom-out-cur", titleSrc: "title", verticalFit: !0, tError: 'The image could not be loaded.', }, proto: { initImage: function () { var r = t.st.image, a = ".image"; t.types.push("image"), c("Open" + a, function () { "image" === t.currItem.type && r.cursor && e(document.body).addClass(r.cursor); }), c("Close" + a, function () { r.cursor && e(document.body).removeClass(r.cursor), d.off("resize.mfp"); }), c("Resize" + a, t.resizeImage), t.isLowIE && c("AfterChange", t.resizeImage); }, resizeImage: function () { var e = t.currItem; if (e && e.img && t.st.image.verticalFit) { var r = 0; t.isLowIE && (r = parseInt(e.img.css("padding-top"), 10) + parseInt(e.img.css("padding-bottom"), 10)), e.img.css("max-height", t.wH - r); } }, _onImageHasSize: function (e) { e.img && ((e.hasSize = !0), w && clearInterval(w), (e.isCheckingImgSize = !1), u("ImageHasSize", e), e.imgHidden && (t.content && t.content.removeClass("mfp-loading"), (e.imgHidden = !1))); }, findImageSize: function (e) { var r = 0, a = e.img[0], o = function (n) { w && clearInterval(w), (w = setInterval(function () { a.naturalWidth > 0 ? t._onImageHasSize(e) : (r > 200 && clearInterval(w), 3 === ++r ? o(10) : 40 === r ? o(50) : 100 === r && o(500)); }, n)); }; o(1); }, getImage: function (r, a) { var o = 0, n = function () { r && (r.img[0].complete ? (r.img.off(".mfploader"), r === t.currItem && (t._onImageHasSize(r), t.updateStatus("ready")), (r.hasSize = !0), (r.loaded = !0), u("ImageLoadComplete")) : ++o < 200 ? setTimeout(n, 100) : i()); }, i = function () { r && (r.img.off(".mfploader"), r === t.currItem && (t._onImageHasSize(r), t.updateStatus("error", s.tError.replace("%url%", r.src))), (r.hasSize = !0), (r.loaded = !0), (r.loadError = !0)); }, s = t.st.image, l = a.find(".mfp-img"); if (l.length) { var d = document.createElement("img"); (d.className = "mfp-img"), r.el && r.el.find("img").length && (d.alt = r.el.find("img").attr("alt")), (r.img = e(d).on("load.mfploader", n).on("error.mfploader", i)), (d.src = r.src), l.is("img") && (r.img = r.img.clone()), (d = r.img[0]).naturalWidth > 0 ? (r.hasSize = !0) : d.width || (r.hasSize = !1); } return ( t._parseMarkup(a, { title: C(r), img_replaceWith: r.img }, r), t.resizeImage(), r.hasSize ? (w && clearInterval(w), r.loadError ? (a.addClass("mfp-loading"), t.updateStatus("error", s.tError.replace("%url%", r.src))) : (a.removeClass("mfp-loading"), t.updateStatus("ready")), a) : (t.updateStatus("loading"), (r.loading = !0), r.hasSize || ((r.imgHidden = !0), a.addClass("mfp-loading"), t.findImageSize(r)), a) ); }, }, }); var S; e.magnificPopup.registerModule("zoom", { options: { enabled: !1, easing: "ease-in-out", duration: 300, opener: function (e) { return e.is("img") ? e : e.find("img"); }, }, proto: { initZoom: function () { var e, r = t.st.zoom, a = ".zoom"; if (r.enabled && t.supportsTransition) { var o, n, i = r.duration, s = function (e) { var t = e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), a = "all " + r.duration / 1e3 + "s " + r.easing, o = { position: "fixed", zIndex: 9999, left: 0, top: 0, "-webkit-backface-visibility": "hidden" }, n = "transition"; return (o["-webkit-" + n] = o["-moz-" + n] = o["-o-" + n] = o[n] = a), t.css(o), t; }, l = function () { t.content.css("visibility", "visible"); }; c("BuildControls" + a, function () { if (t._allowZoom()) { if ((clearTimeout(o), t.content.css("visibility", "hidden"), !(e = t._getItemToZoom()))) return void l(); (n = s(e)).css(t._getOffset()), t.wrap.append(n), (o = setTimeout(function () { n.css(t._getOffset(!0)), (o = setTimeout(function () { l(), setTimeout(function () { n.remove(), (e = n = null), u("ZoomAnimationEnded"); }, 16); }, i)); }, 16)); } }), c("BeforeClose" + a, function () { if (t._allowZoom()) { if ((clearTimeout(o), (t.st.removalDelay = i), !e)) { if (!(e = t._getItemToZoom())) return; n = s(e); } n.css(t._getOffset(!0)), t.wrap.append(n), t.content.css("visibility", "hidden"), setTimeout(function () { n.css(t._getOffset()); }, 16); } }), c("Close" + a, function () { t._allowZoom() && (l(), n && n.remove(), (e = null)); }); } }, _allowZoom: function () { return "image" === t.currItem.type; }, _getItemToZoom: function () { return !!t.currItem.hasSize && t.currItem.img; }, _getOffset: function (r) { var a, o = (a = r ? t.currItem.img : t.st.zoom.opener(t.currItem.el || t.currItem)).offset(), n = parseInt(a.css("padding-top"), 10), i = parseInt(a.css("padding-bottom"), 10); o.top -= e(window).scrollTop() - n; var s = { width: a.width(), height: (l ? a.innerHeight() : a[0].offsetHeight) - i - n }; return void 0 === S && (S = void 0 !== document.createElement("p").style.MozTransform), S ? (s["-moz-transform"] = s.transform = "translate(" + o.left + "px," + o.top + "px)") : ((s.left = o.left), (s.top = o.top)), s; }, }, }); var x = function (e) { if (t.currTemplate.iframe) { var r = t.currTemplate.iframe.find("iframe"); r.length && (e || (r[0].src = "//about:blank"), t.isIE8 && r.css("display", e ? "block" : "none")); } }; e.magnificPopup.registerModule("iframe", { options: { markup: '
', srcAction: "iframe_src", patterns: { youtube: { index: "youtube.com", id: "v=", src: "//www.youtube.com/embed/%id%?autoplay=1" }, vimeo: { index: "vimeo.com/", id: "/", src: "//player.vimeo.com/video/%id%?autoplay=1" }, gmaps: { index: "//maps.google.", src: "%id%&output=embed" }, }, }, proto: { initIframe: function () { t.types.push("iframe"), c("BeforeChange", function (e, t, r) { t !== r && ("iframe" === t ? x() : "iframe" === r && x(!0)); }), c("Close.iframe", function () { x(); }); }, getIframe: function (r, a) { var o = r.src, n = t.st.iframe; e.each(n.patterns, function () { if (o.indexOf(this.index) > -1) return this.id && (o = "string" == typeof this.id ? o.substr(o.lastIndexOf(this.id) + this.id.length, o.length) : this.id.call(this, o)), (o = this.src.replace("%id%", o)), !1; }); var i = {}; return n.srcAction && (i[n.srcAction] = o), t._parseMarkup(a, i, r), t.updateStatus("ready"), a; }, }, }); var T = function (e) { var r = t.items.length; return e > r - 1 ? e - r : e < 0 ? r + e : e; }, P = function (e, t, r) { return e.replace(/%curr%/gi, t + 1).replace(/%total%/gi, r); }; e.magnificPopup.registerModule("gallery", { options: { enabled: !1, arrowMarkup: '', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%", }, proto: { initGallery: function () { var r = t.st.gallery, o = ".mfp-gallery"; if (((t.direction = !0), !r || !r.enabled)) return !1; (n += " mfp-gallery"), c("Open" + o, function () { r.navigateByImgClick && t.wrap.on("click" + o, ".mfp-img", function () { if (t.items.length > 1) return t.next(), !1; }), a.on("keydown" + o, function (e) { 37 === e.keyCode ? t.prev() : 39 === e.keyCode && t.next(); }); }), c("UpdateStatus" + o, function (e, r) { r.text && (r.text = P(r.text, t.currItem.index, t.items.length)); }), c("MarkupParse" + o, function (e, a, o, n) { var i = t.items.length; o.counter = i > 1 ? P(r.tCounter, n.index, i) : ""; }), c("BuildControls" + o, function () { if (t.items.length > 1 && r.arrows && !t.arrowLeft) { var a = r.arrowMarkup, o = (t.arrowLeft = e(a.replace(/%title%/gi, r.tPrev).replace(/%dir%/gi, "left")).addClass("mfp-prevent-close")), n = (t.arrowRight = e(a.replace(/%title%/gi, r.tNext).replace(/%dir%/gi, "right")).addClass("mfp-prevent-close")); o.click(function () { t.prev(); }), n.click(function () { t.next(); }), t.container.append(o.add(n)); } }), c("Change" + o, function () { t._preloadTimeout && clearTimeout(t._preloadTimeout), (t._preloadTimeout = setTimeout(function () { t.preloadNearbyImages(), (t._preloadTimeout = null); }, 16)); }), c("Close" + o, function () { a.off(o), t.wrap.off("click" + o), (t.arrowRight = t.arrowLeft = null); }); }, next: function () { (t.direction = !0), (t.index = T(t.index + 1)), t.updateItemHTML(); }, prev: function () { (t.direction = !1), (t.index = T(t.index - 1)), t.updateItemHTML(); }, goTo: function (e) { (t.direction = e >= t.index), (t.index = e), t.updateItemHTML(); }, preloadNearbyImages: function () { var e, r = t.st.gallery.preload, a = Math.min(r[0], t.items.length), o = Math.min(r[1], t.items.length); for (e = 1; e <= (t.direction ? o : a); e++) t._preloadItem(t.index + e); for (e = 1; e <= (t.direction ? a : o); e++) t._preloadItem(t.index - e); }, _preloadItem: function (r) { if (((r = T(r)), !t.items[r].preloaded)) { var a = t.items[r]; a.parsed || (a = t.parseEl(r)), u("LazyLoad", a), "image" === a.type && (a.img = e('') .on("load.mfploader", function () { a.hasSize = !0; }) .on("error.mfploader", function () { (a.hasSize = !0), (a.loadError = !0), u("LazyLoadError", a); }) .attr("src", a.src)), (a.preloaded = !0); } }, }, }); e.magnificPopup.registerModule("retina", { options: { replaceSrc: function (e) { return e.src.replace(/\.\w+$/, function (e) { return "@2x" + e; }); }, ratio: 1, }, proto: { initRetina: function () { if (window.devicePixelRatio > 1) { var e = t.st.retina, r = e.ratio; (r = isNaN(r) ? r() : r) > 1 && (c("ImageHasSize.retina", function (e, t) { t.img.css({ "max-width": t.img[0].naturalWidth / r, width: "100%" }); }), c("ElementParse.retina", function (t, a) { a.src = e.replaceSrc(a, r); })); } }, }, }), f(); });
Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77