var rient=rient||{},rientShortCode=rientShortCode||{};!function(a){"use strict";var b,c=window.location.pathname;window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.host),b=window.location.origin+c,b=b.replace("https","http").replace("www.",""),"/"!==b.substr(-1)&&(b+="/"),rient.isChrome=/chrome/.test(navigator.userAgent.toLowerCase()),rient.isSafari=/safari/.test(navigator.userAgent.toLowerCase())&&!rient.isChrome,a(function(){function c(){0!==rientShortCode.length&&"undefined"!=typeof rientShortCode.testimonial&&a.each(rientShortCode.testimonial,function(b,c){var d="true"===c.direction_nav?!0:!1;a(document.getElementById(b)).flexslider({slideshowSpeed:c.slide_show_speed,animationSpeed:c.animation_speed,directionNav:d,animation:"fade",controlNav:"thumbnails",slideshow:!0})})}function d(){0!==rientShortCode.length&&"undefined"!=typeof rientShortCode.imagesCarousel&&a.each(rientShortCode.imagesCarousel,function(b,c){var d="true"===c.autoplay?!0:!1,e="true"===c.navigation?!0:!1;a(document.getElementById(b)).owlCarousel({items:4,slideSpeed:c.speed,navigation:e,pagination:!1,autoPlay:d,navigationText:['','']})})}function e(b){var c=a("#site-header"),d=c.outerHeight(),e=0;if(i.width()<=768?(j.hasClass("header-sticky-top")||c.hasClass("sticky"))&&(d=c.find(".site-branding").height()):j.hasClass("header-sticky-top")||c.hasClass("sticky")||(d=2*d),j.hasClass("left-header")&&(d=0),null!=b){var f=a(b);if(f.length>0){var g=f.offset().top;e=g-d}}a("html, body").stop().animate({scrollTop:e},1200,"easeInOutExpo")}function f(a){var b="";return a.indexOf("#")>0&&(b=a.substring(a.indexOf("#"))),a=a.replace("https","http").replace("www.","").replace(b,""),"/"!==a.substr(-1)&&(a+="/"),a}function g(){if(0!==rientShortCode.length&&"undefined"!=typeof rientShortCode.map){var b="";j.hasClass("dark-version")&&(b={stylers:[{hue:"#000"},{invert_lightness:!0},{saturation:-100},{lightness:33},{gamma:.5}]});var c={scrollwheel:!1,draggable:!1,zoom:19,mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:!1,zoomControl:!1,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL},scaleControl:!1,streetViewControl:!1,styles:[b]};a.each(rientShortCode.map,function(a,b){var d,e,f=new google.maps.LatLng(b.lat,b.lng);c.zoom=parseInt(b.zoom,10),c.center=f,d=new google.maps.Map(document.getElementById(a),c);var g={map:d,position:f};if(b.marker&&(g.icon=b.marker),e=new google.maps.Marker(g),b.info){var h=new google.maps.InfoWindow({content:'
'+b.info+"
",maxWidth:400});google.maps.event.addListener(e,"click",function(){h.open(d,e)})}})}}function h(b){var c,d,e=a(b),f=e.parents("section"),g=16/9,h=f.outerWidth(),i=f.outerHeight();i>h/g?(c=Math.ceil(i*g),e.width(c).height(i).css({left:(h-c)/2,top:0})):(d=Math.ceil(h/g),e.width(h).height(d).css({left:0,top:(i-d)/2}))}var i=a(window),j=a("body"),k=a("#site-header"),l=a("#primary-nav"),m=k.outerHeight();if(k.on("click",".navbar-toggle",function(a){a.preventDefault(),j.hasClass("left-header")?j.toggleClass("toggled"):l.slideToggle()}),i.resize(function(){j.hasClass("left-header")||(i.width()>768?l.show():l.hide())}),a("#primary-nav").on("click","a",function(c){var d=this.hash,g=a(this).attr("href"),h=f(g);h===b&&(c.preventDefault(),e(d)),j.hasClass("left-header")||a(".navbar-toggle:visible").click()}),!j.hasClass("header-sticky-top")&&!j.hasClass("left-header")){var n;j.hasClass("one-page")?n=a("#site-content").children("section:first"):j.hasClass("no-title-area")||(n=a("#title-area")),k.insertAfter(n);var o=k.offset().top}if(i.scroll(function(){j.hasClass("header-sticky-top")||j.hasClass("left-header")||(i.scrollTop()>=o?k.addClass("sticky"):k.removeClass("sticky"));var c=!1,d=a(window).scrollTop(),e=k.position().top;k.find(".primary-nav a").each(function(){var f=this.hash,g=a(this).attr("href");if(!(""===f&&g!==b||c)){var h=a(f);if(h.length){var i=h.offset().top-m-e-1,j=i+h.outerHeight();k.find(".primary-nav a").parent("li").removeClass("current"),d>=i&&j>=d&&(a(this).parent("li").addClass("current"),c=!0)}}})}).trigger("scroll"),a("#scroll-top").on("click",function(a){a.preventDefault(),e()}),a(".flexslider").find("li").length>1&&a(".flexslider").flexslider({animation:"slide",slideshowSpeed:5e3,pauseOnAction:!1}),j.fitVids(),a(".entry-format .gallery-slider").owlCarousel({autoPlay:3e3,stopOnHover:!0,navigation:!0,navigationText:['',''],pagination:!1,goToFirstSpeed:2e3,singleItem:!0,autoHeight:!0}),a(".counter-box .counter").counterUp({delay:20,time:4e3}),a(".view-portfolio-image").nivoLightbox(),a(".team-member-socials").each(function(){var b=a(this),c=b.siblings(".team-member-bio");c.length&&b.insertBefore(c)}),a(" .team_member").each(function(){a(this).wrapInner('
')}),a(".ta-team-shortcode").each(function(){var b=a(this),c=!1;b.hasClass("ta-team-grid-4")?c=4:b.hasClass("ta-team-grid-3")?c=3:b.hasClass("ta-team-grid-2")&&(c=2),c&&b.children(".row").owlCarousel({items:c,pagination:!1,autoPlay:!0,navigation:!0,navigationText:['',''],itemsDesktop:[1199,3],itemsDesktopSmall:[979,2]})}),i.width()>768)for(var p=j.find(".parallax"),q=0;q0&&a(".particles").particleground(),c(),d(),g(),j.imagesLoaded(function(){a("#loader").fadeOut(800,function(){j.addClass("loaded")})});var s=a(".ytvideo-bg");if(s.length){var t=document.createElement("script"),u=document.getElementsByTagName("script")[0];t.src="//www.youtube.com/iframe_api",u.parentNode.insertBefore(t,u),window.onYouTubeIframeAPIReady=function(){s.each(function(){var b=a(this),c=b.siblings(".toggle-sound"),d=b.attr("id"),e=new YT.Player(d,{width:i.width(),height:i.height(),videoId:b.data("video"),playerVars:{controls:0,showinfo:0,rel:0,loop:1,autoplay:1},events:{onReady:function(a){h("#"+d),rient.isSafari||a.target.setPlaybackQuality("hd720"),"mute"!==b.data("sound")?a.target.unMute():a.target.mute()},onStateChange:function(a){0===a.data&&e.seekTo(0)}}});c.on("click",function(a){a.preventDefault(),e.isMuted()?(e.unMute(),c.addClass("rient-volume").removeClass("rient-mute")):(e.mute(),c.removeClass("rient-volume").addClass("rient-mute"))})}),i.on("resize",function(){s.each(function(){h("#"+a(this).attr("id"))})}).trigger("resize")}}a(".countdown").each(function(){var b=a(this).data("datetime");a(this).downCount({date:b})}),j.hasClass("single-portfolio_project")&&a("#site-content").find(".entry-content .gallery").owlCarousel({autoPlay:3e3,stopOnHover:!0,navigation:!0,navigationText:['',''],pagination:!1,goToFirstSpeed:2e3,singleItem:!0,autoHeight:!0});var v=a("#modal"),w=v.find(".modal-body");a(".portfolio-showcase").on("click","h3 a, .view-portfolio-detail",function(b){b.preventDefault(),j.addClass("modal-open"),v.fadeIn().addClass("in"),w.html('
'),a.get(a(this).attr("href"),function(b){if(b){var c=a(b).find("#site-content article"),d=c.find(".gallery");c.find(".entry-footer ul").remove(),d.length&&(d.prependTo(c),d.owlCarousel({autoPlay:3e3,stopOnHover:!0,navigation:!0,navigationText:['',''],pagination:!1,goToFirstSpeed:2e3,singleItem:!0,autoHeight:!0})),w.html(c)}})}),v.on("click","button.close",function(a){a.preventDefault(),v.fadeOut(500,function(){j.removeClass("modal-open"),v.removeClass("in"),i.trigger("resize")})})})}(jQuery);