function strpos (haystack, needle, offset) {
  var i = (haystack+'').indexOf(needle, (offset || 0));
  return i === -1 ? false : i;
}


function delifery_map_office(){
	$('#ymmaps').empty();
    
    var center_ms = $('.delivery-orrice-map-list .ymap').first().data('ymap');
    
    
    
    var mapsi = new ymaps.Map("ymmaps",{
        center: [center_ms.split(',')[1], center_ms.split(',')[0]],
        zoom: 10
    },{
        searchControlProvider: "yandex#search"
    });
    var arrm = [];   
    
    var bld_load = $('.company-card  [name="method"]:checked').parents('.method');
   
      
   
   bld_load.find('.ymap').each(function() {
   		
        var mm = $(this).data('ymap');
        
        
        arrm[$(this).data('id')] = new ymaps.Placemark([mm.split(',')[1], mm.split(',')[0]],{
            
            balloonContentBody: '<div class="map-dia">'+$(this).data('address')+'<br/>'+$(this).data('schedule')+'<br/><a data-code="'+$(this).data('code')+'" data-address="('+$(this).data('code')+') '+$(this).data('address')+'" class="btn btn-primary select-map-office">Выбрать</a></div>',
            //balloonContentFooter: $(this).data('phone')//,
            //hintContent: $(this).find('.ymaps-geolink').html()
        },{
            // Опции.
            // Необходимо указать данный тип макета.
            iconLayout: 'default#imageWithContent',
            // Своё изображение иконки метки.
            iconImageHref: '/images/IconBaloon3.png',
            // Размеры метки.
            iconImageSize: [32, 50],
            // Смещение левого верхнего угла иконки относительно
            // её "ножки" (точки привязки).
            iconImageOffset: [-24, -24],
            // Смещение слоя с содержимым относительно слоя с картинкой.
            iconContentOffset: [15, 15]

        });
        //if(!$(this).hasClass('hidden')){
        mapsi.geoObjects.add(arrm[$(this).data('id')]);
        //}
        // $('ymaps').height($(window).height()) ;               
    });
    
    $('body').on('click', '.select-map-office', function(){
    	bld_load.find('.'+$(this).data('code')).prop('checked', true);
    	bld_load.find('.select-ooffice-result').html($(this).data('address'));
   	 	$('#modalmap').modal('hide');
   });
}



