!function(t){t.fn.hoverIntent=function(e,i,s){var n,o,a,r,l={interval:100,sensitivity:7,timeout:0};l="object"==typeof e?t.extend(l,e):t.isFunction(i)?t.extend(l,{over:e,out:i,selector:s}):t.extend(l,{over:e,out:e,selector:i});var h=function(t){n=t.pageX,o=t.pageY},c=function(e,i){if(i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(a-n)+Math.abs(r-o)'),loader:$('
'),toolbar:$('
'),innerToolbar:$('
'),title:$('
'),closeButton:$(''),fullScreenButton:$(''),innerPlayButton:$(''),innerNextButton:$(''),innerPrevButton:$(''),holder:$('
'),nextPhoto:$('
'),prevPhoto:$('
'),nextButton:$(''),prevButton:$(''),thumbnails:$('
'),thumbs:!1,nextLock:!1,prevLock:!1,hashLock:!1,isMobile:!1,mobileMaxWidth:980,isInFullScreen:!1,isSwipe:!1,mouseID:0,cycleID:0,isPaused:0},n.vars.hideableElements=n.vars.nextButton.add(n.vars.prevButton),n.normalizeItems(),n.availPlugins(),n.options.startFrom=n.options.startFrom>0&&n.options.startFrom>=n.vars.total?n.vars.total-1:n.options.startFrom,n.options.startFrom=n.options.randomStart?floor(random()*n.vars.total):n.options.startFrom,n.vars.start=n.options.startFrom,s?n.instantCall():n.patchItemsEvents(),n.options.linkId&&(n.hashChangeHandler(),$win.iLightBoxHashChange(function(){n.hashChangeHandler()})),supportTouch){var o=/(click|mouseenter|mouseleave|mouseover|mouseout)/gi,a="itap";n.options.caption.show=n.options.caption.show.replace(o,a),n.options.caption.hide=n.options.caption.hide.replace(o,a),n.options.social.show=n.options.social.show.replace(o,a),n.options.social.hide=n.options.social.hide.replace(o,a)}n.options.controls.arrows&&$.extend(n.options.styles,{nextOffsetX:0,prevOffsetX:0,nextOpacity:0,prevOpacity:0})};function getPixel(t,e){return parseInt(t.css(e),10)||0}function within(t,e,i){return ti?i:t}function getViewport(){var t=window,e="inner";return"innerWidth"in window||(e="client",t=document.documentElement||document.body),{width:t[e+"Width"],height:t[e+"Height"]}}function removeHash(){var t=getScrollXY();window.location.hash="",window.scrollTo(t.x,t.y)}function doAjax(t,e){t="https://ilightbox.net/getSource/jsonp.php?url="+encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");$.ajax({url:t,dataType:"jsonp"}),iLCallback=function(t){e.call(this,t)}}function findImageInElement(t){var e=$("*",t),i=new Array;return e.each(function(){var t="",e=this;if("none"!=$(e).css("background-image")?t=$(e).css("background-image"):void 0!==$(e).attr("src")&&"img"==e.nodeName.toLowerCase()&&(t=$(e).attr("src")),-1==t.indexOf("gradient"))for(var s=(t=(t=(t=(t=t.replace(/url\(\"/g,"")).replace(/url\(/g,"")).replace(/\"\)/g,"")).replace(/\)/g,"")).split(","),n=0;n0&&-1==$.inArray(s[n],i)){var o="";browser.msie&&browser.version<9&&(o="?"+floor(3e3*random())),i.push(s[n]+o)}}),i}function getExtension(t){var e=t.split(".").pop().toLowerCase(),i=-1!==e.indexOf("?")?e.split("?").pop():"";return(e=e.replace(i,"")).replace("?","")}function getTypeByExtension(t){var e=getExtension(t);return-1!==extensions.image.indexOf(e)?"image":-1!==extensions.flash.indexOf(e)?"flash":-1!==extensions.video.indexOf(e)?"video":"iframe"}function percentToValue(t,e){return parseInt(e/100*t)}function parseURI(t){var e=String(t).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return e?{href:e[0]||"",protocol:e[1]||"",authority:e[2]||"",host:e[3]||"",hostname:e[4]||"",port:e[5]||"",pathname:e[6]||"",search:e[7]||"",hash:e[8]||""}:null}function absolutizeURI(t,e){var i,s;return e=parseURI(e||""),t=parseURI(t||""),e&&t?(e.protocol||t.protocol)+(e.protocol||e.authority?e.authority:t.authority)+(i=e.protocol||e.authority||"/"===e.pathname.charAt(0)?e.pathname:e.pathname?(t.authority&&!t.pathname?"/":"")+t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)+e.pathname:t.pathname,s=[],i.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(t){"/.."===t?s.pop():s.push(t)}),s.join("").replace(/^\//,"/"===i.charAt(0)?"/":""))+(e.protocol||e.authority||e.pathname?e.search:e.search||t.search)+e.hash:null}function version_compare(t,e,i){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var s,n=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},r=function(t){return(t=(t=(""+t).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?t.split("."):[-8]},l=function(t){return t?isNaN(t)?a[t]||-7:parseInt(t,10):0};for(t=r(t),e=r(e),s=max(t.length,e.length),n=0;ne[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return o<=0;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return o<0;default:return null}}function getScrollXY(){var t=0,e=0;return"number"==typeof window.pageYOffset?(e=window.pageYOffset,t=window.pageXOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(e=document.body.scrollTop,t=document.body.scrollLeft):document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)&&(e=document.documentElement.scrollTop,t=document.documentElement.scrollLeft),{x:t,y:e}}iLightBox.prototype={showLoader:function(){var t=this;t.vars.loadRequests+=1,"horizontal"==t.options.path.toLowerCase()?t.vars.loader.stop().animate({top:"-30px"},t.options.show.speed,"easeOutCirc"):t.vars.loader.stop().animate({left:"-30px"},t.options.show.speed,"easeOutCirc")},hideLoader:function(){var t=this;t.vars.loadRequests-=1,t.vars.loadRequests=t.vars.loadRequests<0?0:t.vars.loadRequests,"horizontal"==t.options.path.toLowerCase()?t.vars.loadRequests<=0&&t.vars.loader.stop().animate({top:"-192px"},t.options.show.speed,"easeInCirc"):t.vars.loadRequests<=0&&t.vars.loader.stop().animate({left:"-192px"},t.options.show.speed,"easeInCirc")},createUI:function(){var t=this;t.ui={currentElement:t.vars.holder,nextElement:t.vars.nextPhoto,prevElement:t.vars.prevPhoto,currentItem:t.vars.current,nextItem:t.vars.next,prevItem:t.vars.prev,hide:function(){t.closeAction()},refresh:function(){arguments.length>0?t.repositionPhoto(!0):t.repositionPhoto()},fullscreen:function(){t.fullScreenAction()}}},attachItems:function(){var iL=this,itemsObject=new Array,items=new Array;$(iL.selector,iL.context).each(function(){var t=$(this),URL=t.attr(iL.options.attr)||null,options=t.data("options")&&eval("({"+t.data("options")+"})")||{},caption=t.data("caption"),title=t.data("title")?t.data("title"):t.attr("title"),type=t.data("type")||getTypeByExtension(URL);"false"==t.attr("data-title")&&(title=""),items.push({URL:URL,caption:caption,title:title,type:type,options:options}),iL.instant||itemsObject.push(t)}),iL.items=items,iL.itemsObject=itemsObject},normalizeItems:function(){var t=this,e=new Array;$.each(t.items,function(i,s){"string"==typeof s&&(s={url:s});var n=s.url||s.URL||null,o=s.options||{},a=s.caption||null,r=s.title||null,l=s.type?s.type.toLowerCase():getTypeByExtension(n),h="object"!=typeof n?getExtension(n):"";o.thumbnail=o.thumbnail||("image"==l?n:null),o.videoType=o.videoType||null,o.iframeType=o.iframeType||null,o.skin=o.skin||t.options.skin,o.width=o.width||t.options.width,o.height=o.height||t.options.height,o.mousewheel=void 0===o.mousewheel||o.mousewheel,o.swipe=void 0===o.swipe||o.swipe,o.social=void 0!==o.social?o.social:t.options.social.buttons&&$.extend({},{},t.options.social.buttons),"video"==l&&(o.html5video=void 0!==o.html5video?o.html5video:{},o.html5video.webm=o.html5video.webm||o.html5video.WEBM||null,o.html5video.controls=void 0!==o.html5video.controls?o.html5video.controls:"controls",o.html5video.preload=o.html5video.preload||"metadata",o.html5video.autoplay=void 0!==o.html5video.autoplay&&o.html5video.autoplay),o.width&&o.height||("video"==l?(o.width=t.options.videoWidth||1280,o.height=t.options.videoHeight||720):"iframe"==l?"video"==o.iframeType?(o.width=t.options.videoWidth||1280,o.height=t.options.videoHeight||720):(o.width=t.options.iframeWidth||"100%",o.height=t.options.iframeHeight||"90%"):"flash"==l&&(o.width=t.options.flashWidth||1280,o.height=t.options.flashHeight||720)),delete s.url,s.index=i,s.URL=n,s.caption=a,s.title=r,s.type=l,s.options=o,s.ext=h,e.push(s)}),t.items=e},instantCall:function(){var t=this,e=t.vars.start;t.vars.current=e,t.vars.next=t.items[e+1]?e+1:null,t.vars.prev=t.items[e-1]?e-1:null,t.addContents(),t.patchEvents()},addContents:function(){var t=this,e=t.vars,i=t.options,s=getViewport(),n=i.path.toLowerCase(),o=e.total>0&&t.items.filter(function(t,e,s){return-1===["image","flash","video"].indexOf(t.type)&&void 0===t.recognized&&(i.smartRecognition||t.options.smartRecognition)}),a=o.length>0;i.mobileOptimizer&&!i.innerToolbar&&(e.isMobile=s.width<=e.mobileMaxWidth),e.overlay.addClass(i.skin).hide().css("opacity",i.overlay.opacity),i.linkId&&e.overlay[0].setAttribute("linkid",i.linkId),i.controls.toolbar&&(e.toolbar.addClass(i.skin).append(e.closeButton),i.controls.fullscreen&&e.toolbar.append(e.fullScreenButton),i.controls.slideshow&&e.toolbar.append(e.innerPlayButton),e.total>1&&e.toolbar.append(e.innerPrevButton).append(e.innerNextButton)),e.BODY.addClass("ilightbox-noscroll").append(e.overlay).append(e.loader).append(e.holder).append(e.nextPhoto).append(e.prevPhoto),i.innerToolbar||e.BODY.append(e.toolbar),i.controls.arrows&&e.BODY.append(e.nextButton).append(e.prevButton),i.controls.thumbnail&&e.total>1&&(e.BODY.append(e.thumbnails),e.thumbnails.addClass(i.skin).addClass("ilightbox-"+n),$("div.ilightbox-thumbnails-grid",e.thumbnails).empty(),e.thumbs=!0);var r="horizontal"==i.path.toLowerCase()?{left:parseInt(s.width/2-e.loader.outerWidth()/2)}:{top:parseInt(s.height/2-e.loader.outerHeight()/2)};e.loader.addClass(i.skin).css(r),e.nextButton.add(e.prevButton).addClass(i.skin),"horizontal"==n&&e.loader.add(e.nextButton).add(e.prevButton).addClass("horizontal"),e.BODY[e.isMobile?"addClass":"removeClass"]("isMobile"),i.infinite||(e.prevButton.add(e.prevButton).add(e.innerPrevButton).add(e.innerNextButton).removeClass("disabled"),0==e.current&&e.prevButton.add(e.innerPrevButton).addClass("disabled"),e.current>=e.total-1&&e.nextButton.add(e.innerNextButton).addClass("disabled")),i.show.effect?(e.overlay.stop().fadeIn(i.show.speed),e.toolbar.stop().fadeIn(i.show.speed)):(e.overlay.show(),e.toolbar.show());var l=o.length;a?(t.showLoader(),$.each(o,function(s,n){t.ogpRecognition(this,function(s){var n=-1,o=(t.items.filter(function(t,e,i){return t.URL==s.url&&(n=e),t.URL==s.url}),t.items[n]);s&&$.extend(!0,o,{URL:s.source,type:s.type,recognized:!0,options:{html5video:s.html5video,width:"image"==s.type?0:s.width||o.width,height:"image"==s.type?0:s.height||o.height,thumbnail:o.options.thumbnail||s.thumbnail}}),0==--l&&(t.hideLoader(),e.dontGenerateThumbs=!1,t.generateThumbnails(),i.show.effect?setTimeout(function(){t.generateBoxes()},i.show.speed):t.generateBoxes())})})):i.show.effect?setTimeout(function(){t.generateBoxes()},i.show.speed):t.generateBoxes(),t.createUI(),window.iLightBox={close:function(){t.closeAction()},fullscreen:function(){t.fullScreenAction()},moveNext:function(){t.moveTo("next")},movePrev:function(){t.moveTo("prev")},goTo:function(e){t.goTo(e)},refresh:function(){t.refresh()},reposition:function(){arguments.length>0?t.repositionPhoto(!0):t.repositionPhoto()},setOption:function(e){t.setOption(e)},destroy:function(){t.closeAction(),t.dispatchItemsEvents()}},i.linkId&&(e.hashLock=!0,window.location.hash=i.linkId+"/"+e.current,setTimeout(function(){e.hashLock=!1},55)),i.slideshow.startPaused||(t.resume(),e.innerPlayButton.removeClass("ilightbox-play").addClass("ilightbox-pause")),"function"==typeof t.options.callback.onOpen&&t.options.callback.onOpen.call(t)},loadContent:function(t,e,i){var s,n,o=this;switch(o.createUI(),t.speed=i||o.options.effects.loadedFadeSpeed,"current"==e&&(t.options.mousewheel?o.vars.lockWheel=!1:o.vars.lockWheel=!0,t.options.swipe?o.vars.lockSwipe=!1:o.vars.lockSwipe=!0),e){case"current":s=o.vars.holder,n=o.vars.current;break;case"next":s=o.vars.nextPhoto,n=o.vars.next;break;case"prev":s=o.vars.prevPhoto,n=o.vars.prev}if(s.removeAttr("style class").addClass("ilightbox-holder"+(supportTouch?" supportTouch":"")).addClass(t.options.skin),$("div.ilightbox-inner-toolbar",s).remove(),t.title||o.options.innerToolbar){var a=o.vars.innerToolbar.clone();if(t.title&&o.options.show.title){var r=o.vars.title.clone();r.empty().html(t.title),a.append(r)}o.options.innerToolbar&&a.append(o.vars.total>1?o.vars.toolbar.clone():o.vars.toolbar),s.prepend(a)}o.loadSwitcher(t,s,n,e)},loadSwitcher:function(t,e,i,s){var n=this,o=n.options,a={element:e,position:i};switch(t.type){case"image":"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(n,a),n.loadImage(t.URL,function(r){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a);var l=r?r.width:400,h=r?r.height:200;e.data({naturalWidth:l,naturalHeight:h}),$("div.ilightbox-container",e).empty().append(r?'':''+o.errors.loadImage+""),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a),n.configureHolder(t,s,e)});break;case"video":e.data({naturalWidth:t.options.width,naturalHeight:t.options.height}),n.addContent(e,t),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a),n.configureHolder(t,s,e);break;case"iframe":n.showLoader(),e.data({naturalWidth:t.options.width,naturalHeight:t.options.height});var r=n.addContent(e,t);"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a),"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(n,a),r.bind("load",function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a),n.hideLoader(),n.configureHolder(t,s,e),r.unbind("load")});break;case"inline":r=$(t.URL);var l=n.addContent(e,t),h=findImageInElement(e);e.data({naturalWidth:n.items[i].options.width||r.outerWidth(),naturalHeight:n.items[i].options.height||r.outerHeight()}),l.children().eq(0).show(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a),"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(n,a),n.loadImage(h,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a),n.configureHolder(t,s,e)});break;case"flash":r=n.addContent(e,t);e.data({naturalWidth:n.items[i].options.width||r.outerWidth(),naturalHeight:n.items[i].options.height||r.outerHeight()}),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a),n.configureHolder(t,s,e);break;case"ajax":var c=t.options.ajax||{};"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(n,a),n.showLoader(),$.ajax({url:t.URL||o.ajaxSetup.url,data:c.data||null,dataType:c.dataType||"html",type:c.type||o.ajaxSetup.type,cache:c.cache||o.ajaxSetup.cache,crossDomain:c.crossDomain||o.ajaxSetup.crossDomain,global:c.global||o.ajaxSetup.global,ifModified:c.ifModified||o.ajaxSetup.ifModified,username:c.username||o.ajaxSetup.username,password:c.password||o.ajaxSetup.password,beforeSend:c.beforeSend||o.ajaxSetup.beforeSend,complete:c.complete||o.ajaxSetup.complete,success:function(r,l,h){n.hideLoader();var d=$(r),u=$("div.ilightbox-container",e),p=n.items[i].options.width||parseInt(d[0].getAttribute("width")),f=n.items[i].options.height||parseInt(d[0].getAttribute("height")),g=d[0].getAttribute("width")&&d[0].getAttribute("height")?{overflow:"hidden"}:{};u.empty().append($('
').css(g).html(d)),e.show().data({naturalWidth:p||u.outerWidth(),naturalHeight:f||u.outerHeight()}).hide(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a);var m=findImageInElement(e);n.loadImage(m,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a),n.configureHolder(t,s,e)}),o.ajaxSetup.success(r,l,h),"function"==typeof c.success&&c.success(r,l,h)},error:function(r,l,h){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a),n.hideLoader(),$("div.ilightbox-container",e).empty().append(''+o.errors.loadContents+""),n.configureHolder(t,s,e),o.ajaxSetup.error(r,l,h),"function"==typeof c.error&&c.error(r,l,h)}});break;case"html":var d=t.URL;if(container=$("div.ilightbox-container",e),d[0].nodeName)r=d.clone();else{var u=$(d);r=u.selector?$("
"+u+"
"):u}var p=n.items[i].options.width||parseInt(r.attr("width")),f=n.items[i].options.height||parseInt(r.attr("height"));n.addContent(e,t),r.appendTo(document.documentElement).hide(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(n,n.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(n,a);h=findImageInElement(e);"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(n,a),n.loadImage(h,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(n,a),e.show().data({naturalWidth:p||container.outerWidth(),naturalHeight:f||container.outerHeight()}).hide(),r.remove(),n.configureHolder(t,s,e)})}},configureHolder:function(t,e,i){var s=this,n=s.vars,o=s.options;if("current"!=e&&("next"==e?i.addClass("ilightbox-next"):i.addClass("ilightbox-prev")),"current"==e)var a=n.current;else if("next"==e){var r=o.styles.nextOpacity;a=n.next}else r=o.styles.prevOpacity,a=n.prev;var l={element:i,position:a};s.items[a].options.width=s.items[a].options.width||0,s.items[a].options.height=s.items[a].options.height||0,"current"==e?o.show.effect?i.css(transform,gpuAcceleration).fadeIn(t.speed,function(){if(i.css(transform,""),t.caption){s.setCaption(t,i);var e=$("div.ilightbox-caption",i),n=parseInt(e.outerHeight()/i.outerHeight()*100);o.caption.start&n<=50&&e.fadeIn(o.effects.fadeSpeed)}var r=t.options.social;r&&(s.setSocial(r,t.URL,i),o.social.start&&$("div.ilightbox-social",i).fadeIn(o.effects.fadeSpeed)),s.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(s,s.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(s,l)}):(i.show(),s.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(s,s.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(s,l)):o.show.effect?i.fadeTo(t.speed,r,function(){"next"==e?n.nextLock=!1:n.prevLock=!1,s.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(s,s.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(s,l)}):(i.css({opacity:r}).show(),"next"==e?n.nextLock=!1:n.prevLock=!1,s.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(s,s.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(s,l)),setTimeout(function(){s.repositionPhoto()},0)},generateBoxes:function(){var t=this,e=t.vars,i=t.options;i.infinite&&e.total>=2?(e.current==e.total-1&&(e.next=0),0==e.current&&(e.prev=e.total-1)):i.infinite=!1,t.loadContent(t.items[e.current],"current",i.show.speed),t.items[e.next]&&t.loadContent(t.items[e.next],"next",i.show.speed),t.items[e.prev]&&t.loadContent(t.items[e.prev],"prev",i.show.speed)},generateThumbnails:function(){var t=this,e=t.vars,i=t.options,s=null;if(e.thumbs&&!t.vars.dontGenerateThumbs){var n=e.thumbnails,o=$("div.ilightbox-thumbnails-container",n),a=$("div.ilightbox-thumbnails-grid",o),r=0;a.removeAttr("style").empty(),$.each(t.items,function(l,h){var c=e.current==l?"ilightbox-active":"",d=e.current==l?i.thumbnails.activeOpacity:i.thumbnails.normalOpacity,u=h.options.thumbnail,p=$('
'),f=$('
');p.css({opacity:0}).addClass(c),"video"!=h.type&&"flash"!=h.type||void 0!==h.options.icon?h.options.icon&&(f.addClass("ilightbox-thumbnail-"+h.options.icon),p.append(f)):(f.addClass("ilightbox-thumbnail-video"),p.append(f)),u&&t.loadImage(u,function(e){r++,e?p.data({naturalWidth:e.width,naturalHeight:e.height}).append(''):p.data({naturalWidth:i.thumbnails.maxWidth,naturalHeight:i.thumbnails.maxHeight}),clearTimeout(s),s=setTimeout(function(){t.positionThumbnails(n,o,a)},20),setTimeout(function(){p.fadeTo(i.effects.loadedFadeSpeed,d)},20*r)}),a.append(p)}),t.vars.dontGenerateThumbs=!0}},positionThumbnails:function(t,e,i){var s=this,n=s.vars,o=s.options,a=getViewport(),r=o.path.toLowerCase();t||(t=n.thumbnails),e||(e=$("div.ilightbox-thumbnails-container",t)),i||(i=$("div.ilightbox-thumbnails-grid",e));var l=$(".ilightbox-thumbnail",i),h="horizontal"==r?a.width-o.styles.pageOffsetX:l.eq(0).outerWidth()-o.styles.pageOffsetX,c="horizontal"==r?l.eq(0).outerHeight()-o.styles.pageOffsetY:a.height-o.styles.pageOffsetY,d="horizontal"==r?0:h,u="horizontal"==r?c:0,p=$(".ilightbox-active",i),f={};arguments.length<3&&(l.css({opacity:o.thumbnails.normalOpacity}),p.css({opacity:o.thumbnails.activeOpacity})),l.each(function(t){var e=$(this),i=e.data(),n="horizontal"==r?0:o.thumbnails.maxWidth;height="horizontal"==r?o.thumbnails.maxHeight:0,dims=s.getNewDimenstions(n,height,i.naturalWidth,i.naturalHeight,!0),e.css({width:dims.width,height:dims.height}),"horizontal"==r&&e.css({float:"left"}),"horizontal"==r?d+=e.outerWidth():u+=e.outerHeight()}),f={width:d,height:u},i.css(f),f={};var g=i.offset(),m=p.length?p.offset():{top:parseInt(c/2),left:parseInt(h/2)};g.top=g.top-$doc.scrollTop(),g.left=g.left-$doc.scrollLeft(),m.top=m.top-g.top-$doc.scrollTop(),m.left=m.left-g.left-$doc.scrollLeft(),"horizontal"==r?(f.top=0,f.left=parseInt(h/2-m.left-p.outerWidth()/2)):(f.top=parseInt(c/2-m.top-p.outerHeight()/2),f.left=0),arguments.length<3?i.stop().animate(f,o.effects.repositionSpeed,"easeOutCirc"):i.css(f)},loadImage:function(t,e){$.isArray(t)||(t=[t]);var i=this,s=t.length;s>0?(i.showLoader(),$.each(t,function(n,o){var a=new Image;a.onload=function(){0==(s-=1)&&(i.hideLoader(),e(a))},a.onerror=a.onabort=function(){0==(s-=1)&&(i.hideLoader(),e(!1))},a.src=t[n]})):e(!1)},patchItemsEvents:function(){var t=this,e=t.vars,i=supportTouch?"itap.iL":"click.iL",s=supportTouch?"click.iL":"itap.iL";if(t.context&&t.selector){var n=$(t.selector,t.context);$(t.context).on(i,t.selector,function(){var i=$(this),s=n.index(i);return e.current=s,e.next=t.items[s+1]?s+1:null,e.prev=t.items[s-1]?s-1:null,t.addContents(),t.patchEvents(),!1}).on(s,t.selector,function(){return!1})}else $.each(t.itemsObject,function(n,o){o.on(i,function(){return e.current=n,e.next=t.items[n+1]?n+1:null,e.prev=t.items[n-1]?n-1:null,t.addContents(),t.patchEvents(),!1}).on(s,function(){return!1})})},dispatchItemsEvents:function(){var t=this;t.vars,t.options;t.context&&t.selector?$(t.context).off(".iL",t.selector):$.each(t.itemsObject,function(t,e){e.off(".iL")})},refresh:function(){this.dispatchItemsEvents(),this.attachItems(),this.normalizeItems(),this.patchItemsEvents()},patchEvents:function(){var t=this,e=t.vars,i=t.options,s=i.path.toLowerCase(),n=$(".ilightbox-holder"),o=fullScreenApi.fullScreenEventName+".iLightBox",a=verticalDistanceThreshold=100,r=[e.nextButton[0],e.prevButton[0],e.nextButton[0].firstChild,e.prevButton[0].firstChild];$win.bind("resize.iLightBox",function(){var s=getViewport();i.mobileOptimizer&&!i.innerToolbar&&(e.isMobile=s.width<=e.mobileMaxWidth),e.BODY[e.isMobile?"addClass":"removeClass"]("isMobile"),t.repositionPhoto(null),supportTouch&&(clearTimeout(e.setTime),e.setTime=setTimeout(function(){var t=getScrollXY().y;window.scrollTo(0,t-30),window.scrollTo(0,t+30),window.scrollTo(0,t)},2e3)),e.thumbs&&t.positionThumbnails()}).bind("keydown.iLightBox",function(s){if(i.controls.keyboard)switch(s.keyCode){case 13:s.shiftKey&&i.keyboard.shift_enter&&t.fullScreenAction();break;case 27:i.keyboard.esc&&t.closeAction();break;case 37:i.keyboard.left&&!e.lockKey&&t.moveTo("prev");break;case 38:i.keyboard.up&&!e.lockKey&&t.moveTo("prev");break;case 39:i.keyboard.right&&!e.lockKey&&t.moveTo("next");break;case 40:i.keyboard.down&&!e.lockKey&&t.moveTo("next")}}),fullScreenApi.supportsFullScreen&&$win.bind(o,function(){t.doFullscreen()});var l=[i.caption.show+".iLightBox",i.caption.hide+".iLightBox",i.social.show+".iLightBox",i.social.hide+".iLightBox"].filter(function(t,e,i){return i.lastIndexOf(t)===e}),h="";$.each(l,function(t,e){0!=t&&(h+=" "),h+=e}),$doc.on(clickEvent,".ilightbox-overlay",function(){i.overlay.blur&&t.closeAction()}).on(clickEvent,".ilightbox-next, .ilightbox-next-button",function(){t.moveTo("next")}).on(clickEvent,".ilightbox-prev, .ilightbox-prev-button",function(){t.moveTo("prev")}).on(clickEvent,".ilightbox-thumbnail",function(){var i=$(this),s=$(".ilightbox-thumbnail",e.thumbnails).index(i);s!=e.current&&t.goTo(s)}).on(h,".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(t){var s=$("div.ilightbox-caption",e.holder),n=$("div.ilightbox-social",e.holder),o=i.effects.fadeSpeed;e.nextLock||e.prevLock?(t.type!=i.caption.show||s.is(":visible")?t.type==i.caption.hide&&s.is(":visible")&&s.fadeOut(o):s.fadeIn(o),t.type!=i.social.show||n.is(":visible")?t.type==i.social.hide&&n.is(":visible")&&n.fadeOut(o):n.fadeIn(o)):(t.type!=i.caption.show||s.is(":visible")?t.type==i.caption.hide&&s.is(":visible")&&s.stop().fadeOut(o):s.stop().fadeIn(o),t.type!=i.social.show||n.is(":visible")?t.type==i.social.hide&&n.is(":visible")&&n.stop().fadeOut(o):n.stop().fadeIn(o))}).on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-wrapper",function(t){"mouseenter"==t.type?e.lockWheel=!0:e.lockWheel=!1}).on(clickEvent,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause",function(){var e=$(this);e.hasClass("ilightbox-fullscreen")?t.fullScreenAction():e.hasClass("ilightbox-play")?(t.resume(),e.addClass("ilightbox-pause").removeClass("ilightbox-play")):e.hasClass("ilightbox-pause")?(t.pause(),e.addClass("ilightbox-play").removeClass("ilightbox-pause")):t.closeAction()}).on(touchMoveEvent,".ilightbox-overlay, .ilightbox-thumbnails-container",function(t){t.preventDefault()}),i.controls.arrows&&!supportTouch&&$doc.on("mousemove.iLightBox",function(t){e.isMobile||(e.mouseID||e.hideableElements.show(),e.mouseID=clearTimeout(e.mouseID),-1===r.indexOf(t.target)&&(e.mouseID=setTimeout(function(){e.hideableElements.hide(),e.mouseID=clearTimeout(e.mouseID)},3e3)))}),i.controls.slideshow&&i.slideshow.pauseOnHover&&$doc.on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(i){"mouseenter"==i.type&&e.cycleID?t.pause():"mouseleave"==i.type&&e.isPaused&&t.resume()});var c=$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails");i.controls.mousewheel&&c.on("mousewheel.iLightBox",function(i,s){e.lockWheel||(i.preventDefault(),s<0?t.moveTo("next"):s>0&&t.moveTo("prev"))}),i.controls.swipe&&n.on(touchStartEvent,function(o){if(!(e.nextLock||e.prevLock||1==e.total||e.lockSwipe)){e.BODY.addClass("ilightbox-closedhand");var r,l=o.originalEvent.touches?o.originalEvent.touches[0]:o,h=$doc.scrollTop(),c=$doc.scrollLeft(),d=[n.eq(0).offset(),n.eq(1).offset(),n.eq(2).offset()],u=[{top:d[0].top-h,left:d[0].left-c},{top:d[1].top-h,left:d[1].left-c},{top:d[2].top-h,left:d[2].left-c}],p={time:(new Date).getTime(),coords:[l.pageX-c,l.pageY-h]};n.bind(touchMoveEvent,g),$doc.one(touchStopEvent,function(o){n.unbind(touchMoveEvent,g),e.BODY.removeClass("ilightbox-closedhand"),p&&r&&("horizontal"==s&&r.time-p.time<1e3&&abs(p.coords[0]-r.coords[0])>a&&abs(p.coords[1]-r.coords[1])r.coords[0]?e.current!=e.total-1||i.infinite?(e.isSwipe=!0,t.moveTo("next")):m():0!=e.current||i.infinite?(e.isSwipe=!0,t.moveTo("prev")):m():"vertical"==s&&r.time-p.time<1e3&&abs(p.coords[1]-r.coords[1])>a&&abs(p.coords[0]-r.coords[0])r.coords[1]?e.current!=e.total-1||i.infinite?(e.isSwipe=!0,t.moveTo("next")):m():0!=e.current||i.infinite?(e.isSwipe=!0,t.moveTo("prev")):m():m()),p=r=undefined})}function f(t){var e=$(this),i=u[t],n=[p.coords[0]-r.coords[0],p.coords[1]-r.coords[1]];e[0].style["horizontal"==s?"left":"top"]=("horizontal"==s?i.left-n[0]:i.top-n[1])+"px"}function g(t){if(p){var e=t.originalEvent.touches?t.originalEvent.touches[0]:t;r={time:(new Date).getTime(),coords:[e.pageX-c,e.pageY-h]},n.each(f),t.preventDefault()}}function m(){n.each(function(){var t=$(this),e=t.data("offset")||{top:t.offset().top-h,left:t.offset().left-c},i=e.top,s=e.left;t.css(transform,gpuAcceleration).stop().animate({top:i,left:s},500,"easeOutCirc",function(){t.css(transform,"")})})}})},goTo:function(t){var e=this,i=e.vars,s=e.options,n=t-i.current;if(s.infinite&&(t==i.total-1&&0==i.current&&(n=-1),i.current==i.total-1&&0==t&&(n=1)),1==n)e.moveTo("next");else if(-1==n)e.moveTo("prev");else{if(i.nextLock||i.prevLock)return!1;"function"==typeof s.callback.onBeforeChange&&s.callback.onBeforeChange.call(e,e.ui),s.linkId&&(i.hashLock=!0,window.location.hash=s.linkId+"/"+t),e.items[t]&&(e.items[t].options.mousewheel?e.vars.lockWheel=!1:i.lockWheel=!0,e.items[t].options.swipe?i.lockSwipe=!1:i.lockSwipe=!0),$.each([i.holder,i.nextPhoto,i.prevPhoto],function(t,e){e.css(transform,gpuAcceleration).fadeOut(s.effects.loadedFadeSpeed)}),i.current=t,i.next=t+1,i.prev=t-1,e.createUI(),setTimeout(function(){e.generateBoxes()},s.effects.loadedFadeSpeed+50),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(t).addClass("ilightbox-active"),e.positionThumbnails(),s.linkId&&setTimeout(function(){i.hashLock=!1},55),s.infinite||(i.nextButton.add(i.prevButton).add(i.innerPrevButton).add(i.innerNextButton).removeClass("disabled"),0==i.current&&i.prevButton.add(i.innerPrevButton).addClass("disabled"),i.current>=i.total-1&&i.nextButton.add(i.innerNextButton).addClass("disabled")),e.resetCycle(),"function"==typeof s.callback.onAfterChange&&s.callback.onAfterChange.call(e,e.ui)}},moveTo:function(t){var e=this,i=e.vars,s=e.options,n=s.path.toLowerCase(),o=getViewport(),a=s.effects.switchSpeed;if(i.nextLock||i.prevLock)return!1;var r="next"==t?i.next:i.prev;if(s.linkId&&(i.hashLock=!0,window.location.hash=s.linkId+"/"+r),"next"==t){if(!e.items[r])return!1;var l=i.nextPhoto,h=i.holder,c=i.prevPhoto,d="ilightbox-prev",u="ilightbox-next"}else if("prev"==t){if(!e.items[r])return!1;l=i.prevPhoto,h=i.holder,c=i.nextPhoto,d="ilightbox-next",u="ilightbox-prev"}"function"==typeof s.callback.onBeforeChange&&s.callback.onBeforeChange.call(e,e.ui),"next"==t?i.nextLock=!0:i.prevLock=!0;var p=$("div.ilightbox-caption",h),f=$("div.ilightbox-social",h);if(p.length&&p.stop().fadeOut(a,function(){$(this).remove()}),f.length&&f.stop().fadeOut(a,function(){$(this).remove()}),e.items[r].caption){e.setCaption(e.items[r],l);var g=$("div.ilightbox-caption",l),m=parseInt(g.outerHeight()/l.outerHeight()*100);s.caption.start&&m<=50&&g.fadeIn(a)}var v=e.items[r].options.social;v&&(e.setSocial(v,e.items[r].URL,l),s.social.start&&$("div.ilightbox-social",l).fadeIn(s.effects.fadeSpeed)),$.each([l,h,c],function(t,e){e.removeClass("ilightbox-next ilightbox-prev")});var y=l.data("offset"),b=o.width-s.styles.pageOffsetX,w=o.height-s.styles.pageOffsetY,x=y.newDims.width,S=y.newDims.height,C=y.thumbsOffset,_=y.diff,T=parseInt(w/2-S/2-_.H-C.H/2),I=parseInt(b/2-x/2-_.W-C.W/2);l.css(transform,gpuAcceleration).animate({top:T,left:I,opacity:1},a,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){l.css(transform,"")}),$("div.ilightbox-container",l).animate({width:x,height:S},a,i.isSwipe?"easeOutCirc":"easeInOutCirc");var k=h.data("offset"),L=k.object;_=k.diff,x=k.newDims.width,S=k.newDims.height,x=parseInt(x*s.styles["next"==t?"prevScale":"nextScale"]),S=parseInt(S*s.styles["next"==t?"prevScale":"nextScale"]),T="horizontal"==n?parseInt(w/2-L.offsetY-S/2-_.H-C.H/2):parseInt(w-L.offsetX-_.H-C.H/2),"prev"==t?I="horizontal"==n?parseInt(b-L.offsetX-_.W-C.W/2):parseInt(b/2-x/2-_.W-L.offsetY-C.W/2):(T="horizontal"==n?T:parseInt(L.offsetX-_.H-S-C.H/2),I="horizontal"==n?parseInt(L.offsetX-_.W-x-C.W/2):parseInt(b/2-L.offsetY-x/2-_.W-C.W/2)),$("div.ilightbox-container",h).animate({width:x,height:S},a,i.isSwipe?"easeOutCirc":"easeInOutCirc"),h.addClass(d).css(transform,gpuAcceleration).animate({top:T,left:I,opacity:s.styles.prevOpacity},a,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){h.css(transform,""),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(r).addClass("ilightbox-active"),e.positionThumbnails(),e.items[r]&&(e.items[r].options.mousewheel?i.lockWheel=!1:i.lockWheel=!0,e.items[r].options.swipe?i.lockSwipe=!1:i.lockSwipe=!0),i.isSwipe=!1,"next"==t?(i.nextPhoto=c,i.prevPhoto=h,i.holder=l,i.nextPhoto.hide(),i.next=i.next+1,i.prev=i.current,i.current=i.current+1,s.infinite&&(i.current>i.total-1&&(i.current=0),i.current==i.total-1&&(i.next=0),0==i.current&&(i.prev=i.total-1)),e.createUI(),e.items[i.next]?e.loadContent(e.items[i.next],"next"):i.nextLock=!1):(i.prevPhoto=c,i.nextPhoto=h,i.holder=l,i.prevPhoto.hide(),i.next=i.current,i.current=i.prev,i.prev=i.current-1,s.infinite&&(i.current==i.total-1&&(i.next=0),0==i.current&&(i.prev=i.total-1)),e.createUI(),e.items[i.prev]?e.loadContent(e.items[i.prev],"prev"):i.prevLock=!1),s.linkId&&setTimeout(function(){i.hashLock=!1},55),s.infinite||(i.nextButton.add(i.prevButton).add(i.innerPrevButton).add(i.innerNextButton).removeClass("disabled"),0==i.current&&i.prevButton.add(i.innerPrevButton).addClass("disabled"),i.current>=i.total-1&&i.nextButton.add(i.innerNextButton).addClass("disabled")),e.repositionPhoto(),e.resetCycle(),"function"==typeof s.callback.onAfterChange&&s.callback.onAfterChange.call(e,e.ui)}),T="horizontal"==n?getPixel(c,"top"):"next"==t?parseInt(-w/2-c.outerHeight()):parseInt(2*T),I="horizontal"==n?"next"==t?parseInt(-b/2-c.outerWidth()):parseInt(2*I):getPixel(c,"left"),c.css(transform,gpuAcceleration).animate({top:T,left:I,opacity:s.styles.nextOpacity},a,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){c.css(transform,"")}).addClass(u)},setCaption:function(t,e){var i=$('
');t.caption&&(i.html(t.caption),$("div.ilightbox-container",e).append(i))},normalizeSocial:function(t,e){this.vars;var i=this.options,s=window.location.href;return $.each(t,function(n,o){if(!o)return!0;var a,r;switch(n.toLowerCase()){case"facebook":a="https://www.facebook.com/share.php?v=4&src=bm&u={URL}",r="Share on Facebook";break;case"twitter":a="https://twitter.com/home?status={URL}",r="Share on Twitter";break;case"googleplus":a="https://plus.google.com/share?url={URL}",r="Share on Google+";break;case"delicious":a="https://delicious.com/post?url={URL}",r="Share on Delicious";break;case"digg":a="https://digg.com/submit?phase=2&url={URL}",r="Share on Digg";break;case"reddit":a="https://reddit.com/submit?url={URL}",r="Share on reddit"}t[n]={URL:o.URL&&absolutizeURI(s,o.URL)||i.linkId&&window.location.href||"string"!=typeof e&&s||e&&absolutizeURI(s,e)||s,source:o.source||a||o.URL&&absolutizeURI(s,o.URL)||e&&absolutizeURI(s,e),text:o.text||r||"Share on "+n,width:void 0===o.width||isNaN(o.width)?640:parseInt(o.width),height:o.height||360}}),t},setSocial:function(t,e,i){var s=$('
'),n="
    ";t=this.normalizeSocial(t,e),$.each(t,function(t,e){t.toLowerCase();var i=e.source.replace(/\{URL\}/g,encodeURIComponent(e.URL).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+"));n+='
  • '}),n+="
",s.html(n),$("div.ilightbox-container",i).append(s)},fullScreenAction:function(){this.vars;fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen(document.documentElement):fullScreenApi.requestFullScreen(document.documentElement):this.doFullscreen()},doFullscreen:function(){var t=this,e=t.vars,i=getViewport(),s=t.options;if(s.fullAlone){var n=e.holder,o=t.items[e.current],a=i.width,r=i.height,l=[n,e.nextPhoto,e.prevPhoto,e.nextButton,e.prevButton,e.overlay,e.toolbar,e.thumbnails,e.loader],h=[e.nextPhoto,e.prevPhoto,e.nextButton,e.prevButton,e.loader,e.thumbnails];if(e.isInFullScreen)e.isInFullScreen=e.lockKey=e.lockWheel=e.lockSwipe=!1,e.overlay.css({opacity:t.options.overlay.opacity}),$.each(h,function(t,e){e.show()}),e.fullScreenButton.attr("title",s.text.enterFullscreen),n.data({naturalWidth:n.data("naturalWidthOld"),naturalHeight:n.data("naturalHeightOld"),naturalWidthOld:null,naturalHeightOld:null}),$.each(l,function(t,e){e.removeClass("ilightbox-fullscreen")}),"function"==typeof s.callback.onExitFullScreen&&s.callback.onExitFullScreen.call(t,t.ui);else{if(e.isInFullScreen=e.lockKey=e.lockWheel=e.lockSwipe=!0,e.overlay.css({opacity:1}),$.each(h,function(t,e){e.hide()}),e.fullScreenButton.attr("title",s.text.exitFullscreen),-1!=s.fullStretchTypes.indexOf(o.type))n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:a,naturalHeight:r});else{i=o.options.fullViewPort||s.fullViewPort||"";var c=a,d=r,u=n.data("naturalWidth"),p=n.data("naturalHeight");if("fill"==i.toLowerCase())(d=c/u*p)c||p>d;c=(f=t.getNewDimenstions(c,d,u,p,g)).width,d=f.height}n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:c,naturalHeight:d})}$.each(l,function(t,e){e.addClass("ilightbox-fullscreen")}),"function"==typeof s.callback.onEnterFullScreen&&s.callback.onEnterFullScreen.call(t,t.ui)}}else e.isInFullScreen?e.isInFullScreen=!1:e.isInFullScreen=!0;t.repositionPhoto(!0)},closeAction:function(){var t=this.vars,e=this.options;$win.unbind(".iLightBox"),$doc.off(".iLightBox"),t.isInFullScreen&&fullScreenApi.cancelFullScreen(document.documentElement),$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails").off(".iLightBox"),e.hide.effect?t.overlay.stop().fadeOut(e.hide.speed,function(){t.overlay.remove(),t.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")}):(t.overlay.remove(),t.BODY.removeClass("ilightbox-noscroll").off(".iLightBox"));var i=[t.toolbar,t.holder,t.nextPhoto,t.prevPhoto,t.nextButton,t.prevButton,t.loader,t.thumbnails];$.each(i,function(t,e){e.removeAttr("style").remove()}),t.dontGenerateThumbs=t.isInFullScreen=!1,window.iLightBox=null,e.linkId&&(t.hashLock=!0,removeHash(),setTimeout(function(){t.hashLock=!1},55)),"function"==typeof e.callback.onHide&&e.callback.onHide.call(this,this.ui)},repositionPhoto:function(){var t=this,e=t.vars,i=t.options,s=i.path.toLowerCase(),n=getViewport(),o=n.width,a=n.height,r=e.isInFullScreen&&i.fullAlone||e.isMobile?0:"horizontal"==s?0:e.thumbnails.outerWidth(),l=e.isMobile?e.toolbar.outerHeight():e.isInFullScreen&&i.fullAlone?0:"horizontal"==s?e.thumbnails.outerHeight():0,h=e.isInFullScreen&&i.fullAlone?o:o-i.styles.pageOffsetX,c=e.isInFullScreen&&i.fullAlone?a:a-i.styles.pageOffsetY,d="horizontal"==s?parseInt(t.items[e.next]||t.items[e.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):h/10<=30?30:h/10):parseInt(h/10<=30?30:h/10)+r,u="horizontal"==s?parseInt(c/10<=30?30:c/10)+l:parseInt(t.items[e.next]||t.items[e.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):c/10<=30?30:c/10),p={type:"current",width:h,height:c,item:t.items[e.current],offsetW:d,offsetH:u,thumbsOffsetW:r,thumbsOffsetH:l,animate:arguments.length,holder:e.holder};t.repositionEl(p),t.items[e.next]&&(p=$.extend(p,{type:"next",item:t.items[e.next],offsetX:i.styles.nextOffsetX,offsetY:i.styles.nextOffsetY,holder:e.nextPhoto}),t.repositionEl(p)),t.items[e.prev]&&(p=$.extend(p,{type:"prev",item:t.items[e.prev],offsetX:i.styles.prevOffsetX,offsetY:i.styles.prevOffsetY,holder:e.prevPhoto}),t.repositionEl(p));var f="horizontal"==s?{left:parseInt(h/2-e.loader.outerWidth()/2)}:{top:parseInt(c/2-e.loader.outerHeight()/2)};e.loader.css(f)},repositionEl:function(t){var e=this.vars,i=this.options,s=i.path.toLowerCase(),n="current"==t.type&&e.isInFullScreen&&i.fullAlone?t.width:t.width-t.offsetW,o="current"==t.type&&e.isInFullScreen&&i.fullAlone?t.height:t.height-t.offsetH,a=t.item,r=t.item.options,l=t.holder,h=t.offsetX||0,c=t.offsetY||0,d=t.thumbsOffsetW,u=t.thumbsOffsetH;"current"==t.type?("number"==typeof r.width&&r.width&&(n=e.isInFullScreen&&i.fullAlone&&(-1!=i.fullStretchTypes.indexOf(a.type)||r.fullViewPort||i.fullViewPort)?n:r.width>n?n:r.width),"number"==typeof r.height&&r.height&&(o=e.isInFullScreen&&i.fullAlone&&(-1!=i.fullStretchTypes.indexOf(a.type)||r.fullViewPort||i.fullViewPort)?o:r.height>o?o:r.height)):("number"==typeof r.width&&r.width&&(n=r.width>n?n:r.width),"number"==typeof r.height&&r.height&&(o=r.height>o?o:r.height)),o=parseInt(o-$(".ilightbox-inner-toolbar",l).outerHeight());var p="string"==typeof r.width&&-1!=r.width.indexOf("%")?percentToValue(parseInt(r.width.replace("%","")),t.width):l.data("naturalWidth"),f="string"==typeof r.height&&-1!=r.height.indexOf("%")?percentToValue(parseInt(r.height.replace("%","")),t.height):l.data("naturalHeight"),g="string"==typeof r.width&&-1!=r.width.indexOf("%")||"string"==typeof r.height&&-1!=r.height.indexOf("%")?{width:p,height:f}:this.getNewDimenstions(n,o,p,f),m=$.extend({},g,{});"prev"==t.type||"next"==t.type?(p=parseInt(g.width*("next"==t.type?i.styles.nextScale:i.styles.prevScale)),f=parseInt(g.height*("next"==t.type?i.styles.nextScale:i.styles.prevScale))):(p=g.width,f=g.height);var v=parseInt((getPixel(l,"padding-left")+getPixel(l,"padding-right")+getPixel(l,"border-left-width")+getPixel(l,"border-right-width"))/2),y=parseInt((getPixel(l,"padding-top")+getPixel(l,"padding-bottom")+getPixel(l,"border-top-width")+getPixel(l,"border-bottom-width")+$(".ilightbox-inner-toolbar",l).outerHeight())/2);switch(t.type){case"current":var b=parseInt(t.height/2-f/2-y-u/2),w=parseInt(t.width/2-p/2-v-d/2);break;case"next":b="horizontal"==s?parseInt(t.height/2-c-f/2-y-u/2):parseInt(t.height-h-y-u/2),w="horizontal"==s?parseInt(t.width-h-v-d/2):parseInt(t.width/2-p/2-v-c-d/2);break;case"prev":b="horizontal"==s?parseInt(t.height/2-c-f/2-y-u/2):parseInt(h-y-f-u/2),w="horizontal"==s?parseInt(h-v-p-d/2):parseInt(t.width/2-c-p/2-v-d/2)}l.data("offset",{top:b,left:w,newDims:m,diff:{W:v,H:y},thumbsOffset:{W:d,H:u},object:t}),t.animate>0&&i.effects.reposition?(l.css(transform,gpuAcceleration).stop().animate({top:b,left:w},i.effects.repositionSpeed,"easeOutCirc",function(){l.css(transform,"")}),$("div.ilightbox-container",l).stop().animate({width:p,height:f},i.effects.repositionSpeed,"easeOutCirc"),$("div.ilightbox-inner-toolbar",l).stop().animate({width:p},i.effects.repositionSpeed,"easeOutCirc",function(){$(this).css("overflow","visible")})):(l.css({top:b,left:w}),$("div.ilightbox-container",l).css({width:p,height:f}),$("div.ilightbox-inner-toolbar",l).css({width:p}))},resume:function(t){var e=this,i=e.vars,s=e.options;!s.slideshow.pauseTime||s.controls.slideshow&&i.total<=1||to.options.maxScale?factor=o.options.maxScale:factor=0,html5H264:!(!t.canPlayType||!t.canPlayType("video/mp4").replace(/no/,"")),html5WebM:!(!t.canPlayType||!t.canPlayType("video/webm").replace(/no/,"")),html5Vorbis:!(!t.canPlayType||!t.canPlayType("video/ogg").replace(/no/,"")),html5QuickTime:!(!t.canPlayType||!t.canPlayType("video/quicktime").replace(/no/,""))}},addContent:function(t,e){var i=this;switch(e.type){case"video":var s=!1,n=e.videoType,o=e.options.html5video;("video/mp4"==n||"mp4"==e.ext||"m4v"==e.ext||o.h264)&&i.plugins.html5H264?(e.ext="mp4",e.URL=o.h264||e.URL):o.webm&&i.plugins.html5WebM?(e.ext="webm",e.URL=o.webm||e.URL):o.ogg&&i.plugins.html5Vorbis&&(e.ext="ogv",e.URL=o.ogg||e.URL),!i.plugins.html5H264||"video/mp4"!=n&&"mp4"!=e.ext&&"m4v"!=e.ext?!i.plugins.html5WebM||"video/webm"!=n&&"webm"!=e.ext?!i.plugins.html5Vorbis||"video/ogg"!=n&&"ogv"!=e.ext?!i.plugins.html5QuickTime||"video/quicktime"!=n&&"mov"!=e.ext&&"qt"!=e.ext||(s=!0,n="video/quicktime"):(s=!0,n="video/ogg"):(s=!0,n="video/webm"):(s=!0,n="video/mp4"),s?l=$("