function out(html){
if(!jQuery('.out').length){
jQuery('body').append('
');
jQuery('.out:last').css({padding:10, zIndex:1000, color:'#c00', border:'4px solid #c00', background:'rgba(255, 255, 255, .85)'});
}
if(jQuery('.out:last').text() != '') jQuery('.out:last').append('
');
if(jQuery('.out:last').height() > 600) jQuery('.out:last').html('');
jQuery('.out:last').append(html);
}
jQuery(document).ready(function($){
/*var resizeSubTimer;
function populate_acs(){
$('.categories .categories-items').children().each(function(){
if($(window).width() <= 992){
$('.categories .categories-items').addClass('row');
if($('.acs-flexed').length){
if($(this).hasClass('acs-appended')) $(this).remove();
else{
var classes_ini = $(this).data('classes_ini');
$(this).attr('class', classes_ini);
}
}
}else{
$('.categories .categories-items').removeClass('row');
if($('.acs-flexed').length < 4){
var acs_flexed = $('.categories .categories-items').children().length;
if(acs_flexed < 4){
for(var i=0; i<4-acs_flexed; i++){
var acs_appended = $('.categories .categories-items').children('div:eq(0)').clone();
if(i%2) acs_appended = $('.categories .categories-items').children('div:eq(1)').clone();
$('.categories .categories-items').append(acs_appended);
}
if(resizeSubTimer) window.clearTimeout(resizeSubTimer);
resizeSubTimer = window.setTimeout(function(){
populate_acs();
}, 150);
}else{
var classes_ini = $(this).attr('class');
$(this).data('classes_ini', classes_ini);
$(this).attr('class', 'acs-flexed');
}
}
}
});
}
var resizeTimer;
$(window).resize(function(){
if(resizeTimer) window.clearTimeout(resizeTimer);
resizeTimer = window.setTimeout(function(){
if(window.location.href.toString().indexOf('/catalog/aksessuary/') > -1){
populate_acs();
}
}, 250);
});
if(window.location.href.toString().indexOf('/catalog/aksessuary/') > -1){
populate_acs();
}*/
// ==== маска телефона везде где встречается телефон?? ====
// $('input[autocomplete="tel"], input[name="userPhone"]').mask("+7 (999) 999-9999");
// ==== считать хлебные крошки в каталоге и смещаться до фильтра ====
if(window.location.href.toString().indexOf('/catalog/') > -1 && $('#filter').hasOwnProperty('top') ){
if($('.breadcrumb .breadcrumb-item').length > 3){
$('body, html').animate({scrollTop: $('#filter').offset().top - 100}, 'slow');
}
}
// ==== запустить слайдер на главной ====
if($('.container-for-slick-slider').length){
$('.container-for-slick-slider').slick({
arrows: false,
autoplay: true,
dots: true,
infinite: false,
speed: 300,
slidesToShow: 1,
slidesToScroll: 1,
});
}
// ==== переделать работу вкладок на главной странице ====
if($('section.tiles').length){
function open_tiles(id){
$('section.tiles .tiles-tabs__controls li').removeClass('active');
$('section.tiles .tiles-tabs__controls li:eq(' + id + ')').addClass('active');
$('section.tiles .tiles-tabs__item').slideUp();
$('section.tiles .tiles-tabs__item:eq(' + id + ')').slideDown();
}
open_tiles(0);
$('section.tiles .tiles-tabs__controls li').click(function(){
open_tiles($(this).index('section.tiles .tiles-tabs__controls li'));
$('html, body').animate({scrollTop: $('section.tiles').offset().top}, 'slow');
});
}
});