Pages.Home={}
Pages.Home.webinarInfoBoxes={init:function(){jQuery('.webinar-event-popup .close').click(function(){var curBar=jQuery(this);var prevBar=jQuery(this).parent().prev();var id=jQuery(this).parent().attr('id');jQuery.post(oState.baseUrl+'includes/js/handlers/webinar-action.php',{action:'close',id:id},function(result){if(result.success){jQuery(curBar).parent().fadeOut(300,function(){if(prevBar.length!==0){jQuery(prevBar).fadeIn(300);}});}},'json');});}}
Pages.Home.featuredProductsPanel={featuredProductsSelected:0,featuredProductsCount:0,updateFeaturedProductContainers:function(){var current=0;jQuery('.featured-product-container').each(function(i,el){if(current!==Pages.Home.featuredProductsPanel.featuredProductsSelected){addClass(el,'hide');}else{removeClass(el,'hide');}
current++;});},showPrevFeaturedProducts:function(){Pages.Home.featuredProductsPanel.featuredProductsSelected--;if(Pages.Home.featuredProductsPanel.featuredProductsSelected===-1){Pages.Home.featuredProductsPanel.featuredProductsSelected=Pages.Home.featuredProductsPanel.featuredProductsCount-1;}
Pages.Home.featuredProductsPanel.updateFeaturedProductContainers();},showNextFeaturedProducts:function(){Pages.Home.featuredProductsPanel.featuredProductsSelected++;if(Pages.Home.featuredProductsPanel.featuredProductsSelected===Pages.Home.featuredProductsPanel.featuredProductsCount){Pages.Home.featuredProductsPanel.featuredProductsSelected=0;}
Pages.Home.featuredProductsPanel.updateFeaturedProductContainers();},init:function(){Pages.Home.featuredProductsPanel.featuredProductsCount=jQuery('.featured-product-container').length;if(Pages.Home.featuredProductsPanel.featuredProductsCount>0){jQuery('.featured-products .sel-right')[0].onclick=Pages.Home.featuredProductsPanel.showNextFeaturedProducts;jQuery('.featured-products .sel-left')[0].onclick=Pages.Home.featuredProductsPanel.showPrevFeaturedProducts;}}}
jQuery(document).ready(function(){Pages.Home.featuredProductsPanel.init();Pages.Home.webinarInfoBoxes.init();});;Pages.WelcomePage={};Pages.WelcomePage={timerId:null,timerName:'welcome-page-slider-timer',timeout:'7s',animationDelay:900,slidesCount:0,currentSlide:0,isAnimateNow:false,init:function(){Pages.WelcomePage.bindEvents();Pages.WelcomePage.slidesCount=jQuery('.banners .banner-item').length;if(Pages.WelcomePage.slidesCount>1){Pages.WelcomePage.setTimer();}
if(jQuery.cookie('common-info-box')!='closed'){jQuery('.common-info-box').removeClass('hidden');}
jQuery('.common-info-box .close').click(function(){jQuery(this).parent().fadeOut(300);if(Arboreus.isAllowedCookie){jQuery.cookie('common-info-box','closed');}});},bindEvents:function(){jQuery('.stepper .ico').click(function(){if(Pages.WelcomePage.isAnimateNow){return false;}
Pages.WelcomePage.resetTimer();var n=jQuery(this).parents('.stepper').children('.ico').index(this);jQuery('.stepper .ico').removeClass('ico-act');jQuery(this).addClass('ico-act');Pages.WelcomePage.doAnimation(n);return false});jQuery('.banner-item .info .banner-button').mouseover(function(){Pages.WelcomePage.stopTimer();});jQuery('.banner-item .info .banner-button').mouseout(function(){Pages.WelcomePage.setTimer();});jQuery('.column-item').click(function(){location.href=jQuery(this).find('.item-name a').attr('href');});jQuery('.banner-button').click(function(){location.href=jQuery(this).children('a').attr('href');return false;});},doAnimation:function(n){Pages.WelcomePage.isAnimateNow=true;jQuery('.banners .banner-item').eq(Pages.WelcomePage.currentSlide).fadeOut(Pages.WelcomePage.animationDelay,function(){jQuery('.banners .banner-item').eq(n).fadeIn(Pages.WelcomePage.animationDelay);Pages.WelcomePage.isAnimateNow=false;});Pages.WelcomePage.currentSlide=n;},setTimer:function(){if(Pages.WelcomePage.slidesCount>1){jQuery(this).everyTime(Pages.WelcomePage.timeout,Pages.WelcomePage.timerName,Pages.WelcomePage.onTimer);}},stopTimer:function(){jQuery(this).stopTime(Pages.WelcomePage.timerName);},resetTimer:function(){Pages.WelcomePage.stopTimer();Pages.WelcomePage.setTimer();},onTimer:function(){var curIndex=Pages.WelcomePage.currentSlide;var lastIndex=Pages.WelcomePage.slidesCount-1;var slideIndex;jQuery('.stepper .ico').removeClass('ico-act');if(curIndex==lastIndex){slideIndex=0;jQuery('.stepper .ico:first').addClass('ico-act');}else{slideIndex=Pages.WelcomePage.currentSlide+1;jQuery('.stepper .ico.index-'+slideIndex).addClass('ico-act');}
Pages.WelcomePage.doAnimation(slideIndex);}};jQuery(document).ready(function(){Pages.WelcomePage.init();jQuery('.banners .banner-item').eq(0).css({'opacity':1});});
