!function(e,t,n){var c,l,m,w,y={flash:["swf"],image:["bmp","gif","jpeg","jpg","png","tiff","tif","jfif","jpe","webp"],iframe:["asp","aspx","cgi","cfm","htm","html","jsp","php","pl","php3","php4","php5","phtml","rb","rhtml","shtml","txt"],video:["avi","mov","mpg","mpeg","movie","mp4","webm","ogv","ogg","3gp","m4v"]},b=e(t),i=e(document),s="",L=navigator.userAgent||navigator.vendor||t.opera,a="ontouchstart"in t||navigator.msMaxTouchPoints,Y=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(L)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(L.substr(0,4)),d=a?"click itap":"click",q=a?"mousedown.iLightBox touchstart.iLightBox":"mousedown.iLightBox",P=a?"mouseup.iLightBox touchend.iLightBox":"mouseup.iLightBox",A=a?"mousemove.iLightBox touchmove.iLightBox":"mousemove.iLightBox",f=Math.abs,j=Math.sqrt,E=Math.round,R=Math.max,S=Math.min,g=Math.floor,O=Math.random,x={quicktime:"http://www.apple.com/quicktime/download",flash:"http://www.adobe.com/go/getflash"},N=function(t,n,s,o){var r,i=this;(i.options=n,i.selector=t.selector||t,i.context=t.context,i.instant=o,s.length<1?i.attachItems():i.items=s,i.vars={total:i.items.length,start:0,current:null,next:null,prev:null,BODY:e("body"),loadRequests:0,overlay:e('
'),loader:e('
'),toolbar:e('
'),innerToolbar:e('
'),title:e('
'),closeButton:e(''),fullScreenButton:e(''),innerPlayButton:e(''),innerNextButton:e(''),innerPrevButton:e(''),holder:e('
'),nextPhoto:e('
'),prevPhoto:e('
'),nextButton:e(''),prevButton:e(''),thumbnails:e('
'),thumbs:!1,nextLock:!1,prevLock:!1,hashLock:!1,isMobile:!1,mobileMaxWidth:980,isInFullScreen:!1,isSwipe:!1,mouseID:0,cycleID:0,isPaused:0},i.vars.hideableElements=i.vars.nextButton.add(i.vars.prevButton),i.normalizeItems(),i.availPlugins(),i.options.startFrom=i.options.startFrom>0&&i.options.startFrom>=i.vars.total?i.vars.total-1:i.options.startFrom,i.options.startFrom=i.options.randomStart?g(O()*i.vars.total):i.options.startFrom,i.vars.start=i.options.startFrom,o?i.instantCall():i.patchItemsEvents(),i.options.linkId&&(i.hashChangeHandler(),b.iLightBoxHashChange(function(){i.hashChangeHandler()})),a)&&(r=/(click|mouseenter|mouseleave|mouseover|mouseout)/gi,i.options.caption.show=i.options.caption.show.replace(r,"itap"),i.options.caption.hide=i.options.caption.hide.replace(r,"itap"),i.options.social.show=i.options.social.show.replace(r,"itap"),i.options.social.hide=i.options.social.hide.replace(r,"itap")),i.options.controls.arrows&&e.extend(i.options.styles,{nextOffsetX:0,prevOffsetX:0,nextOpacity:0,prevOpacity:0})};function u(e,t){return parseInt(e.css(t),10)||0}function X(e,t,n){return en?n:e}function p(){var e=t,n="inner";return"innerWidth"in t||(n="client",e=document.documentElement||document.body),{width:e[n+"Width"],height:e[n+"Height"]}}function H(){history&&history.pushState&&history.pushState("",document.title,t.location.pathname+t.location.search)}function B(t,n){t="http://ilightbox.net/getSource/jsonp.php?url="+encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),e.ajax({url:t,dataType:"jsonp"}),iLCallback=function(e){n.call(this,e)}}function _(t){var s=e("*",t),n=new Array;return s.each(function(){if(t="","none"!=e(this).css("background-image")?t=e(this).css("background-image"):0[0]!==e(this).attr("src")&&"img"==this.nodeName.toLowerCase()&&(t=e(this).attr("src")),-1==t.indexOf("gradient"))for(var t,i,o=(t=(t=(t=(t=t.replace(/url\("/g,"")).replace(/url\(/g,"")).replace(/"\)/g,"")).replace(/\)/g,"")).split(","),s=0;s0&&-1==e.inArray(o[s],n)&&(i="",l.msie&&l.version<9&&(i="?"+g(3e3*O())),n.push(o[s]+i))}),n}function T(e){var t=e.split(".").pop().toLowerCase(),n=-1!==t.indexOf("?")?"?"+t.split("?").pop():"";return t.replace(n,"")}function z(e){var t=T(e);return-1!==y.image.indexOf(t)?"image":-1!==y.flash.indexOf(t)?"flash":-1!==y.video.indexOf(t)?"video":"iframe"}function D(e,t){return parseInt(t/100*e)}function C(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function v(e,t){var n,s;return t=C(t||""),e=C(e||""),t&&e?(t.protocol||e.protocol)+(t.protocol||t.authority?t.authority:e.authority)+(s=t.protocol||t.authority||"/"===t.pathname.charAt(0)?t.pathname:t.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("../index.html")+1)+t.pathname:e.pathname,n=[],s.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"../index.html").replace(/\/\.\.$/,"/../").replace(/\/?[^/]*/g,function(e){"/.."===e?n.pop():n.push(e)}),n.join("").replace(/^\//,"/"===s.charAt(0)?"/":""))+(t.protocol||t.authority||t.pathname?t.search:t.search||e.search)+t.hash:null}function U(e,t,n){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var i,s=0,o=0,c={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},a=function(e){return(e=(e=(""+e).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?e.split("."):[-8]},r=function(e){return e?isNaN(e)?c[e]||-7:parseInt(e,10):0};for(e=a(e),t=a(t),i=R(e.length,t.length),s=0;st[s]){o=1;break}}if(!n)return o;switch(n){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 k(){var e=0,n=0;return"number"==typeof t.pageYOffset?(n=t.pageYOffset,e=t.pageXOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(n=document.body.scrollTop,e=document.body.scrollLeft):document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)&&(n=document.documentElement.scrollTop,e=document.documentElement.scrollLeft),{x:e,y:n}}N.prototype={showLoader:function(){var e=this;e.vars.loadRequests+=1,"horizontal"==e.options.path.toLowerCase()?e.vars.loader.addClass("ilightbox-show").stop().animate({top:"-30px"},e.options.show.speed,"easeOutCirc"):e.vars.loader.addClass("ilightbox-show").stop().animate({left:"-30px"},e.options.show.speed,"easeOutCirc")},hideLoader:function(){var e=this;e.vars.loadRequests-=1,e.vars.loadRequests=e.vars.loadRequests<0?0:e.vars.loadRequests,"horizontal"==e.options.path.toLowerCase()?e.vars.loadRequests<=0&&e.vars.loader.removeClass("ilightbox-show").stop().animate({top:"-192px"},e.options.show.speed,"easeInCirc"):e.vars.loadRequests<=0&&e.vars.loader.removeClass("ilightbox-show").stop().animate({left:"-192px"},e.options.show.speed,"easeInCirc")},createUI:function(){var e=this;e.ui={currentElement:e.vars.holder,nextElement:e.vars.nextPhoto,prevElement:e.vars.prevPhoto,currentItem:e.vars.current,nextItem:e.vars.next,prevItem:e.vars.prev,hide:function(){e.closeAction()},refresh:function(){arguments.length>0?e.repositionPhoto(!0):e.repositionPhoto()},fullscreen:function(){e.fullScreenAction()}}},attachItems:function(){var t=this,s=new Array,n=new Array;e(t.selector,t.context).each(function(){var o=e(this),i=o.attr(t.options.attr)||null,a=o.data("options")&&eval("({"+o.data("options")+"})")||{},r=o.data("caption"),c=o.data("title"),l=o.data("type")||z(i);n.push({URL:i,caption:r,title:c,type:l,options:a}),t.instant||s.push(o)}),t.items=n,t.itemsObject=s,t.vars&&(t.vars.total=n.length)},normalizeItems:function(){var t=this,n=new Array;e.each(t.items,function(s,o){"string"==typeof o&&(o={url:o});var c,a=o.url||o.URL||null,i=o.options||{},l=o.caption||null,d=o.title||null,r=o.type?o.type.toLowerCase():z(a),u="object"!=typeof a?T(a):"";(i.thumbnail=i.thumbnail||("image"==r?a:null),i.videoType=i.videoType||null,i.skin=i.skin||t.options.skin,i.width=i.width||null,i.height=i.height||null,i.mousewheel=0[0]===i.mousewheel||i.mousewheel,i.swipe=0[0]===i.swipe||i.swipe,i.social=0[0]!==i.social?i.social:t.options.social.buttons&&e.extend({},{},t.options.social.buttons),"video"==r&&(i.html5video=0[0]!==i.html5video?i.html5video:{},i.html5video.webm=i.html5video.webm||i.html5video.WEBM||null,i.html5video.controls=0[0]!==i.html5video.controls?i.html5video.controls:"controls",i.html5video.preload=i.html5video.preload||"metadata",i.html5video.autoplay=0[0]!==i.html5video.autoplay&&i.html5video.autoplay),"iframe"===r)&&(-1!==a.indexOf("youtube.com")?(c=a.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/),c&&11===c[7].length&&(i.thumbnail="//img.youtube.com/vi/"+c[7]+"/mqdefault.jpg")):-1!==a.indexOf("vimeo.com")&&($videoID=a.split(/[?#]/)[0].replace(/[^\d]/g,""),e.getJSON("https://vimeo.com/api/oembed.json?url=https://vimeo.com/"+$videoID,{format:"json"},function(e){i.thumbnail=e.thumbnail_url}))),i.width&&i.height||"video"!==r&&"iframe"!==r&&"flash"!==r||(i.width=parseInt(fusionLightboxVideoVars.lightbox_video_width),i.height=parseInt(fusionLightboxVideoVars.lightbox_video_height)),delete o.url,o.index=s,o.URL=a,o.caption=l,o.title=d,o.type=r,o.options=i,o.ext=u,n.push(o)}),t.items=n},instantCall:function(){var e=this,t=e.vars.start;e.vars.current=t,e.vars.next=e.items[t+1]?t+1:null,e.vars.prev=e.items[t-1]?t-1:null,e.addContents(),e.patchEvents()},addContents:function(){var c,l,o=this,n=o.vars,s=o.options,i=p(),r=s.path.toLowerCase(),a=n.total>0&&o.items.filter(function(e){return-1===["image","flash","video"].indexOf(e.type)&&0[0]===e.recognized&&(s.smartRecognition||e.options.smartRecognition)}),d=a.length>0;s.mobileOptimizer&&!s.innerToolbar&&(n.isMobile=i.width<=n.mobileMaxWidth),n.overlay.addClass(s.skin).hide().css("opacity",s.overlay.opacity),s.linkId&&n.overlay[0].setAttribute("linkid",s.linkId),s.controls.toolbar&&(n.toolbar.addClass(s.skin).append(n.closeButton),s.controls.fullscreen&&n.toolbar.append(n.fullScreenButton),s.controls.slideshow&&n.toolbar.append(n.innerPlayButton),n.total>1&&n.toolbar.append(n.innerPrevButton).append(n.innerNextButton)),n.BODY.addClass("ilightbox-noscroll").append(n.overlay).append(n.loader).append(n.holder).append(n.nextPhoto).append(n.prevPhoto),s.innerToolbar||n.BODY.append(n.toolbar),s.controls.arrows&&n.BODY.append(n.nextButton).append(n.prevButton),s.controls.thumbnail&&n.total>1&&(n.BODY.append(n.thumbnails),n.thumbnails.addClass(s.skin).addClass("ilightbox-"+r),e("div.ilightbox-thumbnails-grid",n.thumbnails).empty(),n.thumbs=!0),c="horizontal"==s.path.toLowerCase()?{left:parseInt(i.width/2-n.loader.outerWidth()/2)}:{top:parseInt(i.height/2-n.loader.outerHeight()/2)},n.loader.addClass(s.skin).css(c),n.nextButton.add(n.prevButton).addClass(s.skin),"horizontal"==r&&n.loader.add(n.nextButton).add(n.prevButton).addClass("horizontal"),n.BODY[n.isMobile?"addClass":"removeClass"]("isMobile"),s.infinite||(n.prevButton.add(n.prevButton).add(n.innerPrevButton).add(n.innerNextButton).removeClass("disabled"),0==n.current&&n.prevButton.add(n.innerPrevButton).addClass("disabled"),n.current>=n.total-1&&n.nextButton.add(n.innerNextButton).addClass("disabled")),s.show.effect?(n.overlay.stop().fadeIn(s.show.speed),n.toolbar.stop().fadeIn(s.show.speed)):(n.overlay.show(),n.toolbar.show()),l=a.length,d?(o.showLoader(),e.each(a,function(){o.ogpRecognition(this,function(t){var a=-1,i=(o.items.filter(function(e,n){return e.URL==t.url&&(a=n),e.URL==t.url}),o.items[a]);t&&e.extend(!0,i,{URL:t.source,type:t.type,recognized:!0,options:{html5video:t.html5video,width:"image"==t.type?0:t.width||i.width,height:"image"==t.type?0:t.height||i.height,thumbnail:i.options.thumbnail||t.thumbnail}}),0==--l&&(o.hideLoader(),n.dontGenerateThumbs=!1,o.generateThumbnails(),s.show.effect?setTimeout(function(){o.generateBoxes()},s.show.speed):o.generateBoxes())})})):s.show.effect?setTimeout(function(){o.generateBoxes()},s.show.speed):o.generateBoxes(),o.createUI(),t.iLightBox={close:function(){o.closeAction()},fullscreen:function(){o.fullScreenAction()},moveNext:function(){o.moveTo("next")},movePrev:function(){o.moveTo("prev")},goTo:function(e){o.goTo(e)},refresh:function(){o.refresh()},reposition:function(){arguments.length>0?o.repositionPhoto(!0):o.repositionPhoto()},setOption:function(e){o.setOption(e)},destroy:function(){o.closeAction(),o.dispatchItemsEvents()}},s.linkId&&(n.hashLock=!0,t.location.hash=s.linkId+"/"+n.current,setTimeout(function(){n.hashLock=!1},55)),s.slideshow.startPaused||(o.resume(),n.innerPlayButton.removeClass("ilightbox-play").addClass("ilightbox-pause")),"function"==typeof o.options.callback.onOpen&&o.options.callback.onOpen.call(o)},loadContent:function(t,n,s){var i,r,c,l,o=this;switch(o.createUI(),t.speed=s||o.options.effects.loadedFadeSpeed,"current"==n&&(t.options.mousewheel?o.vars.lockWheel=!1:o.vars.lockWheel=!0,t.options.swipe?o.vars.lockSwipe=!1:o.vars.lockSwipe=!0),n){case"current":i=o.vars.holder,r=o.vars.current;break;case"next":i=o.vars.nextPhoto,r=o.vars.next;break;case"prev":i=o.vars.prevPhoto,r=o.vars.prev}(i.removeAttr("style class").addClass("ilightbox-holder"+(a?" supportTouch":"")).addClass(t.options.skin),e("div.ilightbox-inner-toolbar",i).remove(),t.title||o.options.innerToolbar)&&(c=o.vars.innerToolbar.clone(),t.title&&o.options.show.title&&(l=o.vars.title.clone(),l.empty().html(t.title),c.append(l)),o.options.innerToolbar&&c.append(o.vars.total>1?o.vars.toolbar.clone():o.vars.toolbar),i.prepend(c)),o.loadSwitcher(t,i,r,n)},loadSwitcher:function(t,n,s,o){var c,l,d,u,h,m,p,v,b,i=this,a=i.options,r={element:n,position:s};switch(t.type){case"image":"function"==typeof a.callback.onBeforeLoad&&a.callback.onBeforeLoad.call(i,i.ui,s),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(i,r),i.loadImage(t.URL,function(c){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(i,i.ui,s),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(i,r);var l=c?c.width:400,d=c?c.height:200;n.data({naturalWidth:l,naturalHeight:d}),e("div.ilightbox-container",n).empty().append(c?'':''+a.errors.loadImage+""),"function"==typeof a.callback.onRender&&a.callback.onRender.call(i,i.ui,s),"function"==typeof t.options.onRender&&t.options.onRender.call(i,r),i.configureHolder(t,o,n)});break;case"video":n.data({naturalWidth:t.options.width,naturalHeight:t.options.height}),i.addContent(n,t),"function"==typeof a.callback.onRender&&a.callback.onRender.call(i,i.ui,s),"function"==typeof t.options.onRender&&t.options.onRender.call(i,r),i.configureHolder(t,o,n);break;case"iframe":for(var g=t.URL.substring(t.URL.indexOf("?")+1).split("&"),j={},f=0;f').css(v).html(h)),n.show().data({naturalWidth:p||m.outerWidth(),naturalHeight:g||m.outerHeight()}).hide(),"function"==typeof a.callback.onRender&&a.callback.onRender.call(i,i.ui,s),"function"==typeof t.options.onRender&&t.options.onRender.call(i,r),f=_(n),i.loadImage(f,function(){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(i,i.ui,s),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(i,r),i.configureHolder(t,o,n)}),a.ajaxSetup.success(l,d,u),"function"==typeof c.success&&c.success(l,d,u)}).fail(function(l,d,u){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(i,i.ui,s),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(i,r),i.hideLoader(),e("div.ilightbox-container",n).empty().append(''+a.errors.loadContents+""),i.configureHolder(t,o,n),a.ajaxSetup.error(l,d,u),"function"==typeof c.error&&c.error(l,d,u)});break;case"html":h=t.URL,container=e("div.ilightbox-container",n),h[0].nodeName?l=h.clone():(m=e(h),l=m.selector?e("
"+m+"
"):m),v=i.items[s].options.width||parseInt(l.attr("width")),b=i.items[s].options.height||parseInt(l.attr("height")),i.addContent(n,t),l.appendTo(document.documentElement).hide(),"function"==typeof a.callback.onRender&&a.callback.onRender.call(i,i.ui,s),"function"==typeof t.options.onRender&&t.options.onRender.call(i,r),u=_(n),"function"==typeof a.callback.onBeforeLoad&&a.callback.onBeforeLoad.call(i,i.ui,s),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(i,r),i.loadImage(u,function(){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(i,i.ui,s),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(i,r),n.show().data({naturalWidth:v||container.outerWidth(),naturalHeight:b||container.outerHeight()}).hide(),l.remove(),i.configureHolder(t,o,n)})}},configureHolder:function(t,n,s){var a,l,d,o=this,r=o.vars,i=o.options;"current"!=n&&("next"==n?s.addClass("ilightbox-next"):s.addClass("ilightbox-prev")),"current"==n?(a=r.current):"next"==n?(d=i.styles.nextOpacity,a=r.next):(d=i.styles.prevOpacity,a=r.prev),l={element:s,position:a},o.items[a].options.width=o.items[a].options.width||0,o.items[a].options.height=o.items[a].options.height||0,"current"==n?i.show.effect?s.css(c,m).fadeIn(t.speed,function(){if(s.css(c,""),t.caption){o.setCaption(t,s);var n,r=e("div.ilightbox-caption",s),d=parseInt(r.outerHeight()/s.outerHeight()*100);i.caption.start&d<=50&&r.fadeIn(i.effects.fadeSpeed)}n=t.options.social,n&&(o.setSocial(n,t.URL,s),i.social.start&&e("div.ilightbox-social",s).fadeIn(i.effects.fadeSpeed)),o.generateThumbnails(),"function"==typeof i.callback.onShow&&i.callback.onShow.call(o,o.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(o,l)}):(s.show(),o.generateThumbnails(),"function"==typeof i.callback.onShow&&i.callback.onShow.call(o,o.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(o,l)):i.show.effect?s.fadeTo(t.speed,d,function(){"next"==n?r.nextLock=!1:r.prevLock=!1,o.generateThumbnails(),"function"==typeof i.callback.onShow&&i.callback.onShow.call(o,o.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(o,l)}):(s.css({opacity:d}).show(),"next"==n?r.nextLock=!1:r.prevLock=!1,o.generateThumbnails(),"function"==typeof i.callback.onShow&&i.callback.onShow.call(o,o.ui,a),"function"==typeof t.options.onShow&&t.options.onShow.call(o,l)),setTimeout(function(){o.repositionPhoto()},0)},generateBoxes:function(){var t=this,e=t.vars,n=t.options;n.infinite&&e.total>=3?(e.current==e.total-1&&(e.next=0),0==e.current&&(e.prev=e.total-1)):n.infinite=!1,t.loadContent(t.items[e.current],"current",n.show.speed),t.items[e.next]&&t.loadContent(t.items[e.next],"next",n.show.speed),t.items[e.prev]&&t.loadContent(t.items[e.prev],"prev",n.show.speed)},generateThumbnails:function(){var t=this,s=t.vars,n=t.options,i=null;if(s.thumbs&&!t.vars.dontGenerateThumbs){var a=s.thumbnails,r=e("div.ilightbox-thumbnails-container",a),o=e("div.ilightbox-thumbnails-grid",r),c=0;o.removeAttr("style").empty(),e.each(t.items,function(l,d){var f=s.current==l?"ilightbox-active":"",p=s.current==l?n.thumbnails.activeOpacity:n.thumbnails.normalOpacity,m=d.options.thumbnail,u=e('
'),h=e('
');u.css({opacity:0}).addClass(f),"video"!=d.type&&"flash"!=d.type||0[0]!==d.options.icon?d.options.icon&&(h.addClass("ilightbox-thumbnail-"+d.options.icon),u.append(h)):(h.addClass("ilightbox-thumbnail-video"),u.append(h)),m&&t.loadImage(m,function(e){c++,e?u.data({naturalWidth:e.width,naturalHeight:e.height}).append(''):u.data({naturalWidth:n.thumbnails.maxWidth,naturalHeight:n.thumbnails.maxHeight}),clearTimeout(i),i=setTimeout(function(){t.positionThumbnails(a,r,o)},20),setTimeout(function(){u.fadeTo(n.effects.loadedFadeSpeed,p)},20*c)}),o.append(u)}),t.vars.dontGenerateThumbs=!0}},positionThumbnails:function(t,n,s){var h=this,j=h.vars,o=h.options,g=p(),a=o.path.toLowerCase();t||(t=j.thumbnails),n||(n=e("div.ilightbox-thumbnails-container",t)),s||(s=e("div.ilightbox-thumbnails-grid",n));var c,l,u=e(".ilightbox-thumbnail",s),m="horizontal"==a?g.width-o.styles.pageOffsetX:u.eq(0).outerWidth()-o.styles.pageOffsetX,f="horizontal"==a?u.eq(0).outerHeight()-o.styles.pageOffsetY:g.height-o.styles.pageOffsetY,b="horizontal"==a?0:m,v="horizontal"==a?f:0,d=e(".ilightbox-active",s),r={};arguments.length<3&&(u.css({opacity:o.thumbnails.normalOpacity}),d.css({opacity:o.thumbnails.activeOpacity})),u.each(function(){var n=e(this),s=n.data(),i="horizontal"==a?0:o.thumbnails.maxWidth;height="horizontal"==a?o.thumbnails.maxHeight:0,dims=h.getNewDimenstions(i,height,s.naturalWidth,s.naturalHeight,!0),n.css({width:dims.width,height:dims.height}),"horizontal"==a&&n.css({float:"left"}),"horizontal"==a?b+=n.outerWidth(!0):v+=n.outerHeight()}),r={width:b,height:v},s.css(r),r={},l=s.offset(),c=d.length?d.offset():{top:parseInt(f/2),left:parseInt(m/2)},l.top=l.top-i.scrollTop(),l.left=l.left-i.scrollLeft(),c.top=c.top-l.top-i.scrollTop(),c.left=c.left-l.left-i.scrollLeft(),"horizontal"==a?(r.top=0,r.left=parseInt(m/2-c.left-d.outerWidth()/2)):(r.top=parseInt(f/2-c.top-d.outerHeight()/2),r.left=0),arguments.length<3?s.stop().animate(r,o.effects.repositionSpeed,"easeOutCirc"):s.css(r)},loadImage:function(t,n){e.isArray(t)||(t=[t]);var s=this,o=t.length;o>0?(s.showLoader(),e.each(t,function(e){var a=new Image;a.onload=function(){0==(o-=1)&&(s.hideLoader(),n(a))},a.onerror=a.onabort=function(){0==(o-=1)&&(s.hideLoader(),n(!1))},a.src=t[e]})):n(!1)},patchItemsEvents:function(){var i,t=this,n=t.vars,s=a?"click.iL itap.iL":"click.iL",o=a?"click.iL itap.iL":"itap.iL";t.context&&t.selector?(i=e(t.selector,t.context),e(t.context).on(s,t.selector,function(){var o=e(this),s=i.index(o);return n.current=s,n.next=t.items[s+1]?s+1:null,n.prev=t.items[s-1]?s-1:null,t.addContents(),t.patchEvents(),!1}).on(o,t.selector,function(){return!1})):e.each(t.itemsObject,function(e,i){i.on(s,function(){return n.current=e,n.next=t.items[e+1]?e+1:null,n.prev=t.items[e-1]?e-1:null,t.addContents(),t.patchEvents(),!1}).on(o,function(){return!1})})},dispatchItemsEvents:function(){var t=this;t.vars,t.options,t.context&&t.selector?e(t.context).off(".iL",t.selector):e.each(t.itemsObject,function(e,t){t.off(".iL")})},refresh:function(){this.dispatchItemsEvents(),this.attachItems(),this.normalizeItems(),this.patchItemsEvents()},patchEvents:function(){var g,j,y,l=this,o=l.vars,r=l.options,h=r.path.toLowerCase(),u=e(".ilightbox-holder"),_=s.fullScreenEventName+".iLightBox",v=verticalDistanceThreshold=100,w=[o.nextButton[0],o.prevButton[0],o.nextButton[0].firstChild,o.prevButton[0].firstChild];b.bind("resize.iLightBox",function(){var e=p();r.mobileOptimizer&&!r.innerToolbar&&(o.isMobile=e.width<=o.mobileMaxWidth),o.BODY[o.isMobile?"addClass":"removeClass"]("isMobile"),o.nextLock||o.prevLock||l.repositionPhoto(null),a&&(clearTimeout(o.setTime),o.setTime=setTimeout(function(){var e=k().y;t.scrollTo(0,e-30),t.scrollTo(0,e+30),t.scrollTo(0,e)},2e3)),o.thumbs&&l.positionThumbnails()}).bind("keydown.iLightBox",function(e){if(r.controls.keyboard)switch(e.keyCode){case 13:e.shiftKey&&r.keyboard.shift_enter&&l.fullScreenAction();break;case 27:r.keyboard.esc&&l.closeAction();break;case 37:r.keyboard.left&&!o.lockKey&&l.moveTo("prev");break;case 38:r.keyboard.up&&!o.lockKey&&l.moveTo("prev");break;case 39:r.keyboard.right&&!o.lockKey&&l.moveTo("next");break;case 40:r.keyboard.down&&!o.lockKey&&l.moveTo("next")}}),s.supportsFullScreen&&b.bind(_,function(){l.doFullscreen()}),j=[r.caption.show+".iLightBox",r.caption.hide+".iLightBox",r.social.show+".iLightBox",r.social.hide+".iLightBox"].filter(function(e,t,n){return n.lastIndexOf(e)===t}),g="",e.each(j,function(e,t){0!=e&&(g+=" "),g+=t}),i.on(d,".ilightbox-overlay",function(){r.overlay.blur&&l.closeAction()}).on(d,".ilightbox-next, .ilightbox-next-button",function(){l.moveTo("next")}).on(d,".ilightbox-prev, .ilightbox-prev-button",function(){l.moveTo("prev")}).on(d,".ilightbox-thumbnail",function(){var n=e(this),t=e(".ilightbox-thumbnail",o.thumbnails).index(n);t!=o.current&&l.goTo(t)}).on(g,".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(t){var n=e("div.ilightbox-caption",o.holder),s=e("div.ilightbox-social",o.holder),i=r.effects.fadeSpeed;o.nextLock||o.prevLock?(t.type!=r.caption.show||n.is(":visible")?t.type==r.caption.hide&&n.is(":visible")&&n.fadeOut(i):n.fadeIn(i),t.type!=r.social.show||s.is(":visible")?t.type==r.social.hide&&s.is(":visible")&&s.fadeOut(i):s.fadeIn(i)):(t.type!=r.caption.show||n.is(":visible")?t.type==r.caption.hide&&n.is(":visible")&&n.stop().fadeOut(i):n.stop().fadeIn(i),t.type!=r.social.show||s.is(":visible")?t.type==r.social.hide&&s.is(":visible")&&s.stop().fadeOut(i):s.stop().fadeIn(i))}).on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-wrapper",function(e){"mouseenter"==e.type?o.lockWheel=!0:o.lockWheel=!1}).on(d,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause",function(){var t=e(this);t.hasClass("fusion-updated")||(t.hasClass("ilightbox-fullscreen")?l.fullScreenAction():t.hasClass("ilightbox-play")?(l.resume(),t.addClass("ilightbox-pause").removeClass("ilightbox-play")):t.hasClass("ilightbox-pause")?(l.pause(),t.addClass("ilightbox-play").removeClass("ilightbox-pause")):l.closeAction(),t.addClass("fusion-updated"),setTimeout(function(){t.removeClass("fusion-updated")},100))}).on(A,".ilightbox-overlay, .ilightbox-thumbnails-container",function(e){e.preventDefault()}),r.controls.arrows&&!a&&i.on("mousemove.iLightBox",function(e){o.isMobile||(o.mouseID||o.hideableElements.show(),o.mouseID=clearTimeout(o.mouseID),-1===w.indexOf(e.target)&&(o.mouseID=setTimeout(function(){o.hideableElements.hide(),o.mouseID=clearTimeout(o.mouseID)},3e3)))}),r.controls.slideshow&&r.slideshow.pauseOnHover&&i.on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(e){"mouseenter"==e.type&&o.cycleID?l.pause():"mouseleave"==e.type&&o.isPaused&&l.resume()}),y=e(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails"),r.controls.mousewheel&&y.on("mousewheel.iLightBox",function(e,t){o.lockWheel||(e.preventDefault(),t<0?l.moveTo("next"):t>0&&l.moveTo("prev"))}),r.controls.swipe&&u.on(q,function(t){if(!(o.nextLock||o.prevLock||1==o.total||o.lockSwipe)){o.BODY.addClass("ilightbox-closedhand");var s,j=t.originalEvent.touches?t.originalEvent.touches[0]:t,d=i.scrollTop(),p=i.scrollLeft(),g=[u.eq(0).offset(),u.eq(1).offset(),u.eq(2).offset()],_=[{top:g[0].top-d,left:g[0].left-p},{top:g[1].top-d,left:g[1].left-p},{top:g[2].top-d,left:g[2].left-p}],a={time:(new Date).getTime(),coords:[j.pageX-p,j.pageY-d]};u.bind(A,y),i.one(P,function(){u.unbind(A,y),o.BODY.removeClass("ilightbox-closedhand"),a&&s&&("horizontal"==h&&s.time-a.time<1e3&&f(a.coords[0]-s.coords[0])>v&&f(a.coords[1]-s.coords[1])s.coords[0]?o.current!=o.total-1||r.infinite?(o.isSwipe=!0,l.moveTo("next")):b():0!=o.current||r.infinite?(o.isSwipe=!0,l.moveTo("prev")):b():"vertical"==h&&s.time-a.time<1e3&&f(a.coords[1]-s.coords[1])>v&&f(a.coords[0]-s.coords[0])s.coords[1]?o.current!=o.total-1||r.infinite?(o.isSwipe=!0,l.moveTo("next")):b():0!=o.current||r.infinite?(o.isSwipe=!0,l.moveTo("prev")):b():b()),a=s=n})}function w(t){var i=e(this),n=_[t],o=[a.coords[0]-s.coords[0],a.coords[1]-s.coords[1]];i[0].style["horizontal"==h?"left":"top"]=("horizontal"==h?n.left-o[0]:n.top-o[1])+"px"}function y(e){if(a){var t=e.originalEvent.touches?e.originalEvent.touches[0]:e;s={time:(new Date).getTime(),coords:[t.pageX-p,t.pageY-d]},u.each(w),e.preventDefault()}}function b(){u.each(function(){var t=e(this),n=t.data("offset")||{top:t.offset().top-d,left:t.offset().left-p},s=n.top,o=n.left;t.css(c,m).stop().animate({top:s,left:o},500,"easeOutCirc",function(){t.css(c,"")})})}})},goTo:function(n){var o=this,s=o.vars,i=o.options,a=n-s.current;if(i.infinite&&(n==s.total-1&&0==s.current&&(a=-1),s.current==s.total-1&&0==n&&(a=1)),1==a)o.moveTo("next");else if(-1==a)o.moveTo("prev");else{if(s.nextLock||s.prevLock)return!1;"function"==typeof i.callback.onBeforeChange&&i.callback.onBeforeChange.call(o,o.ui),i.linkId&&(s.hashLock=!0,t.location.hash=i.linkId+"/"+n),o.items[n]&&(o.items[n].options.mousewheel?o.vars.lockWheel=!1:s.lockWheel=!0,o.items[n].options.swipe?s.lockSwipe=!1:s.lockSwipe=!0),e.each([s.holder,s.nextPhoto,s.prevPhoto],function(e,t){t.css(c,m).fadeOut(i.effects.loadedFadeSpeed)}),s.current=n,s.next=n+1,s.prev=n-1,o.createUI(),setTimeout(function(){o.generateBoxes()},i.effects.loadedFadeSpeed+50),e(".ilightbox-thumbnail",s.thumbnails).removeClass("ilightbox-active").eq(n).addClass("ilightbox-active"),o.positionThumbnails(),i.linkId&&setTimeout(function(){s.hashLock=!1},55),i.infinite||(s.nextButton.add(s.prevButton).add(s.innerPrevButton).add(s.innerNextButton).removeClass("disabled"),0==s.current&&s.prevButton.add(s.innerPrevButton).addClass("disabled"),s.current>=s.total-1&&s.nextButton.add(s.innerNextButton).addClass("disabled")),o.resetCycle(),"function"==typeof i.callback.onAfterChange&&i.callback.onAfterChange.call(o,o.ui)}},moveTo:function(n){var o=this,s=o.vars,i=o.options,w=i.path.toLowerCase(),L=p(),v=i.effects.switchSpeed,T=o.vars.holder,k=T.find("iframe").length?T.find("iframe").attr("src"):"";if(k&&-1!==k.indexOf("vimeo.com")&&T.find("iframe").attr("src",k),s.nextLock||s.prevLock)return!1;if(a="next"==n?s.next:s.prev,i.linkId&&a&&(s.hashLock=!0,t.location.hash=i.linkId+"/"+a),"next"==n){if(!o.items[a])return!1;var r=s.nextPhoto,h=s.holder,d=s.prevPhoto,N="ilightbox-prev",D="ilightbox-next"}else if("prev"==n){if(!o.items[a])return!1;r=s.prevPhoto,h=s.holder,d=s.nextPhoto,N="ilightbox-next",D="ilightbox-prev"}"function"==typeof i.callback.onBeforeChange&&i.callback.onBeforeChange.call(o,o.ui),"next"==n?s.nextLock=!0:s.prevLock=!0,F=e("div.ilightbox-caption",h),M=e("div.ilightbox-social",h),(F.length&&F.stop().fadeOut(v,function(){e(this).remove()}),M.length&&M.stop().fadeOut(v,function(){e(this).remove()}),o.items[a].caption)&&(o.setCaption(o.items[a],r),S=e("div.ilightbox-caption",r),z=parseInt(S.outerHeight()/r.outerHeight()*100),i.caption.start&&z<=50&&S.fadeIn(v)),A=o.items[a].options.social,A&&(o.setSocial(A,o.items[a].URL,r),i.social.start&&e("div.ilightbox-social",r).fadeIn(i.effects.fadeSpeed)),e.each([r,h,d],function(e,t){t.removeClass("ilightbox-next ilightbox-prev")});var a,b,O,A,S,M,F,z,E=r.data("offset"),x=L.width-i.styles.pageOffsetX,C=L.height-i.styles.pageOffsetY,g=E.newDims.width,y=E.newDims.height,f=E.thumbsOffset,l=E.diff,j=parseInt(C/2-y/2-l.H-f.H/2),_=parseInt(x/2-g/2-l.W-f.W/2);r.css(c,m).animate({top:j,left:_,opacity:1},v,s.isSwipe?"easeOutCirc":"easeInOutCirc",function(){r.css(c,"")}),e("div.ilightbox-container",r).animate({width:g,height:y},v,s.isSwipe?"easeOutCirc":"easeInOutCirc"),O=h.data("offset"),b=O.object,l=O.diff,g=O.newDims.width,y=O.newDims.height,g=parseInt(g*i.styles["next"==n?"prevScale":"nextScale"]),y=parseInt(y*i.styles["next"==n?"prevScale":"nextScale"]),j=parseInt("horizontal"==w?C/2-b.offsetY-y/2-l.H-f.H/2:C-b.offsetX-l.H-f.H/2),"prev"==n?_=parseInt("horizontal"==w?x-b.offsetX-l.W-f.W/2:x/2-g/2-l.W-b.offsetY-f.W/2):(j="horizontal"==w?j:parseInt(b.offsetX-l.H-y-f.H/2),_=parseInt("horizontal"==w?b.offsetX-l.W-g-f.W/2:x/2-b.offsetY-g/2-l.W-f.W/2)),e("div.ilightbox-container",h).animate({width:g,height:y},v,s.isSwipe?"easeOutCirc":"easeInOutCirc"),h.addClass(N).css(c,m).animate({top:j,left:_,opacity:i.styles.prevOpacity},v,s.isSwipe?"easeOutCirc":"easeInOutCirc",function(){h.css(c,""),e(".ilightbox-thumbnail",s.thumbnails).removeClass("ilightbox-active").eq(a).addClass("ilightbox-active"),o.positionThumbnails(),o.items[a]&&(o.items[a].options.mousewheel?s.lockWheel=!1:s.lockWheel=!0,o.items[a].options.swipe?s.lockSwipe=!1:s.lockSwipe=!0),s.isSwipe=!1,"next"==n?(s.nextPhoto=d,s.prevPhoto=h,s.holder=r,s.nextPhoto.hide(),s.next=s.next+1,s.prev=s.current,s.current=s.current+1,i.infinite&&(s.current>s.total-1&&(s.current=0),s.current==s.total-1&&(s.next=0),0==s.current&&(s.prev=s.total-1)),o.createUI(),o.items[s.next]?o.loadContent(o.items[s.next],"next"):s.nextLock=!1):(s.prevPhoto=d,s.nextPhoto=h,s.holder=r,s.prevPhoto.hide(),s.next=s.current,s.current=s.prev,s.prev=s.current-1,i.infinite&&(s.current==s.total-1&&(s.next=0),0==s.current&&(s.prev=s.total-1)),o.createUI(),o.items[s.prev]?o.loadContent(o.items[s.prev],"prev"):s.prevLock=!1),i.linkId&&setTimeout(function(){s.hashLock=!1},55),i.infinite||(s.nextButton.add(s.prevButton).add(s.innerPrevButton).add(s.innerNextButton).removeClass("disabled"),0==s.current&&s.prevButton.add(s.innerPrevButton).addClass("disabled"),s.current>=s.total-1&&s.nextButton.add(s.innerNextButton).addClass("disabled")),o.repositionPhoto(),o.resetCycle(),"function"==typeof i.callback.onAfterChange&&i.callback.onAfterChange.call(o,o.ui)}),j="horizontal"==w?u(d,"top"):parseInt("next"==n?-C/2-d.outerHeight():2*j),_="horizontal"==w?parseInt("next"==n?-x/2-d.outerWidth():2*_):u(d,"left"),d.css(c,m).animate({top:j,left:_,opacity:i.styles.nextOpacity},v,s.isSwipe?"easeOutCirc":"easeInOutCirc",function(){d.css(c,"")}).addClass(D)},setCaption:function(t,n){var s=e('
');t.caption&&(s.html(t.caption),e("div.ilightbox-container",n).append(s))},normalizeSocial:function(n,s){this.vars;var i=this.options,o=t.location.href;return e.each(n,function(e,a){if(!a)return!0;var r,c;switch(e.toLowerCase()){case"facebook":r="http://www.facebook.com/share.php?v=4&src=bm&u={URL}",c="Share on Facebook";break;case"twitter":r="http://twitter.com/home?status={URL}",c="Share on Twitter";break;case"delicious":r="http://delicious.com/post?url={URL}",c="Share on Delicious";break;case"digg":r="http://digg.com/submit?phase=2&url={URL}",c="Share on Digg";break;case"reddit":r="http://reddit.com/submit?url={URL}",c="Share on reddit"}n[e]={URL:a.URL&&v(o,a.URL)||i.linkId&&t.location.href||"string"!=typeof s&&o||s&&v(o,s)||o,source:a.source||r||a.URL&&v(o,a.URL)||s&&v(o,s),text:a.text||c||"Share on "+e,width:0[0]===a.width||isNaN(a.width)?640:parseInt(a.width),height:a.height||360}}),n},setSocial:function(t,n,s){var i=e('
'),o="
    ";t=this.normalizeSocial(t,n),e.each(t,function(e,t){e.toLowerCase();var n=t.source.replace(/\{URL\}/g,encodeURIComponent(t.URL).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+"));o+='
  • '}),o+="
",i.html(o),e("div.ilightbox-container",s).append(i)},fullScreenAction:function(){this.vars,s.supportsFullScreen?s.isFullScreen()?s.cancelFullScreen(document.documentElement):s.requestFullScreen(document.documentElement):this.doFullscreen()},doFullscreen:function(){var s=this,t=s.vars,r=p(),a=s.options;if(a.fullAlone){var u,v,n=t.holder,g=s.items[t.current],f=r.width,l=r.height,h=[n,t.nextPhoto,t.prevPhoto,t.nextButton,t.prevButton,t.overlay,t.toolbar,t.thumbnails,t.loader],m=[t.loader,t.thumbnails];if(t.isInFullScreen)t.isInFullScreen=t.lockKey=t.lockWheel=t.lockSwipe=!1,t.overlay.css({opacity:s.options.overlay.opacity}),e.each(m,function(e,t){t.show()}),t.fullScreenButton.attr("title",a.text.enterFullscreen),n.data({naturalWidth:n.data("naturalWidthOld"),naturalHeight:n.data("naturalHeightOld"),naturalWidthOld:null,naturalHeightOld:null}),e.each(h,function(e,t){t.removeClass("ilightbox-fullscreen")}),"function"==typeof a.callback.onExitFullScreen&&a.callback.onExitFullScreen.call(s,s.ui);else{if(t.isInFullScreen=t.lockKey=t.lockWheel=t.lockSwipe=!0,t.overlay.css({opacity:1}),e.each(m,function(e,t){t.hide()}),t.fullScreenButton.attr("title",a.text.exitFullscreen),-1!=a.fullStretchTypes.indexOf(g.type))n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:f,naturalHeight:l});else{r=g.options.fullViewPort||a.fullViewPort||"";var o=f,i=l,c=n.data("naturalWidth"),d=n.data("naturalHeight");"fill"==r.toLowerCase()?(i=o/c*d)o||d>i,o=(u=s.getNewDimenstions(o,i,c,d,v)).width,i=u.height),n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:o,naturalHeight:i})}e.each(h,function(e,t){t.addClass("ilightbox-fullscreen")}),"function"==typeof a.callback.onEnterFullScreen&&a.callback.onEnterFullScreen.call(s,s.ui)}}else t.isInFullScreen?t.isInFullScreen=!1:t.isInFullScreen=!0;s.repositionPhoto(!0)},closeAction:function(){var a,n=this.vars,o=this.options;b.unbind(".iLightBox"),i.off(".iLightBox"),i.off(d,".ilightbox-overlay"),i.off(d,".ilightbox-next, .ilightbox-next-button"),i.off(d,".ilightbox-prev, .ilightbox-prev-button"),i.off(d,".ilightbox-thumbnail"),i.off(d,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause"),n.isInFullScreen&&s.cancelFullScreen(document.documentElement),e(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails").off(".iLightBox"),o.hide.effect?n.overlay.stop().fadeOut(o.hide.speed,function(){n.overlay.remove(),n.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")}):(n.overlay.remove(),n.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")),a=[n.toolbar,n.holder,n.nextPhoto,n.prevPhoto,n.nextButton,n.prevButton,n.loader,n.thumbnails],e.each(a,function(e,t){t.removeAttr("style").remove()}),n.prevButton.removeClass("disabled"),n.nextButton.removeClass("disabled"),n.dontGenerateThumbs=n.isInFullScreen=!1,t.iLightBox=null,o.linkId&&(n.hashLock=!0,H(),setTimeout(function(){n.hashLock=!1},55)),"function"==typeof o.callback.onHide&&o.callback.onHide.call(this,this.ui)},repositionPhoto:function(){var m,s=this,t=s.vars,n=s.options,r=n.path.toLowerCase(),h=p(),u=h.width,d=h.height,c=t.isInFullScreen&&n.fullAlone||t.isMobile?0:"horizontal"==r?0:t.thumbnails.outerWidth(),l=t.isMobile?t.toolbar.outerHeight():t.isInFullScreen&&n.fullAlone?0:"horizontal"==r?t.thumbnails.outerHeight():0,i=t.isInFullScreen&&n.fullAlone?u:u-n.styles.pageOffsetX,a=t.isInFullScreen&&n.fullAlone?d:d-n.styles.pageOffsetY,f="horizontal"==r?parseInt(s.items[t.next]||s.items[t.prev]?2*(n.styles.nextOffsetX+n.styles.prevOffsetX):i/10<=30?30:i/10):parseInt(i/10<=30?30:i/10)+c,g="horizontal"==r?parseInt(a/10<=30?30:a/10)+l:parseInt(s.items[t.next]||s.items[t.prev]?2*(n.styles.nextOffsetX+n.styles.prevOffsetX):a/10<=30?30:a/10),o={type:"current",width:i,height:a,item:s.items[t.current],offsetW:f,offsetH:g,thumbsOffsetW:c,thumbsOffsetH:l,animate:arguments.length,holder:t.holder};s.repositionEl(o),s.items[t.next]&&(o=e.extend(o,{type:"next",item:s.items[t.next],offsetX:n.styles.nextOffsetX,offsetY:n.styles.nextOffsetY,holder:t.nextPhoto}),s.repositionEl(o)),s.items[t.prev]&&(o=e.extend(o,{type:"prev",item:s.items[t.prev],offsetX:n.styles.prevOffsetX,offsetY:n.styles.prevOffsetY,holder:t.prevPhoto}),s.repositionEl(o)),m="horizontal"==r?{left:parseInt(i/2-t.loader.outerWidth()/2)}:{top:parseInt(a/2-t.loader.outerHeight()/2)},t.loader.css(m)},repositionEl:function(t){var d,h,f,v,j=this.vars,o=this.options,y=o.path.toLowerCase(),l="current"==t.type&&j.isInFullScreen&&o.fullAlone?t.width:t.width-t.offsetW,a="current"==t.type&&j.isInFullScreen&&o.fullAlone?t.height:t.height-t.offsetH,O=t.item,n=t.item.options,s=t.holder,w=t.offsetX||0,_=t.offsetY||0,p=t.thumbsOffsetW,g=t.thumbsOffsetH;"current"==t.type?("number"==typeof n.width&&n.width&&(l=j.isInFullScreen&&o.fullAlone&&(-1!=o.fullStretchTypes.indexOf(O.type)||n.fullViewPort||o.fullViewPort)?l:n.width>l?l:n.width),"number"==typeof n.height&&n.height&&(a=j.isInFullScreen&&o.fullAlone&&(-1!=o.fullStretchTypes.indexOf(O.type)||n.fullViewPort||o.fullViewPort)?a:n.height>a?a:n.height)):("number"==typeof n.width&&n.width&&(l=n.width>l?l:n.width),"number"==typeof n.height&&n.height&&(a=n.height>a?a:n.height)),e(".ilightbox-inner-toolbar",s).length&&(a=parseInt(a-e(".ilightbox-inner-toolbar",s).outerHeight()));var i="string"==typeof n.width&&-1!=n.width.indexOf("%")?D(parseInt(n.width.replace("%","")),t.width):s.data("naturalWidth"),r="string"==typeof n.height&&-1!=n.height.indexOf("%")?D(parseInt(n.height.replace("%","")),t.height):s.data("naturalHeight"),b="string"==typeof n.width&&-1!=n.width.indexOf("%")||"string"==typeof n.height&&-1!=n.height.indexOf("%")?{width:i,height:r}:this.getNewDimenstions(l,a,i,r),x=e.extend({},b,{});switch("prev"==t.type||"next"==t.type?(i=parseInt(b.width*("next"==t.type?o.styles.nextScale:o.styles.prevScale)),r=parseInt(b.height*("next"==t.type?o.styles.nextScale:o.styles.prevScale))):(i=b.width,r=b.height),h=parseInt((u(s,"padding-left")+u(s,"padding-right")+u(s,"border-left-width")+u(s,"border-right-width"))/2),d=parseInt((u(s,"padding-top")+u(s,"padding-bottom")+u(s,"border-top-width")+u(s,"border-bottom-width")+(e(".ilightbox-inner-toolbar",s).outerHeight()||0))/2),t.type){case"current":f=parseInt(t.height/2-r/2-d-g/2),v=parseInt(t.width/2-i/2-h-p/2);break;case"next":f=parseInt("horizontal"==y?t.height/2-_-r/2-d-g/2:t.height-w-d-g/2),v=parseInt("horizontal"==y?t.width-w-h-p/2:t.width/2-i/2-h-_-p/2);break;case"prev":f=parseInt("horizontal"==y?t.height/2-_-r/2-d-g/2:w-d-r-g/2),v=parseInt("horizontal"==y?w-h-i-p/2:t.width/2-_-i/2-h-p/2)}s.data("offset",{top:f,left:v,newDims:x,diff:{W:h,H:d},thumbsOffset:{W:p,H:g},object:t}),t.animate>0&&o.effects.reposition?(s.css(c,m).stop().animate({top:f,left:v},o.effects.repositionSpeed,"easeOutCirc",function(){s.css(c,"")}),e("div.ilightbox-container",s).stop().animate({width:i,height:r},o.effects.repositionSpeed,"easeOutCirc"),e("div.ilightbox-inner-toolbar",s).stop().animate({width:i},o.effects.repositionSpeed,"easeOutCirc",function(){e(this).css("overflow","visible")})):(s.css({top:f,left:v}),e("div.ilightbox-container",s).css({width:i,height:r}),e("div.ilightbox-inner-toolbar",s).css({width:i}))},resume:function(e){var n=this,t=n.vars,s=n.options;!s.slideshow.pauseTime||s.controls.slideshow&&t.total<=1||ei.options.maxScale?factor=i.options.maxScale:factor=0,html5H264:!!e.canPlayType&&!!e.canPlayType("video/mp4").replace(/no/,""),html5WebM:!!e.canPlayType&&!!e.canPlayType("video/webm").replace(/no/,""),html5Vorbis:!!e.canPlayType&&!!e.canPlayType("video/ogg").replace(/no/,""),html5QuickTime:!!e.canPlayType&&!!e.canPlayType("video/quicktime").replace(/no/,"")}},addContent:function(t,n){switch(s=this,n.type){case"video":var s,o,i,d,u,h,m,f,v,b,j,y,_,w,C,p=!1,r=n.videoType,c=n.options.html5video;("video/mp4"==r||"mp4"==n.ext||"m4v"==n.ext||c.h264)&&s.plugins.html5H264?(n.ext="mp4",n.URL=c.h264||n.URL):c.webm&&s.plugins.html5WebM?(n.ext="webm",n.URL=c.webm||n.URL):c.ogg&&s.plugins.html5Vorbis&&(n.ext="ogv",n.URL=c.ogg||n.URL),!s.plugins.html5H264||"video/mp4"!=r&&"mp4"!=n.ext&&"m4v"!=n.ext?!s.plugins.html5WebM||"video/webm"!=r&&"webm"!=n.ext?!s.plugins.html5Vorbis||"video/ogg"!=r&&"ogv"!=n.ext?!s.plugins.html5QuickTime||"video/quicktime"!=r&&"mov"!=n.ext&&"qt"!=n.ext||(p=!0,r="video/quicktime"):(p=!0,r="video/ogg"):(p=!0,r="video/webm"):(p=!0,r="video/mp4"),p?o=e("