!function(t){function a(){imageSources=[],t("img").each(function(){var a=t(this).attr("src");imageSources.push(a)}),t(imageSources).load()&&t(".smartlib-pre-loader-area").fadeOut("slow")}var e={common:{init:function(){this.expandNavbarOnClickSearch(),this.animateSection(t(".smartlib-animate-object")),this.counterUp(t(".smartlib-counter")),this.chartAnimation(t(".smartlib-chart-bar")),this.add_pretty_photo_gallery(),this.addParalaxEffect(),this.displayGooleMap(),this.add_flexy_slider(),this.scrollToElement(),this.scrollToTop(),this.tab_widget(),this.threeLevelMenuBootstrap(),this.responsive_section(),this.addDirectionalHover()},animateSection:function(a,e){a.each(function(){var a=t(this),i=a.attr("data-os-animation"),n=a.attr("data-os-animation-delay");a.css({"-webkit-animation-delay":n,"-moz-animation-delay":n,"animation-delay":n}),"undefined"!=typeof i&&i!==!1&&Modernizr.cssanimations!==!1&&a.css({opacity:0});var o=e?e:a;o.waypoint(function(){a.addClass("animated").addClass(i)},{triggerOnce:!0,offset:"80%"})})},counterUp:function(t){t.length>0&&(t.text(0),t.waypoint(function(){t.hasClass("smartlib-counter-end")||(t.countTo({speed:2100}),t.addClass("smartlib-counter-end"))},{offset:"90%"}))},chartAnimation:function(a){a.length>0&&a.each(function(){var a=t(this);t(this).waypoint(function(){var t=(a.parent(".smartlib-chart-box"),a.attr("data-to")),e=t+"%";a.animate({width:e},1200,function(){})},{offset:"90%"})})},expandNavbarOnClickSearch:function(){t(".smartlib-navbar-search-form .smartlib-search-btn").on("click",function(a){var e=t(".smartlib-navbar-search-form");e.hasClass("smartlib-expanded-search-form")||(e.addClass("smartlib-expanded-search-form animated fadeIn"),a.preventDefault())}),t(".smartlib-navbar-search-form .smartlib-search-close-form").on("click",function(a){var e=t(".smartlib-navbar-search-form");e.hasClass("smartlib-expanded-search-form")&&e.removeClass("smartlib-expanded-search-form animated fadeIn"),a.preventDefault()})},responsive_section:function(){var a=t(window).width();t(".smartlib-responsive-section").each(function(e){var i=t(this),n=i.attr("data-proportions");"undefined"!=typeof n&&n!==!1&&i.height(a*n)})},add_pretty_photo_gallery:function(){t("a[rel^='smartlib-resize-photo']").length>0&&t("a[rel^='smartlib-resize-photo']").prettyPhoto()},add_flexy_slider:function(){var a=t(".smartlib-slider-container");a.length>0&&a.each(function(){t(this).flexslider()})},tab_widget:function(){jQuery(".smartlib-tab-content .smartlib-tab-single-content").length>0&&(jQuery(".smartlib-tab-content .smartlib-tab-single-content:first-child").show(),jQuery(".smartlib-tab-menu li:first-child").addClass("smartlib-active-tab"),jQuery(".smartlib-tab-menu a").on("click",function(t){var a=jQuery(this).attr("href");jQuery(".smartlib-tab-content "+a).show().siblings().hide(),jQuery(this).parent("li").addClass("smartlib-active-tab").siblings().removeClass("smartlib-active-tab"),t.preventDefault()}))},addParalaxEffect:function(){$window=t(window),t('div[data-type="background"], section[data-type="background"]').each(function(){var a=t(this),e=a.attr("data-overlay-color"),i=/^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/,n=i.exec(e);if(n){var o="rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",0.8)";a.css("background-color",o)}})},scrollToElement:function(){t("body").scrollspy({target:"#smartlib-spy-scroll-nav",offset:50}),t("#smartlib-one-page-menu a").on("click",function(){var a=t(this),e=a.parents("#smartlib-one-page-menu"),i=a.attr("href"),n=1*e.data("scroll-offset");t("html, body").animate({scrollTop:t(i).offset().top-n},2e3)})},scrollToTop:function(){$btnTop=t("#scroll-top-top"),t(window).scroll(function(){t(this).scrollTop()>100?$btnTop.addClass("slideInUp"):$btnTop.removeClass("slideInUp")}),$btnTop.click(function(){return t("html, body").animate({scrollTop:0},800),!1})},threeLevelMenuBootstrap:function(){t("ul.dropdown-menu [data-toggle=dropdown]").on("click",function(a){a.preventDefault(),a.stopPropagation(),t(this).parent().siblings().removeClass("open"),t(this).parent().toggleClass("open")})},displayGooleMap:function(){t(".smrtlib-google-maps").length>0&&t(".smrtlib-google-maps").each(function(){var a=t(this),e=a.find(".smartlib-map-marker"),i=new GMaps({scrollwheel:!1,div:"#"+a.attr("id"),zoom:a.data("zoom"),lat:a.data("lat"),lng:a.data("long")});e.length>0&&e.each(function(){var a=t(this);i.addMarker({lat:a.data("lat"),lng:a.data("long"),title:a.data("text"),infoWindow:{content:"
"+a.data("text")+"
"}})})})},addDirectionalHover:function(){t(".smrtlib-directional-hover-effect > li").directionalHover({overlay:"smartlib-caption-overlay",easing:"swing",speed:400})},contactHomepageMapHeight:function(){var t=jQuery(".smartlib-homepage-form-column").height();jQuery(".smartlib-contact-iframe-map iframe").height(t)}},home:{init:function(){e.common.contactHomepageMapHeight()}},about_us:{init:function(){}},page_portfolio_isotope:{init:function(){this.portfolio_filter()},portfolio_filter:function(){var a=t(".smartlib-layout-isotope-list");a.length>0&&(a.shuffle("shuffle"),t(".smartlib-sort-source li a").on("click",function(e){e.preventDefault(),t(".smartlib-sort-source li a").removeClass("smartlib-active-filter");var i=t(this).hasClass("smartlib-active-filter");t(this).addClass("smartlib-active-filter");var n=i?"all":t(this).data("group");a.shuffle("shuffle",n)}))}}},i={fire:function(t,a,i){var n=e;a=void 0===a?"init":a,""!==t&&n[t]&&"function"==typeof n[t][a]&&n[t][a](i)},loadEvents:function(){i.fire("common"),t.each(document.body.className.replace(/-/g,"_").split(/\s+/),function(t,a){i.fire(a)})}};t(document).ready(i.loadEvents),t(window).resize(function(){e.common.responsive_section(),e.common.contactHomepageMapHeight()}),t(window).load(function(){a()}),t("body").on("touchstart","*",function(){var a=t(this),e=a.get(0);if(!e.click){var i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),e.dispatchEvent(i)}})}(jQuery);