/* Backstretch 2.0.3 2012-11-30 http://srobbin.com/jquery-plugins/backstretch/ (c) Scott Robbin Licensed MIT */
;(function(f,b,g){f.fn.backstretch=function(h,e){return(h===g||h.length===0)&&f.error("No images were supplied for Backstretch"),f(b).scrollTop()===0&&b.scrollTo(0,0),this.each(function(){var i=f(this),j=i.data("backstretch");j&&(e=f.extend(j.options,e),j.destroy(!0)),j=new a(this,h,e),i.data("backstretch",j)})},f.backstretch=function(e,h){return f("body").backstretch(e,h).data("backstretch")},f.expr[":"].backstretch=function(e){return f(e).data("backstretch")!==g},f.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5000,fade:0/*!Themify*/,mode:'fullcover'/*!Themify*/ };var d={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},img:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxWidth:"none",zIndex:-999999}},a=function(l,j,k){this.options=f.extend({},f.fn.backstretch.defaults,k||{}),this.images=f.isArray(j)?j:[j],f.each(this.images,function(){f("<img />")[0].src=this}),this.isBody=l===document.body,this.$container=f(l),this.$wrap=f('<div class="backstretch"></div>').css(d.wrap).appendTo(this.$container),this.$root=this.isBody?c?f(b):f(document):this.$container;if(!this.isBody){var h=this.$container.css("position"),e=this.$container.css("zIndex");this.$container.css({position:h==="static"?"relative":h,zIndex:e==="auto"?0:e,background:"none"}),this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&c?"fixed":"absolute"}),this.index=0,this.show(this.index),f(b).on("resize.backstretch",f.proxy(this.resize,this)).on("orientationchange.backstretch",f.proxy(function(){this.isBody&&b.pageYOffset===0&&(b.scrollTo(0,1),this.resize())},this))};a.prototype={resize:function(){try{var m={left:0,top:0},q=this.isBody?this.$root.width():this.$root.innerWidth(),l=q,j=this.isBody?b.innerHeight?b.innerHeight:this.$root.height():this.$root.innerHeight(),k=l/this.$img.data("ratio"),p;k>=j?(p=(k-j)/2,this.options.centeredY&&(m.top="-"+p+"px")):(k=j,l=k*this.$img.data("ratio"),p=(l-q)/2,this.options.centeredX&&(m.left="-"+p+"px")),this.$wrap.css({width:q,height:j}).find("img:not(.deleteable)").css({width:l,height:k}).css(m);
/*!Begin Themify*/
;if("best-fit"==k.options.mode){if(this.$img.width()<this.$img.height()){if(this.$img.closest('.row_inner').width()<f(window).height()){if(this.$img.closest('.row_inner').width()<this.$img.width()){this.$img.removeClass("best-fit-vertical").addClass("best-fit-horizontal")}}else{this.$img.removeClass("best-fit-horizontal").addClass("best-fit-vertical")}}}
/*!End Themify*/
}catch(h){}return this},show:function(h){if(Math.abs(h)>this.images.length-1){return}this.index=h;var k=this,e=k.$wrap.find("img").addClass("deleteable"),j=f.Event("backstretch.show",{relatedTarget:k.$container[0]});return clearInterval(k.interval),k.$img=f("<img />").css(d.img).bind("load",function(i){var l=this.width||f(i.target).width(),m=this.height||f(i.target).height();
/*!Begin Themify*/
;if("best-fit"==k.options.mode){if(this.width<this.height){f(this).removeClass('best-fit-horizontal').addClass("best-fit best-fit-vertical")}else{f(this).removeClass('best-fit-vertical').addClass("best-fit best-fit-horizontal")}}
/*!End Themify*/
;f(this).data("ratio",l/m),f(this).fadeIn(k.options.speed||k.options.fade,function(){e.remove(),k.paused||k.cycle(),k.$container.trigger(j,k)}),k.resize()}).appendTo(k.$wrap),k.$img.attr("src",k.images[h]),k},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(this.index===0?this.images.length-1:this.index-1)},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this.next(),this},cycle:function(){return this.images.length>1&&(clearInterval(this.interval),this.interval=setInterval(f.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(e){f(b).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),e||this.$wrap.remove(),this.$container.removeData("backstretch")}};var c=function(){var t=navigator.userAgent,k=navigator.platform,h=t.match(/AppleWebKit\/([0-9]+)/),p=!!h&&h[1],x=t.match(/Fennec\/([0-9]+)/),j=!!x&&x[1],w=t.match(/Opera Mobi\/([0-9]+)/),v=!!w&&w[1],q=t.match(/MSIE ([0-9]+)/),m=!!q&&q[1];return !((k.indexOf("iPhone")>-1||k.indexOf("iPad")>-1||k.indexOf("iPod")>-1)&&p&&p<534||b.operamini&&{}.toString.call(b.operamini)==="[object OperaMini]"||w&&v<7458||t.indexOf("Android")>-1&&p&&p<533||j&&j<6||"palmGetResource" in b&&p&&p<534||t.indexOf("MeeGo")>-1&&t.indexOf("NokiaBrowser/8.5.0")>-1||m&&m<=6)}()})(jQuery,window);