// LiteBox v1.2, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/
// ===============================================================================
!function(e,t){function o(t,o){this.element=t,this.$element=e(this.element),this.options=e.extend({},a,o),this._defaults=a,this._name=l,this.init()}function i(){return t.innerHeight?t.innerHeight:e(t).height()}function n(t){e(t).each(function(){var t=new Image;t.src=this,t.width>0&&e("").attr("src",this).addClass("litebox-preload").appendTo("body").hide()})}var l="liteBox",a={revealSpeed:400,background:"rgba(0,0,0,.8)",overlayClose:!0,escKey:!0,navKey:!0,closeTip:"tip-l-fade",closeTipText:"Close",prevTip:"tip-t-fade",prevTipText:"Previous",nextTip:"tip-t-fade",nextTipText:"Next",callbackInit:function(){},callbackBeforeOpen:function(){},callbackAfterOpen:function(){},callbackBeforeClose:function(){},callbackAfterClose:function(){},callbackError:function(){},callbackPrev:function(){},callbackNext:function(){},errorMessage:"Error loading content."};o.prototype={init:function(){var t=this;this.$element.on("click",function(e){e.preventDefault(),t.openLitebox()}),keyEsc=27,keyLeft=37,keyRight=39,e("body").off("keyup").on("keyup",function(o){t.options.escKey&&o.keyCode==keyEsc&&t.closeLitebox(),t.options.navKey&&o.keyCode==keyLeft&&e(".litebox-prev").trigger("click"),t.options.navKey&&o.keyCode==keyRight&&e(".litebox-next").trigger("click")}),this.options.callbackInit.call(this)},openLitebox:function(){var t=this;this.options.callbackBeforeOpen.call(this),t.buildLitebox();var o=this.$element;if(t.populateLitebox(o),t.options.overlayClose&&$litebox.on("click",function(o){(o.target===this||e(o.target).hasClass("litebox-container")||e(o.target).hasClass("litebox-error"))&&t.closeLitebox()}),$close.on("click",function(){t.closeLitebox()}),this.$element.attr("data-litebox-group")){var t=this,i=this.$element.attr("data-litebox-group"),l=e('[data-litebox-group="'+this.$element.attr("data-litebox-group")+'"]'),a=[];e('[data-litebox-group="'+i+'"]').each(function(){var t=e(this).attr("href");a.push(t)}),n(a),e(".litebox-nav").show(),$prevNav.off("click").on("click",function(){t.options.callbackPrev.call(this);var i=l.index(o);o=l.eq(i-1),e(o).length||(o=l.last()),t.populateLitebox(o)}),$nextNav.off("click").on("click",function(){t.options.callbackNext.call(this);var i=l.index(o);o=l.eq(i+1),e(o).length||(o=l.first()),t.populateLitebox(o)})}this.options.callbackAfterOpen.call(this)},buildLitebox:function(){$litebox=e("