!function(t,i,e){"use strict";t.fn.backstretch=function(e,s){return void 0!==e&&0!==e.length||t.error("No images were supplied for Backstretch"),0===t(i).scrollTop()&&i.scrollTo(0,0),this.each(function(){var i=t(this),r=i.data("backstretch");r&&(s=t.extend(r.options,s),r.destroy(!0)),r=new n(this,e,s),i.data("backstretch",r)})},t.backstretch=function(i,e){return t("body").backstretch(i,e).data("backstretch")},t.expr[":"].backstretch=function(i){return void 0!==t(i).data("backstretch")},t.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0};var s={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}},n=function(e,n,a){if(this.options=t.extend({},t.fn.backstretch.defaults,a||{}),this.images=t.isArray(n)?n:[n],t.each(this.images,function(){t("<img />")[0].src=this}),this.isBody=e===document.body,this.$container=t(e),this.$wrap=t('<div class="backstretch"></div>').css(s.wrap).appendTo(this.$container),this.$root=this.isBody?t(r?i:document):this.$container,!this.isBody){var o=this.$container.css("position"),h=this.$container.css("zIndex");this.$container.css({position:"static"===o?"relative":o,zIndex:"auto"===h?0:h,background:"none"}),this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&r?"fixed":"absolute"}),this.index=0,this.show(this.index),t(i).on("resize.backstretch",t.proxy(this.resize,this)).on("orientationchange.backstretch",t.proxy(function(){this.isBody&&0===i.pageYOffset&&(i.scrollTo(0,1),this.resize())},this))};n.prototype={resize:function(){try{var t,e={left:0,top:0},s=this.isBody?this.$root.width():this.$root.innerWidth(),n=s,r=this.isBody?i.innerHeight?i.innerHeight:this.$root.height():this.$root.innerHeight(),a=n/this.$img.data("ratio");a>=r?(t=(a-r)/2,this.options.centeredY&&(e.top="-"+t+"px")):(t=((n=(a=r)*this.$img.data("ratio"))-s)/2,this.options.centeredX&&(e.left="-"+t+"px")),this.$wrap.css({width:s,height:r}).find("img:not(.deleteable)").css({width:n,height:a}).css(e)}catch(t){}return this},show:function(i){if(!(Math.abs(i)>this.images.length-1)){this.index=i;var e=this,n=e.$wrap.find("img").addClass("deleteable"),r=t.Event("backstretch.show",{relatedTarget:e.$container[0]});return clearInterval(e.interval),e.$img=t("<img />").css(s.img).bind("load",function(i){var s=this.width||t(i.target).width(),a=this.height||t(i.target).height();t(this).data("ratio",s/a),t(this).fadeIn(e.options.speed||e.options.fade,function(){n.remove(),e.paused||e.cycle(),e.$container.trigger(r,e)}),e.resize()}).appendTo(e.$wrap),e.$img.attr("src",e.images[i]),e}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?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(t.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(e){t(i).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),e||this.$wrap.remove(),this.$container.removeData("backstretch")}};var r=function(){var t=navigator.userAgent,e=navigator.platform,s=t.match(/AppleWebKit\/([0-9]+)/),n=!!s&&s[1],r=t.match(/Fennec\/([0-9]+)/),a=!!r&&r[1],o=t.match(/Opera Mobi\/([0-9]+)/),h=!!o&&o[1],c=t.match(/MSIE ([0-9]+)/),d=!!c&&c[1];return!((e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1||e.indexOf("iPod")>-1)&&n&&n<534||i.operamini&&"[object OperaMini]"==={}.toString.call(i.operamini)||o&&h<7458||t.indexOf("Android")>-1&&n&&n<533||a&&a<6||"palmGetResource"in i&&n&&n<534||t.indexOf("MeeGo")>-1&&t.indexOf("NokiaBrowser/8.5.0")>-1||d&&d<=6)}()}(jQuery,window);