PageSourceSearch

https://ebisu66.ru/uss-js/uss-script-5.0.0-06.js

js ebisu66.ru collected 2026-10-04 22:54:03 UTC 175,138 bytes, 3,218 lines download raw bytes

1function getWindowWidth() {
2    return isMobileDevice() ? (window.mobileWidth > 0 && window.innerWidth < window.innerHeight ? window.mobileWidth : window.innerWidth) : $(window).width();
3}
4function getWindowHeight() {
5    return isMobileDevice() ? window.innerHeight : $(window).height();
6}
7function getBodyScrollTop() {
8    return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
9}
10function redyUSSfoto(e, t, i) {
11    (t = t || !1),
12        (i = i || !1),
13        (window.wtype = i),
14        e.die("click.ussPhoto"),
15        e.live("click.ussPhoto", function (e) {
16            var s = getWindowHeight(),
17                o = getBodyScrollTop() + s / 2;
18            return (check_touchwipe_pda = !1), openUSSfoto($(this), o, t, i), !1;
19        });
20}
21function openUSSfoto(e, t, i, s) {
22    var o = !1;
23    if ("fotoalbum" == s)
24        e.closest(".uss_photoalbums").find("div.uss_img_item:first").is(":visible") && e.closest(".uss_photoalbums").find("div.uss_img_item:first").addClass("uss_img_item_first"),
25        e.closest(".uss_photoalbums").find("div.uss_img_item:last").is(":visible") && e.closest(".uss_photoalbums").find("div.uss_img_item:last").addClass("uss_img_item_last"),
26            $("div.uss_img_item").removeAttr("id"),
27            (l = e.parent().parent()).attr("id", "uss_foto_point"),
28            (o = "div.uss_img_item");
29    else if ("eshop" == s || "slide" == s) {
30        if (($("div.uss_img_ico:first").addClass("uss_img_item_first"), $("div.uss_img_ico:last").addClass("uss_img_item_last"), e.closest(".uss_img_big").length)) {
31            e.closest(".uss_img_big").removeAttr("id"),
32            "eshop" == s &&
33            ($("#uss_foto_point").removeAttr("id"),
34                (e.closest(".uss_catalog_detail").length || e.closest(".uss_shop_detail").length) && $(".uss_tabs #tab_images img").length
35                    ? $(".uss_tabs #tab_images .uss_img_item_first").attr("id", "uss_foto_point")
36                    : (e.closest(".uss_catalog_detail").length || e.closest(".uss_shop_detail").length) && $(".uss_shop_detail .uss_eshop_bottom_images").length
37                    ? $(".uss_shop_detail .uss_eshop_bottom_images .uss_img_item_first").attr("id", "uss_foto_point")
38                    : e.closest(".uss_img_big").parent().find("div.uss_img_item_first").attr("id", "uss_foto_point"));
39            l = $("div#uss_foto_point");
40        } else $("div.uss_img_ico").removeAttr("id"), (l = e.parent()).attr("id", "uss_foto_point");
41        o = "div.uss_img_ico";
42    } else if ("photo_widget" == s)
43        (n = e.closest(".uss_images_block")).find("div.uss_one_image:first").addClass("uss_img_item_first"),
44            n.find("div.uss_one_image:last").addClass("uss_img_item_last"),
45            n.find("div.uss_one_image").removeAttr("id"),
46            (l = e.closest(".uss_one_image")).attr("id", "uss_foto_point"),
47            (o = "div.uss_one_image");
48    else if ("eshop_pos_list" == s) {
49        var a = e.closest(".uss_eshop_item"),
50            n = a.find(".uss_eshop_images_list");
51        if (((l = n.find("div#uss_foto_point")), n.find("div.uss_img_ico:first").addClass("uss_img_item_first"), n.find("div.uss_img_ico:last").addClass("uss_img_item_last"), l.length)) l = e.closest("div.uss_img_ico");
52        else if (a.find(".uss_advanced_image_list"))
53            var r = a.find(".uss_advanced_image_list").find(".active").index(),
54                l = n.find(".uss_img_ico").eq(r);
55        else l = n.find(".uss_img_item_first");
56        n.find("div.uss_img_ico").removeAttr("id"), l.attr("id", "uss_foto_point"), (o = "div.uss_img_ico");
57    }
58    if (t) {
59        $(".uss_img_item_first").attr("class"), $(".uss_img_item_last").attr("class");
60        var d = "",
61            c = "";
62        i &&
63        ((d = '<a href="/" id="uss_foto_button_next" onclick="nextUSSfoto(\'' + s + '\');return false;" title="Ñëåäóþùåå èçîáðàæåíèå">Ñëåäóùåå</a>'),
64            (c = '<a href="/" id="uss_foto_button_before" onclick="beforeUSSfoto(\'' + s + '\');return false;" title="Ïðåäûäóùåå èçîáðàæåíèå">Ïðåäûäóþùåå</a>'));
65        var _ =
66            '\t<div id="ufnav_left" class="uss_foto_button">\t\t\t\t\t\t\t\t' +
67            c +
68            '\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div id="ufnav_right" class="uss_foto_button">\t\t\t\t\t\t\t\t<a href="/" id="uss_foto_button_close" onclick="closeUSSfoto();return false;" title="Çàâåðøèòü ïðîñìîòð">Çàêðûòü</a>\t\t\t\t\t\t\t\t<a href="/" id="uss_foto_button_play" onclick="reviewUSSPlay(this);return false;" title="Âêëþ÷èòü àâòîïðîñìîòð">Àâòîïðîñìîòð</a>\t\t\t\t\t\t\t\t' +
69            d +
70            "\t\t\t\t\t\t\t</div>";
71        $("body").append('<div id="uss_substrate" onclick="closeUSSfoto();return false;"></div><div id="uss_view_conteiner" style="top: ' + t + 'px"><div id="uss_inside_view_conteiner"></div>' + _ + "</div>"),
72            $("#uss_substrate").css({ display: "block", opacity: 0 }).animate({ opacity: 0.4 }, 500),
73            $("body").addClass("with_substrate"),
74        !isMobileDevice() && !$(".pda_site_container").length && getWindowHeight() < $(document).height() && $("body").css("padding-right", get
74ScrollWidth() + "px");
75    } else $("#uss_inside_view_conteiner img").css("display", "none"), $("#uss_foto_description").css("display", "none"), $("#uss_inside_view_conteiner").css("background-position", "50% 50%");
76    (right_left = ""),
77    i &&
78    (0 == l.length || l.is(".uss_img_item_first")
79        ? $("#uss_foto_button_before").css("visibility", "hidden")
80        : ((right_left += '<a href="/" id="uss_foto_button_before2" onclick="beforeUSSfoto(\'' + s + '\');return false;" title="Ïðåäûäóùåå èçîáðàæåíèå"><span></span></a>'), $("#uss_foto_button_before").css("visibility", "visible")),
81        0 == l.length || l.is(".uss_img_item_last")
82            ? $("#uss_foto_button_next").css("visibility", "hidden")
83            : ((right_left += '<a href="/" id="uss_foto_button_next2" onclick="nextUSSfoto(\'' + s + '\');return false;" title="Ñëåäóþùåå èçîáðàæåíèå"><span></span></a>'), $("#uss_foto_button_next").css("visibility", "visible")));
84    var u = "";
85    o && (u = createCircleNavigation(l, o));
86    var h = e.attr("href"),
87        f = parseInt($("#uss_view_conteiner").css("margin-left"));
88    (f && !isNaN(f)) || ((f = (getWindowWidth() - $("#uss_view_conteiner").outerWidth(!0)) / 2), $("#uss_view_conteiner").css("margin-left", f + "px"));
89    var m = new Image();
90    (m.onload = function () {
91        m.onload = null;
92        var i = m.width,
93            a = m.height;
94        (window.imgMaxWidth = i), (window.imgMaxHeight = a);
95        var n = $("#uss_view_conteiner"),
96            r = $("#uss_inside_view_conteiner"),
97            d = n.outerHeight() - n.height();
98        (window.documentWidth = $("body").width()), (window.documentHeight = $("body").height());
99        var c = getWindowHeight(),
100            _ = getWindowWidth(),
101            h = _ >= window.smallScreenSize ? window.contWidth : window.smallContWidth,
102            f = _ - h,
103            p = c - window.contHeight - d,
104            g = window.imgMaxWidth / window.imgMaxHeight;
105        f < window.minDocumentWidth && (f = window.minDocumentWidth),
106        p < window.minDocumentHeight && (p = window.minDocumentHeight),
107        i > f && ((i = f), (a = f / g)),
108        a > p && (i = (a = p) * g),
109            r.css("background-position", "-100000px 50%");
110        var v = "",
111            b = "";
112        if ("fotoalbum" == s) {
113            var w = l,
114                y = w.find("div.uss_img_name").html(),
115                k = w.find("div.uss_img_description").html();
116            b = w.find("img").attr("alt");
117        } else if ("slide" == s)
118            var y = e.attr("alt"),
119                k = e.attr("title");
120        else y = e.attr("title");
121        var C = 0;
122        (v = y ? "<p><strong>" + y + "</strong></p>" : ""), k && (v += k), v && (v = '<div id="uss_foto_description">' + v + "</div>");
123        var x = b ? ' alt="' + b + '"' : "",
124            S = '<img src="' + m.src + '" width="' + i + '" height="' + a + '" style="display: none;"' + x + "/>" + v + right_left;
125        r.html(S);
126        var I = c - window.contHeight - d,
127            W = 0,
128            E = _ - _ / h;
129        if (((window.isDescriptionBig = !1), v)) {
130            if (((C = parseInt($("#uss_foto_description").outerHeight(!0))), (W = parseInt($("#uss_foto_description").outerWidth())), C > c / 3)) {
131                window.isDescriptionBig = !0;
132                for (var M = 0, j = !0; j && M < 100; ) {
133                    C = $("#uss_foto_description").outerHeight(!0);
134                    var L = (W = $("#uss_foto_description").outerWidth()) + parseInt(E / 100);
135                    L < i && ((L = i - window.descriptionPadding), (j = !1)), L >= E && ((L = E), (j = !1)), $("#uss_foto_description").css("width", L), j && (j = C > c / 3), M++;
136                }
137                (W = $("#uss_foto_description").outerWidth()), (C = parseInt($("#uss_foto_description").outerHeight(!0)));
138            } else window.isDescriptionBig || (W = 0);
139            I -= C;
140        }
141        var D = 0;
142        if (u) {
143            var H;
144            if ($("body .uss_circle_navigation").length) (H = $("body .uss_circle_navigation")).html(u);
145            else {
146                n.after('<div class="uss_circle_navigation">' + u + "</div>"), (H = $("body .uss_circle_navigation"));
147                var T = window.pageYOffset || document.documentElement.scrollTop;
148                H.css({ top: T + getWindowHeight() - H.outerHeight(!0), "margin-left": (_ - $(".uss_circle_navigation").outerWidth()) / 2 + $(document).scrollLeft() + "px" }),
149                    H.find(".uss_foto_nav_item:not(.ignore)").die("click"),
150                    H.find(".uss_foto_nav_item:not(.ignore)").live("click", function () {
151                        if ($(this).hasClass("active")) return !1;
152                        if ($(this).hasClass("prev")) beforeUSSfoto(s);
153                        else if ($(this).hasClass("next")) nextUSSfoto(s);
154                        else {
155                            if (((l = $("#uss_foto_point")).parent().hasClass("column") && (l = l.parent()), $("#uss_foto_point").
155closest(".slick-slide").length))
156                                e = $("#uss_foto_point").closest(".slick-track").find(".slick-slide:not(.slick-cloned)").find(".uss_img_ico, .uss_img_item, .uss_one_image").eq($(this).data("index"));
157                            else var e = $(l.parent().find(o).not(".photo_page_navitem").eq($(this).data("index")));
158                            nextUSSfoto(s, e);
159                        }
160                    });
161            }
162            I -= D = parseInt(H.outerHeight(!0));
163        }
164        a > I && ((i = parseInt(i * (I / a))), (a = I), r.find("img").attr("height", a).attr("width", i));
165        var O = a + C;
166        if (isMobileDevice() && $("#uss_foto_description").length) {
167            $("#uss_foto_description").removeAttr("style");
168            var F = parseInt(getWindowHeight() - O);
169            F > C && ($("#uss_foto_description").css("max-height", F), (O -= C), (O += C = parseInt($("#uss_foto_description").outerHeight(!0))));
170        }
171        var z = (_ - (n.outerWidth() - n.width()) - i) / 2;
172        if (($(document).scrollLeft() > 0 && (z += $(document).scrollLeft()), W > i)) {
173            var B = (W - i) / 2;
174            r.find("img").css("margin", "0 " + B + "px"), (z -= B);
175        }
176        n.animate({ marginLeft: z + "px" }, 250), r.animate({ width: (W > i ? W : i) + "px" }, 250);
177        var P = 0;
178        t && t - O / 2 < 0 && (P = t - O / 2);
179        var A = O / 2 + P + d / 2 + D / 2;
180        n.animate({ marginTop: "-" + A + "px" }, 250),
181            r.animate({ height: a + "px" }, 250, function () {
182                viewImg(r, a, v);
183            }),
184            r.find("img").css("max-width", window.imgMaxWidth + "px");
185    }),
186        (m.src = h),
187    $(".pda_site_container").length > 0 &&
188    ($("#uss_view_conteiner").unbind("mousedown"),
189        $("#uss_view_conteiner").unbind("mousemove"),
190        $(document).unbind("mouseup"),
191        $("#uss_inside_view_conteiner").die("click"),
192        $("#uss_inside_view_conteiner").live("click", function (e) {
193            return (
194                $("#uss_view_conteiner").unbind("mousedown"),
195                    $("#uss_view_conteiner").unbind("mousemove"),
196                    $(document).unbind("mouseup"),
197                    $("#uss_inside_view_conteiner").die("click"),
198                    $("#uss_substrate").remove(),
199                    $("#uss_view_conteiner").remove(),
200                    !1
201            );
202        }),
203        $("#uss_view_conteiner.noclick #uss_inside_view_conteiner").live("click", function () {
204            return !1;
205        }),
206        (check_click = !1),
207        isIOS() && !check_touchwipe_pda
208            ? ($(".uss_submit").val($(".uss_submit").val() + 1),
209                (check_touchwipe_pda = !0),
210                $("#uss_view_conteiner").touchwipe_pda({
211                    wipeLeft: function () {
212                        nextUSSfoto(s);
213                    },
214                    wipeRight: function () {
215                        beforeUSSfoto(s);
216                    },
217                }))
218            : ($("#uss_view_conteiner").bind("mousedown", function (e) {
219                e.preventDefault(), (offset_mouse_start = e.pageX), $("#uss_view_conteiner").removeClass("noclick"), (check_click = !0);
220            }),
221                $("#uss_view_conteiner").bind("mousemove", function (e) {
222                    $("#uss_view_conteiner").addClass("noclick");
223                }),
224                $(document).bind("mouseup", function (e) {
225                    if (!check_click) return !1;
226                    (check_click = !1), (offset_mouse_stop = e.pageX), (rez = offset_mouse_start - offset_mouse_stop), rez > 20 ? nextUSSfoto(s) : rez < -20 && beforeUSSfoto(s);
227                })));
228}
229function centerCircleNavigation(e) {
230    if (e) {
231        var t = createCircleNavigation($("#uss_foto_point"), "div.uss_img_item");
232        $(".uss_circle_navigation").html(t);
233    }
234    var i = (getWindowWidth() - $(".uss_circle_navigation").outerWidth()) / 2 + $(document).scrollLeft();
235    $(".uss_circle_navigation").css({ "margin-left": i });
236}
237function createCircleNavigation(e, t) {
238    if ((e.parent().hasClass("column") && (e = e.parent()), e.closest(".slick-slide").length)) i = e.closest(".slick-track").find(".slick-slide:not(.slick-cloned)").find(t);
239    else var i = e.parent().find(t);
240    var s = "",
241        o = i.not(".photo_page_navitem"),
242        a = o.length,
243        n = o.not(".ignore").index(e.parent().find("#uss_foto_point")),
244        r = i.eq(0).filter(".photo_page_navitem").not(":visible").length > 0,
245        l = i.eq(-1).filter(".photo_page_navitem").not(":visible").length > 0;
246    if (a > 0) {
247        s += '<div class="uss_circle_navigation_inner">';
248        var d = 0,
249            c = 0,
250            _ = 9;
251        a > _ + 1 && n > 0 && (n >= Math.round(_ / 2) && (d = Math.round(n - _ / 2)), d + _ > a && (d = a - _)),
252            a > _ + 1 || r
253                ? (a > _ + 1 && (s += '<div class="uss_circle_navigation_bar"><span class="uss_circle_navigation_bar_point" style="width: ' + (100 * (n + 1)) / a + '%"></span></div>'),
254                    (s += n > 0 || r ? '<span class="uss_foto_nav_item prev">«</span>' : '<span class="empty ignore"></span>'))
255                : _++;
256        for (var u = d; u < a && c < _; u++) {
257            var h = "";
258            o.eq(u).find("img").attr("src") &&
259            (h = /(http:\/\/|https:\/\/)/.test(o.eq(u).find("img").attr("src"))
260                ? ' style="background-image:url(' + o.eq(u).find("img").attr("src") + ')"'
261                : ' style="background-image:url(' + window.location.protocol + "//" + window.location.hostname + o.eq(u).find("img").attr("src") + ')"'),
262                (s += '<span class="uss_foto_nav_item' + (n == u ? " active" : "") + '" data-index="' + u + '"' + h + "></span>"),
263                c++;
264        }
265        (a > _ && n != a - 1) || l ? (s += '<span class="uss_foto_nav_item next">»</span>') : a > _ && (s += '<span class="empty ignore"></span>'), (s += "</div>");
266    }
267    return s;
268}
269function viewImg(e, t, i) {
270    $("#uss_inside_view_conteiner img")
271        .css({ display: "block", opacity: 0 })
272        .animate({ opacity: 1 }, 500, function () {
273            if (i) {
274                var s = $("#uss_foto_description"),
275                    o = s.outerHeight(!0);
276                e.animate({ height: t + o + "px" }, 500), s.css({ visibility: "visible" }), s.slideDown(500);
277            }
278        });
279}
280function nextUSSfoto(e, t) {
281    if (!t)
282        if ($("#uss_foto_point").parent().hasClass("column"))
283            var i = (s = $(".uss_img_ico, .uss_img_item")).index($("#uss_foto_point")) + 1,
284                t = s.eq(i);
285        else if ($("#uss_foto_point").closest(".slick-slide").length)
286            var s = $("#uss_foto_point").closest(".slick-track").find(".slick-slide:not(.slick-cloned)").find(".uss_img_ico, .uss_img_item, .uss_one_image"),
287                i = s.index($("#uss_foto_point")) + 1,
288                t = s.eq(i);
289        else if ("photo_widget" == e) t = $("#uss_foto_point").next(".uss_one_image");
290        else t = $("#uss_foto_point").next(".uss_img_ico, .uss_img_item");
291    if ((0 != t.find(".uss_img_pre").length && (t = t.find(".uss_img_pre")), 0 == t.length)) return !1;
292    var o = t.find("a");
293    if (($("#uss_view_conteiner *").stop(!0, !0), openUSSfoto(o, !1, !0, e), o.hasClass("nextpage"))) {
294        var a = {};
295        (a.type = "next"),
296            (a.listen_page = "1"),
297            $.get($(".uss_pagenator .uss_page_selected").next().find("a").attr("href"), a, function (e) {
298                var t = $(".uss_pagenator .uss_page_selected").next().find("a").attr("href");
299                void 0 !== t && history.pushState(null, null, decodeURI(t)),
300                    o.closest(".uss_photoalbums").replaceWith(e),
301                    $(".uss_page_selected").removeClass("uss_page_selected").next().addClass("uss_page_selected"),
302                    $("#uss_foto_point").is(".uss_img_item_last")
303                        ? ($("#uss_foto_button_next").css("visibility", "hidden"), $("#uss_foto_button_next2").css("visibility", "hidden"))
304                        : ($("#uss_foto_button_next").css("visibility", "visible"), $("#uss_foto_button_next2").css("visibility", "visible")),
305                    $(window).trigger("resize"),
306                    centerCircleNavigation(!0);
307            });
308    }
309    centerCircleNavigation();
310}
311function beforeUSSfoto(e) {
312    if ($("#uss_foto_point").parent().hasClass("column"))
313        var t = (s = $(".uss_img_ico, .uss_img_item")).index($("#uss_foto_point")) - 1,
314            i = s.eq(t);
315    else if ($("#uss_foto_point").closest(".slick-slide").length)
316        var s = $("#uss_foto_point").closest(".slick-track").find(".slick-slide:not(.slick-cloned)").find(".uss_img_ico, .uss_img_item, .uss_one_image"),
317            t = s.index($("#uss_foto_point")) - 1,
318            i = s.eq(t);
319    else if ("photo_widget" == i) $("#uss_foto_point").prev(".uss_one_image");
320    else i = $("#uss_foto_point").prev();
321    if ((0 != i.find(".uss_img_pre").length && (i = i.find(".uss_img_pre")), 0 == i.length)) return !1;
322    var o = i.find("a");
323    if (($("#uss_view_conteiner *").stop(!0, !0), openUSSfoto(o, !1, !0, e), o.hasClass("prevpage"))) {
324        var a = {};
325        (a.type = "prev"),
326            (a.listen_page = "1"),
327            $.get($(".uss_pagenator .uss_page_selected").prev().find("a").attr("href"), a, function (e) {
328                var t = $(".uss_pagenator .uss_page_selected").prev().find("a").attr("href");
329                void 0 !== t && history.pushState(null, null, decodeURI(t)),
330                    o.closest(".uss_photoalbums").replaceWith(e),
331                    $(".uss_page_selected").removeClass("uss_page_selected").prev().addClass("uss_page_selected"),
332                    $("#uss_foto_point").is(".uss_img_item_first")
333                        ? ($("#uss_foto_button_before").css("visibility", "hidden"), $("#uss_foto_button_before2").css("visibility", "hidden"))
334                        : ($("#uss_foto_button_before").css("visibility", "visible"), $("#uss_foto_button_before2").css("visibility", "visible")),
335                    centerCircleNavigation(!0),
336                    $(window).trigger("resize");
337            });
338    }
339    centerCircleNavigation();
340}
341function brightnessUSSfoto() {
342    var e,
343        t = $("#uss_substrate"),
344        i = parseFloat(t.css("opacity"));
345    (e = i < 1 ? i + 0.2 : 0), t.css("opacity", e);
346}
347function reviewUSSPlay(e) {
348    e = e || !1;
349}
350function closeUSSfoto() {
351    $("body").removeClass("with_substrate"),
352    !isMobileDevice() && $("body").css("padding-right") && $("body").css("padding-right", "0"),
353        $("#uss_substrate").remove(),
354        $("#uss_view_conteiner").remove(),
355        $(".uss_circle_navigation").remove(),
356        $.each($("#uss_foto_point"), function () {
357            $(this).removeAttr("id");
358        });
359}
360function navigateKey(e) {
361    if ((window.event && (e = window.event), $("#uss_substrate").length && e))
362        switch (e.keyCode ? e.keyCode : e.which ? e.which : null) {
363            case 27:
364                closeUSSfoto();
365                break;
366            case 37:
367                beforeUSSfoto(window.wtype);
368                break;
369            case 39:
370            case 13:
371            case 32:
372                e.preventDefault(), nextUSSfoto(window.wtype);
373        }
374}
375function changeItemInBasket(e, t, i, s, o, a) {
376    if ($(e).hasClass("already_in_cart")) return !0;
377    var n = $("body");
378    n.css("cursor", "wait");
379    var r = $(".uss_basket_wrapper.uss_basket_mini"),
380        l = $(".uss_basket_wrapper.uss_basket_big"),
381        d = $(".uss_user_basket"),
382        c = !1,
383        _ = !1,
384        u = !1;
385    r.length > 0 && (c = !0), l.length > 0 && (_ = !0), d.length > 0 && (u = !0);
386    var h = $(e).attr("href");
387    if (!s) {
388        var f = $(e).val();
389        (f = f.replace(",", ".")), (!(f = 1 * parseFloat(f).toFixed(2)) || f <= 0) && (f = 1), $(e).val(f);
390    }
391    if (!h && !f) return !1;
392    if (h) {
393        var m = $(e),
394            p = m.html();
395        $(e).removeAttr("href"), m.html('<span class="uss_basket_loader">&nbsp;&nbsp;&nbsp;&nbsp;</span>');
396    }
397    if ((f && !h && (h = "basket/?change=" + t + "&amount=" + f), s || (s = 0), (s = parseFloat(s)) > 0)) g = s;
398    else var g = 0;
399    $(e).parents("tr.basket_item").length && (arr = $(e).parents("tr.basket_item").attr("id").split("_"));
400    var v = {};
401    if (o && o > 0)
402        for (var b = 0; b < o; b++)
403            $(".uss_specifications").length
404                ? ((specItem = $(".uss_specifications .spec_item #specification_" + t + "_" + b).val()), specItem && (v["spec" + b] = specItem))
405                : "undefined" != typeof arr && void 0 !== arr[3 + b] && (v["spec" + b] = arr[3 + b]);
406    if ($(e).closest(".uss_eshop_item").length > 0) w = $(e).closest(".uss_eshop_item").find(".eshop_filters_area").find("select, input").length > 0;
407    else if ($(e).closest(".uss_shop_detail_pos").length > 0) w = $(e).closest(".uss_shop_detail_pos").find(".eshop_filters_area").find("select, input").length > 0;
408    else if ($(e).closest(".uss_eshop_block_item ").length > 0) w = $(e).closest(".uss_eshop_block_item").find(".eshop_filters_area").find("select, input").length > 0;
409    else if ($(e).closest(".uss_eshop_sameproducts").length > 0) var w = $(e).closest(".item").find(".eshop_filters_area").find("select, input").length > 0;
410    if (1 == w) {
411        var y = getEshopFilters(e);
412        $.extend(v, y);
413    }
414    (v.minbasket = c), (v.bigbasket = _), (v.mainbasket = u), (v.addamount = g), (v.basketorderdata = 1);
415    var k = getBasketWidgetIds();
416    return (
417        k.length && (v.widgets = k),
418        $(".uss_basket_mini span.totals").html() && (v.style = 1),
419        1 == $(".fc_radio.delivery input:radio:checked").length && (v.delivery = $(".fc_radio.delivery input:radio:checked").val()),
420            $.get(
421                h,
422                v,
423                function (o) {
424					if (o.totalSumNumber < 3000) {
425						$('.buyCredit-link').hide();
426					}else if (o.totalSumNumber > 3000) {
427						$('.modal-wrap').replaceWith(o.tinkoffFormData);
428						$('.buyCredit-link').show();
429						if (o.totalSumNumber > 20000) {
430							$('.buyCredit-link span').text('Êóïèòü â ðàññðî÷êó');
431						}else {
432							$('.buyCredit-link span').text('Êóïèòü â êðåäèò');
433						}
434						
435					}
436                    if ($(e).hasClass("goto_basket")) return (window.location.href = "basket/"), !1;
437                    if (c && o.mini) {
438                        var a = r.find(".amounts").find(".countword").html(),
439                            d = r.find(".totals").find(".priceword").html();
440                        r.html(o.mini), a && r.find(".amounts").find(".countword").html(a), d && r.find(".totals").find(".priceword").html(d);
441                    }
442                    if ((_ && o.big && l.html(o.big), u && o.main)) {
443                        var f = $("#uss_basket_totals");
444                        f.html() ? f.html(o.main) : ($("body").append(o), (I = $("#uss_basket_ask_where_to_go_block")).siblings("span.currency_total").remove());
445                    } else {
446                        var g = $("#uss_block_basket_totals").html();
447                        $("#uss_basket_totals").html(g);
448                    }
449                    k.length && o.basket_widgets && setBasketWidgets(o.basket_widgets);
450                    var v = $("#basket_amount_" + t);
451                    if (i) b = i;
452                    else if (s) b = parseFloat(v.val()) + parseFloat(s);
453                    else var b = parseFloat(v.val());
454                    if (((b = 1 * b.toFixed(2)) <= 0 && (b = parseFloat(v.val())), b)) {
455                        v.val(b);
456                        var w = parseFloat($("#basket_item_price_" + t).attr("rel"));
457                        if (!isNaN(w)) {
458                            var y = b * w;
459                            (arr = y + ""), (arr = arr.split(".")), arr.length > 1 ? (count = 2) : (count = 0), (y = number_format(y, count, ".", $("#basket_item_price_" + t).attr("razd"))), $("#basket_item_total_" + t).html(y);
460                        }
461                    }
462                    if (m) m.attr("class");
463                    if (m && m.hasClass("add_to_cart")) {
464                        m.attr("href", "/basket/"), m.addClass("already_in_cart");
465                        var C = $(".text_after_order_" + t)
466                            .eq(0)
467                            .html();
468                        m.html(C).attr("title", C);
469                        var x = $(".basket_amount_pos_" + t);
470                        if (x) {
471                            var S = x.siblings(".amount_title");
472                            x.val(1), S.addClass("hidden"), x.addClass("hidden");
473                        }
474                    } else
475                        m &&
476                        ($(e).attr("href", h),
477                            m.html(p),
478                        $(e).hasClass("show-basket-send-message") &&
479                        ($(e).before('<span class="basket-send-message-block">' + $(e).attr("data-message") + "</span>"),
480                            setTimeout(function () {
481                                $(e)
482                                    .parent()
483                                    .find(".basket-send-message-block")
484                                    .animate({ opacity: 0 }, 300, function () {
485                                        $(this).remove();
486                                    });
487                            }, 1e3)));
488                    if (o.ask) {
489                        $("#uss_basket_ask_where_to_go_block").length > 0 && $("#uss_basket_ask_where_to_go_block").remove(), $("body").append(o.ask);
490                        var I = $("#uss_basket_ask_where_to_go_block"),
491                            W = Math.round((getClientHeight() - 2 * I.height()) / 2) + getScrollY(),
492                            E = Math.round((getClientWidth() - I.width()) / 2);
493                        I.css("top", W + "px"), I.css("left", E + "px");
494                    }
495
496                    if(typeof o.ecommerce != 'undefined' && o.ecommerce){
497                        try {
498                            eval(o.ecommerce);
499                        } catch (e) {
500                            console.error(e);
501                        }
502                    }
503
504                    u && o.basketOrderData && setBasketData(o.basketOrderData), n && n.css("cursor", "default");
505                },
506                "json"
507            ),
508            !1
509    );
510}
511function getWrapperPos(e) {
512    var t;
513    return (
514        e.closest(".uss_eshop_item").length > 0
515            ? (t = e.closest(".uss_eshop_item"))
516            : e.closest(".uss_shop_detail_pos").length > 0
517            ? (t = e.closest(".uss_shop_detail_pos"))
518            : e.closest(".uss_eshop_block_item ").length > 0
519                ? (t = e.closest(".uss_eshop_block_item"))
520                : e.closest(".uss_eshop_sameproducts ").length > 0 && (t = e.closest(".item")),
521            t
522    );
523}
524function getEshopFilters(e) {
525    var t = {};
526    if ($(e).closest(".uss_eshop_item").length > 0) i = $(e).closest(".uss_eshop_item").find(".eshop_filters_area");
527    else if ($(e).closest(".uss_shop_detail_pos").length > 0) i = $(e).closest(".uss_shop_detail_pos").find(".eshop_filters_area");
528    else if ($(e).closest(".uss_eshop_block_item ").length > 0) i = $(e).closest(".uss_eshop_block_item").find(".eshop_filters_area");
529    else if ($(e).closest(".uss_eshop_sameproducts ").length > 0) i = $(e).closest(".item").find(".eshop_filters_area");
530    else if ($(e).closest(".section_eshop").children(".buy_one_click_form_inp
530os").length > 0) var i = $(e).closest(".section_eshop").find(".uss_shop_detail_pos .eshop_filters_area");
531    return (
532        i.length &&
533        $.each(i.find("input:checked, select option:selected"), function () {
534            var e = $(this).get(0).tagName;
535            if ("INPUT" == e)
536                0 != $(this).val() &&
537                ("checkbox" == $(this).attr("type") ? (void 0 === t[$(this).attr("name")] && (t[$(this).attr("name")] = new Array()), t[$(this).attr("name")].push($(this).val())) : (t[$(this).attr("name")] = $(this).val()));
538            else if ("OPTION" == e) {
539                var i = $(this).closest("select").attr("name");
540                $(this).parent().attr("multiple") ? (void 0 === t[(i += "[]")] && (t[i] = new Array()), t[i].push($(this).val())) : 0 != $(this).val() && (t[i] = $(this).val());
541            }
542        }),
543            t
544    );
545}
546function removeItemFromBasket(e, t) {
547    var i = $(".uss_basket_wrapper.uss_basket_mini"),
548        s = $(".uss_basket_wrapper.uss_basket_big"),
549        o = $(".uss_user_basket"),
550        a = !1,
551        n = !1,
552        r = !1;
553    i.length > 0 && (a = !0), s.length > 0 && (n = !0), o.length > 0 && (r = !0);
554    var l = $(e).attr("href");
555    if (!l) return !1;
556    var d = $(e);
557    d.html();
558    $(e).removeAttr("href"), d.html('<span class="uss_basket_loader">&nbsp;&nbsp;&nbsp;&nbsp;</span>');
559    var c = {};
560    (c.minbasket = a), (c.bigbasket = n), (c.mainbasket = r), (c.basketorderdata = 1);
561    var _ = getBasketWidgetIds();
562    return (
563        _.length && (c.widgets = _),
564        1 == $("div.delivery.radio input:radio:checked").length && (c.delivery = $("div.delivery.radio input:radio:checked").val()),
565        $(".uss_basket_mini span.totals").html() && (c.style = 1),
566            $.get(
567                l,
568                c,
569                function (e) {
570					if (e.totalSumNumber < 3000) {
571						$('.buyCredit-link').hide();
572					}else if (e.totalSumNumber > 3000) {
573						$('.modal-wrap').replaceWith(e.tinkoffFormData);
574						$('.buyCredit-link').show();
575						if (e.totalSumNumber > 20000) {
576							$('.buyCredit-link span').text('Êóïèòü â ðàññðî÷êó');
577						}else {
578							$('.buyCredit-link span').text('Êóïèòü â êðåäèò');
579						}
580						
581					}					
582                    if (a && e.mini) {
583                        var o = i.find(".amounts").find(".countword").html(),
584                            l = i.find(".totals").find(".priceword").html();
585                        i.html(e.mini), o && i.find(".amounts").find(".countword").html(o), l && i.find(".totals").find(".priceword").html(l);
586                    }
587                    n && e.big && s.html(e.big), _.length && e.basket_widgets && setBasketWidgets(e.basket_widgets), $(".uss_user_basket #basket_item_" + t).remove();
588                    var d = $("#uss_block_basket_totals").html();
589
590                    if(typeof e.ecommerce != 'undefined' && e.ecommerce){
591                        try {
592                            eval(e.ecommerce);
593                        } catch (e) {
594                            console.error(e);
595                        }
596                    }
597
598                    d ? $("#uss_basket_totals").html(d) : r && e.main ? $("#uss_basket_totals").html(e.main) : ($(".uss_user_basket").html(e.main), $("#basket2form_id").html("")),
599                        "" == d ? $(".uss_bottom").hide() : $(".uss_bottom").show(),
600                    r && e.basketOrderData && setBasketData(e.basketOrderData);
601                },
602                "json"
603            ),
604            !1
605    );
606}
607function setBasketData(e) {
608    var t = JSON.parse(e);
609    if (
610        (void 0 !== t.total_sum_display && $("#uss_basket_totals").html(t.total_sum_display),
611            void 0 !== t.min_sum_order_error && t.min_sum_order_error
612                ? ($(".uss_shop_form .uss_form_tml, .uss_shop_form .fc_form_tml .fc_form").addClass("form_basket_hide"), $(".uss_min_sum_order_text_wrapper").html(t.min_sum_order_error))
613                : ($(".uss_shop_form .uss_form_tml, .uss_shop_form .fc_form_tml .fc_form").removeClass("form_basket_hide"), $(".uss_min_sum_order_text_wrapper").html("")),
614        void 0 !== t.basket_total_sum_cur &&
615        t.basket_total_sum_cur &&
616        $(".uss_bottom")
617            .children(".totals")
618            .children(".title")
619            .html(t.basket_total_sum_cur + ":"),
620            void 0 !== t.discount_text && t.discount_text
621                ? $(".uss_bottom.sum_with_discount")
622                    .html('<td colspan="7" class="totals"><span id="uss_basket_sum_with_discount">' + t.discount_text + "</span></td>")
623                    .removeClass("hide")
624                : $(".uss_bottom.sum_with_discount").html("").addClass("hide"),
625            void 0 !== t.delivery_data && void 0 !== t.delivery_data.price && t.delivery_data.price > 0
626                ? $(".uss_bottom.sum_delivery")
627                    .html('<td colspan="7" class="totals">' + t.delivery_data.price_str + "</td>")
628                    .removeClass("hide")
629                : $(".uss_bottom.sum_delivery").html("").addClass("hide"),
630            void 0 !== t.total_order_sum_display && t.total_order_sum_display
631                ? $(".uss_bottom.total_order_sum")
632                    .html('<td colspan="7" class="totals">' + t.total_order_sum_display + "</td>")
633                    .removeClass("hide")
634                : $(".uss_bottom.total_order_sum").html("").addClass("hide"),
635        void 0 !== t.delivery_data_price && t.delivery_data_price)
636    ) {
637        var i = $(".fc_radio.delivery");
638        0 != i.length &&
639        $.each(i.find(".elements_set .radio_wrapper"), function () {
640            var e = $(this).find("input:radio").val();
641            void 0 !== t.delivery_data_price[e] && $(this).find(".description_inline").html(t.delivery_data_price[e]);
642        });
643    }
644    void 0 !== t.empty_basket && ($(".uss_user_basket").html(t.empty_basket), $(".uss_shop_form").remove());
645}
646function setBasketWidgets(e) {
647    $.each(e, function (e, t) {
648        $(".widget_basket.widget_" + e).replaceWith(t);
649    });
650}
651function closePopupBasketWindow() {
652    $("#uss_basket_ask_where_to_go_block").remove();
653}
654function eshopUSSchangeDetailImage(e) {
655    var t = $(".uss_img_big .uss_eshop_icons").html(),
656        i = $(".uss_img_big .uss_eshop_icons").attr("class"),
657        s = e.attr("href"),
658        o = new Image();
659    (o.onload = function () {
660        o.onload = null;
661        var e = o.width,
662            s = o.height,
663            a = $("div.uss_img_big_image"),
664            n = '<img src="' + o.src + '" width="' + e + '" height="' + s + '" alt="" />';
665        a.html(n), t && a.append('<div class="' + i + '">' + t + "</div>");
666    }),
667        (o.src = s);
668}
669function changeFilterFormAction(e) {
670    var t = $(e).parents("form#uss_block_filters");
671    if ($(e).attr("checked")) {
672        var i = $("#filter_action").attr("class");
673        t.attr("action", i);
674    } else {
675        var s = $("#filter_actiondefault").attr("class");
676        t.attr("action", s);
677    }
678}
679function deleteWish(e, t, i) {
680    (i = i || ""),
681        $.ajax({
682            url: $(e).attr("href") + "&harakteristics=" + i,
683            success: function (e) {
684                $(".uss_user_wishlist table tr#basket_item_" + t + i).length && $(".uss_user_wishlist table tr#basket_item_" + t + i).remove(),
685                $(".uss_user_wishlist table td").length <= 0 && $(".uss_user_wishlist").html("Ó âàñ íåò îòëîæåííûõ òîâàðîâ"),
686                $(".uss_wishlist_big .wishlist_item").length && ($(".uss_wishlist_big .wishlist_item_" + t + i).remove(), $(".uss_wishlist_big .wishlist_item").length || $(".uss_wishlist_big").append("Ó âàñ íåò îòëîæåííûõ òîâàðîâ"));
687            },
688        });
689}
690function addWish(e, t, i, s) {
691    s = 0;
692    var o = $(".uss_wishlist_big"),
693        a = $(e).attr("href"),
694        n = $(e).attr("href").split("?");
695    $(e).parents("tr").length && (arr = $(e).parents("tr").attr("id").split("_")),
696    i && $(e).next().click(),
697    s || ($(e).attr("href", n[0]), $(e).attr("onClick", "")),
698        $.ajax({
699            url: a,
700            type: "POST",
701            beforeSend: function () {
702                $(e).hide().before('<span class="uss_basket_loader">&nbsp;&nbsp;&nbsp;&nbsp;</span>'), $(e).closest(".uss_delete_pos").length && $(e).closest(".uss_delete_pos").find(".del_basket_item").hide();
703            },
704            success: function (t) {
705                s || $(e).html("Òîâàð îòëîæåí"), $(e).show(), $(e).parent().find(".uss_basket_loader").remove(), o.length && !$(e).hasClass("already_in_wish") && (o.find("p").remove(), o.append(t));
706            },
707        });
708}
709function number_format(e, t, i, s) {
710    var o,
711        a,
712        n,
713        r,
714        l,
715        d = "";
716    return (
717        e < 0 && ((d = "-"), (e *= -1)),
718        isNaN((t = Math.abs(t))) && (t = 2),
719        void 0 == i && (i = ","),
720        void 0 == s && (s = "."),
721            (o = parseInt((e = (+e || 0).toFixed(t))) + ""),
722            (a = o.length) > 3 ? (a %= 3) : (a = 0),
723            (l = a ? o.substr(0, a) + s : ""),
724            (n = o.substr(a).replace(/(\d{3})(?=\d)/g, "$1" + s)),
725            (r = t
726                ? i +
727                Math.abs(e - o)
728                    .toFixed(t)
729                    .replace(/-/, 0)
730                    .slice(2)
731                : ""),
732        d + l + n + r
733    );
734}
735function setPriceIfZero(e, t, i) {
736    s = "uss_shop_price";
737    if (0 == e.closest(t).find("." + s).length) var s = "uss_price";
738    if (
739        !e
740            .closest(t)
741            .find("." + s + " .price_zero_class")
742            .hasClass("price_zero_class_for_amount")
743    )
744        return (
745            e
746                .closest(t)
747                .find("." + s + " .price_zero_class")
748                .hide(),
749                e
750                    .closest(t)
751                    .find("." + s + " " + i)
752                    .append(
753                        '<em class="price_class" data-clear-price="0"></em> <em class="currency_class">' +
754                        e
755                            .closest(t)
756                            .find("." + s + " .price_zero_class")
757                            .attr("data-currency") +
758                        "</em>"
759                    ),
760                e
761                    .closest(t)
762                    .find("." + s + " " + i)
763                    .find(".price_class")
764        );
765}
766function calculateEshopFilterPrice(e) {
767    var t = null;
768    if (e.closest(".uss_shop_detail_pos").length > 0) {
769        i = ".uss_shop_detail_pos";
770        0 == (t = e.closest(i).find(".uss_shop_price .price").not(".old_price").find(".price_class")).length && e.closest(i).find(".uss_shop_price .price_zero_class") && (t = setPriceIfZero(e, i, ".price"));
771    } else if (e.closest(".uss_eshop_item").length > 0) {
772        i = ".uss_eshop_item";
773        0 == (t = e.closest(i).find(".actual_price .price_class")).length && e.closest(i).find(".uss_shop_price .price_zero_class") && (t = setPriceIfZero(e, i, ".actual_price"));
774    } else if (e.closest(".uss_eshop_block_item").length > 0) {
775        i = ".uss_eshop_block_item";
776        0 == (t = e.closest(i).find(".actual_price .price_class")).length && e.closest(i).find(".uss_shop_price .price_zero_class").length && (t = setPriceIfZero(e, i, ".actual_price"));
777    } else if (e.closest(".uss_eshop_sameproducts").length > 0) {
778        var i = ".item";
779        0 == (t = e.closest(i).find(".actual_price .price_class")).length && e.closest(i).find(".uss_shop_price .price_zero_class") && (t = setPriceIfZero(e, i, ".actual_price"));
780    }
781    if (null != t && 0 != t.length) {
782        var s = parseFloat(t.attr("data-clear-price").replace(/[^\d\.,]/g, "")) || 0;
783        if (e.closest(".uss_shoppos_table").length > 0) o = e.closest("tr").find(".eshop_filters_area");
784        else var o = e.closest(i);
785        $.each(o.find("input:checkbox:checked, input:radio:checked"), function () {
786            if ($(this).val() > 0 && $(this).attr("data-dop-price")) {
787                var e = parseFloat($(this).attr("data-dop-price"));
788                e > 0 && (s += e);
789            }
790        }),
791            $.each(o.find("select"), function () {
792                var e = $(this).val();
793                if (void 0 !== e)
794                    if ("object" == typeof e && $(this).find("option:selected").length > 0)
795                        for (var t = 0; t <= e.length - 1; t++)
796                            (i = parseFloat(
797                                $(this)
798                                    .find('option[value="' + e[t] + '"]')
799                                    .attr("data-dop-price")
800                            )) > 0 && (s += i);
801                    else if (e > 0 && $(this).find("option:selected").attr("data-dop-price")) {
802                        var i = parseFloat($(this).find("option:selected").attr("data-dop-price"));
803                        i > 0 && (s += i);
804                    }
805            }),
806            0 == s && 1 == t.parent().find(".price_zero_class").length
807                ? (t.parent().find(".price_zero_class").show(), t.parent().find(".price_class, .currency_class").remove())
808                : ((s = number_format(s, s == ~~s ? 0 : 2, ".", " ")), t.html(s));
809    }
810}
811function getBasketWidgetIds() {
812    var e = [];
813    return (
814        $(".widget_item.widget_basket").each(function () {
815            e.push($(this).attr("data-id"));
816        }),
817            e
818    );
819}
820function buyOneClickOpenForm(e, t) {
821    var i = "";
822    $(e).find("form:first").hasClass("wide") ? (i = " wide") : $(e).find("form:first").hasClass("wide_big") && (i = " wide_big");
823    var s = '<div class="buy_one_click_form_tml" data-hash="' + t + '"><div class="buy_one_click_window_wrap' + i + '"><a href="javascript:void(0);" class="close"></a><div class="buy_one_click_window">' + e + "</div></div></div>";
824    $("body").append('<div id="uss_substrate2" />' + s),
825        $("body #uss_substrate2").show().animate({ opacity: 0.4 }, 100),
826        $("body .buy_one_click_form_tml")
827            .show(0, function () {
828                initStyler();
829            })
830            .animate({ opacity: 1 }, 100);
831    var o = $(".buy_one_click_form_tml");
832    if ((o.css({ "margin-left": "-" + o.width() / 2 + "px" }), o.outerHeight(!0) < $(window).height())) {
833        var a = ($(window).height() - o.outerHeight()) / 2;
834        o.css({ "margin-top": a + "px" });
835    }
836    var n = $(window).scrollTop();
837    $(document).height() < o.outerHeight(!0) + $(window).scrollTop() && (n = $(window).scrollTop() - (o.outerHeight(!0) + $(window).scrollTop() - $(document).height())), o.css({ top: n + "px" });
838}
839function buyOneClickChangeAmount(e, t) {
840    var i = e.closest(".buy_one_click_window_wrap").find("input.amount").val();
841    if (-1 == t && i <= 1) return !1;
842    buyOneClickCalculatePrice(e, parseInt(i) + t);
843}
844function buyOneClickCalculatePrice(e, t) {
845    t <= 0 && (t = 1);
846    var i = e.closest(".buy_one_click_window_wrap");
847    i.find("input.amount").val(t), i.find("input.fc_field__amount").val(t);
848    var s = i.find(".actual_price .price_class span"),
849        o = 0;
850    s.attr("rel").split(".").length > 1 && (o = 2);
851    var a = s.attr("rel") * t;
852    s.html(number_format(a, o, ".", s.attr("razd")));
853}
854function addCompare(e, t) {
855    var i = $(e),
856        s = i.attr("data-url");
857    if (s) {
858        i.html();
859        $(e).removeAttr("href"), i.html('<span class="uss_basket_loader">&nbsp;&nbsp;&nbsp;&nbsp;</span>');
860    }
861    var o = s.split("?", 1);
862    o = o[0];
863    var a = {};
864    (a.compare = "ajax"),
865        (a.item_id = t),
866    $(".compare_count_block").length > 0 && (a.widget = !0),
867        $.get(s, a, function (e) {
868            i
869                .attr("href", o + "compare/")
870                .removeAttr("onclick")
871                .removeAttr("data-url")
872                .addClass("already_in_compare")
873                .html(i.attr("data-already-title")),
874            e && $(".compare_count_block").length > 0 && $(".compare_count_block").replaceWith(e);
875        });
876}
877function initCompareTable(e, t) {
878    (t = t || !1),
879        e
880            .closest(".compare_block_wrapper")
881            .find(".header_table_wrap")
882            .css({ width: e.closest(".compare_block_wrapper").width() - 1 });
883    var i = e.closest(".compare_block_wrapper").outerWidth();
884    if (
885        (new RegExp(/compare\/\?items=/).test(window.location.href) || setCompareUrl(),
886            e.closest(".compare_wrap").hasClass("pda")
887                ? e.find("tr").each(function () {
888                    $(this).css({ height: $(this).outerHeight(!0) });
889                })
890                : "startInit" == t
891                ? setTimeout(function () {
892                    calculateCompareColumnsWidth(e.closest(".compare_block_wrapper"));
893                }, 50)
894                : "resize" == t && calculateCompareColumnsWidth(e.closest(".compare_block_wrapper")),
895        e.width() - 5 <= i)
896    )
897        return !1;
898    e.closest(".tab_item").find(".compare_scroll.right").removeClass("hide"),
899        setTimeout(function () {
900            e.closest(".compare_wrap").hasClass("pda") ? setCompareSliderButtonsPda() : setCompareSliderButtons();
901        }, 50);
902}
903function calculateCompareColumnsWidth(e) {
904    var t = e.outerWidth(),
905        i = e.find(".body_table tr:first td:first"),
906        s = e.find(".body_table tr:first td").length - 1;
907    if (
908        (s <= 3 &&
909        e
910            .removeClass("c_items_1")
911            .removeClass("c_items_2")
912            .removeClass("c_items_3")
913            .addClass("c_items_" + s),
914            !(e.find(".body_table tr:first td").length <= 1))
915    ) {
916        var o = (t - i.outerWidth()) / s,
917            a = i.outerWidth() - i.width();
918        if (o < 140)
919            var n = Math.floor((t - i.outerWidth()) / 140),
920                r = (t - i.outerWidth()) / n;
921        else r = o;
922        e.find(".td_item .cell_inner").css("width", r - a);
923    }
924}
925function setCompareSliderButtons() {
926    if ($(".tab_item.selected .compare_scroll.right").hasClass("proc_fixed")) {
927        var e = $(".tab_item.selected").closest(".compare_block");
928        parseInt(
929            $(".tab_item.selected .compare_scroll.right")
930                .css("right")
931                .replace(/[a-zA-Z]*/g, "")
932        );
933        $(".tab_item.selected .compare_scroll.left").css({ left: e.offset().left }), $(".tab_item.selected .compare_scroll.right").css({ left: e.offset().left + e.width() - $(".tab_item.selected .compare_scroll.right").width() });
934    }
935    if ($(".tab_item.selected .header_table_wrap").hasClass("fixed"))
936        $(".tab_item.selected")
937            .find(".compare_scroll")
938            .css({ "margin-top": $(".tab_item.selected .header_table tr:first").outerHeight() });
939    else {
940        var t = $(".tab_item.selected .body_table tr:first");
941        $(".tab_item.selected").find(".compare_scroll").css({ "margin-top": t.outerHeight() });
942    }
943}
944function setCompareSliderButtonsPda() {
945    $(".tab_item.selected .compare_table").width() > $(".tab_item.selected").closest(".compare_block").width() && $(".tab_item.selected .compare_scroll.right").removeClass("hide"),
946    $(".tab_item.selected .compare_table td.hidden_cell").length > 0 && $(".tab_item.selected .compare_scroll.left").removeClass("hide");
947    var e,
948        t = $(".tab_item.selected .compare_table tr:first").outerHeight(),
949        i = $(".tab_item.selected .compare_table").offset().top,
950        s = $(window).scrollTop(),
951        o = $(".tab_item.selected .compare_scroll:not(.hide) span").outerHeight(!0);
952    (e = $(window).height() / 2 - o / 2 - (i - s)) > $(".tab_item.selected .compare_table").outerHeight() - o && (e = $(".tab_item.selected .compare_table").outerHeight() - o),
953    e < t && (e = t),
954        $(".tab_item.selected .compare_scroll").css({ top: e });
955}
956function delCompare(e, t) {
957    var i = e.closest("td").attr("data-pos-id"),
958        s = e.closest("table"),
959        o = e.closest(".compare_block_wrapper"),
960        a = o.closest(".tab_item"),
961        n = e.attr("href"),
962        t = t || !1,
963        r = e.closest(".compare_wrap").hasClass("pda");
964    r
965        ? t
966        ? e.closest(".compare_block_wrapper").find("tr").remove()
967        : e
968            .closest(".compare_block_wrapper")
969            .find(".td_item_" + i + ":first")
970            .closest("tr")
971            .remove()
972        : t
973        ? e.closest(".compare_block_wrapper").find(".td_item").remove()
974        : e
975            .closest(".compare_block_wrapper")
976            .find(".td_item_" + i)
977            .remove(),
978        afterCompareDelete(s, a, o, r),
979        $.get(n, { compare: "ajax", widget: $(".compare_count_block").length > 0 }, function (e) {
980            e && $(".compare_count_block").length > 0 && $(".compare_count_block").replaceWith(e);
981        });
982}
983function afterCompareDelete(e, t, i, s) {
984    if ((n = e.find("tr:first td").length) < 2) {
985        var o = e.closest(".compare_wrap");
986        if (o.find(".compare_block_tabs").children("span").length > 0) {
987            var a = o.find(".compare_block_tabs").children("span.selected").attr("rel");
988            o.find("#" + a).remove(), o.find(".compare_block_tabs").children("span.selected").remove(), o.find(".compare_block_tabs").children("span:first").trigger("click");
989        }
990        0 == o.find(".compare_block_tabs").children("span").length && (o.find(".compare_block_tabs").remove(), o.find(".tab_items").remove(), o.append('<div class="empty_compare">' + o.attr("data-empty-compare") + "</div>"));
991    } else {
992        if (s)
993            for (var n = e.find("tr").length, r = 1; r <= e.find("tr:first td").length; r++) {
994                var l = !0,
995                    d = "";
996                e.find("tr>td.td_item:nth-child(" + r + ")").each(function (e, t) {
997                    $(this).is(".image") || $(this).is(".controls") || $(this).is(".del_link") || $(this).is(".to_basket") ? (l = !1) : 0 == e && l ? (d = $(this).text()) : e > 0 && l && d != $(this).text() && (l = !1);
998                }),
999                    e.find("tr>td:nth-child(" + r + ")").removeClass("same_fields"),
1000                l && e.find("tr>td:nth-child(" + r + ")").addClass("same_fields");
1001            }
1002        else
1003            e.find("tr").each(function () {
1004                if (!($(this).find("td").length != n || $(this).is(".image") || $(this).is(".controls") || $(this).is(".del_link") || $(this).is(".to_basket"))) {
1005                    var e = !0,
1006                        t = "";
1007                    $(this)
1008                        .find("td")
1009                        .each(function (i, s) {
1010                            1 == i && e ? (t = $(this).html()) : i > 1 && e && t != $(this).html() && (e = !1);
1011                        }),
1012                        $(this).removeClass("same_fields"),
1013                    e && $(this).addClass("same_fields");
1014                }
1015            });
1016        if (e.outerWidth() - 5 < i.outerWidth()) {
1017            if (e.find(".hidden_cell").length > 0) {
1018                var c = e.find("tr:first td:last").outerWidth();
1019                if (e.outerWidth() + c <= i.outerWidth()) {
1020                    var _ = e.find("tr:first td.hidden_cell:last").attr("data-pos-id");
1021                    i.find(".td_item_" + _).removeClass("hidden_cell");
1022                }
1023            }
1024            0 == e.find(".hidden_cell").length ? t.find(".compare_scroll").addClass("hide") : t.find(".compare_scroll.right").addClass("hide");
1025        }
1026    }
1027    setCompareUrl();
1028}
1029function setCompareUrl() {
1030    var e = [];
1031    if (
1032        ($(".compare_wrap").hasClass("pda")
1033            ? $(".tab_items")
1034                .find(".body_table")
1035                .find("tr")
1036                .each(function () {
1037                    $(this).find(".td_item:first").length > 0 && e.push($(this).find(".td_item:first").attr("data-pos-id"));
1038                })
1039            : $(".tab_items")
1040                .find(".body_table")
1041                .find("tr:first .td_item")
1042                .each(function () {
1043                    e.push($(this).attr("data-pos-id"));
1044                }),
1045        0 == e.length)
1046    )
1047        t = $(".compare_wrap").attr("data-address");
1048    else var t = $(".compare_wrap").attr("data-address") + "?items=" + e.join(",");
1049    try {
1050        return void history.pushState(null, null, t);
1051    } catch (e) {}
1052}
1053function ajutorEshopFiltersHover(e) {
1054    var t = e.find(".ajutor_info_eshop_filters").clone();
1055    t.addClass("body_ajutor_info"), t.css({ top: e.offset().top - 5, left: e.offset().left + 15, display: "block" }), $("body").append(t);
1056}
1057function getClientWidth() {
1058    return "CSS1Compat" != document.compatMode || window.opera ? document.body.clientWidth : document.documentElement.clientWidth;
1059}
1060function getClientHeight() {
1061    return "CSS1Compat" != document.compatMode || window.opera ? document.body.clientHeight : document.documentElement.clientHeight;
1062}
1063function getScrollY() {
1064    return (
1065        (scrollY = 0),
1066            "number" == typeof window.pageYOffset
1067                ? (scrollY = window.pageYOffset)
1068                : document.documentElement && document.documentElement.scrollTop
1069                ? (scrollY = document.documentElement.scrollTop)
1070                : document.body && document.body.scrollTop
1071                    ? (scrollY = document.body.scrollTop)
1072                    : window.scrollY && (scrollY = window.scrollY),
1073            scrollY
1074    );
1075}
1076function trim(e) {
1077    return e.replace(/\s+$/, "").replace(/^\s+/, "");
1078}
1079function setLeft(e, t) {
1080    samep_block.css({
1081        left: e + "px",
1082        transition: "transform " + t + "s linear",
1083        transform: "translate(" + e + "px, 0)",
1084        transform: "translate3d(" + e + "px, 0px, 0px)",
1085        "-webkit-transition": "-webkit-transform " + t + "s linear",
1086        "-webkit-transform": "translate(" + e + "px, 0)",
1087        "-webkit-transform": "translate3d(" + e + "px, 0px, 0px)",
1088    });
1089}
1090function isIOS() {
1091    var e = navigator.userAgent.toLowerCase(),
1092        t = e.indexOf("ipad") > -1,
1093        i = e.indexOf("iphone") > -1,
1094        s = e.indexOf("ipod") > -1,
1095        o = e.indexOf("android") > -1;
1096    return !!t || !!i || !!s || !!o || (void 0 != navigator && "iPad" == navigator.platform);
1097}
1098function goslide(e, t) {
1099    main_slide_block.bind("mousemove", function (i) {
1100        check_click && (samep_block.addClass("noclick"), (check_click = !1)), setLeft(i.pageX 
1100- e + t, 0);
1101    });
1102}
1103function setSliderWidth() {
1104    if (
1105        ($.each($(".uss_img_sl_line"), function () {
1106            setSliderWidthElem($(this));
1107        }),
1108            $(".uss_img_wrapper.uss_img_sections").length)
1109    ) {
1110        var e = $(".uss_img_wrapper.uss_img_sections .uss_img_big");
1111        e.css("max-height", e.width()), e.find(".big_image_block").css("height", e.width());
1112    }
1113}
1114function setSliderWidthElem(e) {
1115    var t = e.closest(".uss_img_wrapper").width(),
1116        i = e.find("> .big_image_block").length,
1117        s = e.closest(".uss_img_wrapper").find(".uss_img_ico_box > .uss_img_ico.uss_img_ico_active").attr("rel") - 1;
1118    (window.mSliderImgWidth = t), e.css({ width: i * t, "margin-left": "-" + s * t + "px" }), e.find(".big_image_block").css({ width: t });
1119}
1120function startPdaSlider() {
1121    function e(e, t) {
1122        if (!i && !e) return !1;
1123        var s = t.closest(".uss_img_wrapper"),
1124            o = parseInt(s.find(".uss_img_ico_active").attr("rel"));
1125        if (0 == s.find(".uss_img_ico[rel=" + o + "]").next().length) return !1;
1126        o = s
1127            .find(".uss_img_ico[rel=" + o + "]")
1128            .next()
1129            .attr("rel");
1130        var a = t.closest(".uss_img_wrapper").find(".uss_img_sl_line");
1131        if (!(a.width() <= mSliderImgWidth)) {
1132            a.stop(!0, !0);
1133            var n = parseInt(a.css("margin-left"));
1134            n || (n = 0),
1135                (n -= mSliderImgWidth),
1136                a.animate({ "margin-left": n + "px" }, 500),
1137                s.find(".uss_img_big").unbind("mousemove"),
1138                (i = !1),
1139                s.find(".uss_img_ico_box").find(".uss_img_ico").removeClass("uss_img_ico_active"),
1140                s.find(".uss_img_ico[rel=" + o + "]").addClass("uss_img_ico_active"),
1141                0 == s.find(".uss_img_ico[rel=" + o + "]").next().length ? s.find(".bigimgpos_right").addClass("arrow_hidden") : s.find(".bigimgpos_right").removeClass("arrow_hidden"),
1142                0 == s.find(".uss_img_ico[rel=" + o + "]").prev().length ? s.find(".bigimgpos_left").addClass("arrow_hidden") : s.find(".bigimgpos_left").removeClass("arrow_hidden");
1143        }
1144    }
1145    function t(e, t) {
1146        if (!i && !e) return !1;
1147        var s = t.closest(".uss_img_wrapper"),
1148            o = parseInt(s.find(".uss_img_ico_active").attr("rel"));
1149        if (0 == s.find(".uss_img_ico[rel=" + o + "]").prev().length) return !1;
1150        o = s
1151            .find(".uss_img_ico[rel=" + o + "]")
1152            .prev()
1153            .attr("rel");
1154        var a = s.closest(".uss_img_wrapper").find(".uss_img_sl_line");
1155        if (!(a.width() <= mSliderImgWidth)) {
1156            a.stop(!0, !0);
1157            var n = parseInt(a.css("margin-left"));
1158            n || (n = 0),
1159                (n += mSliderImgWidth),
1160                a.animate({ "margin-left": n + "px" }, 500),
1161                s.find(".uss_img_big").unbind("mousemove"),
1162                (i = !1),
1163                s.find(".uss_img_ico_box").find(".uss_img_ico").removeClass("uss_img_ico_active"),
1164                s.find(".uss_img_ico[rel=" + o + "]").addClass("uss_img_ico_active"),
1165                0 ==
1166                s
1167                    .find(".uss_img_ico_box")
1168                    .find(".uss_img_ico[rel=" + o + "]")
1169                    .prev().length
1170                    ? s.find(".bigimgpos_left").addClass("arrow_hidden")
1171                    : s.find(".bigimgpos_left").removeClass("arrow_hidden"),
1172                0 ==
1173                s
1174                    .find(".uss_img_ico_box")
1175                    .find(".uss_img_ico[rel=" + o + "]")
1176                    .next().length
1177                    ? s.find(".bigimgpos_right").addClass("arrow_hidden")
1178                    : s.find(".bigimgpos_right").removeClass("arrow_hidden");
1179        }
1180    }
1181    if (
1182        (setSliderWidth(),
1183        1 != $("#tab_images").length ||
1184        $("#tab_images").hasClass("initialized") ||
1185        $('.uss_eshop_tabs_pda [rel="tab_images"]').bind("click.sliderInit", function () {
1186            1 == $("#tab_images").find(".uss_img_sl_line").length && setSliderWidthElem($("#tab_images").find(".uss_img_sl_line")), $("#tab_images").addClass("initialized"), $(".uss_tabs_navigation .images").unbind("click.sliderInit");
1187        }),
1188            $(window).resize(function () {
1189                setSliderWidth(), 1 == $("#tab_images").length && $("#tab_images").is(":hidden") && $("#tab_images").hasClass("initialized") && $("#tab_images").removeClass("initialized");
1190            }),
1191            isIOS())
1192    )
1193        $(".uss_img_big").touchwipe2({
1194            wipeLeft: function (t) {
1195                e(!0, $(t.target));
1196            },
1197            wipeRight: function (e) {
1198                t(!0, $(e.target));
1199            },
1200        });
1201    else {
1202        var i = !1;
1203        $(".uss_img_big").bind("mousedown", function (s) {
1204            (i = !0),
1205                s.preventDefault(),
1206                (mouse_start = s.pageX),
1207                $(".uss_img_big").bind("mousemove", function (i) {
1208                    var s = i.pageX - mouse_start;
1209                    Math.abs(s) > 20 && (s < 0 ? e(!1, $(this)) : s > 0 && t(!1, $(this)));
1210                });
1211        }),
1212            $(document).bind("mouseup", function (e) {
1213                if (!i) return !1;
1214                $(".uss_img_big").unbind("mousemove"), (i = !1);
1215            });
1216    }
1217    $(".uss_img_big .bigimgpos_right").bind("touchend click", function (t) {
1218        return (!isIOS() || "click" != t.type) && !$(this).hasClass("arrow_hidden") && void e(!0, $(this));
1219    }),
1220        $(".uss_img_big .bigimgpos_left").bind("touchend click", function (e) {
1221            return (!isIOS() || "click" != e.type) && !$(this).hasClass("arrow_hidden") && void t(!0, $(this));
1222        }),
1223        $("div.uss_img_ico_box div.uss_img_ico a").bind("touchend click", function (e) {
1224            if (isIOS() && "click" == e.type) return !1;
1225            var t = $(this).closest(".uss_img_wrapper");
1226            if ($(this).closest(".uss_img_ico").hasClass("uss_img_ico_active")) return !1;
1227            $(this).closest(".uss_img_ico_box").find(".uss_img_ico").removeClass("uss_img_ico_active"), $(this).closest(".uss_img_ico").addClass("uss_img_ico_active");
1228            var i = parseInt($(this).closest(".uss_img_ico").attr("rel")),
1229                s = $(this).closest(".uss_img_wrapper").find(".uss_img_sl_line");
1230            return (
1231                s.stop(!0, !0),
1232                    s.animate({ "margin-left": -(i - 1) * mSliderImgWidth + "px" }, 500),
1233                    0 ==
1234                    t
1235                        .find(".uss_img_ico_box")
1236                        .find(".uss_img_ico[rel=" + i + "]")
1237                        .prev().length
1238                        ? t.find(".bigimgpos_left").addClass("arrow_hidden")
1239                        : t.find(".bigimgpos_left").removeClass("arrow_hidden"),
1240                    0 ==
1241                    t
1242                        .find(".uss_img_ico_box")
1243                        .find(".uss_img_ico[rel=" + i + "]")
1244                        .next().length
1245                        ? t.find(".bigimgpos_right").addClass("arrow_hidden")
1246                        : t.find(".bigimgpos_right").removeClass("arrow_hidden"),
1247                    !1
1248            );
1249        }),
1250        $(".uss_img_wrapper.autoslide").each(function () {
1251            var t = parseInt($(this).attr("data-interval"));
1252            (isNaN(t) || t <= 0) && (t = 5);
1253            var i = $(this);
1254            $(this).find(".uss_img_ico_box .uss_img_ico").length > 1 &&
1255            setInterval(function () {
1256                i.find(".uss_img_ico_box .uss_img_ico:last").hasClass("uss_img_ico_active") ? i.find(".uss_img_ico_box .uss_img_ico:first a").trigger("click") : e(!0, i.find(".uss_img_big .bigimgpos_right"));
1257            }, 1e3 * t);
1258        });
1259}
1260function disableSubmitButton(e, t) {
1261    try {
1262        (void 0 !== t && void 0 !== t.get(0) && "INPUT" == t.get(0).tagName && "submit" == t.get(0).type) || (t = void 0);
1263    } catch (e) {
1264        t = void 0;
1265    }
1266    void 0 == t && (t = e.find("input:submit")),
1267        e.attr("data-sended", "1"),
1268        t.attr("disabled", "disabled"),
1269        t.after('<span class="preloder_small"></span>'),
1270        t.each(function () {
1271            $(this).attr("name") && e.append('<input type="hidden" name="' + $(this).attr("name") + '" value="' + $(this).val() + '">');
1272        });
1273}
1274function submitFormAjax(e) {
1275    e.ajaxSubmit({
1276        success: function (t) {
1277            var i = e.offset().top;
1278            e.closest(".fc_form_tml").replaceWith($(t)), 0 == $("#uss_substrate2").length && $(window).scrollTop() > i && $("html, body").animate({ scrollTop: i }, 500);
1279        },
1280    });
1281}
1282function jsValidate(e) {
1283    "undefined" == typeof formError && (formError = new Object());
1284    var t,
1285        i = !0,
1286        s = new Object(),
1287        o = 0,
1288        a = e.find('input:hidden[name="form_name"]').val();
1289    if (
1290        ($.each(e.find(".fc_item.sector_required, .fc_item.fc_email"), function () {
1291            t = "";
1292            var e = $(this).find("label.sector_title");
1293            if (e.length > 0) n = '<b>"' + e.html().replace(/<[^>].+>/g, "") + '"</b>';
1294            else var n = "";
1295            if ($(this).hasClass("fc_checkbox"))
1296                0 == $(this).find(".elem_item").find("input:checkbox:checked").length &&
1297                (formError[a] && formError[a][$(this).find(".elem_item input:checkbox").attr("name")]
1298                    ? (t = formError[a][$(this).find(".elem_item input:checkbox").attr("name")])
1299                    : $(this).find(".elements_set .radio_wrapper").length > 0 && formError[a] && formError[a].checkbox_required
1300                        ? (t = formError[a].checkbox_required)
1301                        : formError[a] && formError[a].required && (t = formError[a].required));
1302            else if ($(this).hasClass("fc_radio"))
1303                0 == $(this).find(".elem_item").find("input:radio:checked").length &&
1304                (formError[a] && formError[a][$(this).find(".elem_item").find("input:radio").attr("name")]
1305                    ? (t = formError[a][$(this).find(".elem_item input:radio").attr("name")])
1306                    : formError[a] && formError[a].radio_required && (t = formError[a].radio_required));
1307            else if ($(this).hasClass("fc_text") || $(this).hasClass("fc_captcha"))
1308                "" == $(this).find("input:text").val() &&
1309                (formError[a] && formError[a][$(this).find("input:text").attr("name")] ? (t = formError[a][$(this).find("input:text").attr("name")]) : formError[a] && formError[a].required && (t = formError[a].required));
1310            else if ($(this).hasClass("fc_textarea"))
1311                "" == $(this).find("textarea").val() &&
1312                (formError[a] && formError[a][$(this).find("textarea").attr("name")] ? (t = formError[a][$(this).find("textarea").attr("name")]) : formError[a] && formError[a].required && (t = formError[a].required));
1313            else if ($(this).hasClass("fc_select")) {
1314                ($(this).find("select").attr("multiple") ? 0 == $(this).find("select option:selected").length : "" == $(this).find("select").val() || 0 == $(this).find("select").val()) &&
1315                (formError[a] && formError[a][$(this).find("select").attr("name")] ? (t = formError[a][$(this).find("select").attr("name")]) : formError[a] && formError[a].required && (t = formError[a].required));
1316            } else if ($(this).hasClass("fc_files") || $(this).hasClass("fc_images"))
1317                "" == $(this).find("input:file").val() &&
1318                (formError[a] && formError[a][$(this).find("input:file").attr("name")] ? (t = formError[a][$(this).find("input:file").attr("name")]) : formError[a] && formError[a].not_attach_file && (t = formError[a].not_attach_file));
1319            else if ($(this).hasClass("fc_email")) {
1320                $(this).hasClass("sector_required") && "" == $(this).find("input:text").val()
1321                    ? formError[a] && formError[a][$(this).find("input:text").attr("name")]
1322                    ? (t = formError[a][$(this).find("input:text").attr("name")])
1323                    : formError[a] && formError[a].required && (t = formError[a].required)
1324                    : $(this).find("input:text").val() &&
1325                    !/^.+@.+\..+$/.test($(this).find("input:text").val()) &&
1326                    formError[a] &&
1327                    formError[a].email &&
1328                    ((t = formError[a].email), $.post("/basket/?email_error_log", $(this).closest("form").serialize()));
1329            }
1330            var r = void 0;
1331            $(this).hasClass("fc_textarea")
1332                ? (r = $(this).find("textarea"))
1333                : $(this).hasClass("fc_text") || $(this).hasClass("fc_captcha") || $(this).hasClass("fc_email")
1334                ? (r = $(this).find("input:text"))
1335                : $(this).hasClass("fc_file") && (r = $(this).find("input:file")),
1336                t
1337                    ? ((t = t.replace(" %s ", " " + n + " ")), (i = !1), (s[o] = t), $(this).find(".hintError").html(t).addClass("fill"), void 0 !== r && r.addClass("error").addClass("error_field"))
1338                    : ($(this).find(".hintError").html("").removeClass("fill"), void 0 !== r && r.removeClass("error").removeClass("error_field")),
1339                o++;
1340        }),
1341            !i)
1342    ) {
1343        var n = !1;
1344        if (1 == e.find(".uss_error_form").length) {
1345            var r = e.find(".uss_error_form"),
1346                l = "<ol>";
1347            $.each(s, function (e, t) {
1348                l += "<li>" + t + "</li>";
1349            }),
1350                (l += "</ol>"),
1351                r.html(l),
1352                r.show(),
1353                (n = r);
1354        } else n = $(".hintError:parent:first").closest(".fc_item");
1355        return n && n.offset().top < $(window).scrollTop() && $("html, body").animate({ scrollTop: n.offset().top }, 500), !1;
1356    }
1357    return i;
1358}
1359function catalogOpenForm(e) {
1360    var t = "";
1361    $(e).find("form:first").hasClass("wide") ? (t = " wide") : $(e).find("form:first").hasClass("wide_big") && (t = " wide_big");
1362    var i = '<div class="catalog_orderform_tml"><div class="catalog_orderform_window_wrap' + t + '"><a href="javascript:void(0);" class="close"></a><div class="catalog_orderform_window">' + e + "</div></div></div>";
1363    $("body").append('<div id="uss_substrate2" />' + i), $("body #uss_substrate2").show().animate({ opacity: 0.4 }, 100), $("body .catalog_orderform_tml").show().animate({ opacity: 1 }, 100);
1364    var s = $(".catalog_orderform_tml");
1365    if ((s.css({ "margin-left": "-" + s.width() / 2 + "px" }), s.outerHeight(!0) < $(window).height())) {
1366        var o = ($(window).height() - s.outerHeight()) / 2;
1367        s.css({ "margin-top": o + "px" });
1368    }
1369    var a = $(window).scrollTop();
1370    $(document).height() < s.outerHeight(!0) + $(window).scrollTop() && (a = $(window).scrollTop() - (s.outerHeight(!0) + $(window).scrollTop() - $(document).height())), s.css({ top: a + "px" });
1371}
1372function prepareBasketWidget() {
1373    if (!$(".pda_site_container").length) return !1;
1374    "" == $(".uss_basket_mini #uss_block_basket_amount").text() && $(".uss_basket_mini #uss_block_basket_amount").text("0"),
1375        $(".uss_basket_mini .amounts").removeClass("uss_hidden"),
1376        $(".uss_basket_mini .totals").removeClass("uss_hidden"),
1377        $(".uss_pda_basket").click(function () {
1378            window.location.href = $(this).find("a").attr("href");
1379        });
1380}
1381function prepareMenu() {
1382    var e = $(".uss_pda_sectionmenu_wrap.uss_pda_menu_up .horizontal, .uss_pda_sectionmenu_wrap.uss_pda_menu_down .horizontal"),
1383        t = 0;
1384    e.length > 0 &&
1385    e.each(function () {
1386        (t = $(this).children(".menu_item").length) > 0 &&
1387        $(this)
1388            .children(".menu_item")
1389            .css("width", 100 / t + "%");
1390    });
1391}
1392function menu3ItemShow(e) {
1393    var t = e.closest(".menuItem").children(".menuSubItems");
1394    if (0 == e.closest(".menuSubItems").length && 0 == e.closest(".menu3-more-items").length) {
1395        var i,
1396            s = e.closest(".menu3");
1397        s.hasClass("menu3-dropdown-right") && (i = "right"), s.hasClass("menu3-dropdown-down") && (i = "down"), s.hasClass("menu3-dropdown-left") && (i = "left"), s.hasClass("menu3-dropdown-top") && (i = "top");
1398    } else i = 0 == e.closest(".menuSubItems").length && e.closest(".menu3-more-items").length > 0 ? "down" : "right";
1399    i && t.addClass("pos-" + getMenuPositions(e, i)), e.addClass("hover");
1400}
1401function menu3ItemHide(e) {
1402    e.closest(".menuItem").children(".menuSubItems").removeClass("pos-down", "pos-down", "pos-down", "pos-down"), e.removeClass("hover");
1403}
1404function getMenuPositions(e, t, i) {
1405    i = i || !1;
1406    var s = ["right", "left", "down", "top"],
1407        o = e.closest(".menuItem").children(".menuSubItems"),
1408        a = e.closest(".menu3"),
1409        n = !1 !== i;
1410    n ? (s = -1 == s.indexOf(i) ? ["bottom"] : [i]) : s[0] !== t && (s.splice(s.indexOf(t), 1), s.unshift(t));
1411    for (var r = 0; r < s.length; r++)
1412        switch (s[r]) {
1413            case "right":
1414                if (e.offset().left + e.outerWidth(!0) + o.outerWidth(!0) <= $(document).width() || n) return "right";
1415                break;
1416            case "down":
1417                if (a.offset().top + o.outerHeight(!0) <= $(document).height() || n) return "down";
1418                break;
1419            case "left":
1420                if (e.offset().left - o.outerWidth(!0) >= 0 || n) return "left";
1421                break;
1422            case "top":
1423                if (a.offset().top - o.outerHeight(!0) >= 0 || n) return "top";
1424        }
1425    if (n) return i;
1426    getMenuPositions(e, t, t);
1427}
1428function hideLongMenu() {
1429    $.each($(".menu3-autohide-long"), function () {
1430        var e = $(this),
1431            t = e.width(),
1432            i = e.find(".menuItems > .menuItem"),
1433            s = 0,
1434            o = e.find(".menu3-more-items");
1435        if (
1436            ($.each(i, function () {
1437                s += $(this).outerWidth();
1438            }),
1439            s > t)
1440        ) {
1441            var a = "before";
1442            0 == o.length &&
1443            ((o = '<div class="menuItem menu3-more-items"><a href="#more" class="menu3-more-link">' + e.attr("data-more-title") + '</a><div class="menuSubItems"></div></div>'),
1444                i.filter(":last").after(o),
1445                (o = e.find(".menu3-more-items")).hover(
1446                    function () {
1447                        menu3ItemShow($(this));
1448                    },
1449                    function () {
1450                        menu3ItemHide($(this));
1451                    }
1452                ),
1453                (a = "after"));
1454            var n,
1455                r = o.outerWidth();
1456            $.each(i, function () {
1457                if (r + $(this).outerWidth() > t) return (n = i.filter(":gt(" + (i.index($(this)) - 1) + ")").not(".menu3-more-items")).css({ "margin-left": 0, "margin-right": 0 }), !1;
1458                r += $(this).outerWidth();
1459            }),
1460            n.length > 0 &&
1461            $.each(n, function () {
1462                void 0 === $(this).attr("data-width") && $(this).attr("data-width", $(this).outerWidth());
1463            }),
1464                "after" == a ? n.appendTo(o.find(".menuSubItems")) : n.prependTo(o.find(".menuSubItems"));
1465        } else if (o.length > 0) {
1466            var l = t - s,
1467                d = 0,
1468                c = 0;
1469            $.each(o.children(".menuSubItems").children(".menuItem"), function () {
1470                (c += isNaN($(this).attr("data-width")) ? 0 : $(this).attr("data-width")) <= l && d++;
1471            }),
1472            d > 0 &&
1473            o.before(
1474                o
1475                    .children(".menuSubItems")
1476                    .children(".menuItem")
1477                    .filter(":lt(" + d + ")")
1478            ),
1479            0 == o.find(".menuItem").length && o.remove();
1480        }
1481        (i = e.find(".menuItems > .menuItem")).removeClass("first").removeClass("last"), i.filter(":first").addClass("first"), i.filter(":last").addClass("last");
1482        var _ = e.find(".menu3-more-items > .menuSubItems > .menuItem");
1483        _.removeClass("first").removeClass("last"), _.filter(":first").addClass("first"), _.filter(":last").addClass("last");
1484    });
1485}
1486function resizePaddingMenu() {
1487    $.each($(".menu3.menu3-resize-padding"), function () {
1488        var e = $(this).width(),
1489            t = $(this).find(".menuItems > .menuItem"),
1490            i = 0,
1491            s = 0;
1492        if (
1493            ($.each(t, function () {
1494                (s = i + $(this).outerWidth() > e ? e - i : 0), (i += $(this).outerWidth()), (i += s);
1495            }),
1496            i / e > 1)
1497        ) {
1498            for (var o = Math.ceil(i / e), a = Math.ceil(t.length / o), n = new Object({}), r = 1, l = 1; l <= o; l++) n[l] = { width: 0, count: 0, margin: 0 };
1499            $.each(t, function () {
1500                (n[r].count + 1 > a || n[r].width + $(this).outerWidth() >= e) && (e - n[r].width > n[r].count && (n[r].margin = Math.floor((e - n[r].width) / n[r].count / 2) - 1), r < o && r++),
1501                    (n[r].width += $(this).outerWidth()),
1502                    n[r].count++;
1503            }),
1504            0 == n[r].margin && e - n[r].width > n[r].count && (n[r].margin = Math.floor((e - n[r].width) / n[r].count / 2) - 1);
1505            for (var d, c = 0, _ = 0, l = 1; l <= o; l++)
1506                (d = 1 == l ? t.filter(":lt(" + n[l].count + ")") : l == o ? t.filter(":gt(" + (_ - 1) + ")") : t.filter(":gt(" + (n[l].count - 1) + ")").filter(":lt(" + (n[l].count - 1 + c) + ")")),
1507                    (c = n[l].count),
1508                    (_ += n[l].count),
1509                d &&
1510                $.each(d, function () {
1511                    $(this).css({ "margin-left": n[l].margin + "px", "margin-right": n[l].margin + "px" });
1512                });
1513        } else {
1514            var u = Math.floor((e - i) / t.length / 2) - 1;
1515            $.each(t, function () {
1516                $(this).css({ "margin-left": u + "px", "margin-right": u + "px" });
1517            });
1518        }
1519    });
1520}
1521function getPageCoords(e) {
1522    return e.targetTouches && e.targetTouches[0] ? { x: e.targetTouches[0].pageX, y: e.targetTouches[0].pageY } : { x: e.pageX, y: e.pageY };
1523}
1524function jSliderSetLabelWidth(e) {
1525    var t = (e = $("." + e).find(".jslider")).width() / e.find(".jslider-scale span").length;
1526    $.each(e.find(".jslider-scale span ins"), function () {
1527        var e = $(this).width() > t ? t : $(this).width();
1528        $(this).css({ "max-width": t + "px", marginLeft: -e / 2 });
1529    });
1530}
1531function updateContent(e) {
1532    var t = "input:text.filter_ajax_update,input.select_slider.filter_ajax_update, input:checkbox.filter_ajax_update, input:radio.filter_ajax_update, select.filter_ajax_update";
1533    $(t).die("change"),
1534        $(t).live("change", function () {
1535            updateContentProcess($(this), e);
1536        }),
1537        $("input:submit.filter_ajax_update").die("click"),
1538        $("input:submit.filter_ajax_update").live("click", function () {
1539            return updateContentProcess($(this), e);
1540        }),
1541        $("input:text.filter_ajax_update").die("keydown"),
1542        $("input:text.filter_ajax_update").live("keydown", function (e) {
1543            return 13 != e.keyCode || ($(this).trigger("change"), !1);
1544        });
1545}
1546function updateContentProcess(e, t) {
1547    if (
1548        (e.attr("data-tree") &&
1549        (e.get(0),
1550            e
1551                .closest("div")
1552                .find('[name="' + e.attr("name") + '"]')
1553                .filter(":last")
1554                .get(0)),
1555            window.ucProccessState)
1556    )
1557        return (
1558            setTimeout(function () {
1559                updateContentProcess(e, t);
1560            }, 100),
1561                !1
1562        );
1563    if (0 == (t = $(t)).length) return !0;
1564    var i = e.closest("form"),
1565        s = i.serialize(),
1566        o = i.attr("action") + "?" + s + ("" == s ? "" : "&") + "ef_ajax=1";
1567    return (
1568        (window.ucProccessState = !0),
1569            $.ajax({
1570                url: o,
1571                type: "get",
1572                cache: !1,
1573                async: !0,
1574                beforeSend: function () {
1575                    t.stop(!0, !0).animate({ opacity: 0.1 }, 200), $(".loader_line").remove(), t.before('<div class="loader_line"></div>');
1576                },
1577                success: function (e) {
1578                    window.ucProccessState = !1;
1579                    try {
1580                        history.pushState(null, null, decodeURI(o));
1581                    } catch (e) {}
1582                    $("div.uss_shop_cats").is(":visible") && $("div.uss_shop_cats").slideUp(100),
1583                    $("div.catviewtype5_wrap").is(":visible") && $("div.catviewtype5_wrap").slideUp(100),
1584                    $("div.uss_shop_content").is(":visible") && $("div.uss_shop_content").slideUp(100),
1585                    $("div.uss_section_images_area").is(":visible") && $(".uss_section_images_area").hide(),
1586                    $("div.uss_img_sections").is(":visible") && $(".uss_img_sections").hide(),
1587                        t.stop(!0, !0),
1588                        t.replaceWith(e),
1589                        t.animate({ opacity: 1 }, 200),
1590                        $(".loader_line").remove();
1591                },
1592            }),
1593            !1
1594    );
1595}
1596function updateFilter(e, t, i) {
1597    updateFilterProcess(e, null, t, i),
1598        $(".uss_eshop_filters_block")
1599            .find("input.filter_ajax_update, select.filter_ajax_update")
1600            .change(function () {
1601                updateFilterProcess(e, $(this), t, i);
1602            });
1603}
1604function updateFilterProcess(e, t, i, s) {
1605    $.ajax({
1606        url: "/?eshop_filters_update&section_id=" + i + "&cat_id=" + s,
1607        type: "get",
1608        cache: !1,
1609        data: $(e).serialize(),
1610        dataType: "json",
1611        beforeSubmit: function () {
1612            $(e).prop("disabled", !0);
1613        },
1614        success: function (e) {
1615            if ("empty" == e.status) $(".uss_eshop_filters_block .eshop_filters label.filter_elem_label").removeClass("grey");
1616            else {
1617                var i = e.data,
1618                    s = $(".uss_eshop_filters_block .eshop_filters.filter_item").not(".group_item");
1619                if (t) {
1620                    var o = !1,
1621                        a = $(".filter_item_" + t.closest(".eshop_filters").attr("name"));
1622                    a.hasClass("select") && (a.find("select :selected").length || 0 == a.find("select :selected").index())
1623                        ? (o = !0)
1624                        : a.hasClass("radio") && a.find("input:radio:checked").hasClass("filter_elem_item_null")
1625                        ? (o = !0)
1626                        : (a.hasClass("checkbox") || a.hasClass("checkboxlist")) && 0 == a.find("input:checkbox:checked").length && (o = !0),
1627                    0 == o && (s = s.not(".filter_item_" + t.closest(".eshop_filters").attr("name")));
1628                }
1629                $.each($(s), function () {
1630                    var e = $(this).attr("name");
1631                    $.each($(this).find(".filter_elem_item, select").not(".filter_elem_item_null"), function () {
1632                        var t = !0;
1633                        if ($(this).is("select") && !$(this).attr("data-multiple") && !$(this).attr("data-checkbox")) {
1634                            var s = $(this).closest(".filter_item").find("select");
1635                            if (s.length > 1) {
1636                                var o = s.filter(":last");
1637                                t = $(this).get(0) == o.get(0);
1638                            }
1639                            t && void 0 != $(this).val() && 0 != $(this).val() && (t = !1);
1640                        }
1641                        if ($(this).is("select"))
1642                            $.each($(this).closest(".filter_item").find("select:last").find("option:not(:first)"), function () {
1643                                var s = $(this).val();
1644                                $.isArray(i[e]) && -1 != $.inArray(s, i[e]) ? $(this).removeClass("grey") : t && $(this).addClass("grey");
1645                            });
1646                        else {
1647                            var a = $(this).val();
1648                            $.isArray(i[e]) && -1 != $.inArray(a, i[e]) ? $(this).closest("label.filter_elem_label").removeClass("grey") : t && $(this).closest("label.filter_elem_label").addClass("grey");
1649                        }
1650                    });
1651                });
1652            }
1653        },
1654    });
1655}
1656function getObjectLength(e) {
1657    var t = 0;
1658    for (var i in e) e.hasOwnProperty(i) && t++;
1659    return t;
1660}
1661function getSubSelect(filterId, _this, prefix) {
1662    (prefix = prefix || ""), (_this = $(_this));
1663    var isStyler = _this.closest(".filter_item").find(".jq-selectbox").length > 0;
1664    isStyler ? (_this.closest(".jq-selectbox, .jq-select-multiple").nextAll(".jq-selectbox, .jq-select-multiple").remove(), _this.closest(".jq-selectbox, .jq-select-multiple").nextAll("select").remove()) : _this.nextAll("select").remove(),
1665        _this.closest(".filter_item").find(".dynamic_filter_checkbox").remove();
1666    var value = _this.val(),
1667        selectsArray;
1668    if ((eval(" selectsArray = selectsArray_" + filterId + ";"), void 0 != selectsArray[value] && value != _this.attr("data-parent"))) {
1669        var currentOptions = selectsArray[value],
1670            isDropDown = !1;
1671        if (
1672            ($.each(currentOptions, function (e, t) {
1673                t.id != value && void 0 != selectsArray[t.id] && (isDropDown = !0);
1674            }),
1675            isDropDown || "true" != _this.attr("data-checkbox"))
1676        ) {
1677            var needSelect = $(document.createElement("select"));
1678            needSelect.attr("name", _this.attr("name")),
1679                needSelect.addClass("filter_ajax_update"),
1680            "true" == _this.attr("data-multiple") && needSelect.attr("data-multiple", "true"),
1681            "true" == _this.attr("data-checkbox") && needSelect.attr("data-checkbox", "true"),
1682            "true" == _this.attr("data-tree") && (needSelect.attr("data-tree", "true"), needSelect.attr("data-parent", value)),
1683                $.each(currentOptions, function (e, t) {
1684                    needSelect.append('<option value="' + t.id + '">' + t.title + "</option>");
1685                });
1686            var isLastMultiple = !1;
1687            isDropDown ||
1688            "true" != needSelect.attr("data-multiple") ||
1689            (needSelect.attr("multiple", !0), needSelect.attr("name", needSelect.attr("name") + "[]"), needSelect.find("option").removeAttr("selected"), needSelect.find('option[value="' + value + '"]').remove(), (isLastMultiple = !0)),
1690                needSelect.change(function () {
1691                    getSubSelect(filterId, needSelect);
1692                }),
1693                isStyler ? (needSelect.insertAfter(_this.closest(".jq-selectbox")), needSelect.styler()) : needSelect.insertAfter(_this),
1694            needSelect.find("option:first").length && value != needSelect.find("option:first").val() && !isLastMultiple && needSelect.trigger("change");
1695        } else {
1696            var divCheckboxes = $(document.createElement("div"));
1697            divCheckboxes.addClass("eshop_filters filter_item checkboxlist dynamic_filter_checkbox filter_ajax_update filter_item_" + filterId),
1698                $.each(currentOptions, function (e, t) {
1699                    var i = $(document.createElement("label")),
1700                        s = $(document.createElement("input"));
1701                    s
1702                        .attr("type", "checkbox")
1703                        .attr("name", _this.attr("name") + "[]")
1704                        .addClass("filter_ajax_update")
1705                        .val(t.id),
1706                        i.append(s),
1707                        i.append(t.title),
1708                        divCheckboxes.append(i);
1709                }),
1710                divCheckboxes.insertAfter(_this);
1711        }
1712    }
1713}
1714function getSliderDataForArray(e, t) {
1715    return void 0 != e ? (0 == t || void 0 === e[t] ? 0 : e[t]) : t;
1716}
1717function isMobileDevice() {
1718    return ($.browser.device = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
1719}
1720function getScrollWidth() {
1721    var e = document.createElement("div");
1722    (e.style.overflowY = "scroll"), (e.style.width = "50px"), (e.style.height = "50px"), (e.style.visibility = "hidden"), document.body.appendChild(e);
1723    var t = e.offsetWidth - e.clientWidth;
1724    return document.body.removeChild(e), t;
1725}
1726function openModal(e, t) {
1727    var i = $(window).scrollTop(),
1728        s = i;
1729    (s = e.outerHeight(!0) > $(window).height() ? i + 10 : i + ($(window).height() - e.outerHeight(!0)) / 2),
1730        e.css({ top: s, display: "block", opacity: 0, "margin-left": (e.outerWidth() / 2) * -1 }).animate({ opacity: 1 }, 150, function () {
1731            "function" == typeof t && t();
1732        }),
1733        createSubstrate(),
1734        $("#uss_substrate2").css({ display: "block", opacity: 0 }).animate({ opacity: 0.4 }, 150);
1735}
1736function closeModal() {
1737    $(".uss_modal_window").fadeOut(100), $("#uss_substrate2").remove();
1738}
1739function createSubstrate() {
1740    $("#uss_substrate2").length || $("body").append('<div id="uss_substrate2"/>');
1741}
1742function updateData(e) {
1743    $.ajax({ url: "/?update", data: { type: e } });
1744}
1745function deliveryWidgetChangeCity(e) {
1746    $.ajax("/?change_city&delayed=1&action=setCity", {
1747        data: e,
1748        type: "get",
1749        dataType: "json",
1750        success: function (e) {
1751            void 0 !== e.city &&
1752            ($(".uss_change_city").html(e.city),
1753                $(".uss_modal_change_city .uss_search_city_input").val(""),
1754                $(".uss_modal_change_city .uss_modal_close").trigger("click"),
1755                $(".uss_search_city_form").removeClass("loading"),
1756            e.result && ($(".uss_delivery_error").remove(), $(".uss_widget_delivery").length ? calculateDeliveryWidget() : $(".calculate_basket_delivery").length && calculateDeliveryBasket()));
1757        },
1758    });
1759}
1760function calculateDeliveryWidget() {
1761    if ($(".uss_widget_delivery").length) {
1762        var e = $(".uss_widget_delivery");
1763        $.post("/?delivery&delayed=1&action=widget", { positions: e.data("positions"), type: e.data("type"), characteristic: e.attr("data-characteristic") }, function (t) {
1764            e.replaceWith(t);
1765        });
1766    }
1767}
1768function calculateDelivery(e) {
1769    if (e) {
1770        var t = $(".uss_widget_delivery");
1771        $.ajax({
1772            url: "/?delivery&delayed=1&action=calculate",
1773            data: { deliveryId: e, positions: t.attr("data-positions"), type: t.data("type"), characteristic: t.attr("data-characteristic") },
1774            type: "post",
1775            dataType: "json",
1776            success: function (e) {
1777                $.each(e, function (t, i) {
1778                    "object" == typeof i &&
1779                    $.each(i, function (i, s) {
1780                        var o = $(".uss_widget_delivery_item.item_" + t + "_" + i);
1781                        if (
1782                            (o.removeClass("loader"),
1783                            s.period && (o.find(".uss_widget_delivery_item_period .uss_dwi_period").html(s.period), o.find(".uss_widget_delivery_item_period").removeClass(".empty")),
1784                                parseInt(s.price) > 0
1785                                    ? (o.find(".uss_widget_delivery_item_price .uss_dwi_price").html(s.price), o.find(".uss_widget_delivery_item_price .uss_dwi_currency").html(s.currency).removeClass("uss_hidden"))
1786                                    : (o.find(".uss_widget_delivery_item_price .uss_dwi_price").html(e.text_price_zero), o.find(".uss_widget_delivery_item_price .uss_dwi_currency").addClass("uss_hidden")),
1787                            s.error || isNaN(parseFloat(s.price)))
1788                        ) {
1789                            o.addClass("uss_hidden");
1790                            var a = o.find(".uss_widget_delivery_item_title").text() + " - íå ðàñ÷èòàíà";
1791                            s.error && (a += " (" + s.error + ")"), console.log(a);
1792                        } else o.removeClass("uss_hidden");
1793                    });
1794                }),
1795                    t.removeClass("loading");
1796            },
1797        });
1798    }
1799}
1800function calculateMinDelivery() {
1801    var e = $(".uss_widget_delivery");
1802    $.ajax({
1803        url: "/?delivery&delayed=1&action=calculate",
1804        data: { positions: e.data("positions"), type: e.data("type"), characteristic: e.attr("data-characteristic") },
1805        type: "post",
1806        dataType: "json",
1807        success: function (e) {
1808            if ("object" == typeof e) {
1809                var t = $(".uss_widget_delivery_item.item_min_price");
1810                t.removeClass("loader"),
1811                e.period && (t.find(".uss_widget_delivery_item_period .uss_dwi_period").html(e.period), t.find(".uss_widget_delivery_item_period").removeClass(".empty")),
1812                    t.find(".uss_widget_delivery_item_title").html(e.title),
1813                    parseInt(e.price) > 0
1814                        ? (t.find(".uss_widget_delivery_item_price .uss_dwi_price").html(e.price), t.find(".uss_widget_delivery_item_price .uss_dwi_currency").html(e.currency).removeClass("uss_hidden"))
1815                        : (t.find(".uss_widget_delivery_item_price .uss_dwi_price").html(e.text_price_zero), t.find(".uss_widget_delivery_item_price .uss_dwi_currency").addClass("uss_hidden")),
1816                e.error && t.find(".uss_widget_delivery_item_error").html(e.error);
1817            }
1818        },
1819    });
1820}
1821function calculateDeliveryBasket() {
1822    var e = $(".fc_item.delivery .radio_wrapper").filter(":not(.radio_tariff_item)").find("input:radio:checked"),
1823        t = e.closest(".radio_wrapper");
1824    if (!$(".calculate_basket_delivery").length) return !1;
1825    if (!e.length || !t.hasClass("need_calculate")) return !1;
1826    var i,
1827        s = e.val(),
1828        o = t.find("." + s + "_tariff").find(".calculate_basket_delivery"),
1829        a = o.attr("data-tariff"),
1830        n = o.attr("data-psv"),
1831        r = !1;
1832    if (
1833        (t.find(".radio_tariff_item input:radio:checked").length && ((a = t.find(".radio_tariff_item input:radio:checked").val()), (r = !0)),
1834        t.find("select.delivery_psv_" + s).length && (n = t.find("select.delivery_psv").val()),
1835        t.find("input.delivery_psv_" + s).length && (n = t.find("input.delivery_psv").val()),
1836            a)
1837    ) {
1838        i = a;
1839        var l = a.split("_");
1840        "number" == typeof l[1] && (i = l[1]);
1841    }
1842    var d = t.find(".uss_delivery_template").clone(),
1843        c = t.find(".elem_item .elements_set");
1844    c.find(".radio_wrapper").not(".uss_delivery_template").remove(), d.hasClass("set_styler") && d.find("input:radio").addClass("styler"), d.removeClass("set_styler").removeClass("uss_delivery_template").removeClass("uss_hidden");
1845    var _ = d.get(0).outerHTML;
1846    t.find(".uss_widget_delivery_load_title").removeClass("uss_hidden"),
1847        $.ajax({
1848            url: "/?delivery&delayed=1&action=calculateBasket",
1849            data: { id: s, psv: n, selectTariff: i },
1850            type: "post",
1851            dataType: "json",
1852            success: function (e) {
1853                t.find(".calculate_basket_delivery").removeClass("loader"), t.find(".uss_widget_delivery_load_title").addClass("uss_hidden");
1854                var i = 0;
1855                if (e.empty) c.find(".uss_delivery_error").length ? c.find(".uss_delivery_error").html(e.message) : c.append('<div class="uss_delivery_error">' + e.message + "</div>");
1856                else if (
1857                    ($.each(e, function (e, t) {
1858                        "object" == typeof t &&
1859                        $.each(t, function (t, s) {
1860                            var o = _;
1861                            (o = (o = (o = (o = o.replace(/{value}/gi, e + "_" + t)).replace(/{title}/gi, s.name)).replace(/{description_inline}/gi, s.description_inline)).replace(/{description}/gi, s.description)), c.append(o), i++;
1862                        });
1863                    }),
1864                        initStyler(),
1865                        t.find(".uss_widget_delivery_load_title").addClass("uss_hidden"),
1866                    1 === i)
1867                )
1868                    t.find(".delivery_tariff_panel").addClass("one-tariff"), t.find(".radio_tariff_item:not(.uss_delivery_template) input:radio").attr("checked", !0).trigger("change");
1869                else {
1870                    t.find(".delivery_tariff_panel").removeClass("one-tariff"),
1871                    n &&
1872                    t
1873                        .find("select.delivery_psv_" + s + ", input.delivery_psv_" + s)
1874                        .val(n)
1875                        .trigger("change");
1876                    var o = [];
1877                    r || (o = ["auto"]),
1878                        t.find('input:radio[value="' + a + '"]').length
1879                            ? (t
1880                                .find('input:radio[value="' + a + '"]')
1881                                .attr("checked", !0)
1882                                .trigger("change", o)
1883                                .trigger("refresh"),
1884                                t
1885                                    .find('input:radio[value="' + a + '"]')
1886                                    .closest(".radio_tariff_item")
1887                                    .find(".psv_wrapper")
1888                                    .removeClass("uss_hidden"))
1889                            : t.find('input:radio[value="' + s + '"]').length &&
1890                            t
1891                                .find('input:radio[value="' + s + '"]')
1892                                .prop("checked", !0)
1893                                .trigger("change", o)
1894                                .trigger("refresh");
1895                }
1896            },
1897        });
1898}
1899function ecommersPush(e) {
1900
1901    //Äîñëîâíî àíàëîãè÷íûé dataLayer.push ïðîèñõîäèò ÷åðåç gtag, êîòîðûé âñòàâëåí â ñ÷åò÷èêàõ ñàéòà.
1902    //Îòïðàâêó â ýòîì ìåòîäå îòêëþ÷ó, ÷òîáû íå ïðîèñõîäèëî äóáëèðóþùåãî âûçîâà	
1903    return true;
1904
1905    if (!1 === (e = prepareJSON(e))) return !1;
1906    (window.dataLayer = window.dataLayer || []), window.dataLayer.push(e);
1907    console.log("Ecommerce: datalayer push " + JSON.stringify(e));
1908
1909}
1910
1911function prepareJSON(e) {
1912    if ("object" == typeof e) return e;
1913    if ("string" == typeof e)
1914        try {
1915            return JSON.parse(e);
1916        } catch (e) {
1917            return !1;
1918        }
1919    return !1;
1920}
1921function yaGoal(e, t) {
1922    if ("function" != typeof ym)
1923        window.infinityLoopGoal++,
1924            window.infinityLoopGoal < window.infinityLoopGoalMax
1925                ? setTimeout(function () {
1926                    yaGoal(e, t);
1927                }, 200)
1928                : ((window.infinityLoopGoal = 0), console.log("ym function is not found (metrika: " + e + " goal: " + t + ")"));
1929    else
1930        try {
1931            ym(e, "reachGoal", t), console.log("yandex reachGoal(metrika: " + e + " goal: " + t + ") was sent"), (window.infinityLoopGoal = 0);
1932        } catch (i) {
1933            (window.infinityLoopGoal = 0), console.error(i), console.log("ym error (metrika: " + e + " goal: " + t + ")");
1934        }
1935}
1936function googleEvent(e, t) {
1937    if (((t = t || {}), "function" != typeof gtag))
1938        window.infinityLoopGoal++,
1939            window.infinityLoopGoal < window.infinityLoopGoalMax
1940                ? setTimeout(function () {
1941                    googleEvent(e, t);
1942                }, 200)
1943                : ((window.infinityLoopGoal = 0), console.log("gtag function is not found (event: " + e + ")"));
1944    else
1945        try {
1946            var i = JSON.stringify(t) !== JSON.stringify({});
1947            gtag("event", e, t), console.log("google event(" + e + ") was sent" + (i ? " params:" : "")), i && console.log(t), (window.infinityLoopGoal = 0);
1948        } catch (t) {
1949            (window.infinityLoopGoal = 0), console.error(t), console.log("gtag (event: " + e + ")");
1950        }
1951}
1952function userScript(code) {
1953    try {
1954        eval(code);
1955    } catch (e) {
1956        console.error(e), console.log("user code: " + code);
1957    }
1958}
1959"1.3.2" != $.fn.jquery &&
1960$(document).ajaxSend(function (e, t, i) {
1961    t.setRequestHeader("X-Requested-With", "XMLHttpRequest");
1962}),
1963"undefined" == typeof console && (window.console = { log: function () {}, error: function () {} });
1964var wtype = "",
1965    contWidth = 180,
1966    contHeight = 20,
1967    documentWidth,
1968    documentHeight,
1969    imgMaxWidth,
1970    imageMaxHeight,
1971    minDocumentWidth = 32,
1972    smallScreenSize = 900,
1973    smallContWidth = 10,
1974    minDocumentHeight = 32,
1975    descriptionPadding = 20,
1976    isDescriptionBig = !1,
1977    mobileWidth = 0;
1978isIOS() &&
1979$(document).on("touchmove", function (e) {
1980    $("#uss_view_conteiner").length && e.preventDefault();
1981}),
1982    $(document).ready(function () {
1983        isMobileDevice() && window.innerWidth < window.innerHeight && (window.mobileWidth = window.innerWidth),
1984        $(".pda_site_container").length > 0 && (contWidth = 50),
1985            $(".l-toggle .lt-caption").click(function () {
1986                return $(this).siblings(".l-toggle .lt-content").toggle("fast"), !1;
1987            }),
1988            redyUSSfoto($("a.user_set_enlarge_image"), !1),
1989            redyUSSfoto($("a.photo_enlarge_image"), !0, "photo_widget"),
1990            $(window).on("orientationchange", function () {
1991                setTimeout(function () {
1992                    $(window).resize();
1993                }, 300);
1994            }),
1995            $(window).resize(function () {
1996                if ((isMobileDevice() && 0 == window.mobileWidth && window.innerWidth < window.innerHeight && (window.mobileWidth = $("body").width()), $("#uss_view_conteiner").length)) {
1997                    var e = getWindowHeight(),
1998                        t = getWindowWidth(),
1999                        i = $("#uss_view_conteiner"),
2000                        s = $("#uss_inside_view_conteiner"),
2001                        o = $("#uss_inside_view_conteiner img"),
2002                        a = window.imgMaxWidth / window.imgMaxHeight,
2003                        n = i.outerHeight() - i.height(),
2004                        r = t >= window.smallScreenSize ? window.contWidth : window.smallContWidth,
2005                        l = t - r,
2006                        d = e - window.contHeight - n,
2007                        c = window.imgMaxWidth,
2008                        _ = window.imgMaxHeight;
2009                    l < window.minDocumentWidth && (l = window.minDocumentWidth),
2010                    d < window.minDocumentHeight && (d = window.minDocumentHeight),
2011                    c > l && ((c = l), (_ = l / a)),
2012                    _ > d && (c = (_ = d) * a),
2013                    isMobileDevice() && $("#uss_foto_description").css("max-height", "");
2014                    var u = 0,
2015                        h = 0,
2016                        f = e - window.contHeight - n,
2017                        m = t - t / r;
2018                    if ($("#uss_foto_description").length && $("#uss_foto_description").html()) {
2019                        if (((u = parseInt($("#uss_foto_description").outerHeight(!0))), (h = parseInt($("#uss_foto_description").outerWidth())), u > e / 3)) {
2020                            window.isDescriptionBig = !0;
2021                            for (var p = 0, g = !0; g && p < 100; ) {
2022                                u = $("#uss_foto_description").outerHeight(!0);
2023                                var v = (h = $("#uss_foto_description").outerWidth()) + parseInt(m / 100);
2024                                v < c && ((v = c - window.descriptionPadding), (g = !1)), v >= m && ((v = m), (g = !1)), $("#uss_foto_description").css("width", v), g && (g = u > e / 3), p++;
2025                            }
2026                            (h = $("#uss_foto_description").outerWidth()), (u = parseInt($("#uss_foto_description").outerHeight(!0)));
2027                        } else window.isDescriptionBig || (h = 0);
2028                        f -= u;
2029                    }
2030                    var b = 0;
2031                    if ($("body .uss_circle_navigation").length) {
2032                        var w = $("body .uss_circle_navigation");
2033                        f -= b = parseInt(w.outerHeight(!0));
2034                        var y = window.pageYOffset || document.documentElement.scrollTop;
2035                        w.css({ top: y + getWindowHeight() - b, "margin-left": (t - $(".uss_circle_navigation").outerWidth()) / 2 + $(document).scrollLeft() + "px" });
2036                    }
2037                    _ > f && ((c = parseInt(c * (f / _))), (_ = f));
2038                    var k = _ + u;
2039                    if (isMobileDevice()) {
2040                        var C = parseInt(getWindowHeight() - k);
2041                        C > u && ($("#uss_foto_description").css("max-height", C), (k -= u), (k += u = parseInt($("#uss_foto_description").outerHeight(!0))));
2042                    }
2043                    var x = 0,
2044                        S = getBodyScrollTop() + getWindowHeight() / 2;
2045                    S && S - k / 2 < 0 && (x = S - k / 2);
2046                    var I = k / 2 + x + n / 2 + b / 2,
2047                        W = (t - (i.outerWidth() - i.width()) - c) / 2;
2048                    if (($(document).scrollLeft() > 0 && (W += $(document).scrollLeft()), h > c)) {
2049                        var E = (h - c) / 2;
2050                        o.css({ "margin-left": E + "px", "margin-right": E + "px" }), (W -= E);
2051                    } else o.css({ "margin-left": "0", "margin-right": "0" });
2052                    i.css({ "margin-left": W + "px", "margin-top": "-" + I + "px", top: S + "px" }), s.css({ width: (h > c ? h : c) + "px", height: _ + u + "px" }), o.css({ width: c + "px", height: _ + "px" });
2053                }
2054            });
2055    }),
2056    ($.fn.touchwipe_pda = function (e) {
2057        var t = { min_move_x: 30 };
2058        return (
2059            e && $.extend(t, e),
2060                this.each(function () {
2061                    function e() {
2062                        this.removeEventListener("touchmove", i), this.removeEventListener("touchend", s), (o = null), (isMoving = !1);
2063                    }
2064                    function i(e) {
2065                        check_click && ($("#uss_view_conteiner").addClass("noclick"), (check_click = !1));
2066                        var t = e.touches[0].pageX,
2067                            i = e.touches[0].pageY,
2068                            n = o - t,
2069                            r = a - i;
2070                        Math.abs(n) > 5 && isMoving ? (e.preventDefault(), "ontouchend" in document.documentElement && this.addEventListener("touchend", s, !1)) : Math.abs(r) > 5 && (isMoving = !1);
2071                    }
2072                    function s(i) {
2073                        var s = i.changedTouches[0].pageX,
2074                            a = o - s;
2075                        Math.abs(a) >= t.min_move_x && (i.preventDefault(), a > 0 ? t.wipeLeft() : t.wipeRight()), e();
2076                    }
2077                    var o, a;
2078                    "ontouchstart" in document.documentElement &&
2079                    this.addEventListener(
2080                        "touchstart",
2081                        function (e) {
2082                            $("#uss_view_conteiner").removeClass("noclick"), (check_click = !0), 1 == e.touches.length && ((o = e.touches[0].pageX), (isMoving = !0), this.addEventListener("touchmove", i, !1));
2083                        },
2084                        !1
2085                    );
2086                }),
2087                this
2088        );
2089    }),
2090    (document.onkeydown = navigateKey),
2091    $(function () {
2092        var e = $("div.uss_tabs div.tab_item");
2093        e.hide().filter(":first").show().addClass("selected"),
2094            $("div.uss_tabs .uss_tabs_navigation span").click(function () {
2095                if ($(this).hasClass("selected") && e.filter("#" + $(this).attr("rel")).hasClass("selected")) return !1;
2096                if (
2097                    ($("div.uss_tabs .tab_items").css("height", e.filter("#" + $(this).attr("rel")).height() + 30),
2098                        e.hide().removeClass("selected"),
2099                        e
2100                            .filter("#" + $(this).attr("rel"))
2101                            .fadeIn()
2102                            .addClass("selected"),
2103                        $("div.uss_tabs .tab_items").css("height", "auto"),
2104                        $("div.uss_tabs .uss_tabs_navigation span").removeClass("selected"),
2105                        $(this).addClass("selected"),
2106                    $(".compare_wrap").length > 0)
2107                ) {
2108                    var t = e.filter("#" + $(this).attr("rel")).find(".body_table");
2109                    t.closest(".compare_block_wrapper").closest(".tab_item");
2110                    initCompareTable(t, "resize");
2111                }
2112                return !1;
2113            });
2114        var t = window.location.hash.toString().split("#").pop();
2115        ("add_comment_form" == t || new RegExp(/linkcomm/).test(t)) && (t = "comments"),
2116            $('div.uss_tabs .uss_tabs_navigation span[rel="tab_' + t + '"]').length > 0
2117                ? $('div.uss_tabs .uss_tabs_navigation span[rel="tab_' + t + '"]').trigger("click")
2118                : $("div.uss_tabs .uss_tabs_navigation span.selected").length > 0
2119                ? $("div.uss_tabs .uss_tabs_navigation span.selected").trigger("click")
2120                : $("div.uss_tabs .uss_tabs_navigation span:first").trigger("click");
2121    }),
2122    $(function () {
2123        function e() {
2124            if (glob_count > 3) e = 4;
2125            else var e = 3;
2126            main_slide_block.width() < 620 && (e = 2);
2127            var t = main_slide_block.width() / e;
2128            (globws = glob_count * t * -1), samep_block.find(".item").width(t), samep_block.width(samep_block.find(".item").length * t), setLeft(globws, 0);
2129        }
2130        function t() {
2131            var e = parseFloat(main_slide_block.width()) - parseFloat(samep_block.width()),
2132                t = samep_block.find(".item:first").outerWidth(),
2133                i = parseFloat(samep_block.position().left),
2134                s = Math.abs(e - i);
2135            s - t < 0 && (t = s), setLeft(i - t, 0.3);
2136        }
2137        function i() {
2138            var e = samep_block.find(".item:first").outerWidth(),
2139                t = parseFloat(samep_block.position().left),
2140                i = Math.abs(0 - t);
2141            i - e < 0 && (e = i), setLeft(t + e, 0.3);
2142        }
2143        if (
2144            ($(".uss_eshop_tabs_pda .tab_nav").click(function () {
2145                var e = $(this).closest(".tab_expanded");
2146                e.hasClass("open") ? (e.removeClass("open"), e.find(".tab_content").slideUp(200)) : (e.addClass("open"), e.find(".tab_content").slideDown(200));
2147            }),
2148                $(".eshop_filters_items select, .eshop_filters_items input, .uss_specifications select").change(function () {
2149                    var e = getWrapperPos($(this));
2150                    if (e && e.find(".buy_from_cart").length && e.find(".buy_from_cart").hasClass("already_in_cart")) {
2151                        var t = e.find(".buy_from_cart");
2152                        t.removeClass("already_in_cart")
2153                            .html(t.attr("data-title-tocart"))
2154                            .attr("title", t.attr("data-title-tocart"))
2155                            .attr("href", "/basket/?change=" + t.attr("data-item-id"));
2156                        var i = $(".basket_amount_pos_" + t.attr("data-item-id"));
2157                        if (i) {
2158                            var s = i.siblings(".amount_title");
2159                            i.val(1), s.removeClass("hidden"), i.removeClass("hidden");
2160                        }
2161                    }
2162                }),
2163                $("form.paymentForm").submit(function (e) {
2164                    return $.ajax({ url: "/basket/goPaymentLog/", data: $(this).serialize() }), !0;
2165                }),
2166                $("td.uss_delete_pos a").click(function () {
2167                    $(this).hasClass("add_to_cart") && !$(this).hasClass("already_in_cart") && ($("#buy_count").length && $("#buy_count").text(1 * $("#buy_count").text() + 1), $(this).parent().find(".del_wish").click()),
2168                    $(this).hasClass("add_to_cart") && $(this).hasClass("already_in_cart") && $(this).parent().find(".del_wish").click(),
2169                    $(this).hasClass("add_to_wishlist") && !$(this).hasClass("already_in_wish") && $("#wish_count").length && $("#wish_count").text(1 * $("#wish_count").text() + 1),
2170                    $(this).hasClass("del_wish") && $("#wish_count").length && $("#wish_count").text($("#wish_count").text() - 1),
2171                    $(this).hasClass("del_basket_item") && $("#buy_count").length && $("#buy_count").text($("#buy_count").text() - 1);
2172                }),
2173                $(".wishlist_item .delete_link a").click(function () {
2174                    $("#wish_count").length && $("#wish_count").text($("#wish_count").text() - 1);
2175                }),
2176                $(".basket_item .delete_link a").click(function () {
2177                    $("#buy_count").length && $("#buy_count").text($("#buy_count").text() - 1);
2178                }),
2179                $(".eshop_filters_area input:checkbox").live("change", function () {
2180                    calculateEshopFilterPrice($(this));
2181                }),
2182                $(".eshop_filters_area input:radio").live("change", function () {
2183                    calculateEshopFilterPrice($(this));
2184                }),
2185                $(".eshop_filters_area select").live("change", function () {
2186                    calculateEshopFilterPrice($(this));
2187                }),
2188                $(".fc_radio.delivery input:radio").live("change", function () {
2189                    var e = $(this).val();
2190                    $.ajax({
2191                        type: "get",
2192                        url: window.location.href,
2193                        data: { basketorderdata: 1, delivery: e },
2194                        dataType: "json",
2195                        success: function (e) {
2196                            setBasketData(e.basketOrderData);
2197                        },
2198                    });
2199                }),
2200            $(".pda_site_container").length > 0)
2201        )
2202            if (
2203                ($(".pda_site_container .basket_item").click(function (e) {
2204                    return !($(e.target).closest(".uss_field").length > 0) && !($(e.target).closest(".del_basket_item").length > 0 || $(e.target).hasClass("del_basket_item")) && void (location.href = $(this).find("a:first").attr("href"));
2205                }),
2206                    (main_slide_block = $(".pda_site_container .uss_eshop_sameproducts_inner")),
2207                    (samep_block = $(".pda_site_container .uss_eshop_sameproducts_inner2")),
2208                    (glob_count = samep_block.find(".item").length),
2209                    (check_click = !0),
2210                glob_count < 3)
2211            ) {
2212                $(".sprod_left").remove(), $(".sprod_right").remove();
2213                var s = glob_count,
2214                    o = main_slide_block.width() / s;
2215                samep_block.find(".item").width(o),
2216                    samep_block.width(samep_block.find(".item").length * o),
2217                    $(window).resize(function () {
2218                        var e = glob_count,
2219                            t = main_slide_block.width() / e;
2220                        samep_block.find(".item").width(t), samep_block.width(samep_block.find(".item").length * t);
2221                    });
2222            } else if (glob_count >= 3) {
2223                (globws = 0), (mouse_start = 0), (m_start = !1);
2224                var a = samep_block.html();
2225                samep_block.append(a),
2226                    samep_block.prepend(a),
2227                    e(),
2228                    $(window).resize(function () {
2229                        samep_block.css("transition", "transform 0s linear"), samep_block.css("-webkit-transition", "-webkit-transform 0s linear"), e();
2230                    }),
2231                    isIOS()
2232                        ? main_slide_block.touchwipe({
2233                            wipeLeft: function () {
2234                                t();
2235                            },
2236                            wipeRight: function () {
2237                                i();
2238                            },
2239                        })
2240                        : (main_slide_block.bind("mousedown", function (e) {
2241                            samep_block.removeClass("noclick"), (check_click = !0), (m_start = !0), samep_block.css({ transition: "transform 0s linear", "-webkit-transition": "-webkit-transform 0s linear" }), e.preventDefault();
2242                            var t = e.pageX,
2243                                i = parseFloat(samep_block.position().left),
2244                                s = samep_block.find(".item:first").outerWidth(),
2245                                o = main_slide_block.outerWidth(),
2246                                a = Math.round(Math.abs(i) / s),
2247                                n = 3 * glob_count - Math.round(o / s) - a;
2248                            if (a <= 2 || n <= 2) {
2249                                if (a <= 2) r = i - glob_count * s;
2250                                if (n <= 2) var r = i + glob_count * s;
2251                                setLeft(r, 0), (i = r);
2252                            }
2253                            goslide(t, i);
2254                        }),
2255                            $(document).bind("mouseup", function (e) {
2256                                if (!m_start) return !1;
2257                                main_slide_block.unbind("mousemove");
2258                                var t = parseFloat(samep_block.position().left),
2259                                    i = samep_block.find(".item:first").outerWidth(),
2260                                    s = Math.abs(t),
2261                                    o = Math.round(s / i) * i;
2262                                t < 0 && (o *= -1), setLeft(o, 0.3), (m_start = !1);
2263                            })),
2264                    $(".sprod_left").bind("touchend click", function (e) {
2265                        if (isIOS() && "click" == e.type) return !1;
2266                        var t = parseFloat(samep_block.position().left),
2267                            s = samep_block.find(".item:first").outerWidth(),
2268                            o = main_slide_block.outerWidth(),
2269                            a = Math.round(Math.abs(t) / s),
2270                            n = 3 * glob_count - Math.round(o / s) - a;
2271                        if (a <= 2 || n <= 2) {
2272                            if (a <= 2) r = t - glob_count * s;
2273                            if (n <= 2) var r = t + glob_count * s;
2274                            setLeft(r, 0);
2275                        }
2276                        return i(), !1;
2277                    }),
2278                    $(".sprod_right").bind("touchend click", function (e) {
2279                        if (isIOS() && "click" == e.type) return !1;
2280                        var i = parseFloat(samep_block.position().left),
2281                            s = samep_block.find(".item:first").outerWidth(),
2282                            o = main_slide_block.outerWidth(),
2283                            a = Math.round(Math.abs(i) / s),
2284                            n = 3 * glob_count - Math.round(o / s) - a;
2285                        if (a <= 2 || n <= 2) {
2286                            if (a <= 2) r = i - glob_count * s;
2287                            if (n <= 2) var r = i + glob_count * s;
2288                            setLeft(r, 0);
2289                        }
2290                        return t(), !1;
2291                    }),
2292                    main_slide_block.find(".noclick a").live("click", function () {
2293                        return !1;
2294                    });
2295            }
2296    }),
2297    $(function () {
2298        $("a.buy_one_click").live("click", function () {
2299            var e = $(this);
2300            if ($(e).closest(".uss_eshop_item").length > 0)
2301                var t = $(e).closest(".uss_eshop_item").find(".eshop_filters_area").find("select, input").length > 0,
2302                    i = $(e).closest(".uss_eshop_item").find(".uss_specifications");
2303            else if ($(e).closest(".uss_shop_detail_pos").length > 0)
2304                var t = $(e).closest(".uss_shop_detail_pos").find(".eshop_filters_area").find("select, input").length > 0,
2305                    i = $(e).closest(".uss_shop_detail_pos").find(".uss_specifications");
2306            else if ($(e).closest(".uss_eshop_block_item ").length > 0)
2307                var t = $(e).closest(".uss_eshop_block_item").find(".eshop_filters_area").find("select, input").length > 0,
2308                    i = $(e).closest(".uss_eshop_block_item").find(".uss_specifications");
2309            else if ($(e).closest(".uss_eshop_sameproducts").length > 0)
2310                var t = $(e).closest(".item").find(".eshop_filters_area").find("select, input").length > 0,
2311                    i = $(e).closest(".item").find(".uss_specifications");
2312            var s = { buy_one_click: 1, change: e.attr("data-pos-id") };
2313            if (void 0 !== i && i.length > 0) {
2314                var o,
2315                    a = e.attr("data-pos-id"),
2316                    n = 0;
2317                $.each(i.find(".spec_item"), function () {
2318                    (o = $(this)
2319                        .find("#specification_" + a + "_" + n)
2320                        .val()) && (s["spec" + n] = o),
2321                        n++;
2322                });
2323            }
2324            if (1 == t) {
2325                var r = getEshopFilters(e);
2326                $.extend(s, r);
2327            }
2328            var l = "";
2329            if (
2330                ($.each(s, function (e, t) {
2331                    l += (l ? "-" : "") + e + "-" + t;
2332                }),
2333                $(".buy_one_click_form_tml").length > 0 && $(".buy_one_click_form_tml").attr("data-hash") == l)
2334            )
2335                $("body").append('<div id="uss_substrate2" />'), $("#uss_substrate2").show().animate({ opacity: 0.4 }, 100), $(".buy_one_click_form_tml").show().animate({ opacity: 1 }, 100);
2336            else {
2337                $("body .buy_one_click_form_tml").remove();
2338                var d = e.html();
2339                e.html('<span class="uss_basket_loader">&nbsp;&nbsp;&nbsp;&nbsp;</span>'),
2340                    $.ajax({
2341                        url: e.attr("data-url"),
2342                        data: s,
2343                        type: "get",
2344                        success: function (t) {
2345                            t && buyOneClickOpenForm(t, l), e.html(d);
2346                        },
2347                    });
2348            }
2349            return !1;
2350        }),
2351            $(".buy_one_click_form_tml a.close").live("click", function () {
2352                return $("body #uss_substrate2").remove(), $("body .buy_one_click_form_tml").hide(), !1;
2353            }),
2354            $(".buy_one_click_window_wrap .uss_plus").live("click", function () {
2355                buyOneClickChangeAmount($(this), 1);
2356            }),
2357            $(".buy_one_click_window_wrap .uss_minus").live("click", function () {
2358                buyOneClickChangeAmount($(this), -1);
2359            }),
2360            $(".buy_one_click_window_wrap input.amount").live("change", function () {
2361                buyOneClickCalculatePrice($(this), $(this).val());
2362            }),
2363            $(".buy_one_click_form_inpos form").submit(function () {
2364                var e = $(this);
2365                if (e.closest(".section_eshop").find(".uss_shop_detail_pos").length > 0)
2366                    var t = e.closest(".section_eshop").find(".uss_shop_detail_pos .eshop_filters_area").find("select, input").length > 0,
2367                        i = e.closest(".section_eshop").find(".uss_shop_detail_pos .uss_specifications");
2368                var s = [];
2369                if (i.length) {
2370                    var o,
2371                        a = 0;
2372                    $.each(i.find(".spec_item"), function () {
2373                        (o = $(this)
2374                            .find('[name="specification_' + a + '"]')
2375                            .val()) && (s["spec" + a] = o),
2376                            a++;
2377                    });
2378                }
2379                if (1 == t) {
2380                    var n = getEshopFilters(e);
2381                    $.extend(s, n);
2382                }
2383                s.change = e.find("input.pos_id").val();
2384                var r = new Array();
2385                for (var l in s) r.push(l + "=" + encodeURIComponent(s[l]));
2386                var d = r.join("&");
2387                if (d.length > 0) {
2388                    void 0 === e.attr("data-old-action") && e.attr("data-old-action", e.attr("action"));
2389                    var c = e.attr("data-old-action"),
2390                        _ = /\?/.test(c) ? "&" : "?";
2391                    e.attr("action", c + _ + d);
2392                }
2393                return !0;
2394            });
2395    }),
2396    $(document).ready(function () {
2397        $(".compare_table .delete_item").live("click", function () {
2398            if (!confirm($(this).closest(".compare_wrap").attr("data-confirm-delete-item"))) return !1;
2399            var e = $(this).closest(".compare_block_wrapper");
2400            return delCompare($(this)), $(this).closest(".compare_wrap").hasClass("pda") || calculateCompareColumnsWidth(e), !1;
2401        }),
2402            $(".compare_table .delete_all_item").live("click", function () {
2403                var e;
2404                return (
2405                    (e = $(this).closest(".tab_items").find(".tab_item").length > 0 ? $(this).closest(".compare_wrap").attr("data-confirm-delete-all-tab") : $(this).closest(".compare_wrap").attr("data-confirm-delete-all")),
2406                    !!confirm(e) && (delCompare($(this), !0), !1)
2407                );
2408            }),
2409            $(".compare_view_type > a").live("click", function (e) {
2410                $(this).closest(".compare_view_type").find("a").removeClass("active"), $(this).addClass("active");
2411                var t = $(this).closest(".compare_block_wrapper");
2412                if (t.closest(".compare_wrap").hasClass("pda")) {
2413                    if (t.find(".body_table tr").length <= 2) return !1;
2414                } else if (t.find(".body_table tr:first td.td_item").length <= 1) return !1;
2415                $(this).hasClass("various") ? t.find(".compare_table").toggleClass("difference_compare_table") : t.find(".compare_table").removeClass("difference_compare_table");
2416            }),
2417            $(".compare_link_input").focus(function () {
2418                $(this).select();
2419            }),
2420            $(".compare_wrap .compare_block_wrapper > table.compare_table.body_table").each(function () {
2421                initCompareTable($(this), "startInit");
2422            }),
2423            $(".compare_scroll").click(function () {
2424                var e = $(this).closest(".tab_items").find(".tab_item.selected .compare_block_wrapper");
2425                if ($(this).closest(".compare_wrap").hasClass("pda")) {
2426                    if ($(this).hasClass("right")) {
2427                        t = e.find(".compare_table tr:first td.hidden_cell").length;
2428                        if (
2429                            (e.find(".compare_table tr").each(function () {
2430                                $(this).find("td").eq(t).addClass("hidden_cell");
2431                            }),
2432                                $(this).closest(".tab_item").find(".compare_scroll.left").removeClass("hide"),
2433                            e.find(".compare_table").width() - 5 <= e.outerWidth())
2434                        )
2435                            return $(this).addClass("hide"), !1;
2436                    } else if (
2437                        $(this).hasClass("left") &&
2438                        (e.find(".compare_table tr").each(function () {
2439                            $(this).find("td.hidden_cell:last").removeClass("hidden_cell");
2440                        }),
2441                            $(this).closest(".tab_item").find(".compare_scroll.right").removeClass("hide"),
2442                        0 == e.find(".body_table tr:first td.hidden_cell").length && $(this).addClass("hide"),
2443                        e.find(".body_table").width() > e.outerWidth())
2444                    )
2445                        return e.find(".compare_scroll.right").removeClass("hide"), !1;
2446                } else if ($(this).hasClass("right")) {
2447                    t = e.find(".body_table tr:first td").not(".title").not(".hidden_cell").filter(":first").attr("data-pos-id");
2448                    if ((e.find(".td_item_" + t).addClass("hidden_cell"), $(this).closest(".tab_item").find(".compare_scroll.left").removeClass("hide"), e.find(".body_table").width() - 5 <= e.outerWidth()))
2449                        return $(this).addClass("hide"), !1;
2450                } else if ($(this).hasClass("left")) {
2451                    var t = e.find(".body_table tr:first td.hidden_cell").filter(":last").attr("data-pos-id");
2452                    if (
2453                        (e.find(".td_item_" + t).removeClass("hidden_cell"),
2454                            $(this).closest(".tab_item").find(".compare_scroll.right").removeClass("hide"),
2455                        0 == e.find(".body_table tr:first td.hidden_cell").length && $(this).addClass("hide"),
2456                        e.find(".body_table").width() > e.outerWidth())
2457                    )
2458                        return e.find(".compare_scroll.right").removeClass("hide"), !1;
2459                }
2460                initCompareTable(e.find(".body_table"));
2461            });
2462    }),
2463    $(window).resize(function () {
2464        $(".compare_block_wrapper > table.compare_table.body_table").each(function () {
2465            initCompareTable($(this), "resize");
2466        });
2467    }),
2468    $(window).scroll(function () {
2469        if ($(".compare_wrap:not(.pda)").length > 0) {
2470            var e = $(window).scrollTop(),
2471                t = $(".tab_item.selected .body_table");
2472            if (t.height() < document.body.clientHeight) return !1;
2473            if (0 == t.length) return !1;
2474            var i = $(".tab_item.selected .header_table").outerHeight(),
2475                s = $(".tab_item.selected .body_table tr.image").outerHeight(),
2476                o = t.offset().top;
2477            if (e > o + s - i) {
2478                $(".tab_item.selected .header_table tr:first");
2479                $(".tab_item.selected .header_table_wrap").hasClass("fixed") || ($(".tab_item.selected .header_table_wrap").addClass("fixed"), $(".tab_item.selected .compare_scroll").addClass("proc_fixed"), setCompareSliderButtons()),
2480                    e > t.outerHeight() + o - i
2481                        ? $(".tab_item.selected .header_table_wrap").hasClass("abs") ||
2482                        (setCompareSliderButtons(),
2483                            $(".tab_item.selected .header_table_wrap")
2484                                .css({ top: t.outerHeight() - i })
2485                                .addClass("abs"),
2486                            $(".tab_item.selected .compare_scroll")
2487                                .css({ left: "auto", top: t.outerHeight() - i })
2488                                .addClass("abs"))
2489                        : $(".tab_item.selected .header_table_wrap").hasClass("abs") &&
2490                        (setCompareSliderButtons(), $(".tab_item.selected .header_table_wrap").css({ top: "0px" }).removeClass("abs"), $(".tab_item.selected .compare_scroll").css({ top: "0px" }).removeClass("abs"));
2491            } else
2492                $(".tab_item.selected .header_table_wrap").hasClass("fixed") &&
2493                ($(".tab_item.selected .header_table_wrap").removeClass("fixed"), setCompareSliderButtons(), $(".tab_item.selected .compare_scroll").removeClass("proc_fixed").css({ top: "0px", left: "auto" }));
2494        } else $(".compare_wrap.pda").length > 0 && setCompareSliderButtonsPda();
2495    }),
2496    $(document).ready(function () {
2497        $(".ajutor_show").hover(
2498            function () {
2499                1 == $(this).closest(".eshop_filters_item").find(".ajutor_eshop_f
2499ilters").length && ajutorEshopFiltersHover($(this).closest(".eshop_filters_item").find(".ajutor_eshop_filters"));
2500            },
2501            function () {
2502                $(".body_ajutor_info").remove();
2503            }
2504        ),
2505            $(".ajutor_filter_show").hover(
2506                function () {
2507                    1 == $(this).closest(".eshop_filters.filter_item").find(".ajutor_eshop_filters").length && ajutorEshopFiltersHover($(this).closest(".eshop_filters.filter_item").find(".ajutor_eshop_filters"));
2508                },
2509                function () {
2510                    $(".body_ajutor_info").remove();
2511                }
2512            );
2513    }),
2514    $(function () {
2515        $(".uss_privacy_policy_button span").click(function () {
2516            $(this)
2517                .closest(".uss_privacy_policy_wrap")
2518                .slideUp(300, function () {
2519                    $.get("/", { allow_policy_privacy: 1 });
2520                });
2521        });
2522    }),
2523    ($.fn.touchwipe = function (e) {
2524        return (
2525            e && $.extend({ min_move_x: 30 }, e),
2526                this.each(function () {
2527                    function e() {
2528                        this.removeEventListener("touchmove", t), this.removeEventListener("touchend", t), (s = null), (isMoving = !1);
2529                    }
2530                    function t(e) {
2531                        check_click && (samep_block.addClass("noclick"), (check_click = !1));
2532                        var t = e.touches[0].pageX,
2533                            a = e.touches[0].pageY,
2534                            n = s - t,
2535                            r = o - a;
2536                        setLeft(t - mouse_start + left, 0), Math.abs(n) > 5 && isMoving ? (e.preventDefault(), "ontouchend" in document.documentElement && this.addEventListener("touchend", i, !1)) : Math.abs(r) > 5 && (isMoving = !1);
2537                    }
2538                    function i(t) {
2539                        var i = parseFloat(samep_block.position().left),
2540                            s = samep_block.find(".item:first").outerWidth(),
2541                            o = Math.abs(i),
2542                            a = Math.round(o / s) * s;
2543                        i < 0 && (a *= -1), setLeft(a, 0.3), e();
2544                    }
2545                    var s, o;
2546                    "ontouchstart" in document.documentElement &&
2547                    this.addEventListener(
2548                        "touchstart",
2549                        function (e) {
2550                            samep_block.removeClass("noclick"), (check_click = !0), (mouse_start = e.touches[0].pageX), (left = parseFloat(samep_block.position().left));
2551                            var i = samep_block.find(".item:first").outerWidth(),
2552                                o = main_slide_block.outerWidth(),
2553                                a = Math.round(Math.abs(left) / i),
2554                                n = 3 * glob_count - Math.round(o / i) - a;
2555                            if (a <= 2 || n <= 2) {
2556                                if ((a <= 2 && (r = left - glob_count * i), n <= 2)) var r = left + glob_count * i;
2557                                setLeft(r, 0), (left = r);
2558                            }
2559                            1 == e.touches.length && ((s = e.touches[0].pageX), (isMoving = !0), this.addEventListener("touchmove", t, !1));
2560                        },
2561                        !1
2562                    );
2563                }),
2564                this
2565        );
2566    }),
2567    ($.fn.touchwipe2 = function (e) {
2568        var t = { min_move_x: 20 };
2569        return (
2570            e && $.extend(t, e),
2571                this.each(function () {
2572                    function e() {
2573                        this.removeEventListener("touchmove", i), this.removeEventListener("touchend", i), (o = null), (isMoving = !1);
2574                    }
2575                    function i(e) {
2576                        var t = e.touches[0].pageX,
2577                            i = e.touches[0].pageY,
2578                            n = o - t,
2579                            r = a - i;
2580                        Math.abs(n) > 5 && isMoving ? (e.preventDefault(), "ontouchend" in document.documentElement && this.addEventListener("touchend", s, !1)) : Math.abs(r) > 5 && (isMoving = !1);
2581                    }
2582                    function s(i) {
2583                        var s = i.changedTouches[0].pageX,
2584                            a = o - s;
2585                        Math.abs(a) >= t.min_move_x && (i.preventDefault(), a > 0 ? t.wipeLeft(i) : t.wipeRight(i)), e();
2586                    }
2587                    var o, a;
2588                    "ontouchstart" in document.documentElement &&
2589                    this.addEventListener(
2590                        "touchstart",
2591                        function (e) {
2592                            1 == e.touches.length && ((o = e.touches[0].pageX), (isMoving = !0), this.addEventListener("touchmove", i, !1));
2593                        },
2594                        !1
2595                    );
2596                }),
2597                this
2598        );
2599    }),
2600    $(document).ready(function () {
2601        if ($(".uss_error_form").length > 0 || $(".uss_ok_form").length > 0) {
2602            if ($(".uss_error_form").length > 0) t = (e = $(".uss_error_form").position()).top;
2603            if ($(".uss_ok_form").length > 0)
2604                var e = $(".uss_ok_form").position(),
2605                    t = e.top;
2606            window.scrollTo(0, t);
2607        }
2608        $(".uss_form_tml form, form.fc_form").live("submit", function (e) {
2609            var t = $(this),
2610                i = $(document.activeElement, this);
2611            if (t.hasClass("CatalogOrderForm")) return !0;
2612            if (void 0 !== t.attr("data-sended")) return !1;
2613            var s = !0;
2614            return t.hasClass("validate") && (s = jsValidate(t)), !!s && (disableSubmitButton(t, i), !t.hasClass("ajax_send") || (submitFormAjax(t), !1));
2615        });
2616    }),
2617    $(document).ready(function () {
2618        $(".catalog_orderbutton").click(function () {
2619            var e = $(this);
2620            return (
2621                $.ajax({
2622                    url: e.attr("rel"),
2623                    type: "get",
2624                    success: function (e) {
2625                        catalogOpenForm(e);
2626                    },
2627                }),
2628                    !1
2629            );
2630        }),
2631            $(".catalog_orderform_tml a.close").live("click", function () {
2632                return $("body #uss_substrate2").remove(), $("body .catalog_orderform_tml").remove(), !1;
2633            }),
2634            $("form.CatalogOrderForm").live("submit", function (e) {
2635                var t = $(this);
2636                if (void 0 !== t.attr("data-sended")) return !1;
2637                var i = !0;
2638                return (
2639                    t.hasClass("validate") && (i = jsValidate(t)),
2640                    !!i &&
2641                    (disableSubmitButton(t),
2642                        t.hasClass("ajax_send")
2643                            ? (t.ajaxSubmit({
2644                                success: function (e) {
2645                                    $("body .catalog_orderform_window").length > 0 ? $("body .catalog_orderform_window").html(e) : t.closest(".fc_form_tml").replaceWith($(e));
2646                                },
2647                            }),
2648                                !1)
2649                            : void 0)
2650                );
2651            });
2652        var e = navigator.userAgent,
2653            t = e.match(/iPad/i) || e.match(/iPhone/) ? "touchstart" : "click";
2654        $("#uss_substrate2").live(t, function (e) {
2655            0 == $(e.target).closest(".catalog_orderform_window").length && $(".catalog_orderform_tml a.close").trigger("click"),
2656            0 == $(e.target).closest(".buy_one_click_form_tml").length && $(".buy_one_click_form_tml a.close").trigger("click");
2657        });
2658    }),
2659    $(document).ready(function () {
2660        prepareBasketWidget(),
2661            prepareMenu(),
2662            $(".uss_pda_sectionmenu_wrap .menu_item a.razd").click(function (e) {
2663                var t = $(this).closest(".uss_pda_menu").find(".hidden_sections");
2664                if (t.is(":visible")) t.hide();
2665                else {
2666                    $("a.razd").index($(this));
2667                    t.show();
2668                }
2669            }),
2670        $(".pda_site_container").length &&
2671        $(document).bind("click.myEvent", function (e) {
2672            0 == $(e.target).closest(".hidden_sections").length && 0 == $(e.target).closest("a.razd").length && $(".uss_pda_menu .hidden_sections").hide();
2673        });
2674    }),
2675    $(document).ready(function () {
2676        hideLongMenu(),
2677            resizePaddingMenu(),
2678            $(window).resize(function () {
2679                hideLongMenu(), resizePaddingMenu();
2680            }),
2681            $(".expand-toggle > a").click(function () {
2682                return (
2683                    $(this)
2684                        .closest(".expand-toggle")
2685                        .find(".menuSubItems")
2686                        .eq(0)
2687                        .stop(!0, !0)
2688                        .slideToggle(200, function () {
2689                            $(this).closest(".expand-toggle").toggleClass("open");
2690                        }),
2691                        !1
2692                );
2693            }),
2694            $(".menu3-dropdown .menuItem.subitems").hover(
2695                function () {
2696                    menu3ItemShow($(this));
2697                },
2698                function () {
2699                    menu3ItemHide($(this));
2700                }
2701            ),
2702            $("a.menu3-more-link").live("click", function () {
2703                return !1;
2704            });
2705    }),
2706    $(document).ready(function () {
2707        $(".jslider").live("click", function (e) {
2708            var t = $(this).closest(".jSliderWrap").find("input:first").attr("id"),
2709                i = getPageCoords(e),
2710                s = $("#" + t).slider(),
2711                o = (100 * (i.x - $(this).offset().left)) / $(this).width();
2712            o < 0 && (o = 0), o > 100 && (o = 100), (o = Math.round(10 * o) / 10);
2713            var a = s.prcToValue(o);
2714            $("#" + t).slider("value", a);
2715        });
2716    });
2717var ucProccessState = !1;
2718!(function (e) {
2719    (jQuery.fn.uss_slider = function (t) {
2720        var t = e.extend(
2721            {
2722                id: "uss_slider",
2723                height: 600,
2724                leftBtn: "uss_photoalbums_left",
2725                rightBtn: "uss_photoalbums_right",
2726                leftSlide: "uss_photoalbums_leftSlide",
2727                rightSlide: "uss_photoalbums_rightSlide",
2728                showBigArrows: !0,
2729                showBigArrowsOnHover: !0,
2730                leftSlideBig: "uss_big_left",
2731                rightSlideBig: "uss_big_right",
2732                slider_position: "after",
2733                description: "show",
2734                effect: "fade",
2735            },
2736            t
2737        );
2738        return this.each(function () {
2739            function i() {
2740                var e = navigator.userAgent.toLowerCase(),
2741                    t = e.indexOf("ipad") > -1,
2742                    i = e.indexOf("iphone") > -1,
2743                    s = e.indexOf("ipod") > -1,
2744                    o = e.indexOf("android") > -1;
2745                return !!(t || i || s || o);
2746            }
2747            function s() {
2748                $.find(".uss_foto_point").hasClass("uss_img_ico_first") ? f.find("." + t.leftSlideBig).addClass("hidearrow") : f.find("." + t.leftSlideBig).removeClass("hidearrow"),
2749                    $.find(".uss_foto_point").hasClass("uss_img_ico_last") ? f.find("." + t.rightSlideBig).addClass("hidearrow") : f.find("." + t.rightSlideBig).removeClass("hidearrow");
2750            }
2751            function o(e) {
2752                return (w = -parseInt(e.width() / 2)), "a" == e[0].tagName.toLowerCase() ? (h = 0) : (h = -parseInt(e.height() / 2)), (m = h + "px 0 0 " + w + "px"), m;
2753            }
2754            function a(e) {
2755                b <= f.find("." + t.id + "_cut").width()
2756                    ? ($.css({ left: "0" }), n())
2757                    : ((pos = e.position()),
2758                        (offset = v.width() / 2 - pos.left - e.width() / 2),
2759                        offset >= -b + v.width() + y && offset <= 0
2760                            ? $.animate({ left: offset + "px" }, 300, function () {
2761                                n();
2762                            })
2763                            : offset > 0
2764                            ? $.stop().animate({ left: "0px" }, 300, function () {
2765                                n();
2766                            })
2767                            : $.stop(!0, !0).animate({ left: -b + v.width() + y + "px" }, 300, function () {
2768                                n();
2769                            })),
2770                    s();
2771            }
2772            function n() {
2773                var e = $.position();
2774                Math.round(e.left, 0) < 0 ? f.find("." + t.leftBtn).show() : f.find("." + t.leftBtn).hide(), e.left > -b + v.width() + y ? f.find("." + t.rightBtn).show() : f.find("." + t.rightBtn).hide();
2775            }
2776            function r(i, o, n) {
2777                if (p.find(".new_a").length) return !1;
2778                var r = i;
2779                if (r.parent().hasClass("uss_foto_point")) return !1;
2780                p.find("a").stop(!0, !0);
2781                var l = p.find("a");
2782                p.append('<a class="new_a" style="display:none;"></a>');
2783                var d = p.find(".new_a");
2784                r.attr("title") && d.attr("title", r.attr("title")),
2785                    "slide" == o
2786                        ? "left" == n
2787                        ? ((marga = parseInt(d.css("width")) / 2), d.css({ left: "150%", display: "block", margin: "0 0 0 -" + parseInt(p.width() / 2) + "px", top: 0 }).append('<div class="preload_img"></div>'))
2788                        : d.css({ left: "-150%", display: "block", margin: "0 0 0 -" + parseInt(p.width() / 2) + "px", top: 0 }).append('<div class="preload_img"></div>')
2789                        : (l.remove(), p.prepend('<div class="preload_img"></div>')),
2790                    $.find(".uss_img_ico").removeClass("uss_foto_point"),
2791                    r.parent().addClass("uss_foto_point");
2792                var c = "";
2793                return (
2794                    (r.attr("title") || r.attr("alt")) && ((c = "<div>"), r.attr("alt") && (c = c + "<b>" + r.attr("alt") + "</b>"), r.attr("title") && (c += r.attr("title")), (c += "</div>")),
2795                        r.children("img").attr("longdesc") ? (link = ' href="' + r.children("img").attr("longdesc") + '" ') : (link = ' href="' + r.attr("href") + '" target="_blank" '),
2796                        f.find(".desc").html(c),
2797                        (g = new Image()),
2798                        "slide" == o
2799                            ? ("left" == n
2800                            ? l.animate({ left: "-150%" }, 500, function () {
2801                                l.remove();
2802                            })
2803                            : l.animate({ left: "150%" }, 500, function () {
2804                                l.remove();
2805                            }),
2806                                d.animate({ left: "50%" }, 500, function () {
2807                                    e(this).removeClass("new_a");
2808                                }),
2809                                (g.onload = function () {
2810                                    r.attr("alt") && e(g).attr("alt", r.attr("alt")),
2811                                    r.attr("title") && e(g).attr("title", r.attr("title")),
2812                                        e(g).attr("style", "max-width:100%;"),
2813                                        parseInt(g.width) > p.width() ? ((ow = parseInt(g.width)), (nw = parseInt(p.width())), (oh = parseInt(g.height)), (nh = parseInt((oh * nw) / ow))) : ((nw = parseInt(g.width)), (nh = parseInt(g.height))),
2814                                        (p.height = nh),
2815                                        "after" == t.slider_position
2816                                            ? (e(g).attr("style", "margin:-" + parseInt(nh / 2) + "px 0 0 -" + parseInt(nw / 2) + "px;top:50%;left:50%;position:absolute;"), d.css("margin", "0 0 0 -" + parseInt(p.width() / 2) + "px"))
2817                                            : (e(g).attr("style", "margin:-" + parseInt(nh / 2) + "px 0 0 -" + parseInt(nw / 2) + "px;top:50%;left:50%;position:absolute;"),
2818                                                p.stop(!0, !0).animate({ height: nh }, 500, function () {}),
2819                                                d.css("margin", "0 0 0 -" + parseInt(p.width() / 2) + "px")),
2820                                        l.addClass("old_a").css("z-index:500"),
2821                                        d.empty().append(g),
2822                                        p.find(".preload_img").remove();
2823                                }),
2824                                (g.src = r.attr("href")))
2825                            : ((g.onload = function () {
2826                                r.attr("alt") && e(g).attr("alt", r.attr("alt")),
2827                                r.attr("title") && e(g).attr("title", r.attr("title")),
2828                                    e(g).attr("style", "max-width:100%;"),
2829                                    parseInt(g.width) > p.width() ? ((ow = parseInt(g.width)), (nw = parseInt(p.width())), (oh = parseInt(g.height)), (nh = parseInt((oh * nw) / ow))) : ((nw = parseInt(g.width)), (nh = parseInt(g.height))),
2830                                    (p.height = nh),
2831                                    "after" == t.slider_position
2832                                        ? (e(g).attr("style", "margin:-" + parseInt(nh / 2) + "px 0 0 -" + parseInt(nw / 2) + "px;top:50%;left:50%;position:absolute;"), d.css("margin", "0 0 0 -" + parseInt(p.width() / 2) + "px"))
2833                                        : (e(g).attr("style", "margin:-" + parseInt(nh / 2) + "px 0 0 -" + parseInt(nw / 2) + "px;top:50%;left:50%;position:absolute;"),
2834                                            p.stop(!0, !0).animate({ height: nh }, 500, function () {}),
2835                                            d.css("margin", "0 0 0 -" + parseInt(p.width() / 2) + "px")),
2836                                    l.addClass("old_a").css("z-index:500"),
2837                                    d.append(g),
2838                                    p.find(".preload_img").remove(),
2839                                    d.fadeIn(100, function () {
2840                                        e(this).removeClass("new_a");
2841                                    });
2842                            }),
2843                                (g.src = r.attr("href"))),
2844                        s(),
2845                        a(i.parent()),
2846                        !1
2847                );
2848            }
2849            function l() {
2850                if (!$.find(".uss_foto_point").hasClass("uss_img_ico_last")) {
2851                    var e = $.find(".uss_foto_point").next();
2852                    r(e.find("a"), "slide", "left"), a(e);
2853                }
2854            }
2855            function d() {
2856                if (!$.find(".uss_foto_point").hasClass("uss_img_ico_first")) {
2857                    var e = $.find(".uss_foto_point").prev();
2858                    r(e.find("a"), "slide", "right"), a(e);
2859                }
2860            }
2861            function c() {
2862                var i = f.outerWidth(),
2863                    s = 0,
2864                    o = 1;
2865                e.each(f.find(".uss_img_ico"), function () {
2866                    var a,
2867                        n = e(this).data("width"),
2868                        r = e(this).data("height");
2869                    if ("number" != typeof n || "number" != typeof r) return (s = t.height), !1;
2870                    n > i ? ((o = i / n) > 1 && (o = 1), (a = r * o)) : (a = r), a > s && (s = a);
2871                }),
2872                s > 0 && f.find(".uss_img_big").css("height", s);
2873            }
2874            var _ = 0,
2875                u = 0,
2876                f = e(this),
2877                p = f.find(".uss_img_big"),
2878                g = "";
2879            "show" == t.description && p.after('<div class="desc"></div>'), "after" == t.slider_position && p.css({ height: t.height + "px" });
2880            var v = f.find("." + t.id),
2881                $ = f.find("." + t.id + "_wrap"),
2882                b = 0,
2883                y = 0;
2884            if (
2885                ($.children().each(function () {
2886                    (b += e(this).outerWidth()), (y = parseInt(e(this).css("margin-right"))), (b += y);
2887                }),
2888                    $.css("width", b + "px"),
2889                    e(window).resize(function () {
2890                        a($.find(".uss_foto_point")),
2891                            "after" == t.slider_position
2892                                ? ((imag_a = p.find("a")), (imaga = p.find("img")), imag_a.css("margin", o(imag_a)), imaga.css("margin", o(imaga)))
2893                                : ((imag_a = p.find("a")), imag_a.css("margin", o(imag_a)), (imaga = p.find("img")), p.css("height", imaga.height()), imaga.css("margin", o(imaga))),
2894                            c();
2895                    }),
2896                    c(),
2897                    f.hasClass("autoslide"))
2898            ) {
2899                var k = parseInt(e(this).attr("data-interval"));
2900                (isNaN(k) || k <= 0) && (k = 5),
2901                f.find(".uss_photoalbums_foto_slide_wrap .uss_img_ico").length > 1 &&
2902                setInterval(function () {
2903                    f.find(".uss_photoalbums_foto_slide_wrap .uss_img_ico.uss_img_ico_last").hasClass("uss_foto_point") ? f.find(".uss_photoalbums_foto_slide_wrap .uss_img_ico.uss_img_ico_first a").trigger("click") : l();
2904                }, 1e3 * k);
2905            }
2906            e("." + t.leftBtn).click(function () {
2907                var t = $.position();
2908                t = Math.round(t.left);
2909                var i = 0,
2910                    s = 0;
2911                $.children().each(function () {
2912                    if (((s -= e(this).outerWidth()), (y = parseInt(e(this).css("margin-right"))), (s -= y) <= t))
2913                        return (
2914                            $.stop(!0, !0).animate({ left: i }, 100, function () {
2915                                n();
2916                            }),
2917                                !1
2918                        );
2919                    i = s;
2920                });
2921            }),
2922                e("." + t.rightBtn).click(function () {
2923                    var t = $.position();
2924                    t = Math.round(t.left);
2925                    var i = 0;
2926                    $.children().each(function () {
2927                        if (((i -= e(this).outerWidth()), (y = parseInt(e(this).css("margin-right"))), (i -= y) < t))
2928                            return (
2929                                i < Math.round(-b + v.width() + y) && (i = Math.round(-b + v.width() + y - 2)),
2930                                    $.stop(!0, !0).animate({ left: i }, 100, function () {
2931                                        n();
2932                                    }),
2933                                    !1
2934                            );
2935                    });
2936                }),
2937                $.find("a").click(function (t) {
2938                    return t.preventDefault(), r(e(this), "fade"), !1;
2939                }),
2940                r($.find("a:first"), "fade"),
2941                t.showBigArrows
2942                    ? ((t.showBigArrowsOnHover && !i()) || f.find(".uss_img_big_wrap").addClass("hovered"),
2943                        f.find(".uss_img_big_wrap").hover(
2944                            function (t) {
2945                                e(this).addClass("hovered");
2946                            },
2947                            function (t) {
2948                                e(this).removeClass("hovered");
2949                            }
2950                        ),
2951                        s())
2952                    : f.find(".uss_big_nav").remove(),
2953                i()
2954                    ? (p.touchwipe_page_slider({
2955                        wipeLeft: function () {
2956                            l();
2957                        },
2958                        wipeRight: function () {
2959                            d();
2960                        },
2961                        min_move_x: parseInt(p.width() / 10),
2962                        preventDefaultEvents: !1,
2963                    }),
2964                        f.find("." + t.rightSlideBig).click(function () {
2965                            l();
2966                        }),
2967                        f.find("." + t.leftSlideBig).click(function () {
2968                            d();
2969                        }),
2970                        e("." + t.id + "_cut").bind("touchmove", function (t) {
2971                            t.preventDefault(), e(".uss-site-copyright").text(t.pageX);
2972                        }))
2973                    : p
2974                        .bind("mousedown", function (e) {
2975                            return e.preventDefault(), (_ = e.pageX), !1;
2976                        })
2977                        .bind("mouseup", function (i) {
2978                            (u = i.pageX), (rez = _ - u), rez > 20 || (0 == rez && e(i.target).hasClass(t.rightSlideBig)) ? l() : (rez < -20 || (0 == rez && e(i.target).hasClass(t.leftSlideBig))) && d();
2979                        }),
2980                (document.onkeyup = function (e) {
2981                    if ((window.event && (e = window.event), e))
2982                        switch (e.keyCode ? e.keyCode : e.which ? e.which : null) {
2983                            case 37:
2984                                d();
2985                                break;
2986                            case 39:
2987                                l();
2988                        }
2989                });
2990        });
2991    }),
2992        (e.fn.touchwipe_page_slider = function (t) {
2993            var i = { min_move_x: 50, min_move_y: 50, wipeLeft: function () {}, wipeRight: function () {}, wipeUp: function () {}, wipeDown: function () {}, preventDefaultEvents: !1 };
2994            return (
2995                t && e.extend(i, t),
2996                    this.each(function () {
2997                        function e() {
2998                            this.removeEventListener("touchmove", t), this.removeEventListener("touchend", t), (o = null), (isMoving = !1);
2999                        }
3000                        function t(e) {
3001                            var t = e.touches[0].pageX,
3002                                i = e.touches[0].pageY,
3003                                n = o - t,
3004                                r = a - i;
3005                            Math.abs(n) > 5 && isMoving ? (e.preventDefault(), "ontouchend" in document.documentElement && this.addEventListener("touchend", s, !1)) : Math.abs(r) > 5 && (isMoving = !1);
3006                        }
3007                        function s(t) {
3008                            var s = t.changedTouches[0].pageX,
3009                                a = o - s;
3010                            Math.abs(a) >= i.min_move_x && (t.preventDefault(), a > 0 ? i.wipeLeft() : i.wipeRight()), e();
3011                        }
3012                        var o, a;
3013                        "ontouchstart" in document.documentElement &&
3014                        this.addEventListener(
3015                            "touchstart",
3016                            function (e) {
3017                                1 == e.touches.length && ((o = e.touches[0].pageX), (isMoving = !0), this.addEventListener("touchmove", t, !1));
3018                            },
3019                            !1
3020                        );
3021                    }),
3022                    this
3023            );
3024        });
3025})(jQuery),
3026    $(function () {
3027        $("form#ommentaddform_id").submit(function (e) {
3028            var t = $(this);
3029            if (t.attr("data-comment-sended")) return !0;
3030            var i = [];
3031            if ("undefined" == typeof commentFormLang) return !0;
3032            $("#user_nameid").length && !$("#user_nameid").val() && void 0 !== commentFormLang.user_name ? (i.push(commentFormLang.user_name), $("#user_nameid").addClass("error_field")) : $("#user_nameid").removeClass("error_field"),
3033                $("#textid").val() || void 0 === commentFormLang.text ? $("#textid").removeClass("error_field") : (i.push(commentFormLang.text), $("#textid").addClass("error_field"));
3034            $("#emailid").val() && !/^.+@.+\..+$/.test($("#emailid").val()) && void 0 !== commentFormLang.email ? (i.push(commentFormLang.email), $("#emailid").addClass("error_field")) : $("#emailid").removeClass("error_field"),
3035            $("#allow_privacy_policyid").is(":checked") || void 0 === commentFormLang.allow_privacy_policy || i.push(commentFormLang.allow_privacy_policy),
3036                $("#captchaid").length && !$("#captchaid").val() && void 0 !== commentFormLang.captcha ? (i.push(commentFormLang.captcha), $("#captchaid").addClass("error_field")) : $("#captchaid").removeClass("error_field");
3037            var s = t.closest(".comment_form_block");
3038            if ((s.prev(".uss_error_form").remove(), s.prev(".uss_ok_form").remove(), i.length)) {
3039                var o = "";
3040                return (
3041                    $.each(i, function (e, t) {
3042                        o += "<ol>" + t + "</ol>";
3043                    }),
3044                        s.before('<div class="uss_error_form">' + o + "</div>"),
3045                    s.prev(".uss_error_form").length && $(window).scrollTop() > s.prev(".uss_error_form").offset().top && $("html, body").animate({ scrollTop: s.prev(".uss_error_form").offset().top }, 150),
3046                        !1
3047                );
3048            }
3049            return (
3050                t.append('<input type="hidden" name="sendsaveommentaddform_id" value="Send">'),
3051                    $.ajax({
3052                        url: t.attr("action"),
3053                        data: t.serialize(),
3054                        type: "post",
3055                        success: function (e) {
3056                            return 1 === parseInt(e)
3057                                ? (s.before('<div class="uss_ok_form">' + commentFormLang.success + "</div>"),
3058                                    t.trigger("reset"),
3059                                    t.find("input:text, textarea").val(""),
3060                                    t.find(".preloder_small").remove(),
3061                                    t.find("input:submit").removeAttr("disabled"),
3062                                s.prev(".uss_ok_form").length && $(window).scrollTop() > s.prev(".uss_ok_form").offset().top && $("html, body").animate({ scrollTop: s.prev(".uss_ok_form").offset().top }, 150),
3063                                    !1)
3064                                : (t.attr("data-comment-sended", "1"), t.submit(), !0);
3065                        },
3066                    }),
3067                    !1
3068            );
3069        });
3070    }),
3071    $(function () {
3072        $(".uss_open_modal").on("click", function () {
3073            var e = $(".uss_modal_window." + $(this).data("modal"));
3074            e.length && openModal(e);
3075        }),
3076            $("body").on("click", ".uss_modal_window .uss_modal_content .uss_modal_close", function () {
3077                closeModal();
3078            });
3079    }),
3080    $(".toggle_button").on("click", function () {
3081        var e = $(this).closest(".fc_group_start");
3082        e.hasClass("minimized") ? (e.find(".toggle_area").slideDown(0), e.removeClass("minimized"), $(this).html($(this).data("up"))) : (e.find(".toggle_area").slideUp(0), e.addClass("minimized"), $(this).html($(this).data("down")));
3083    }),
3084    $(function () {
3085        $("body").on("click", ".uss_change_city", function () {
3086            var e = $(this),
3087                t = function () {
3088                    $(".uss_modal_change_city form").removeClass("loading"),
3089                        $(".uss_modal_change_city .uss_search_city_input").focus(),
3090                        $(".uss_modal_change_city .uss_search_city_submit input").prop("disabled", !0),
3091                        $(".uss_search_city_input").autocomplete("/?change_city&delayed=1&action=search", {
3092                            selectFirst: !1,
3093                            inputClass: "uss_search_city_input",
3094                            resultsClass: "uss_search_city_results",
3095                            matchContains: "word",
3096                            cacheLength: 1,
3097                            formatItem: function (e) {
3098                                return e[1];
3099                            },
3100                            formatResult: function (e) {
3101                                return e[1];
3102                            },
3103                        }),
3104                        $(".uss_search_city_input").result(function (e, t, i, s) {
3105                            if (i) return $(".uss_modal_change_city .city_id").val(i), $(".uss_modal_change_city .uss_search_city_submit input").prop("disabled", !1), 13 == s && $(".uss_modal_change_city form").trigger("submit"), !0;
3106                        });
3107                };
3108            $(".uss_modal_change_city").length
3109                ? openModal($(".uss_modal_change_city"), function () {
3110                    $(".uss_modal_change_city .uss_search_city_input").focus(), $(".uss_modal_change_city .uss_search_city_submit input").prop("disabled", !0);
3111                })
3112                : (e.addClass("loading"),
3113                    $.get("/?change_city&delayed=1&action=window", function (i) {
3114                        $("body").append(i), e.removeClass("loading"), openModal($(".uss_modal_change_city"), t);
3115                    }));
3116        }),
3117            $(window).resize(function () {
3118                $(".uss_search_city_results").hide();
3119            }),
3120            $("body")
3121                .on("submit", ".uss_modal_change_city form", function () {
3122                    return !$(this).hasClass("loading") && (deliveryWidgetChangeCity($(this).serialize()), $(this).addClass("loading"), $(this).find(".uss_save_city").attr("disabled", !0), !1);
3123                })
3124                .on("change", "select.delivery_psv", function () {
3125                    var e = $(this);
3126                    $.each($("select.delivery_psv").not(e), function () {
3127                        $(this).val(e.val()).trigger("refresh");
3128                    });
3129                })
3130                .on("change", ".radio_tariff_item input:radio", function () {
3131                    $(".radio_wrapper.need_calculate").children("label").find("input:radio").attr("checked", !1).trigger("refresh"),
3132                        $(this).closest(".radio_wrapper.need_calculate").children("label").find("input:radio").attr("checked", !0).trigger("refresh");
3133                });
3134    }),
3135    $(function () {
3136        function e(e, t) {
3137            e.removeClass("loading"), (t = t || e.attr("data-error")), e.parent().find(".uss_delivery_error").length || e.after('<div class="uss_delivery_error"/>'), e.parent().find(".uss_delivery_error").html(t);
3138        }
3139        (window.ISDEKWidjetLoad = !1),
3140            $("body").on("click", ".open_map, .open_basket_map", function (t) {
3141                if ($(this).hasClass("loading")) return !1;
3142                $(this).addClass("loading"), t.preventDefault();
3143                var i = $(this),
3144                    s = i.hasClass("open_cdek_basket_map"),
3145                    o = i.data("city"),
3146                    a = i.data("to"),
3147                    n = i.data("url"),
3148                    r = i.data("positions"),
3149                    l = i.data("map"),
3150                    d = $(".uss_widget_delivery_city_name").length && $(".uss_widget_delivery_city_name").html() ? $(".uss_widget_delivery_city_name").html() : a,
3151                    c = function (e) {
3152                        var t = i.data("id"),
3153                            s = i.data("title"),
3154                            o = i.data("change-title");
3155                        void 0 !== e.PVZ
3156                            ? (i.closest(".fc_delivery").find(".psv_name").html(e.PVZ.Address), i.closest(".fc_delivery").find(".open_cdek_basket_map").html(o), $("input.delivery_psv").val(e.id), $(".uss_delivery_error").html(""))
3157                            : (i.closest(".fc_delivery").find(".psv_name").html(""),
3158                                i.closest(".fc_delivery").find(".open_cdek_basket_map").html(s),
3159                                $("input.delivery_psv").val(""),
3160                                $(".radio_tariff_item input:checked").attr("checked", !1).trigger("refresh"),
3161                                $('.radio_tariff_item input[value="' + t + "_" + e.tarif + '"]')
3162                                    .attr("checked", !0)
3163                                    .trigger("change")
3164                                    .trigger("refresh"),
3165                                $(".uss_delivery_error").html(""));
3166                    };
3167                if (
3168                    ((cdekError = function (t) {
3169                        console.error(t), e(i);
3170                        var s = setInterval(function () {
3171                            $(".CDEK-widget__popup-mask").length && ($(".CDEK-widget__popup-mask").remove(), (window.ISDEKWidjetLoad = !1), i.removeClass("loading"), clearInterval(s));
3172                        }, 100);
3173                    }),
3174                        window.ISDEKWidjetLoad)
3175                )
3176                    window.ISDEKWidjetObj.city.set(d), window.ISDEKWidjetObj.open();
3177                else
3178                    try {
3179                        (window.ISDEKWidjetObj = new ISDEKWidjet({
3180                            hideMessages: !1,
3181                            defaultCity: d,
3182                            cityFrom: o,
3183                            servicepath: n,
3184                            path: "https://widget.cdek.ru/widget/scripts/",
3185                            goods: r,
3186                            choose: s,
3187                            link: !1,
3188                            popup: !0,
3189                            apikey: l,
3190                            onCalculate: function (e) {
3191                                s && deliveryWidgetChangeCity({ co
3191de: e.city, name: e.cityName, system: "cdek" });
3192                            },
3193                            onReady: function () {
3194                                (window.ISDEKWidjetObj = !0), clearInterval(window.cdekTimeInterval), i.removeClass("loading");
3195                            },
3196                            onChoose: s ? c : function () {},
3197                            onChooseProfile: s ? c : function () {},
3198                            onError: cdekError,
3199                        })),
3200                            (window.cdekTimeIntervalCount = 0),
3201                            (window.cdekTimeInterval = setInterval(function () {
3202                                window.cdekTimeIntervalCount++;
3203                                try {
3204                                    if ((window.ISDEKWidjetObj.open(), window.cdekTimeIntervalCount >= 50)) throw (clearInterval(window.cdekTimeInterval), new Error("Íå óäàëîñü îòîáðàçèòü êàðòó"));
3205                                } catch (t) {
3206                                    clearInterval(window.cdekTimeInterval), e(i), console.error(t);
3207                                }
3208                            }, 1e3));
3209                    } catch (t) {
3210                        (window.ISDEKWidjetLoad = !1), e(i), console.error(t);
3211                    }
3212            }),
3213            $("body").on("click", ".CDEK-widget__popup__close-btn", function (e) {
3214                e.preventDefault(), clearInterval(window.cdekTimeInterval), $(".CDEK-widget__popup-mask").hide(), $(".loading").removeClass("loading");
3215            });
3216    });
3217var infinityLoopGoal = 0,
3218    infinityLoopGoalMax = 10;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.