//(C) Sharefaith, sharefaith.com. All rights reserved. function SFinvalid(a){return(a.indexOf('/custom/bg/?img=BandMainImg.jpg')>-1||a.indexOf('/?img=template70Guitar.jpg')>-1||a.indexOf('/BandMainIMG2-1.jpg')>-1||a.indexOf('/2014/06/Bandpic-1.jpg')>-1||a.indexOf('/custom/bg/?img=Bandpic-1.jpg')>-1||a.indexOf('/custom/bg/?img=MissionMainBG-1.jpg')>-1||a.indexOf('/custom/bg/?img=MissionGirl-2.jpg')>-1||a.indexOf('/custom/bg/?img=CornerStone-Girl.jpg')>-1||a.indexOf('/custom/bg/?img=template63')>-1||a.indexOf('/custom/bg/template63')>-1);}if(window.mejs&&mejs.version.indexOf('2.15')===0)mejs.MediaFeatures.isChromium=false;var closeClass=function(a,b){var c;while(a&&a!==document.body&&a.nodeType==1){c=a.getAttribute('class');if(c&&c.indexOf(b)!==-1)return a;a=a.parentNode;}};function IEorigin(a){return a.protocol+"//"+a.hostname;}(function(a){var b=false;a.fn.sfToggle=function(){var b='toggle';var c={height:b,marginBottom:b,marginTop:b,paddingBottom:b,paddingTop:b};if(a('link[href$="67/67.css"]').length>0)c={width:b,minWidth:b,marginLeft:b,marginRight:b,paddingLeft:b,paddingRight:b};return this.animate(c,400,'swing',function(){if('none'===this.style.display)this.style.display='';a(this).trigger('sfToggled');});};a.fn.lheight=function(){var b=a(this),c=b.children('p,div,h1,h2,h3'),d=0;while(c.length){b=c.eq(0);d+=parseInt(b.css('paddingTop'),10);c=b.children('p,div,h1,h2,h3');}return{height:b.css('lineHeight'),font:b.css('fontSize'),top:d};};a(function(a){a(document).on('click','.sflb_section[data-sflink]',function(b){if(a(b.target).is('a, .sermon_playlist *'))return;if(parent!==window){var c=a('').attr('href',a(b.target).closest('[data-sflink]').attr('data-sflink'));a(document.documentElement).append(c);c.click();}else location.href=a(b.target).closest('[data-sflink]').attr('data-sflink');});a(window).on('load sflb_exit',function(){_.defer(function(){a('.sflb_section[data-bg]').each(function(){var b=a(this),c=JSON.parse(b.attr('data-bg')),d=b.outerWidth(),e=b.outerHeight(),f=window.devicePixelRatio?window.devicePixelRatio:1;var g=_.filter(c.imgs,function(a){return a.width>=d*f&&a.height>=e*f;});if(g.length>0){g=_.sortBy(g,'width');this.style.backgroundImage='url("'+wpbasehome+c.base+g[0].file+'")';this.style.backgroundSize='cover';}else{this.style.backgroundImage='url("'+wpbasehome+c.base+c.imgs[0].file+'")';this.style.backgroundSize='cover';}});});});a(document).on('ready overcolor sflb_exit',function(){var b='';a('.sflb_section[data-overcolor]').each(function(){var a=this.getAttribute('data-overcolor');b+='.sflb_section[data-overcolor="'+a+'"]:before{content:""; background:'+a+'}';});a('head #sectionB').remove();a('head').append('');});var c=function(){var b=a('body').css('backgroundImage');a('.menu, .sub-menu').each(function(){var b=a(this).offset();this.style.backgroundPosition=(-b.left)+'px '+(-b.top)+'px';});};c();a(window).on('load resize',c);a('body').on('mouseover','.menu li',c);a('#main_nav >li').on('touchstart MSPointerDown touchend MSPointerUp',function(b){var c=a('ul',this);if(c.length&&!c.data('shown')){c.show().data('shown',true);a(this).addClass('hover').data('noclick',true);b.preventDefault();}}).click(function(b){var c=a(b.target).parent();if(c.data('noclick')&&!a('body').is('.iOS')){c.data('noclick',false);return false;}});a('#main_nav, #main_nav2').on('touchstart MSPointerDown mouseover','li',function(b){var c=a('ul',this);c.css('marginLeft','');if(c.length&&0===a('body.menuOverflow.menuDown').length){var d=window.innerWidth-(c.offset().left+c.outerWidth());if(d<-1){d-=parseInt(c.css('paddingLeft'),10)||0;c.css('marginLeft',d);}}});a('.menu-item.menu-item-has-children, .menu-item.menu-item-has-children >a').attr("aria-haspopup","true");a(window).on('load',function(){b=true;});var e,f;function g(b){a('iframe[height][width][src*="vimeo.com"], iframe[height][width][src*="youtube.com"]').filter(':not(.tubular-player)').each(function(){var b=a(this);if(b.width()500)a('meta[name=viewport]').attr('content','width='+c+'px');e=a(window).width();f=a(window).height();}}a(window).on('load resize',g);a(g);function i(){if(a('body').is('.mobileOn')&&a('#slideshow img').length){var b=a('#slideshow').width();a('#slideshow').height(b*323/950);}}a(window).on('load resize',i);a('.slideshow_container span:visible').click(function(b){var c=a('#slideshow >.cycle2-slide-active a').attr('href');if(typeof c!=="undefined")if(b.which==1)window.location=c;else window.open(c);}).mouseover(function(){var b=a('#slideshow >.cycle2-slide-active a').attr('href');a(this).css('cursor',(typeof b!=="undefined")?'pointer':'');});a('#slideshow').on('cycle2-update-view',function(){var b=a('#slideshow >.cycle2-slide-active').attr('href');var c=a('.slideshow_container >span:visible');if(typeof b!=="undefined")c.css('cursor','pointer');else c.css('cursor','auto');});var j=false;a(window).scroll(function(){var b=a('#slideshow, .plBannerContainer');if(b.length===1){var c=a(window).scrollTop();var d=a(window).height();var e=b.offset().top-c-d;if(e>=0||e<(-d-b.height())){if(!b.is('.cycle2-paused')){j=true;b.cycle2('pause');}}else if(j){b.cycle2('resume');j=false;}}});a('#mobile_nav .menu_btn a').click(function(b){b.preventDefault();a('#main_nav').sfToggle();a(document.body).toggleClass('menuDown');});a('#mobile_nav .search_btn a').click(function(b){b.preventDefault();a('#header .search').one('sfToggled',function(){if(a(this).is(':visible'))a('.search_inp').focus();}).sfToggle();});if(a(document.body).is('.mobileOn'))a('.mergeDown').each(function(){var b=a(this).children();var c=0;while(c-1&&b[c].innerHTML===' ')c--;c++;b.slice((c+b.length)/2,b.length).addClass('extraSpace');});window.sf=window.sf||{};sf.minis=[];var k=2000;var l=0;var m=function(b){var c=false;var d=!(b instanceof jQuery);if(a(window).width()i){for(var j=0;jf&&parseInt(g.style.fontSize||a(g).css('font-size'),10)>b){var n=g.style.fontSize||a(g).css('font-size');if(l){sf.minis.push({el:g,fs:g.style.fontSize,lh:g.style.lineHeight});l=false;}var o=parseInt(n,10)-2;g.style.fontSize=n.replace(/(\d+)/,o);g.style.lineHeight=n.replace(/(\d+)/,o*1.3);c=true;f=e.width();}g.style.display=k;var p;if(g.tagName&&'H1'===g.tagName)p=g;else if(g.parentNode.tagName&&'H1'===g.parentNode.tagName)p=g.parentNode;if(p&&'table'===a(p).css('display'))if(a(p).width()>f){p.style.minWidth='60px';c=true;}}};h(this);a(this).closest('.page').attr('style',g);});if(c&&d)h();}else if(a(window).width()>k)i();else if(a(window).width()===k&&k!==l)i();l=a(window).width();function i(){var b=sf.minis.length;while(b--){var c=sf.minis[b].el;c.style.lineHeight=sf.minis[b].lh;c.style.fontSize=sf.minis[b].fs;m(a(c).closest('.sflb_section'));}}};var n=_.throttle(m,1900);n();a(window).on('load resize',n).on('sflb_save_finished',function(){k=2000;}).on('orientationchange',function(){setTimeout(n,100);});a('body.home .plBannerContainer').on('cycle2-after',function(b,c,e,f){d=true;n(a(f));d=false;a('.plBanner .sfeditbackground, .plBanner .edit_button').removeAttr('style');});if(window.mejs){var o=mejs.MediaElementPlayer.prototype.setControlsSize;mejs.MediaElementPlayer.prototype.setControlsSize=function(){var a=this;o.call(a);var b=this.controls.find('.mejs-time-rail');b.width(b.width()-1);var c=this.controls.offset().top;_.delay(function(){o.call(a);},1000);};}var p=function(){a('.ngg-albumoverview a, .ngg-navigation a').each(function(b,c){var d=a(c).attr('href');if(d.indexOf('/hp_wordpress')!=-1)a(c).attr('href',d.replace('/hp_wordpress',''));});a('.plFrontPage .ngg-galleryoverview, .plFrontPage .ngg-albumoverview').each(function(){var b=a(this).closest('.plFrontPage');var c=b.attr('data-url');a('a[href*="/nggallery/"]',b).each(function(){this.href=c+this.href.substr(this.href.indexOf('/nggallery/')+1).replace(/\?post_type=sfbannerpage\&p\=(\d+)/,'?inAdmin=1');});});};a(window).on('sflb_save_finished',p);p();var q=false;a(window).on('resize',_.throttle(function(){if(!q&&a('.wc-gallery').length){q=true;setTimeout(function(){a(window).trigger('resize');q=false;},400);}},300));a(document).contextmenu(function(b){var c=b.target.nodeName;if(c!=='A'&&c!=='IMG'&&c!=='INPUT'&&c!=='TEXTAREA'&&b.target.parentNode.nodeName!=='A'&&window.getSelection()+''=='')if(a(b.target).closest('[contenteditable]').length===0)b.preventDefault();});if(navigator.platform&&navigator.platform.match(/^(iPad|iPod|iPhone.*)$/)){a('body').addClass('iOS');a("audio,video").removeAttr("preload");a("iframe[src*='sharefaithgiving.com/go/event.php']").each(function(){this.setAttribute('scrolling','no');this.style.width='1080px';});}function r(){a('iframe[src*="google.com/maps/embed"]').each(function(){if(!a(this).parent().is('.gmapWrap'))a(this).wrap('
').parent().append('
');});var b=jQuery('.gmapBlock');var c;a(window).scroll(function(){b.show();if(c)clearTimeout(c);c=setTimeout(function(){b.hide();},500);});}r();jQuery(window).on('sflb_exit',r);if(navigator.platform&&navigator.platform.match(/^(iPad)$/))a('body').addClass('iPad');var s=function(){var b=(a(window).width()<480),c='data-was-padding';if(b)a('body.mobileOn .sflb_section[style*="border-box"]').each(function(){a(this).attr(c,this.style.paddingLeft).css({padding:'','-webkit-box-sizing':'','-moz-box-sizing':'','box-sizing':''});});else a('body.mobileOn .sflb_section[data-was-padding]').each(function(){var b=a(this).attr(c);a(this).css({paddingLeft:b,paddingRight:b,'-webkit-box-sizing':'border-box','-moz-box-sizing':'border-box','box-sizing':'border-box'}).removeAttr(c);});};s();a(window).resize(s);var t=function(){a('.thumbnail >img').each(function(b,c){var d=a(c).parent();if(this.height*(d.width()/this.width)#full_bg').remove();b.prepend('
');}}else{}if((navigator.userAgent.indexOf('Android')!=-1||navigator.userAgent.indexOf('Silk/')!=-1||a('body').is('.iOS'))&&navigator.userAgent.indexOf('AppleWebKit/')!=-1){var d=a(window),e=a('body');var f=function(){a('html')[0].style.minHeight='';while(d.height()==e.height()&&d.width()0;var l=closeClass(b,'entry');if(l)l=a(l);else return;d=true;if(c)l.css('height',l.height());_.each(h,function(a){a.style.height='';});var m=h.eq(0).height();if(h.children('.type-post').length===0){if(h.length+i.length>1){m=_.max(_.map(h,function(b){return a(b).height();}));if(m>1)h.height(m);}_.each(i,function(a){a.style.height='';});if(i.length>0){_.each(i,function(a){a.style.display='none';});var n=i.eq(0).parent().next(),o=n.height(),p=i.eq(0).parent().height();_.each(i,function(a){a.style.display='';});if(o>0){var q=_.max(_.map(i,function(b){return a(b).outerHeight();}));var r=o+p;var s=(parseInt(g.css('marginBottom'),10)||0)+(parseInt(g.next().css('top'),10)||0)-(parseInt(g.css('top'),10)||0);r+=s;if(r-1)g(m);}}});a(function(){a(document.body).on('addRowObserver',function(b){if(a(b.target).is('.sflb_row'))k.observe(b.target,{childList:true,subtree:true,attributes:true});else console.error('Not a row!');});a(window).on('load',function(){a('.sflb_row').trigger('addRowObserver');});});}else var k={observe:a.noop,disconnect:a.noop};a(window).on('sflb_exit',function(){_.delay(i,99);a('.entry img').off('load.forheight').one('load.forheight',i);});if(navigator.userAgent.indexOf(' Edge/')!=-1)a(function(){var a=document.getElementsByClassName('menu');if(a.length>0)setInterval(function(){var b=a[0].style.marginLeft;a[0].style.marginLeft='-0.2px';setTimeout(function(){a[0].style.marginLeft=b;},1);},1000);});var l=_.throttle(function(b){var c=a('body').is('.withFootPage');a('.fl_l, #footerPage').css({position:'',bottom:'',top:'',left:'',right:''});var d={position:'fixed',bottom:0,top:'auto',left:0,right:0};var e=a('.fl_l').offset();if(e&&e.top&&c){if(e.top1){a('#content').css('height','');var f=a(window).height(),g=a('#footerPage'),h=g.outerHeight(),i=g.offset().top,j=f-h-i;if(j>0)a('#content').height(j+a('#content').height());}}},100);l({});a(window).on('load resize sflb_save_finished sflb_exit reset-sf-tinyMCE footerChange updated_wc_div',l);a(window).on('load resize',function(){var b=40,c=a('#logo a span');if(is_parallax()){var d=a('#logo img');if(d.length===1){d.css({maxHeight:'',marginTop:''});var e=d.width(),f=d.height();if(Math.abs(e/f-d[0].naturalWidth/d[0].naturalHeight)>.1){var g=d[0].naturalHeight/d[0].naturalWidth*e;d.css({maxHeight:g,marginTop:parseInt(d.css('marginTop'),10)+(f-g)/2});}}else if(c.length===1){c[0].style.lineHeight='';c[0].style.fontSize='';while((c.height()>a('#header').height()||c.width()>(a('#header .container').width()-60))&&a('#header').height()<90&&b-->0){var h=c.css('fontSize'),i=parseInt(h,10),j=c.css('lineHeight'),k=parseInt(j,10);c[0].style.fontSize=h.replace(i,i-2);c[0].style.lineHeight=j.replace(k,k-2);}}}});var m=function(){a('body.excerpting .sflb_section >.type-post >.entry').each(function(){var b=a(this).height()-1)a("iframe").each(function(){if(this.contentWindow===b.source)a(this).stop(true,false).animate({height:b.data.height+35});});},false);})(jQuery);