/**
 * 2007-2022 ETS-Soft
 *
 * NOTICE OF LICENSE
 *
 * This file is not open source! Each license that you purchased is only available for 1 wesite only.
 * If you want to use this file on more websites (or projects), you need to purchase additional licenses.
 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please contact us for extra customization service at an affordable price
 *
 *  @author ETS-Soft <etssoft.jsc@gmail.com>
 *  @copyright  2007-2022 ETS-Soft
 *  @license    Valid for 1 website (or project) for each purchase of license
 *  International Registered Trademark & Property of ETS-Soft
 */
$(function() {
         if ($('.ybc_float_header .main-menu').length > 0)
         {

            if ( $('.ybc-menu-wrapper').length > 0){
                var sticky_navigation_offset_top = $('.ybc-menu-wrapper').offset().top;
            }

            var headerFloatingHeight = $('.main-menu').height();
            var sticky_navigation = function(){
                var scroll_top = $(window).scrollTop(); 
                if (scroll_top > sticky_navigation_offset_top) {
                    $('.main-menu').addClass('scroll_heading').css({ 'position': 'fixed','z-index':'10'});
                    $('#header').css({'margin-bottom':''+headerFloatingHeight+'px'});
                    $('.main-menu').addClass('has_fixed');
                } else {
                    $('.main-menu').removeClass('scroll_heading').css({ 'position': 'relative','z-index':'0' });
                    $('#header').css({'margin-bottom':'0px'});
                    $('.main-menu').removeClass('has_fixed');
                } 
                $(window).on('resize',function(e){
                    if (scroll_top <= sticky_navigation_offset_top){
                        $('.main-menu').removeClass('scroll_heading').css({ 'position': 'relative','z-index':'0' });
                        $('#header').css({'margin-bottom':'0px'});
                        $('.main-menu').removeClass('has_fixed');
                    }
                });
            };
            
            sticky_navigation();
             
            $(window).scroll(function() {
                 sticky_navigation();
            });
            if($(window).width() < 768 && !$('body').hasClass('disable-sticky'))
                        $('body').addClass('disable-sticky');
            
         }
         if ($('.ybc_float_header .main-menu').length > 0)
         {
             $(window).on('resize',function(e){
                
                    if($(window).width() < 768 && !$('body').hasClass('disable-sticky'))
                        $('body').addClass('disable-sticky');
                    else
                        if($(window).width() >= 768 && $('body').hasClass('disable-sticky'))
                            $('body').removeClass('disable-sticky');
                 
             });
         }
    });


$(document).ready(function(){
   $(document).on('click','.header_bottom.scroll_heading .ybc-menu-toggle',function(){
        if ( $(window).width() > 767 && $(window).width() < 992){
            $(this).parent().find('#ybc-menu-main-content').toggleClass('floating_active');
        }
        return false;
   }); 
});

$(document).ready(function() {    
    if(YBC_TC_FLOAT_CSS3)
    {  
       var wow = new WOW(
          {
            boxClass:     'wow',      // animated element css class (default is wow)
            animateClass: 'animated', // animation css class (default is animated)
            offset:       0,          // distance to the element when triggering the animation (default is 0)
            mobile:       false        // trigger animations on mobile devices (true is default)
          }
        );
        wow.init();
        
        $(document).on('click','#home-page-tabs a', function(){
            var datahref = $(this).attr('href');
            $('.tab-content .tab-pane:not(.active) .wow').removeClass('animated').css({'visibility':'hidden','animation-name':'none'});
            $(datahref+' .wow').delay(200).addClass('animated').css({'visibility':'visible','animation-name':'zoomIn'});                 
            
        });
        
    } else
    {
        $('.animated').removeClass('animated');
        $('.animation').removeClass('animation');        
    }    
});

