var dt = new Date();
var time = dt.getHours();
var loadCaptcha = function() {
grecaptcha.render('robo-challenge', {
'sitekey' : '6LfBXjkUAAAAAJS7Z1U5XJVHzIsykKMIc6HJFXWc'
});
};
//Каруселька
//Документация: http://owlgraphic.com/owlcarousel/
$(document).ready(function(){
var owl = $(".carousel");
owl.owlCarousel({
items : 4
});
/*owl.on("mousewheel", ".owl-wrapper", function (e) {
if (e.deltaY > 0) {
owl.trigger("owl.prev");
} else {
owl.trigger("owl.next");
}
e.preventDefault();
});*/
$(".next_button").click(function(){
owl.trigger("owl.next");
});
$(".prev_button").click(function(){
owl.trigger("owl.prev");
});
});
//Псевдо ссылки
$(document).on('mousedown', '.pseudo-a', function(e) {
var pa_url = $(this).data('url');
switch(e.which)
{
case 1:
if($(this).hasClass('pseudo-a-blank')) {
window.open(pa_url, "_blank","noopener,noreferrer");
}
else {
window.location.href = pa_url;
}
break;
case 2:
window.open(pa_url, "_blank","noopener,noreferrer");
break;
}
return true;
});
//Сворачиваемые кастомные отзывы
$(document).ready(function(){
$('.demi-slider.custom-reviews .review-text').each(function() {
if(Number($(this).text().length) > 180) {
$(this).append('
Смотреть полностью
');
$(this).addClass('huge');
}
});
$('html').on('click', '.custom-review-more span', function() {
if(!$(this).hasClass('ext')) {
$(this).addClass('ext');
$(this).html('Скрыть');
$(this).parents('.demi-slider.custom-reviews .review-text').addClass('expanded');
}
else {
$(this).removeClass('ext');
$(this).html('Смотреть полностью');
$(this).parents('.demi-slider.custom-reviews .review-text').removeClass('expanded');
}
});
});
/* For devices */
$(document).ready(function(){
$('#main-menu ul .hidden-item.switch-hidden').click(function(){
$('.hidden-washers').toggle(300);
$('#main-menu ul li.hidden-item a i').toggleClass('fa-chevron-down');
$('#main-menu ul li.hidden-item a i').toggleClass('fa-chevron-up');
});
$('.show-mobile-menu').click(function() {
$('#main-menu').slideToggle(100);
});
$('.switch-sub').click(function() {
$(this).find('.sub-menu').slideToggle(100);
});
});
/* TOOLTIPS */
$(document).ready(function(){
$("#washer-blocks .w-block img").hover(function() {
$(this).next("em").stop(true, true).animate({opacity: "show"}, "fast");
}, function() {
$(this).next("em").animate({opacity: "hide"}, "fast");
});
$('.faq-list .title').click(function() {
if($(this).hasClass('ext')) {
$(this).removeClass('ext');
$(this).parent().children('.answer').slideUp(100);
$(this).children('i').addClass('fa-chevron-right');
$(this).children('i').removeClass('fa-chevron-down');
}
else {
$(this).addClass('ext');
$(this).parent().children('.answer').slideDown(100);
$(this).children('i').addClass('fa-chevron-down');
$(this).children('i').removeClass('fa-chevron-right');
}
});
});
/* ICONS */
(function($){
$(document).one('ready', function() {
$('').prependTo("#footer .footer-block.kontakty .map a");
$('').prependTo("#footer .footer-block.kontakty .f-phone");
$('').prependTo("#footer .footer-block.kontakty .mail a");
$('').prependTo("#footer .footer-block.kontakty .site a");
$('').prependTo("#footer .sitemap li a");
$('').prependTo("#footer .sitemap li span");
$('#sidebar .block-title').click(function(){
$('#sidebar .rounded-list').toggle(300);
});
});
})(jQuery);
/* POPUP */
$(document).ready(function() {
$('body').append('');
var boxWidth = 270;
function centerBox() {
/* Preliminary information */
var winWidth = $(window).width();
var winHeight = $(document).height();
var scrollPos = $(window).scrollTop();
/* auto scroll bug */
/* Calculate positions */
var disWidth = (winWidth - boxWidth) / 2
var disHeight = scrollPos + 150;
/* Move stuff about */
$('.popup-box').css({'width' : boxWidth+'px', 'left' : disWidth+'px', 'top' : disHeight+'px'});
$('#blackout').css({'width' : winWidth+'px', 'height' : winHeight+'px'});
return false;
}
$(window).resize(centerBox);
$(window).scroll(centerBox);
centerBox();
$('[class*=popup-link]').click(function(e) {
/* Prevent default actions */
e.preventDefault();
e.stopPropagation();
/* Get the id (the number appended to the end of the classes) */
var name = $(this).attr('class');
var id = name[name.length - 1];
var scrollPos = $(window).scrollTop();
/* Show the correct popup box, show the blackout and disable scrolling */
$('#popup-box-'+id).show();
$('#blackout').show();
//$('html,body').css('overflow', 'hidden');
//Добавляем капчу
if(!$('#contactForm .dynamic-recaptcha').length) {
$('#contactForm #captcha_normal').html('