"use strict";
function themo_support_mobile_navigation(){
if(Modernizr.mq('(max-width: 767px)')){
jQuery("li.dropdown .dropdown-toggle").attr("data-toggle", "dropdown");
jQuery("li.dropdown .dropdown-toggle").attr("data-target", "#");
}
if(Modernizr.mq('(min-width:768px)')){
jQuery("li.dropdown .dropdown-toggle").removeAttr("data-toggle", "dropdown");
jQuery("li.dropdown .dropdown-toggle").removeAttr("data-target", "#");
}}
function themo_is_touch_device(checkScreenSize){
if(typeof checkScreenSize==="undefined"||checkScreenSize===null){
checkScreenSize=true;
}
var deviceAgent=navigator.userAgent.toLowerCase();
var isTouch=(deviceAgent.match(/(iphone|ipod|ipad)/) ||
deviceAgent.match(/(android)/)  ||
deviceAgent.match(/iphone/i) ||
deviceAgent.match(/ipad/i) ||
deviceAgent.match(/ipod/i) ||
deviceAgent.match(/blackberry/i));
if(checkScreenSize){
var isMobileSize=Modernizr.mq('(max-width:767px)');
}else{
var isMobileSize=false;
}
if(isTouch||isMobileSize){
return true;
}
return false;
}
function themo_no_transparent_header_for_mobile(isTouch){
if(jQuery(".navbar[data-transparent-header]").length){
if(isTouch){
jQuery('.navbar').attr("data-transparent-header", "false");
}else{
jQuery('.navbar').attr("data-transparent-header", "true");
}}
}
function themo_start_scrollup(){
jQuery.scrollUp({
animationSpeed: 200,
animation: 'fade',
scrollSpeed: 500,
scrollImg: { active: true, type: 'background', src: '../../images/top.png' }});
}
var nice=false;
(function(){
if(!window.console){
window.console={};}
var m=[
"log", "info", "warn", "error", "debug", "trace", "dir", "group",
"groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd",
"dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"
];
for (var i=0; i < m.length; i++){
if(!window.console[m[i]]){
window.console[m[i]]=function(){};}}
})();
jQuery(document).ready(function($){
"use strict";
if(jQuery("#main-flex-slider")[0]){
setTimeout(function(){
jQuery('body').addClass('loaded');
}, 10000);
}else{
jQuery('body').addClass('loaded');
}
if(themo_is_touch_device()){
jQuery('body').addClass('th-touch');
}
themo_support_mobile_navigation($);
jQuery("body").on("click", "ul.dropdown-menu .dropdown-submenu > a[data-toggle='dropdown']", function(event){
event.preventDefault();
event.stopPropagation();
jQuery(this).parents('ul.dropdown-menu .dropdown-submenu').toggleClass('open');
});
var options={
offset: 125,
classes: {
clone:   'headhesive--clone',
stick:   'headhesive--stick',
unstick: 'headhesive--unstick'
},
onStick:   function (){
jQuery('.navbar-collapse').css('height', '0');
jQuery('.navbar-collapse').removeClass('in');
},
onUnstick:   function (){
jQuery('.navbar-collapse').css('height', '0');
jQuery('.navbar-collapse').removeClass('in');
},
throttle: 250,
};
try
{
var banner=new Headhesive('body.th-sticky-header .banner, body.ehf-header.th-sticky-header header#masthead', options);
jQuery('body.th-sticky-header').addClass('headhesive');
}
catch (err){
console.log('Sticky header deactivated. WP Dash / Appearance / Customize / Theme Options / Menu & Header');
}
jQuery('.navbar-collapse').on("click", 'a:not(.dropdown-toggle)', function(){
jQuery('.navbar-collapse').css('height', '0');
jQuery('.navbar-collapse').removeClass('in');
});
function scroll_if_anchor(href){
href=typeof(href)=="string" ? href:jQuery(this).attr("href");
var fromTop=0;
if(jQuery("header").hasClass("headhesive--clone")){
fromTop=jQuery(".headhesive--clone").height() ;
}
if(href.indexOf("#")==0){
var $target=jQuery(href);
if($target.length){
jQuery('html, body').animate({ scrollTop: $target.offset().top - fromTop }, 500, 'linear', function(){
});
if(history&&"pushState" in history){
history.pushState({}, document.title, window.location.pathname + href);
return false;
}}
}}
scroll_if_anchor(window.location.hash);
var th_offset=0;
if(jQuery("header").hasClass("headhesive--clone")){
th_offset=jQuery(".headhesive--clone").height() ;
}
jQuery(window).on('elementor/frontend/init', function(){
elementorFrontend.hooks.addFilter('frontend/handlers/menu_anchor/scroll_top_distance', function(scrollTop){
return scrollTop - th_offset;
});
});
});
jQuery(window).on('load',function ($){
"use strict";
var isTouch=themo_is_touch_device();
themo_no_transparent_header_for_mobile(isTouch);
themo_start_scrollup();
});
jQuery(window).resize(function($){
"use strict";
var isTouch=themo_is_touch_device();
themo_support_mobile_navigation();
themo_no_transparent_header_for_mobile(isTouch);
});