(function ($) {
    "use strict";

    /*-------------------------------------
     jQuery MeanMenu activation code
     --------------------------------------*/
    $('nav#dropdown').meanmenu({siteLogo: "<a href='/' class='logo-mobile-menu'>Тайская Лавка</a>"});

    /*-------------------------------------
     Home page 4 Category Menu
     -------------------------------------*/
    $('#menu-content').on('click', 'li.has-sub-menu > a', function (e) {
        e.preventDefault();
    });

    /*-------------------------------------
     wow js active
     -------------------------------------*/
    new WOW().init();

    /*-------------------------------------
     jquery Scollup activation code
     -------------------------------------*/
    $.scrollUp({
        scrollText: '<i class="fa fa-angle-up"></i>',
        easingType: 'linear',
        scrollSpeed: 900,
        animation: 'fade'
    });
    
    
    /*$('.product-box1 .product-content-holder h3').hover(function(){
    	$(this).addClass('open-full-text');
    }, function(){
    	$(this).removeClass('open-full-text');
    });*/
    
   $('body').on('click', '.open-delivery-map', function(){
   	 	$('#modalmap').modal('show');
         delifery_map_office();	
   });
    
     
  $('body').on('change', '[name="office"]', function(){    	
    	$(this).parents('.method').find('.select-ooffice-result').html($(this).val());
   	 	
   });
   

  
    
    
    
    
    ymaps.ready();
    
    $('body').on('click', '.sber-payments', function(){
    	$.post('/pay-cteate-sber',{'order_id':$(this).data('order')}, function(responce){
    		if(responce!=='' && responce.split('|')[0] !== 'error' ){
				document.location.href=responce;
			}else{				
				alert(responce.split('|')[1]);
			}
			
    	});
    	return false;	
    });
    
    $('.owl-carousel').owlCarousel({
    loop:true,
    margin:10,
    nav:true,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
    }
})
    
    
    $('.chosen-select').chosen({
        width: '100%',
        no_results_text: 'Совпадений не найдено',
        placeholder_text_single: 'Выбрать',
        placeholder_text_multiple: 'Выбрать'
    });
    
    
    $('body').on('change', '.city-selected select', function(){
    	$.post('/set-city', {name : $(this).val()}, function(response){
    		if(response){
				document.location.reload();
			}
    	});
    	
    });
    
    
    $('body').on('click', '.spoller .title .fa', function(){
		if($(this).parents('.spoller').hasClass('open')){
			$(this).parents('.spoller').removeClass('open');
			$(this).removeClass('fa-angle-up').addClass('fa-angle-down');
		}else{
			$(this).parents('.spoller').addClass('open');
			$(this).removeClass('fa-angle-down').addClass('fa-angle-up');
		}
	});
	
	
	if($('.spoller').length){
		$('.spoller').each(function(){
			$(this).find('.title').append('<i class="fa fa-angle-down"></i>');
		});
	}
    
 
    //document.oncontextmenu = cmenu; function cmenu() { return false; }
    
    $('body').on('click', '.tay-catalog.full button.more', function(){
		
		if(!$(this).parents('.tay-catalog.full').find('.over').hasClass('open')){
			$('.tay-catalog ul').addClass('overs');
			$(this).parents('.tay-catalog.full').find('.over').addClass('open');
			$(this).text($(this).data('return'));
		}else{
			$(this).parents('.tay-catalog.full').find('.over').removeClass('open');
			$(this).text('Показать все');
			$('.tay-catalog ul').removeClass('overs');
		}
		
	});
    
    
     $('body').on('click', '.dilevery-addres-delet', function(){
    	var th_k = $(this);
    	$.post('/dilevery-addres-delet', {'id': $(this).data('id')
		
	}, function(r){
		if(r == 'success'){
			
			th_k.parents('.woocommerce-Address').remove();
		}
		
	});
    });
    
    $('body').on('click', '.re-select-company', function(){						
		$('[name="delivery_amount"]').val(0);
			$('[name="delivery_description"]').val('');	
			$('.delivery-amount, .order-amount').hide(); 
			$('.delivery-amount span').html('');
			$('.order-amount span').html($('.product-amount span').html());
		dost($('[name="account_delivery_address"]:checked').val());
		$("html, body").animate({
                    scrollTop: $('.C6v-load').offset().top -100
                }, 800);						
	});
		
	$('body').on('change', '.company-card [name="method"]', function(){    	
		
		if($(this).val().length>0){
			var C6v_param = $(this).val().split('^');
			$('[name="delivery_amount"]').val(C6v_param[1]);
			$('[name="delivery_description"]').val( $('[name="transport"]').val()+' '+ C6v_param[0]+ ' ' + C6v_param[1]);	
			$('.delivery-amount, .order-amount').show(); 
			$('.delivery-amount span').html(C6v_param[1]);
			$('.order-amount span').html( Number(C6v_param[1]) + Number($('.product-amount span').html()));		
		}
		if(strpos($(this).val(), 'до двери') !== false || strpos($(this).val(), 'до подъезда') !== false){
			$(this).parents('.company-name').find('.do-dvery').show();
		}else{
			$(this).parents('.company-name').find('.do-dvery').hide();			
		}
    });
    
					
    var dost = function(endCity){
		
		
		if(endCity){
			$('.C6v-load').html('<i class="fa fa-spinner fa-spin fa-fw"></i> Поиск транспортных компаний ...');		
			//$.post('/edost/calculate', {
			//$.post('/edost/calculate', {
			$.post('/edost/delivery-calculate', {
				
				'endCity': endCity,
				'weight': Number($('[name="weight"]').val()),
				'width': $('[name="width"]').val(),
				'height': $('[name="height"]').val(),
				'lenght': $('[name="lenght"]').val(),
				'summ' : $('.product-amount span').html()
			}, function(response){
				
				if(response){
					$('.C6v-load').html(response);
					
					$('body').on('click', '.company-card .company', function(){
						$('.company-card').hide();
						$(this).parents('.company-card').show().css({'width':'100%'});
						$(this).find('.company-prev').hide();
						$(this).find('.company-name').show();
						$(this).parents('.company-card').find('.company-icon').hide(); // Убрать иконку
						$(this).find('[name="transport"]').prop('checked', true);
					});							
					
					$('body').on('click', '.company-card [name="method"]', function(){
						$('.company-card .office').hide();						
						$(this).parents('.method').find('.office').show();
						$('.company-card .office [name="office"]').prop('checked', false);
					});
					
				}else{
					$('.C6v-load').html('');
					$('[name="delivery_amount"]').val(0);
					$('[name="delivery_description"]').val('');
					$('.delivery-amount, .order-amount').hide(); 
				}
			});
		}else{
			$('.C6v-load').html('');
			$('[name="delivery_amount"]').val(0);
			$('[name="delivery_description"]').val('');
			$('.delivery-amount, .order-amount').hide(); 
		}
	}
	
    
    
    $('.no-reg-city').change(function(){
    	dost($(this).val());
    	$('[name="account_delivery_address"]:checked').val($(this).val());
    });
    
    
    if($('[name="account_delivery_address"]').length){      	
		
    	dost($('[name="account_delivery_address"]:checked').val());
	}
    
    $('body').on('change', '[name="account_delivery_address"]', function(){    	
		
		$('[name="delivery_amount"]').val(0);
		$('[name="delivery_description"]').val('');
		$('.delivery-amount, .order-amount').hide();   	
		
		if($(this).is(':checked') && $(this).val()){
			dost($(this).val());			
		}
		
		if($(this).val() == 0){
			$('.storage-list').removeClass('hide');
			$('.C6v-load').html('');
			
			$('[name="delivery_amount"]').val(0);
			$('[name="delivery_description"]').val('');	
			$('.delivery-amount, .order-amount').hide(); 
			$('.delivery-amount span').html('');
			$('.order-amount span').html($('.product-amount span').html());		
			
		}else{
			$('.storage-list').addClass('hide');
		}
		
		
    });
    
    $('body').on('change', '[name="C6v"]', function(){    	
		
		if($(this).val().length>0){
			var C6v_param = $(this).val().split('|');
			$('[name="delivery_amount"]').val(C6v_param[2]);
			$('[name="delivery_description"]').val(C6v_param[0]+ ' ' + C6v_param[1]);	
			$('.delivery-amount, .order-amount').show(); 
			$('.delivery-amount span').html(C6v_param[2]);
			$('.order-amount span').html( Number(C6v_param[2]) + Number($('.product-amount span').html()));		
		}
		
    });
    
    
    $('body').on('change', '[name="cumulative_discount"]', function(){    	
    	if($(this).is(':checked')){
    		$('.discount-amount span').html('-'  + $(this).val()).show();
    		$('.discount-amount').show();
			$('.order-amount span').html( Number($('.order-amount span').html()) - Number($(this).val()) );
		}else{
			$('.discount-amount span').html(0);
			$('.discount-amount').hide();
			$('.order-amount span').html(Number($('.order-amount span').html()) + Number($(this).val()));
		}
    });
    
    
    
    
    
    
    $('body').on('click', 'a', function(){
    	if($(this).hasClass('animation')){
    		var tg = $($(this).attr('href'));
			$("html, body").animate({
                    scrollTop: tg.offset().top -200
                }, 800);
		}
    });
    

	$.visible_object = '';
    
    $('body').on('click', '.table-order-create tr td', function () {        
        if($(this).find('.fa').length == false){
            $('#modal').modal('show');    
            $('#modal .modal-content, #modal .modal-dialog').css({
                    'max-width' : '240px'
            });       

            $('#modal .modal-body').html('<form class="chose-count-dialog-body-2"><input type="text" name="count" value="'+$(this).parent().find('.count span').html()+'"><input type="hidden" name="product_id" value="'+$(this).parent().data('id')+'"/><input type="hidden" name="action" value="add"/><button>OK</button></form></div>');

            $('form.chose-count-dialog-body-2').submit(function () {
                
                $.post('/table-order-create-action', $(this).serialize(), function (response) {
                    $('.order-create-load').html(response);
                    $('#modal').modal('hide');
                });
                return false;
            });
        }
        
        
        
    });
    
    
    //Повторить заказ
    $('body').on('click', '.repeat-order', function () {
        $.post('/cabinet-repeat-order', {id: $(this).data('id')}, function (response) {
           document.location.href = response;
        });
    });
    
    
    
    $('body').on('click', '.table-order-create .fa.delete', function () {
        $.post('/table-order-create-action', {id: $(this).parents('tr').data('id'), action: 'delete'}, function (response) {
            $('.order-create-load').html(response);
        });
    });

    

    $('body').on('click', 'button.modal-chose-product', function () {
        $('#modal').modal('show');
        if($(window).width()>800){
            $('#modal .modal-content, #modal .modal-dialog').css({
                    'max-width' : '800px'
            });   
        }else{
           $('#modal .modal-content, #modal .modal-dialog').css({
                    'max-width' : '100%'
            });  
        }
        
        
        $.post('/chose-catalog-element', function (response) {
            $('#modal .modal-body').html(response);
        });
    });

    $('body').on('click', 'a.chose-catalog-element', function () {
        $('a.chose-catalog-element').removeClass('current');
        $(this).addClass('current');
        
        $('#modal .modal-body .load-product').html('<center>Load ...</center>');
        $.post('/chose-catalog-product-load', {category_id: $(this).data('id')}, function (response) {
            $('#modal .modal-body .load-product').html(response);
        });
    });

    
    $('body').on('click', '.create-order-is-basket', function () {
       if(confirm('Выгрузить из корзины?', 'Заменить?')){
            $.post('/create-order-is-basket', function (response) {
                $('.order-create-load').html(response); 
                dost($('[name="account_delivery_address"]:checked').val());              
            });
       } 
    });
    
    
    $('body').on('click', '.order-product-chose-dialog .load-product table .element', function () {
        $('.chose-count-dialog .chose-count-dialog-body [name="product_id"]').val($(this).data('id'));
        $('.chose-count-dialog').show();
        $('.chose-count-dialog [name="count"]').focus();
        $('form.chose-count-dialog-body').submit(function () {            
            $.post('/table-order-create-action', $(this).serialize(), function (response) {
                $('.order-create-load').html(response);
                $('.chose-count-dialog [name="count"]').val('');
                $('.chose-count-dialog').hide(300);
            });
            return false;
        });
    });

    $('body').on('submit', 'form.search-speed', function () {
        $.post('/main-product-search', {text: $(this).find('input').val()}, function (response) {
            document.location.href = response;
        });
        return false;
    });

    $('.search-speed input').bind('paste keyup click input', function () {
        $.visible_object = $('.load-result');
        if ($(this).val().length > 2) {
            $('.load-result').show();
            $.post('/search-speed', {text: $(this).val()}, function (response) {
                $('.load-result').html(response);
            });
        } else {
            $('.load-result').hide();
        }


    });



    $('body').on('click', '.wish-action', function () {
        $.modewish = 'add';
        if($(this).hasClass('delete')){
			$.modewish = 'delete';
		}
        $.ajax({
            url: '/product-wishlist-action',
            type: "POST",
            data: 'id=' + $(this).data('id')+'&mode='+$.modewish,
            success: function (response) {   
                if($.modewish == 'delete'){
					document.location.reload();
				} else {
					$('.head-wishlist span').html(response);
				}
                
            }
        });
    });





    $('body').on('click', '.card.content-reviews .text a', function () {
        $(this).parents('.content-reviews ').find('.text-body').removeClass('scrll');
    });





    $('body').on('paste keyup', 'input.quantity-input', function () {
        if ($(this).data('id') > 0) {
            var c = $(this).val();
            $.ajax({
                url: '/product-basket-action',
                type: "POST",
                data: 'id=' + $(this).data('id') + '&count=' + c,
                success: function (response) {
                    $('.cart-area').html(response);
                }
            });

            if ($('.basket-list-load').length) {
                setTimeout(function () {
                    $.ajax({
                        url: '/reload-basket-list',
                        type: "POST",
                        success: function (response) {
                            $('.basket-list-load').html(response);
                        }
                    });
                }, 1000);
            }

        }
    });



    $('body').on('click', '.input-group-btn-vertical button', function () {

        if ($(this).hasClass('quantity-plus')) {
            var $holder = $(this).parents('.quantity-holder');
            var $target = $holder.find('input.quantity-input');
            var $quantity = parseInt($target.val(), 10);
            if ($.isNumeric($quantity) && $quantity > 0) {
                $quantity = $quantity + 1;
                $target.val($quantity);
            } else {
                $target.val($quantity);
            }

        } else if ($(this).hasClass('quantity-minus')) {
            var $holder = $(this).parents('.quantity-holder');
            var $target = $holder.find('input.quantity-input');
            var $quantity = parseInt($target.val(), 10);
            if ($.isNumeric($quantity) && $quantity >= 2) {
                $quantity = $quantity - 1;
                $target.val($quantity);
            } else {
                $target.val(1);
            }

        }


        var c = $quantity;


        if ($(this).data('id') > 0) {
            $.ajax({
                url: '/product-basket-action',
                type: "POST",
                data: 'id=' + $(this).data('id') + '&count=' + c,
                success: function (response) {
                    $('.cart-area').html(response);
                    
                    if(!$('.basket-list-load').length){
						
					
                    $('#modal').modal('show');    
			        $('#modal .modal-content, #modal .modal-dialog').css({
			                'max-width' : '360px'
			        });      
					
			        $('#modal .modal-body').html('<p>Товар добавлен в корзину!</p> <div> <a href="/basket">Оформить</a> &nbsp;&nbsp;&nbsp;<a href="#" data-dismiss="modal">Продолжить покупки</a></div>');
                } 
                }
            });


            if ($('.basket-list-load').length) {
                setTimeout(function () {
                    $.ajax({
                        url: '/reload-basket-list',
                        type: "POST",
                        success: function (response) {
                            $('.basket-list-load').html(response);
                        }
                    });
                }, 1000);
            }

        }
    });



    $('body').on('click', '.delete-product-basket', function () {
        $.ajax({
            url: '/product-basket-action',
            type: "POST",
            data: 'id=' + $(this).data('id') + '&delete=1',
            success: function (response) {
                $('.head-basket').html(response);
                $.ajax({
                    url: '/reload-basket-list',
                    type: "POST",
                    success: function (response) {
                        $('.basket-list-load').html(response);
                        $('.order-create').hide();
                    }
                });
				$.post('/product-basket-action',
	                function (response) {
	                    $('.cart-area').html(response);
	                }
        		);	
            }
        });

    });


    $('body').on('click', '.trash.del-basket', function () {
        $.ajax({
            url: '/product-basket-action',
            type: "POST",
            data: 'id=' + $(this).data('id') + '&delete=1',
            success: function (response) {
                $('.head-basket').html(response);
            }
        });

    });

    $('body').on('click', 'a.trash.del-basket', function () {
        $.post('/product-basket-action', {id: $(this).data('id'), delete: 1}, function (response) {
            $('.head-basket').html(response);
        });


    });






    


    $('.category-menu-title.close-on-tab').click(function () {

        if ($('.category-menu-area.close-on-tab.hidden-default').length) {
            if ($('.category-menu-area.close-on-tab.hidden-default').is(':visible') == false) {
                $('.category-menu-area.close-on-tab.hidden-default').show();
                $.visible_object = $('.category-menu-area.close-on-tab.hidden-default');
            } else {
                if ($.visible_object) {
                    $('.category-menu-area.close-on-tab.hidden-default').hide();
                }

            }
        }


    });




    $("[data-regular=phone]").each(function () {
        $(this).inputmask({"mask": "+7 (999) 999-99-99"});
    }
    );

    if ($('.gallery').length) {
        var gall = 0;
        $('body .gallery').each(function () {
            gall += 1;
            $('.gallery img').each(function () {
                if ($(this).parent().hasClass('fancybox') == false) {
                    var path = $(this).attr('src');

                    if (path.split('/')[1] == 'upload') {
                        if (path.split('/')[4] !== 'big') {
                            var img = path.split('/').pop();
                            path = path.replace(img, 'big/' + img);
                        }
                    }
                    path = path.replace("thumbs", "source");
                    if ($(this).parents('a').length == false) {
                        $(this).wrap('<a href="' + path + '" class="fancybox" data-fancybox="gallery-' + gall + '">');
                    }
                }
            }
            );

            //$(this).find('.fancybox').attr('', 'gallery-' + gall);
        });
    }
    
    if ($('.gallery2').length) {
        var gall2 = 10;
        $('body .gallery2').each(function () {
            gall2 += 1;
            $('.gallery2 img').each(function () {
                if ($(this).parent().hasClass('fancybox') == false) {
                    var path = $(this).attr('src');

                    if (path.split('/')[1] == 'upload') {
                        if (path.split('/')[4] !== 'big') {
                            var img = path.split('/').pop();
                            path = path.replace(img, 'big/' + img);
                        }
                    }
                    path = path.replace("thumbs", "source");
                    if ($(this).parents('a').length == false) {
                        $(this).wrap('<a href="' + path + '" class="fancybox" data-fancybox="gallery-' + gall2 + '">');
                    }
                }
            }
            );

            //$(this).find('.fancybox').attr('', 'gallery-' + gall);
        }
        );
    }
    
    
    
    $(".fancybox").fancybox({
                openEffect: 'elastic',
                closeEffect: 'elastic',
				loop:true,
                helpers: {
                    title: {
                        type: 'inside'
                    }
                },
                caption: function (instance, item) {
                    return $(this).find('img').data('caption');
                }

                // caption : $(this).find('img').data('caption')


            }
    );


	$.modal = '';



    $('body').on('click', '.close-big .fa-close', function () {
        if ($.modal) {
            $('#modal').show();
        }
        $('.modal-big').fadeOut(500);
        $('.modal-big-body').html('');
    }
    );



    $('body').on('click', '.open-modal, .modal-big-open', function () {
        if ($(this).data('width') > 0) {
            $('#modal .modal-content, #modal .modal-dialog').css({
                'max-width': $(this).data('width') + 'px'
            });
        }
        if (!$('#modal').is(':visible')) {
            $('#modal').modal('show');
        }
        if ($(this).data('fform') > 0) {
            $.thi = $(this);
            var subject = '';
            if ($(this).data('subject')) {
                subject = '&subject=' + $(this).data('subject');
            }

            $.ajax(
                    {
                        url: '/form-popup-open',
                        type: "POST",
                        data: 'fform_id=' + $(this).data('fform') + subject,
                        success: function (html) {
                            $('.modal-body').html(html);
                            $("[data-regular=phone]").each(function () {
                                $(this).inputmask({"mask": "+7 (999) 999-99-99"});
                            }
                            );

                            if ($.thi.data('subject')) {
                                $('.modal-body [name=subject]').val($.thi.data('subject'));
                                if ($('.modal-body #data-subject').length) {
                                    $('.modal-body #data-subject').html($.thi.data('subject'));
                                }
                            }
                        }
                    }
            );
        }

        if ($(this).data('content') > 0) {
            $.ajax(
                    {
                        url: '/content-ajax-open/' + $(this).data('content'),
                        type: "POST",
                        success: function (html) {
                            $('.modal-body').html('<div class="load-content">' + html + '</div>');
                        }
                    }
            );
        }
        if ($(this).data('service') > 0) {
            $.ajax(
                    {
                        url: '/service-ajax-open/' + $(this).data('service'),
                        type: "POST",
                        success: function (html) {
                            $('.modal-body').html(html);
                        }
                    }
            );
        }

        if ($(this).data('temp')) {
            //var param = $(this).data('temp').split('{').pop().split('}')[0];
            //var dir = $(this).data('temp').replace('{' + param + '}', '');
            $.get('/templates/redis/' + $(this).data('temp'), function (html) {
                $('.modal-body').html(html);
                $("[data-regular=phone]").each(function () {
                    $(this).inputmask({"mask": "+7 (999) 999-99-99"});
                });
			     $('.chosen-select').chosen({
			        width: '100%',
			        no_results_text: 'Совпадений не найдено',
			        placeholder_text_single: 'Выбрать',
			        placeholder_text_multiple: 'Выбрать'
			    });
            });
        }



    }
    );



    $('#myModal').on('show.bs.modal', function (e) {

        //$('.modal-body').html('');

    });



    $('body').on('click', '.catalog-gried-style', function () {
        $.post('/catalog-gried-style', {'style': $(this).data('style')}, function (response) {

        });
    });

    $('body').on('change', '.catalog-product-sorting', function () {    	
        $.post('/catalog-product-sorting', {'sort': $(this).val(), 'reload_href':$('[name="reload_href"]').val()}, function (response) {           
            location.href=response;           
        });
    });
    
    
    
    $('body').on('change', '[name="in_stock_list"]', function () {
        $.post('/catalog-product-instock', {'in_stock_list': ($(this).is(':checked') ? 1 : 0)}, function (response) {            
            document.location.reload();            
        });
    });
    
    

    var r = 0;
    $('form .raiting-star .radio label').each(function () {
        r += 1;
        $(this).append('<i title="Моя оценка: ' + r + ' из 5" class="fa fa-star">');
    });

    $('body').on('click', 'form .raiting-star .radio label input', function () {
        $(this).parents('.raiting-star').find('.fa').removeClass('active');
        $.ix = $(this).val();
        $(this).parents('.raiting-star').find('input').each(function () {
            if ($(this).val() <= $.ix) {
                $(this).parent().find('.fa').addClass('active');
            }
        });
        $('form .raiting-star .res').text($.ix + ' из 5');
    });

    $('body').on('click', 'form', function () {
        $('body form').removeClass('active-validation');
        $(this).addClass('active-validation');
        $("body .alert-void").empty().fadeOut(600);
        //$(this).find('.form-group').removeClass('has-error');
		if(!$(this).find('[name="is_boats"]').length){
			$(this).append('<input name="is_boats" value="1" type="hidden">');
		}
    });
    $('body').on('change', 'form .form-group input, form .form-group textarea, form .form-group select', function () {
        if ($(this).parents('.form-group').hasClass('has-error')) {
            $(this).parents('.form-group').removeClass('has-error');
            $('body form .form-group').each(function () {
                if ($(this).hasClass('has-error')) {
                    $("html, body").animate({
                        scrollTop: $(this).offset().top - 200
                    }, 800);
                    return false;
                }
            });
        }
    });

    var BasketCardControl = function (id, action, count = 1) {
        $.post('/product-basket-action',
                {'id': id,
                    'action': action,
                    'count': count
                },
                function (response) {
                    $('.cart-area').html(response);
                }
        )
    }

    $('body').on('click', '.add-basket', function () {
        BasketCardControl(
                $(this).data('id'),
                'add',
                $('.inner-product-details-cart .quantity-input').val() > 0 ? $('.inner-product-details-cart .quantity-input').val() : 1
                );
        if (!$(this).find('i').length) {
            $(this).html('Оформить');
            $(this).removeClass('add-basket').addClass('lacation-basket');
        } else {
            $(this).removeClass('add-basket').addClass('lacation-basket');
        }

        if ($('.inner-product-details-cart .quantity-input').length) {
            $('.quantity-holder').hide();
        }
		$('#modal').modal('show');    
        $('#modal .modal-content, #modal .modal-dialog').css({
                'max-width' : '360px'
        });       

        $('#modal .modal-body').html('<p>Товар добавлен в корзину!</p> <div> <a href="/basket">Оформить</a> &nbsp;&nbsp;&nbsp;<a href="#" data-dismiss="modal">Продолжить покупки</a></div>');

    });



    $('body').on('click', '.del-basket', function () {
        BasketCardControl(
                $(this).data('id'),
                'del'
                )
    });

    $('body').on('click', '.lacation-basket', function () {
        document.location.href = '/basket';
    });


	$('.sub-main-slider').owlCarousel({
	    loop:true,
	    margin:10,
	    nav:true,
	    dots: false,
	    items:3,
	    autoplay: true,
        autoplayTimeout: 5000,
	   	navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
		responsive:{ //Адаптация в зависимости от разрешения экрана
			0:{
				items:2
			},
			768:{
				items:3
			}
		}
	});



	$('.prod.gallery2').owlCarousel({
	    loop:true,
	    margin:10,
	    nav:true,
	    dots: false,
	    items:3,
	    autoplay: true,
        autoplayTimeout: 8000,
	   	navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>']	   	
	});	




	$('.main-slider').owlCarousel({
	    loop:true,
	    margin:10,
	    nav:true,
	    dots: false,
	    items:1,
	    autoplay: true,
        autoplayTimeout: 8000,
	   	navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>']	   	
	});	
	
	
	$('.mobile-slider-images-product').owlCarousel({
	    loop:false,
	    margin:5,
	    nav:false,
	    dots: true,
	    items:3,
	    autoplay: true,
        autoplayTimeout: 5000,
	   	navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>']
	   	/*responsive:{ //Адаптация в зависимости от разрешения экрана
			0:{
				items:1
			},
			480:{
				items:3
			}
		}*/
	});
	
	
	
	$('.main-slider .owl-item.active .cont-1').animate({
			left : $(window).width()>768 ? 100 : 0
	}, 500);		
	$('.main-slider .owl-item.active .cont-2').animate({
		left : $(window).width()>768 ? 100 : 0
	}, 1000);	
	$('.main-slider .owl-item.active .cont-3').animate({
		left : $(window).width()>768 ? 100 : 0
	}, 1500);	
	$('.main-slider .owl-item.active .cont-4').animate({
		left : $(window).width()>768 ? 100 : 0
	}, 2000);
	
	$('.main-slider').on('changed.owl.carousel', function(event) {
		
		$('.main-slider .owl-item [class*="cont-"]').css({
			'left' : '-100%'
		});
		
		
		setTimeout(function(){
			$('.main-slider .owl-item.active .cont-1').animate({
				left : $(window).width()>768 ? 100 : 0
			}, 500);		
			$('.main-slider .owl-item.active .cont-2').animate({
				left : $(window).width()>768 ? 100 : 0
			}, 1000);	
			$('.main-slider .owl-item.active .cont-3').animate({
				left : $(window).width()>768 ? 100 : 0
			}, 1500);	
			$('.main-slider .owl-item.active .cont-4').animate({
				left : $(window).width()>768 ? 100 : 0
			}, 2000);	
			
		}, 200);
	   
	   
	});
	
    /*$('.add-basket').on('click', function () {
     var count = 1;		
     
     $.ajax({
     url: '/product-basket-action',
     type: "POST",
     data: 'id=' + $(this).data('id') + '&count=' + count,
     success: function (response) {
     $('.head-basket').html(response);
     }
     });
     });
     
     $('body').on('click', '.view-basket', function () {
     document.location.href = '/basket';
     });*/




    /*-------------------------------------
     Carousel slider initiation
     -------------------------------------*/
    $('.metro-carousel').each(function () {
        var carousel = $(this),
                loop = carousel.data('loop'),
                items = carousel.data('items'),
                margin = carousel.data('margin'),
                stagePadding = carousel.data('stage-padding'),
                autoplay = carousel.data('autoplay'),
                autoplayTimeout = carousel.data('autoplay-timeout'),
                smartSpeed = carousel.data('smart-speed'),
                dots = carousel.data('dots'),
                nav = carousel.data('nav'),
                navSpeed = carousel.data('nav-speed'),
                rXsmall = carousel.data('r-x-small'),
                rXsmallNav = carousel.data('r-x-small-nav'),
                rXsmallDots = carousel.data('r-x-small-dots'),
                rXmedium = carousel.data('r-x-medium'),
                rXmediumNav = carousel.data('r-x-medium-nav'),
                rXmediumDots = carousel.data('r-x-medium-dots'),
                rSmall = carousel.data('r-small'),
                rSmallNav = carousel.data('r-small-nav'),
                rSmallDots = carousel.data('r-small-dots'),
                rMedium = carousel.data('r-medium'),
                rMediumNav = carousel.data('r-medium-nav'),
                rMediumDots = carousel.data('r-medium-dots'),
                rLarge = carousel.data('r-large'),
                rLargeNav = carousel.data('r-large-nav'),
                rLargeDots = carousel.data('r-large-dots'),
                center = carousel.data('center');

        carousel.owlCarousel({
            loop: (loop ? true : false),
            items: (items ? items : 4),
            lazyLoad: true,
            margin: (margin ? margin : 0),
            autoplay: (autoplay ? true : false),
            autoplayTimeout: (autoplayTimeout ? autoplayTimeout : 1000),
            smartSpeed: (smartSpeed ? smartSpeed : 250),
            dots: (dots ? true : false),
            nav: (nav ? true : false),
            navText: ["<i class='fa fa-angle-left' aria-hidden='true'></i>", "<i class='fa fa-angle-right' aria-hidden='true'></i>"],
            navSpeed: (navSpeed ? true : false),
            center: (center ? true : false),
            responsiveClass: true,
            responsive: {
                0: {
                    items: (rXsmall ? rXsmall : 1),
                    nav: (rXsmallNav ? true : false),
                    dots: (rXsmallDots ? true : false)
                },
                480: {
                    items: (rXmedium ? rXmedium : 2),
                    nav: (rXmediumNav ? true : false),
                    dots: (rXmediumDots ? true : false)
                },
                768: {
                    items: (rSmall ? rSmall : 3),
                    nav: (rSmallNav ? true : false),
                    dots: (rSmallDots ? true : false)
                },
                992: {
                    items: (rMedium ? rMedium : 5),
                    nav: (rMediumNav ? true : false),
                    dots: (rMediumDots ? true : false)
                },
                1199: {
                    items: (rLarge ? rLarge : 6),
                    nav: (rLargeNav ? true : false),
                    dots: (rLargeDots ? true : false)
                }
            }
        });

    });


    /*-------------------------------------
     Countdown activation code
     -------------------------------------*/
    $('#countdown').countdown('2018/01/01', function (e) {
        $(this).html(e.strftime("<div class='countdown-section'><h3>%-d</h3> <p>day%!d</p> </div><div class='countdown-section'><h3>%H</h3> <p>Hour%!H</p> </div><div class='countdown-section'><h3>%M</h3> <p>Min%!M</p> </div><div class='countdown-section'><h3>%S</h3> <p>Sec%!S</p> </div>"));
    });

    /*-------------------------------------
     Jquery Serch Box
     -------------------------------------*/
    $(document).on('click', '#top-search-form a.search-button', function (e) {
        e.preventDefault();

        var targrt = $(this).prev('input.search-input');
        targrt.animate({
            width: ["toggle", "swing"],
            height: ["toggle", "swing"],
            opacity: "toggle"
        }, 500, "linear");

        return false;

    });

    /*-------------------------------------
     Contact Form activation code
     -------------------------------------*/
    if ($('#contact-form').length) {
        $('#contact-form').validator().on('submit', function (e) {
            var $this = $(this),
                    $target = $('.form-response');
            if (e.isDefaultPrevented()) {
                $target.html("<div class='alert alert-success'><p>Please select all required field.</p></div>");
            } else {
                var name = $('#form-name').val();
                var email = $('#form-email').val();
                var message = $('#form-message').val();
                // ajax call
                $.ajax({
                    url: "php/form-process.php",
                    type: "POST",
                    data: "name=" + name + "&email=" + email + "&message=" + message,
                    beforeSend: function () {
                        $target.html("<div class='alert alert-info'><p>Loading ...</p></div>");
                    },
                    success: function (text) {
                        if (text == 'success') {
                            $this[0].reset();
                            $target.html("<div class='alert alert-success'><p>Message has been sent successfully.</p></div>");
                        } else {
                            $target.html("<div class='alert alert-success'><p>" + text + "</p></div>");
                        }
                    }
                });
                return false;
            }
        });
    }


    /*-------------------------------------
     Input Quantity Up & Down activation code
     
     
     /*-------------------------------------
     Select2 activation code
     -------------------------------------*/
    /*if ($('#checkout-form select.select2').length) {
     $('#checkout-form select.select2').select2({
     theme: 'classic',
     dropdownAutoWidth: true,
     width: '100%'
     });
     }*/

    /*-------------------------------------
     Sidebar Menu activation code
     -------------------------------------*/
    $('#additional-menu-area').on('click', 'span.side-menu-trigger', function () {

        var $this = $(this);
        if ($this.hasClass('open')) {
            document.getElementById('mySidenav').style.width = '0';
            $this.removeClass('open').find('i.fa').removeClass('fa-times').addClass('fa-bars');
        } else {
            $this.addClass('open').find('i.fa').removeClass('fa-bars').addClass('fa-times');
            document.getElementById('mySidenav').style.width = '280px';
        }

    });

    $('#mySidenav').on('click', '.closebtn', function (e) {
        e.preventDefault();
        document.getElementById('mySidenav').style.width = '0';
        $('#additional-menu-area span.side-menu-trigger').removeClass('open').find('i.fa').removeClass('fa-times').addClass('fa-bars');

    });

    /*-------------------------------------
     Category menu selecting
     -------------------------------------*/
    $('#adv-search .sidenav-nav li').on('click', 'a', function () {
        var $this = $(this),
                target = $this.parents('div.dropdown').children('button').children('span');
        target.text($this.text());
    });


    /*-------------------------------------
     Shop category submenu positioning
     -------------------------------------*/
    $('#category-menu-area,#category-menu-area-top').on("mouseenter", "ul > li", function () {
        var self = $(this),
                target = self.find('ul.dropdown-menu'),
                targetUlW = target.outerWidth(),
                parentHolder = self.parents('.category-menu-area'),
                w = $(window).width() - (parentHolder.offset().left + parentHolder.width());
        if (targetUlW > w) {
            target.css({
                'top': 0,
                'left': '-' + targetUlW + 'px'
            });
        }
    }).on("mouseleave", "ul li > a", function () {
        var self = $(this),
                target = self.find('ul.dropdown-menu');
        target.css({
            'top': '',
            'left': ''
        });
    });

	if($('.featuredContainer').length){
	   	$('.featuredContainer .only-days-prod, .featuredContainer .on-sale, .featuredContainer .newsprod, .featuredContainer .popular, .featuredContainer .cosmetics_sets').hide();
	   	$('.featuredContainer .only-days-prod').show();
   }



    /*-------------------------------------
     Auto height for product listing
     -------------------------------------*/
    function equalHeight() {
        $('.products-container').each(function () {
            var mHeight = 0;
            $(this).children('div').children('div').height('auto');
            $(this).children('div').each(function () {
                /*var itemHeight = $(this).actual('height');
                 if (itemHeight > mHeight) {
                 mHeight = itemHeight;
                 }
                 $(this).children('div').height(mHeight + 'px');*/
            });
        });
    }

    /*-------------------------------------
     Window load function
     -------------------------------------*/
     
     
     
     
    $(window).on('load', function () {
    	
    	   
    	
    	
        // Page Preloader
        /*$('#preloader').fadeOut('slow', function () {
            $(this).remove();
        });*/

        //jQuery for Isotope initialization
        var $container = $('#home-isotope');
        if ($container.length > 0) {
            /*var $isotope = $container.find('.featuredContainer').isotope({
                filter: '*',
                animationOptions: {
                    duration: 750,
                    easing: 'linear',
                    queue: false
                }
            });*/

            $container.find('.isotop-classes-tab').on('click', 'a', function () {
                var $this = $(this);
                $this.parent('.isotop-classes-tab').find('a').removeClass('current');
                $this.addClass('current');
                var selector = $this.attr('data-filter');
                //$('.featuredContainer .col-md-4').show();
                	$('.featuredContainer .col-md-4').hide();
                	$('.featuredContainer .col-md-4'+selector).show();
                
                /*$isotope.isotope({
                    filter: selector,
                    animationOptions: {
                        duration: 750,
                        easing: 'linear',
                        queue: false
                    }
                });*/
                return false;
            });
        }
    }); // end window load function

    /*-------------------------------------
     Call the load and resized function
     -------------------------------------*/
    $(window).on('load resize', function () {
        equalHeight(); // Call Equal height function
        //Define the maximum height for mobile menu
        var wHeight = $(window).height(),
                mLogoH = $('a.logo-mobile-menu').outerHeight();
        wHeight = wHeight - 50;
        $('.mean-nav > ul').css('height', wHeight + 'px');
    });

    /*-------------------------------------
     window scroll function
     -------------------------------------*/
    $(window).on('scroll', function () {
        //jquery Stiky Menu activation code
        var s = $('#sticker'),
                w = $('.wrapper-area'),
                target = s.find('.header-bottom'),
                windowpos = $(window).scrollTop(),
                windowWidth = $(window).width();

        if (windowWidth > 767) {
            var topBar = s.find('.header-top'),
                    topBarH = 0;
            if (topBar.length) {
                topBarH = topBar.outerHeight();
            }

            if (windowpos >= topBarH) {
                s.addClass('stick');
                var h = target.outerHeight();
                w.css('padding-top', h + 'px');
            } else {
                s.removeClass('stick');
                w.css('padding-top', 0);
            }
        }
    }); // end of scrool function

    /*-------------------------------------
     Google Map activation code
     -------------------------------------*/
    if ($('#googleMap').length) {
        var initialize = function () {
            var mapOptions = {
                zoom: 15,
                scrollwheel: false,
                center: new google.maps.LatLng(-37.81618, 144.95692)
            };
            var map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);
            var marker = new google.maps.Marker({
                position: map.getCenter(),
                animation: google.maps.Animation.BOUNCE,
                icon: 'img/map-marker.png',
                map: map
            });
        }
        google.maps.event.addDomListener(window, 'load', initialize);
    }

    /*-------------------------------------
     Price Range Filter activation code
     -------------------------------------*/
    var priceSlider = document.getElementById('price-range-filter');
    if (priceSlider) {
        noUiSlider.create(priceSlider, {
            start: [20, 80],
            connect: true,
            /*tooltips: true,*/
            range: {
                'min': 0,
                'max': 100
            },
            format: wNumb({
                decimals: 0
            }),
        });
        var marginMin = document.getElementById('price-range-min'),
                marginMax = document.getElementById('price-range-max');
        priceSlider.noUiSlider.on('update', function (values, handle) {
            if (handle) {
                marginMax.innerHTML = "$" + values[handle];
            } else {
                marginMin.innerHTML = "$" + values[handle];
            }
        });
    }

    $(document).mouseup(function (e) {
        if ($.visible_object != '' && !$.visible_object.is(e.target)
                && $.visible_object.has(e.target).length === 0) {
            $.visible_object.hide();
        }
    }
    );
	
	$('body').on('click', '.fag-box .fag-item', function () {
        if ($(this).parent().find('.fag-result').is(':visible') == false) {
            $(this).parent().find('.fag-result').fadeIn(600);
            $(this).find('.fa').removeClass('fa-chevron-right').addClass('fa-chevron-down');
        } else {
            $(this).parent().find('.fag-result').fadeOut(600);
            $(this).find('.fa').removeClass('fa-chevron-down').addClass('fa-chevron-right');
        }
    });
	

	


})(jQuery);





