var Layout=function(){var layoutImgPath='layouts/layout3/img/';var layoutCssPath='layouts/layout3/css/';var resBreakpointMd=App.getResponsiveBreakpoint('md');var handleHeader=function(){$('.page-header').on('click','.search-form',function(e){$(this).addClass("open");$(this).find('.form-control').focus();$('.page-header .search-form .form-control').on('blur',function(e){$(this).closest('.search-form').removeClass("open");$(this).unbind("blur");});});$('.page-header').on('keypress','.hor-menu .search-form .form-control',function(e){if(e.which==13){$(this).closest('.search-form').submit();return false;}});$('.page-header').on('mousedown','.search-form.open .submit',function(e){e.preventDefault();e.stopPropagation();$(this).closest('.search-form').submit();});$('body').on('click','.page-header-top-fixed .page-header-top .menu-toggler',function(){App.scrollTop();});};var handleMainMenu=function(){$(".page-header .menu-toggler").on("click",function(event){if(App.getViewPort().width a, .hor-menu .dropdown-submenu > a").on("click",function(e){if(App.getViewPort().width a").on("click",function(e){if(App.getViewPort().widthoffset){$(".page-header-menu").addClass("fixed");}else{$(".page-header-menu").removeClass("fixed");}} if($('body').hasClass('page-header-top-fixed')){if($(window).scrollTop()>offset){$(".page-header-top").addClass("fixed");}else{$(".page-header-top").removeClass("fixed");}}});};var handleMainMenuActiveLink=function(mode,el){var url=location.hash.toLowerCase();var menu=$('.hor-menu');if(mode==='click'||mode==='set'){el=$(el);}else if(mode==='match'){menu.find("li > a").each(function(){var path=$(this).attr("href").toLowerCase();if(path.length>1&&url.substr(1,path.length-1)==path.substr(1)){el=$(this);return;}});} if(!el||el.size()==0){return;} if(el.attr('href').toLowerCase()==='javascript:;'||el.attr('href').toLowerCase()==='#'){return;} menu.find('li.active').removeClass('active');menu.find('li > a > .selected').remove();menu.find('li.open').removeClass('open');el.parents('li').each(function(){$(this).addClass('active');if($(this).parent('ul.navbar-nav').size()===1){$(this).find('> a').append('');}});};var handleMainMenuOnResize=function(){var width=App.getViewPort().width;var menu=$(".page-header-menu");if(width>=resBreakpointMd){$(".page-header-menu").css("display","block");}else if(widthoffset){$('.scroll-to-top').fadeIn(duration);}else{$('.scroll-to-top').fadeOut(duration);}});}else{$(window).scroll(function(){if($(this).scrollTop()>offset){$('.scroll-to-top').fadeIn(duration);}else{$('.scroll-to-top').fadeOut(duration);}});} $('.scroll-to-top').click(function(e){e.preventDefault();$('html, body').animate({scrollTop:0},duration);return false;});};return{initHeader:function(){handleHeader();handleMainMenu();App.addResizeHandler(handleMainMenuOnResize);if(App.isAngularJsApp()){handleMainMenuActiveLink('match');}},initContent:function(){handleContentHeight();},initFooter:function(){handleGoTop();},init:function(){this.initHeader();this.initContent();this.initFooter();},setMainMenuActiveLink:function(mode,el){handleMainMenuActiveLink(mode,el);},closeMainMenu:function(){$('.hor-menu').find('li.open').removeClass('open');if(App.getViewPort().width