jQuery(document).ready(function($){var windowWidth=$(window).width();var windowScroll=$(window).scrollTop();var $window_height=$(window).height();var $window_width=$(window).width();var $win=$(window);var responsiveWidth=981;$(window).on('scroll',function(){checkHeader();});$(window).on('resize',function(){checkHeader();checkMobileMenu();});checkHeader();addMobileSubmenu();function checkHeader(){if(checkWindowSize())return;var doc=document.documentElement;var left=(window.pageXOffset||doc.scrollLeft)-(doc.clientLeft||0);var top=(window.pageYOffset||doc.scrollTop)-(doc.clientTop||0);var windowScroll=top;if(windowScroll<50){if($('.top-menu-wrap').hasClass('top-menu-scrolling')){$('.top-menu-wrap').removeClass('top-menu-scrolling');}
return;}
else{if(!$('.top-menu-wrap').hasClass('top-menu-scrolling')){$('.top-menu-wrap').addClass('top-menu-scrolling');}
return;}
return;}
function checkFooter(){if(checkWindowSize())return;var contentHeight=$('.site-content-contain').height();var footerHeight=$('.footer-wrap').height();var siteFooter=$('.site-footer').height();var windowScroll=$('#cont').scrollTop();var footerScroll=-(contentHeight+siteFooter)+windowScroll;if(footerScroll<0){$('.footer-wrap').css('top',footerScroll);}
else{$('.footer-wrap').css('top',0);}}
function checkWindowSize(){var windowWidth=window.innerWidth;if(windowWidth<responsiveWidth){$('body').addClass('we-mobile');return true;}
$('body').removeClass('we-mobile');return false;}
var mobileOpen,mobileAddOnce=false;$(document).on('click','.mobile-menu',function(e){$(this).toggleClass('active');$('.header-menu').toggleClass('visible');$('html').toggleClass('nav-shown');e.preventDefault();if(!checkWindowSize())return;if(!mobileOpen){mobileOpen=true;$(this).addClass('mobile-menu-open');$('.main-navigation .menu').slideDown(function(){$('.header-search').show();});}
else{mobileOpen=false;$(this).removeClass('mobile-menu-open');$('.header-search').hide();$('.main-navigation .menu').slideUp();}});function addMobileSubmenu(){if(mobileAddOnce||!checkWindowSize())return;$('.header-search, .main-navigation .menu').removeAttr('style');$('.main-navigation .menu li').each(function(){if($(this).find('.sub-menu').length){$(this).find('a').not('.sub-menu li a').after('<a href="#" class="mobile-submenu">+</a>');if($(this).hasClass('current-menu-parent')){$(this).find('.mobile-submenu').addClass('mobile-submenu-open');}}});mobileAddOnce=true;}
function checkMobileMenu(){$('.main-navigation .menu li a.mobile-submenu').remove();$('.main-navigation .menu li.menu-item a').removeClass('we-blue');if(checkWindowSize()){mobileAddOnce=false;addMobileSubmenu();}
else{$('.main-navigation .menu li .sub-menu').each(function(){$(this).removeAttr('style');});$('.header-search, .main-navigation .menu').removeAttr('style');}}
function parallaxScroll(){var scrolled=$(window).scrollTop();}
$(document).on('click','.mobile-submenu',function(e){e.preventDefault();var $this=$(this);$('.main-navigation .menu .sub-menu').not($this).slideUp();$('.main-navigation .menu li').not($(this)).find('> a:first-child').removeClass('we-blue');$('.mobile-submenu').not($this).removeClass('mobile-submenu-open');if(!$(this).hasClass('mobile-submenu-open')){$(this).addClass('mobile-submenu-open');$(this).parent().find('.sub-menu').slideDown('fast','linear');$(this).parent().find('> a:first-child').addClass('we-blue');}
else{$(this).removeClass('mobile-submenu-open');$(this).parent().find('.sub-menu').fadeOut();$(this).parent().find('> a:first-child').removeClass('we-blue');}});var fadein_speed=1500;$('#logoSlideshow').on('cycle-before',function(e,optionHash,outgoingSlideEl,incomingSlideEl,forwardFlag){$('.cycle-slide-active').addClass('cycle-fadeout');var windowWidth=window.innerWidth;$win.on('resize',function(){windowWidth=window.innerWidth;});if(windowWidth<470){$('.cycle-slide-active').next().next().next().hide().fadeIn(fadein_speed);}
else if(windowWidth>=470&&windowWidth<=630){$('.cycle-slide-active').next().next().next().next().hide().fadeIn(fadein_speed);}
else if(windowWidth>630&&windowWidth<=980){$('.cycle-slide-active').next().next().next().next().next().hide().fadeIn(fadein_speed);}
else{$('.cycle-slide-active').next().next().next().next().next().next().next().next().hide().fadeIn(fadein_speed);}});$('#logoSlideshow').on('cycle-after',function(e,optionHash,outgoingSlideEl,incomingSlideEl,forwardFlag){$('.cycle-fadeout:not(.cycle-slide-active)').removeClass('cycle-fadeout');});$('.animated-element').each(function(){var $animatedSection=$(this);var animatedSectionOffsetDiff=parseInt($animatedSection.data('animation-offset'));var scrollTop=0;if(isNaN(animatedSectionOffsetDiff)){animatedSectionOffsetDiff=0;}
$win.on('load resize',function(){var animatedSectionOffset=$animatedSection.offset().top+animatedSectionOffsetDiff;var winHeight=$win.height();scrollTop=$win.scrollTop();if(scrollTop+winHeight>animatedSectionOffset){$animatedSection.addClass('animation-start');}
$win.on('scroll',function(){scrollTop=$win.scrollTop();if(scrollTop+(winHeight)>animatedSectionOffset-animatedSectionOffsetDiff){$animatedSection.data('animated',false);$animatedSection.addClass('animation-start');}});});});});(function(){'use strict';function initSocialSharingClick(){var links;links=document.querySelectorAll('a.cssb');for(var i=0;i<links.length;i++){addEvent(links[i],'click',openPopup);}}
function openPopup(e){var top=(screen.availHeight-500)/2;var left=(screen.availWidth-500)/2;var popup=window.open(this.href,'social','width=550,height=420,left='+left+',top='+top+',location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1');if(popup){popup.focus();e.preventDefault();return false;}
return true;}
function addEvent(element,eventName,callback){if(element.addEventListener){element.addEventListener(eventName,callback,false);}else{element.attachEvent("on"+eventName,callback);}}
addEvent(window,'load',initSocialSharingClick);})();