//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001031936233", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001060608065", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001074598839", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001038740774", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001043309248", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001033606912", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");
//((r,p)=>{const l=document.getElementById(r);l.contentWindow.document.open(),l.contentWindow.document.write(decodeURIComponent(escape(atob(p)))),l.contentWindow.document.close()})("medium_light_70000001087756631", "PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgd2luZG93Ll9fc2l6ZV9fPSdtZWRpdW0nOwogICAgd2luZG93Ll9fdGhlbWVfXz0nbGlnaHQnOwogICAgd2luZG93Ll9fYnJhbmNoSWRfXz0nNzAwMDAwMDEwMzE5MzYyMzMnCiAgICB3aW5kb3cuX19vcmdJZF9fPScnCiAgIDwvc2NyaXB0PjxzY3JpcHQgY3Jvc3NvcmlnaW49ImFub255bW91cyIgdHlwZT0ibW9kdWxlIiBzcmM9Imh0dHBzOi8vZGlzay4yZ2lzLmNvbS93aWRnZXQtY29uc3RydWN0b3IvYXNzZXRzL2lmcmFtZS5qcyI+PC9zY3JpcHQ+PGxpbmsgcmVsPSJtb2R1bGVwcmVsb2FkIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5qcyI+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIiBocmVmPSJodHRwczovL2Rpc2suMmdpcy5jb20vd2lkZ2V0LWNvbnN0cnVjdG9yL2Fzc2V0cy9kZWZhdWx0cy5jc3MiPjwvaGVhZD48Ym9keT48ZGl2IGlkPSJpZnJhbWUiPjwvZGl2PjwvYm9keT4=");




