var wpajaxurl='https://www.butjx.com/wp-admin/admin-ajax.php';var flbuilderurl='https://www.butjx.com/wp-content/plugins/bb-plugin/';var flbuilderlayoutconfig={anchorlinkanimations:{duration:1000,easing:'swing',offset:100},paths:{pluginurl:'https://www.butjx.com/wp-content/plugins/bb-plugin/',wpajaxurl:'https://www.butjx.com/wp-admin/admin-ajax.php'}};(function($){if(typeof flbuilderlayout!='undefined'){return;}
flbuilderlayout={init:function()
{flbuilderlayout._destroy();flbuilderlayout._initclasses();flbuilderlayout._initbackgrounds();if(0===$('.fl-builder-edit').length){flbuilderlayout._initanchorlinks();flbuilderlayout._inithash();flbuilderlayout._initmoduleanimations();flbuilderlayout._initforms();}},refreshgalleries:function(element)
{var $element='undefined'==typeof element?$('body'):$(element),mfcontent=$element.find('.fl-mosaicflow-content'),wmcontent=$element.find('.fl-gallery'),mfobject=null;if(mfcontent){mfobject=mfcontent.data('mosaicflow');if(mfobject){mfobject.columns=$([]);mfobject.columnsheights=[];mfcontent.data('mosaicflow',mfobject);mfcontent.mosaicflow('refill');}}
if(wmcontent){wmcontent.trigger('refreshwookmark');}},refreshgridlayout:function(element)
{var $element='undefined'==typeof element?$('body'):$(element),msnrycontent=$element.find('.masonry');if(msnrycontent.length){msnrycontent.masonry('layout');}},reloadslider:function(element)
{var $element='undefined'==typeof element?$('body'):$(element),bxcontent=$element.find('.bx-viewport .fl-post-carousel-wrapper'),bxobject=null;if(bxcontent.length){bxcontent.each(function(){bxobject=$(this).data('bxslider');if(bxobject){bxobject.reloadslider();}})}},resizeaudio:function(element)
{var $element='undefined'==typeof element?$('body'):$(element),audioplayers=$element.find('.wp-audio-shortcode.mejs-audio'),player=null,mejsplayer=null,rail=null,railwidth=400;if(audioplayers.length&&typeof mejs!=='undefined'){audioplayers.each(function(){player=$(this);mejsplayer=mejs.players[player.attr('id')];rail=player.find('.mejs-controls .mejs-time-rail');var innermejs=player.find('.mejs-inner'),total=player.find('.mejs-controls .mejs-time-total');if(typeof mejsplayer!=='undefined'){railwidth=math.ceil(player.width()*0.8);if(innermejs.length){rail.css('width',railwidth+'px!important');mejsplayer.options.autosizeprogress=true;settimeout(function(){mejsplayer.setcontrolssize();},50);player.find('.mejs-inner').css({visibility:'visible',height:'inherit'});}}});}},preloadaudio:function(element)
{var $element='undefined'==typeof element?$('body'):$(element),contentwrap=$element.closest('.fl-accordion-item'),audioplayers=$element.find('.wp-audio-shortcode.mejs-audio');if(!contentwrap.hasclass('fl-accordion-item-active')&&audioplayers.find('.mejs-inner').length){audioplayers.find('.mejs-inner').css({visibility:'hidden',height:0});}},_destroy:function()
{var win=$(window);win.off('scroll.fl-bg-parallax');win.off('resize.fl-bg-video');},_istouch:function()
{if(('ontouchstart'in window)||(window.documenttouch&&document instanceof documenttouch)){return true;}
return false;},_ismobile:function()
{return/mobile|android|silk\/|kindle|blackberry|opera mini|opera mobi|webos/i.test(navigator.useragent);},_initclasses:function()
{var body=$('body'),ua=navigator.useragent;if(!body.hasclass('archive')&&$('.fl-builder-content-primary').length>0){body.addclass('fl-builder');}
if(flbuilderlayout._istouch()){body.addclass('fl-builder-touch');}
if(flbuilderlayout._ismobile()){body.addclass('fl-builder-mobile');}
if(ua.indexof('trident/7.0')>-1&&ua.indexof('rv:11.0')>-1){body.addclass('fl-builder-ie-11');}},_initbackgrounds:function()
{var win=$(window);if($('.fl-row-bg-parallax').length>0&&!flbuilderlayout._ismobile()){flbuilderlayout._scrollparallaxbackgrounds();flbuilderlayout._initparallaxbackgrounds();win.on('scroll.fl-bg-parallax',flbuilderlayout._scrollparallaxbackgrounds);}
if($('.fl-bg-video').length>0){flbuilderlayout._initbgvideos();flbuilderlayout._resizebgvideos();win.on('resize.fl-bg-video',flbuilderlayout._resizebgvideos);}},_initparallaxbackgrounds:function()
{$('.fl-row-bg-parallax').each(flbuilderlayout._initparallaxbackground);},_initparallaxbackground:function()
{var row=$(this),content=row.find('> .fl-row-content-wrap'),src=row.data('parallax-image'),loaded=row.data('parallax-loaded'),img=new image();if(loaded){return;}
else if(typeof src!='undefined'){$(img).on('load',function(){content.css('background-image','url('+src+')');row.data('parallax-loaded',true);});img.src=src;}},_scrollparallaxbackgrounds:function()
{$('.fl-row-bg-parallax').each(flbuilderlayout._scrollparallaxbackground);},_scrollparallaxbackground:function()
{var win=$(window),row=$(this),content=row.find('.fl-row-content-wrap'),speed=row.data('parallax-speed'),offset=content.offset(),ypos=-((win.scrolltop()-offset.top)/speed);content.css('background-position','center '+ypos+'px');},_initbgvideos:function()
{$('.fl-bg-video').each(flbuilderlayout._initbgvideo);},_initbgvideo:function()
{var wrap=$(this),width=wrap.data('width'),height=wrap.data('height'),mp4=wrap.data('mp4'),youtube=wrap.data('youtube'),vimeo=wrap.data('vimeo'),mp4type=wrap.data('mp4-type'),webm=wrap.data('webm'),webmtype=wrap.data('webm-type'),fallback=wrap.data('fallback'),loaded=wrap.data('loaded'),fallbacktag='',videotag=null,mp4tag=null,webmtag=null,playertag=wrap.find('.fl-bg-video-player');if(loaded){return;}
else if(!flbuilderlayout._ismobile()){videotag=$('');if('undefined'!=typeof mp4){mp4tag=$('');mp4tag.attr('src',mp4);mp4tag.attr('type',mp4type);if('undefined'==typeof webm){mp4tag.on('error',flbuilderlayout._videobgsourceerror);}
videotag.append(mp4tag);}
if('undefined'!=typeof webm){webmtag=$('');webmtag.attr('src',webm);webmtag.attr('type',webmtype);if('undefined'!=typeof mp4){webmtag.on('error',flbuilderlayout._videobgsourceerror);}
videotag.append(webmtag);}
if('undefined'!=typeof youtube){flbuilderlayout._inityoutubebgvideo.apply(this);}
else if('undefined'!=typeof vimeo){flbuilderlayout._initvimeobgvideo.apply(this);}
else{wrap.append(videotag);}}
else if(''!==fallback){fallbacktag=$('
');fallbacktag.addclass('fl-bg-video-fallback');fallbacktag.css('background-image','url('+fallback+')');wrap.append(fallbacktag);}
wrap.data('loaded',true);},_inityoutubebgvideo:function()
{var playerwrap=$(this),videoid=playerwrap.data('video-id'),videoplayer=playerwrap.find('.fl-bg-video-player'),enableaudio=playerwrap.data('enable-audio'),player;if(videoid){flbuilderlayout._onyoutubeapiready(function(yt){settimeout(function(){player=new yt.player(videoplayer[0],{videoid:videoid,events:{onready:function(event){if("no"===enableaudio){event.target.mute();}
else if("yes"===enableaudio&&event.target.ismuted){event.target.unmute();}
playerwrap.data('ytplayer',player);flbuilderlayout._resizeyoutubebgvideo.apply(playerwrap);event.target.playvideo();},onstatechange:function(event){if(event.data===yt.playerstate.ended){player.seekto(0);}}},playervars:{controls:0,showinfo:0}});},1);});}},_onyoutubeapiready:function(callback){if(window.yt&&yt.loaded){callback(yt);}else{settimeout(function(){flbuilderlayout._onyoutubeapiready(callback);},350);}},_initvimeobgvideo:function()
{var playerwrap=$(this),videoid=playerwrap.data('video-id'),videoplayer=playerwrap.find('.fl-bg-video-player'),enableaudio=playerwrap.data('enable-audio'),player,width=playerwrap.outerwidth();if(typeof vimeo!=='undefined'&&videoid){player=new vimeo.player(videoplayer[0],{id:videoid,loop:true,title:false,portrait:false});playerwrap.data('vmplayer',player);if("no"===enableaudio){player.setvolume(0);}
else if("yes"===enableaudio){player.setvolume(1);}
player.play();}},_videobgsourceerror:function(e)
{var source=$(e.target),wrap=source.closest('.fl-bg-video'),vid=wrap.find('video'),fallback=wrap.data('fallback'),fallbacktag='';if(''!==fallback){fallbacktag=$('');fallbacktag.addclass('fl-bg-video-fallback');fallbacktag.css('background-image','url('+fallback+')');wrap.append(fallbacktag);vid.remove();}},_resizebgvideos:function()
{$('.fl-bg-video').each(function(){flbuilderlayout._resizebgvideo.apply(this);if($(this).parent().find('img').length>0){$(this).parent().imagesloaded($.proxy(flbuilderlayout._resizebgvideo,this));}});},_resizebgvideo:function()
{if(0===$(this).find('video').length&&0===$(this).find('iframe').length){return;}
var wrap=$(this),wrapheight=wrap.outerheight(),wrapwidth=wrap.outerwidth(),vid=wrap.find('video'),vidheight=wrap.data('height'),vidwidth=wrap.data('width'),newwidth=wrapwidth,newheight=math.round(vidheight*wrapwidth/vidwidth),newleft=0,newtop=0,iframe=wrap.find('iframe');if(vid.length){if(vidheight===''||typeof vidheight==='undefined'||vidwidth===''||typeof vidwidth==='undefined'){vid.css({'left':'0px','top':'0px','width':newwidth+'px'});vid.on('loadedmetadata',flbuilderlayout._resizeonloadedmeta);}
else{if(newheightaspectratio,width=iswidthfixed?wrapwidth:ratioheight,height=iswidthfixed?ratiowidth:wrapheight;if(video){$(video).width(width).height(height);}},_initmoduleanimations:function()
{if(typeof jquery.fn.waypoint!=='undefined'&&!flbuilderlayout._ismobile()){$('.fl-animation').each(function(){var node=$(this),nodetop=node.offset().top,winheight=$(window).height(),bodyheight=$('body').height(),offset='80%';if(bodyheight-nodetop0){settimeout(function(){module.addclass('fl-animated');},delay*1000);}
else{module.addclass('fl-animated');}},_inithash:function()
{var hash=window.location.hash.replace('#','').split('/').shift(),element=null,tabs=null,responsivelabel=null,tabindex=null,label=null;if(''!==hash){try{element=$('#'+hash);if(element.length>0){if(element.hasclass('fl-accordion-item')){settimeout(function(){element.find('.fl-accordion-button').trigger('click');},100);}
if(element.hasclass('fl-tabs-panel')){settimeout(function(){tabs=element.closest('.fl-tabs');responsivelabel=element.find('.fl-tabs-panel-label');tabindex=responsivelabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabindex+']');if(responsivelabel.is(':visible')){responsivelabel.trigger('click');}
else{flbuilderlayout._scrolltoelement(label);label.trigger('click');}},100);}}}
catch(e){}}},_initanchorlinks:function()
{$('a').each(flbuilderlayout._initanchorlink);},_initanchorlink:function()
{var link=$(this),href=link.attr('href'),loc=window.location,id=null,element=null;if('undefined'!=typeof href&&href.indexof('#')>-1){if(loc.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&loc.hostname==this.hostname){try{id=href.split('#').pop();element=$('#'+id);if(element.length>0){if(link.hasclass('fl-scroll-link')||element.hasclass('fl-row')||element.hasclass('fl-col')||element.hasclass('fl-module')){$(link).on('click',flbuilderlayout._scrolltoelementonlinkclick);}
if(element.hasclass('fl-accordion-item')){$(link).on('click',flbuilderlayout._scrolltoaccordiononlinkclick);}
if(element.hasclass('fl-tabs-panel')){$(link).on('click',flbuilderlayout._scrolltotabonlinkclick);}}}
catch(e){}}}},_scrolltoelementonlinkclick:function(e,callback)
{var element=$('#'+$(this).attr('href').split('#').pop());flbuilderlayout._scrolltoelement(element,callback);e.preventdefault();},_scrolltoelement:function(element,callback)
{var config=flbuilderlayoutconfig.anchorlinkanimations,dest=0,win=$(window),doc=$(document);if(element.length>0){if(element.offset().top>doc.height()-win.height()){dest=doc.height()-win.height();}
else{dest=element.offset().top-config.offset;}
$('html, body').animate({scrolltop:dest},config.duration,config.easing,function(){if('undefined'!=typeof callback){callback();}
if(undefined!=element.attr('id')){if(history.pushstate){history.pushstate(null,null,'#'+element.attr('id'));}
else{window.location.hash=element.attr('id');}}});}},_scrolltoaccordiononlinkclick:function(e)
{var element=$('#'+$(this).attr('href').split('#').pop());if(element.length>0){var callback=function(){if(element){element.find('.fl-accordion-button').trigger('click');element=false;}};flbuilderlayout._scrolltoelementonlinkclick.call(this,e,callback);}},_scrolltotabonlinkclick:function(e)
{var element=$('#'+$(this).attr('href').split('#').pop()),tabs=null,label=null,responsivelabel=null;if(element.length>0){tabs=element.closest('.fl-tabs');responsivelabel=element.find('.fl-tabs-panel-label');tabindex=responsivelabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabindex+']');if(responsivelabel.is(':visible')){var callback=function(){if(element){responsivelabel.trigger('click');element=false;}};flbuilderlayout._scrolltoelementonlinkclick.call(this,e,callback);}
else{flbuilderlayout._scrolltoelement(label);label.trigger('click');}
e.preventdefault();}},_initforms:function()
{if(!flbuilderlayout._hasplaceholdersupport){$('.fl-form-field input').each(flbuilderlayout._initformfieldplaceholderfallback);}
$('.fl-form-field input').on('focus',flbuilderlayout._clearformfielderror);},_hasplaceholdersupport:function()
{var input=document.createelement('input');return'undefined'!=input.placeholder;},_initformfieldplaceholderfallback:function()
{var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if('undefined'!=placeholder&&''===val){field.val(placeholder);field.on('focus',flbuilderlayout._hideformfieldplaceholderfallback);field.on('blur',flbuilderlayout._showformfieldplaceholderfallback);}},_hideformfieldplaceholderfallback:function()
{var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(val==placeholder){field.val('');}},_showformfieldplaceholderfallback:function()
{var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(''===val){field.val(placeholder);}},_clearformfielderror:function()
{var field=$(this);field.removeclass('fl-form-error');field.siblings('.fl-form-error-message').hide();}};$(function(){flbuilderlayout.init();});})(jquery);