api.max_order_amount=10000;$(function(){var $main_nav=$('.fn_mobile_menu');var $toggle=$('.fn_menu_switch');var defaultData={maxWidth:!1,navClass:'mobile_nav',customToggle:$toggle,levelTitles:!0,insertClose:-1,labelBack:'Назад',labelClose:'Закрыть',closeLevels:!1}});$(document).on('click','.fn_view_all',function(e){$(this).closest('.fn_view_content').toggleClass('opened');$('.fn_view_all').not($(this)).html('Смотреть все');$('.fn_view_all').not($(this)).closest('.fn_view_content').removeClass('opened');if($(this).closest('.fn_view_content').hasClass('opened')){$(this).html('Свернуть')}else{$(this).html('Смотреть все')} return!1});api.is_preorder=0;var form_enter_name="Введите имя";var form_enter_phone="Введите номер";var form_error_captcha="Неверно введена капча";var form_enter_email="Введите ваш email";var form_enter_password="Введите пароль";var form_enter_message="Введите сообщение";if($(".fn_validate_product").length>0){$(".fn_validate_product").validate({rules:{name:"required",text:"required",captcha_code:"required"},messages:{name:form_enter_name,text:form_enter_message,captcha_code:form_error_captcha}})} if($(".fn_validate_callback").length>0){$(".fn_validate_callback").validate({rules:{name:"required",phone:"required",captcha_code:"required"},messages:{name:form_enter_name,phone:form_enter_phone,captcha_code:form_error_captcha}})} if($(".fn_validate_subscribe").length>0){$(".fn_validate_subscribe").validate({rules:{subscribe_email:"required",},messages:{subscribe_email:form_enter_email}})} if($(".fn_validate_post").length>0){$(".fn_validate_post").validate({rules:{name:"required",text:"required",captcha_code:"required"},messages:{name:form_enter_name,text:form_enter_message,captcha_code:form_error_captcha}})} if($(".fn_validate_feedback").length>0){$(".fn_validate_feedback").validate({rules:{name:"required",email:{required:!0,email:!0},message:"required",captcha_code:"required"},messages:{name:form_enter_name,email:form_enter_email,message:form_enter_message,captcha_code:form_error_captcha}})} if($(".fn_validate_cart").length>0){$(".fn_validate_cart").validate({rules:{name:"required",email:{required:!0,email:!0},captcha_code:"required"},messages:{name:form_enter_name,email:form_enter_email,captcha_code:form_error_captcha}});var submitted_cart=!1;$('.fn_validate_cart').on('submit',function(){if($('.fn_validate_cart').valid()===!0){if(submitted_cart===!0){return!1}else{submitted_cart=!0}}})} if($(".fn_validate_login").length>0){$(".fn_validate_login").validate({rules:{email:"required",password:"required",},messages:{email:form_enter_email,password:form_enter_password}})} if($(".fn_validate_register").length>0){$(".fn_validate_register").validate({rules:{name:"required",email:{required:!0,email:!0},password:"required",captcha_code:"required"},messages:{name:form_enter_name,email:form_enter_email,captcha_code:form_error_captcha,password:form_enter_password}})} if($(".fn_share").length>0){jsSocials.shares.odnoklassniki={"label":"ok","logo":"fa fa-odnoklassniki","shareUrl":"https:\/\/connect.ok.ru\/dk?st.cmd=WidgetSharePreview&st.shareUrl={url}&title={title}"};$(".fn_share").jsSocials({showLabel:!1,showCount:!1,shares:["twitter","facebook","googleplus","linkedin"]})} if($(".product__rating").length>0){$(function(){$('.product__rating').rater({postHref:api.router.ajax_product_rating})});$.fn.rater=function(options){var opts=$.extend($.fn.rater.defaults,options);return this.each(function(){var $this=$(this);var $on=$this.find('.rating_starOn');var $off=$this.find('.rating_starOff');opts.size=$on.height();if(opts.rating==undefined)opts.rating=$on.width()/opts.size;$off.mousemove(function(e){var left=e.clientX-$off.offset().left;var width=$off.width()-($off.width()-left);width=Math.ceil(width/(opts.size/opts.step))*opts.size/opts.step;$on.width(width)}).hover(function(e){$on.addClass('rating_starHover')},function(e){$on.removeClass('rating_starHover');$on.width(opts.rating*opts.size)}).click(function(e){var r=Math.round($on.width()/$off.width()*(opts.units*opts.step))/opts.step;$off.unbind('click').unbind('mousemove').unbind('mouseenter').unbind('mouseleave');$off.css('cursor','default');$on.css('cursor','default');opts.id=$this.attr('id');$.fn.rater.rate($this,opts,r)}).css('cursor','pointer');$on.css('cursor','pointer')})};$.fn.rater.defaults={postHref:location.href,units:5,step:1};$.fn.rater.rate=function($this,opts,rating){var $on=$this.find('.rating_starOn');var $off=$this.find('.rating_starOff');$off.fadeTo(600,0.4,function(){$.ajax({url:opts.postHref,type:"POST",data:'id='+opts.id+'&rating='+rating,complete:function(req){if(req.status==200){opts.rating=parseFloat(req.responseText);if(opts.rating>0){opts.rating=parseFloat(req.responseText);$off.fadeTo(200,0.1,function(){$on.removeClass('rating_starHover').width(opts.rating*opts.size);var $count=$this.find('.rating_count');$count.text(parseInt($count.text())+1);$this.find('.rating_value').text(opts.rating.toFixed(1));$off.fadeTo(200,1)})}else if(opts.rating==-1){$off.fadeTo(200,0.6,function(){$this.find('.rating_text').text('Ошибка')})}else{$off.fadeTo(200,0.6,function(){$this.find('.rating_text').text('Вы уже голосовали!')})}}else{alert(req.responseText);$on.removeClass('rating_starHover').width(opts.rating*opts.size);$this.rater(opts);$off.fadeTo(2200,1)}}})})}}