$('a[href=#top]').click(function () {
    $('html, body').animate({ scrollTop: 0 }, 'slow');
    return false;
});

$('#q').bind(($.browser.opera ? 'keypress' : 'keydown'), function (e) {
    if (e.keyCode == 13) return postSearch();
});

$(".ns-search-button").click(function () {
    location.href = $('#q').attr('data-url') + "?q=" + $('#q').val();
});

var postSearch = function () {
    location.href = $('#q').attr('data-url') + "?q=" + $('#q').val();
    return false;
}
$('#q').focus(function () {
    $(this).val('');
});

$('#q').blur(function () {
    if ($(this).val() == '') {
        $(this).val($(this).attr('data-tooltip'));
    }
});





$(document).ready(function(){
    $('.product-slider').slick({
        dots: true     
    });
    $(".toc a").each(function () {
        if ($(this).attr('href') == document.location.pathname.split('/')[document.location.pathname.split('/').length - 1]) {
            $(this).parent().addClass('active');
            $(".toc.tocSmall").find("a").first().parent().addClass("active");
        }
        if ("modul-i-kartica.nspx" == document.location.pathname.split('/')[document.location.pathname.split('/').length - 1]) {
            $(".toc.tocSmall").find("a").first().parent().removeClass("active");
        }
    })
    setTimeout(function() {
        $('.not').fadeIn(300)
    },3000)
});

$('.single-item-rtl').slick({
    rtl: true

});