function refreshPaypalPosition() { $("div.msgbox").is(":visible") ? $(".paypal-direct-order").css("top", 528) : $(".paypal-direct-order").css("top", 470) } function show_over_load() { $("#overloading").show() } function show_over_cart() { $.ajax({ type: "GET", url: "details.php", success: function (e) { $("#cart span a strong").html(e) } }), $.ajax({ type: "GET", url: "ajax_cart.php", success: function (e) { $("#overloading").hide(), $("#overcmd").show(), $("#overcontent").html(e) } }) } function delete_product_cart(e) { return $.ajax({ type: "GET", url: "ajax_cart.php", data: { action: "delete", id: e }, success: function (e) { $("#overcontent").html(e) } }), !1 } function total_product_attributes() { $(this).val() && !/[0-9]+/.test($(this).val()) && (alert("Erreur : la quantit\xe9 doit \xeatre un nombre entier !"), $(this).val("")); var e = $("#product-attributes input[type=text]"), t = 0; e.each(function (e) { $(this).val() && (t += parseInt($(this).val(), 10) * $(this).attr("alt")) }), t = number_format(Math.abs(t), 2, ","), $("#product-total-amount").html(t) } function number_format(e, t, a, n) { var i = e, o = isNaN(t = Math.abs(t)) ? 2 : t, s = void 0 == n ? "." : n, r = i < 0 ? "-" : "", c = parseInt(i = Math.abs(+i || 0).toFixed(o)) + "", l = (l = c.length) > 3 ? l % 3 : 0; return r + (l ? c.substr(0, l) + s : "") + c.substr(l).replace(/(\d{3})(?=\d)/g, "$1" + s) + (o ? (void 0 == a ? "," : a) + Math.abs(i - c).toFixed(o).slice(2) : "") } function addQuantity(e, t) { var a = $("#" + e), n = Math.abs(parseInt(a.val())) + parseInt(t); a.val(n >= 0 ? n : 0), total_product_attributes() } $(document).ready(function () { if ($("#user\\:particulier").is(":checked") && ($("#company").hide(), $("#numero_tva").hide()), $("#address\\:particulier").is(":checked") && ($("#company").hide(), $("#numero_tva").hide()), $('input[name="user[typeClient]"], input[name="address[typeClient]"]').on("change", function () { switch ($(this).val()) { case "particulier": $("#company").hide(), $("#numero_tva").hide(); break; case "entreprise": $("#company").show(), $("#numero_tva").show() } }), $("#account-icon").hover(function () { $(this).find("#user").fadeIn() }, function () { $(this).find("#user").stop(!0, !0).hide() }), $("#navstickers").parent().hover(function () { $(this).find(".subnav").fadeIn() }, function () { $(this).find(".subnav").stop(!0, !0).hide() }), $(".navMainItem li").mouseover(function () { var e = $(this).data("image"); $("#mainNavImage").attr("src", e) }), $("#product-image").length) var e = $("#product-image").offset(); if (window.onscroll = function () { window.pageYOffset > 70 ? ($("#header").addClass("sticky"), $("#content").addClass("padding-sticky")) : ($("#header").removeClass("sticky"), $("#content").removeClass("padding-sticky")), $("#product-image").length && $("#product-left").length && (window.pageYOffset > e.top ? ($("#product-image").addClass("sticky"), $("#product-left").addClass("height-sticky")) : ($("#product-image").removeClass("sticky"), $("#product-left").removeClass("height-sticky"))) }, $("#burger-menu").click(function (e) { $("#nav-mobile").toggleClass("open") }), $("#nav-mobile .close").click(function (e) { $("#nav-mobile").toggleClass("open") }), $("#nav-mobile #navstickers").click(function (e) { e.preventDefault(), $(this).parent().find(".subnav").slideToggle() }), $("#search-icon-mobile").click(function (e) { $("#search-mobile").slideToggle() }), $("#categories-menu").click(function (e) { $(this).parent().find("> .subnav").slideToggle() }), $("#home-news-products").length) { let t = new Siema({ selector: "#home-news-products #liste-nouveautes", duration: 200, easing: "ease-out", perPage: { 0: 1, 798: 2, 1025: 4 }, startIndex: 0, draggable: !0, multipleDrag: !0, threshold: 20, loop: !0 }); document.querySelector("#home-news-products .previous").addEventListener("click", function () { t.prev() }), document.querySelector("#home-news-products .next").addEventListener("click", function () { t.next() }) } if ($("#reassurance-banner").length) { let a = new Siema({ selector: "#reassurance-banner", duration: 200, easing: "ease-out", perPage: { 0: 1, 798: 2, 1025: 4 }, startIndex: 0, draggable: !1, threshold: 20, loop: !0 }); setInterval(() => a.next(), 3e3) } $(".show-attributes a").click(function (e) { e.preventDefault(), $(this).parent().parent().find(".product-attributes .item-attributes").slideToggle() }), $(".product-detail-mobile-button").click(function (e) { e.preventDefault(), $(this).parent().find(".product-detail-mobile").fadeIn(), $(this).parent().find(".product-detail-mobile-overlay").fadeIn() }), $(".product-detail-mobile .close").click(function (e) { e.preventDefault(), $(this).parent().fadeOut(), $(this).parent().parent().find(".product-detail-mobile-overlay").fadeOut() }), $(".go-to-reviews").click(function (e) { e.preventDefault(), $([document.documentElement, document.body]).animate({ scrollTop: $("#reviews-product").offset().top - 80 }, 1e3) }), $(".mh-toogle").on("click", function (e) { e.preventDefault(); var t = $(this).data("mh-content"); $(".mh-panel").html($("#" + t).html()).addClass("open"), $(".mh-bg").fadeIn("200") }), $(document).on("click", ".mh-close", function (e) { e.preventDefault(), $(".mh-panel").removeClass("open"), $(".mh-bg").fadeOut("200") }), $(".mh-bg").on("click", function (e) { e.preventDefault(), $(".mh-panel").removeClass("open"), $(".mh-bg").fadeOut("200") }), $(".product-tab-head-link").on("click", function (e) { e.preventDefault(); var t = $(this).data("product-tab"); $(".product-tab-content").hide(), $("#" + t).fadeIn(), $(".product-tab-head-link").removeClass("selected"), $(this).addClass("selected") }), $(".product-tabs-head").length && $(".product-tabs-head .product-tab-head-link").first().trigger("click"), $(".quantity-product").on("keypress", ".quantity-input", function () { $(this).parent(".quantity").next(".refresh").fadeIn("fast") }), $("#categories ul li ul").parent("li").addClass("plus"), $("#categories ul li.selected ul").parent("li").removeClass("plus").addClass("minus"), $("#home-categories li").mouseover(function () { $(this).addClass("hover") }).mouseout(function () { $(this).removeClass("hover") }), setInterval(function () { "0px" == $("#image-header").css("top") ? $("#image-header").animate({ top: "-80px" }, "slow") : $("#image-header").animate({ top: "0" }, "slow") }, 5e3), $("#images-header").css("display", "block"), $("div.msgbox").hide().fadeIn().click(function () { $(this).slideUp("normal", function () { $(this).remove(), refreshPaypalPosition() }) }), $(".payment-methods ul li label").click(function (e) { $(".payment-methods ul li").removeClass("selected"), $(this).parent().addClass("selected") }), $("body").on("click", "#overback", function (e) { e.preventDefault(), $("#overcmd").hide() }), $(".cmdAddCart, .acheter-jeu").click(function (e) { $("#overloading").show() }), $(".imagehovering").hover(function (e) { var t = $(this).attr("alt"); $('<img id="largeImage" src="' + t + '" alt="chargement en cours..." />').css({ top: e.pageY + 10, left: e.pageX + 20 }).appendTo("body") }, function () { $("#largeImage").remove() }), $(".imagehovering").mousemove(function (e) { $("#largeImage").css({ top: e.pageY + 10, left: e.pageX + 20 }) }), refreshPaypalPosition() });