var addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}}; !function(t){t.fn.appear=function(e,i){var n=t.extend({data:void 0,one:!0,accX:0,accY:0},i);return this.each(function(){var i=t(this);if(i.appeared=!1,!e)return void i.trigger("appear",n.data);var s=t(window),o=function(){if(!i.is(":visible"))return void(i.appeared=!1);var t=s.scrollLeft(),e=s.scrollTop(),o=i.offset(),r=o.left,a=o.top,l=n.accX,h=n.accY,d=i.height(),u=s.height(),c=i.width(),p=s.width();a+d+h>=e&&e+u+h>=a&&r+c+l>=t&&t+p+l>=r?i.appeared||i.trigger("appear",n.data):i.appeared=!1},r=function(){if(i.appeared=!0,n.one){s.unbind("scroll",o);var r=t.inArray(o,t.fn.appear.checks);r>=0&&t.fn.appear.checks.splice(r,1)}e.apply(this,arguments)};n.one?i.one("appear",n.data,r):i.bind("appear",n.data,r),s.scroll(o),t.fn.appear.checks.push(o),o()})},t.extend(t.fn.appear,{checks:[],timeout:null,checkAll:function(){var e=t.fn.appear.checks.length;if(e>0)for(;e--;)t.fn.appear.checks[e]()},run:function(){t.fn.appear.timeout&&clearTimeout(t.fn.appear.timeout),t.fn.appear.timeout=setTimeout(t.fn.appear.checkAll,20)}}),t.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(e,i){var n=t.fn[i];n&&(t.fn[i]=function(){var e=n.apply(this,arguments);return t.fn.appear.run(),e})})}(jQuery),function(t){function e(t,e){return t.toFixed(e.decimals)}t.fn.countTo=function(e){return e=e||{},t(this).each(function(){function i(){d+=r,h++,n(d),"function"==typeof s.onUpdate&&s.onUpdate.call(a,d),h>=o&&(l.removeData("countTo"),clearInterval(u.interval),d=s.to,"function"==typeof s.onComplete&&s.onComplete.call(a,d))}function n(t){var e=s.formatter.call(a,t,s);l.html(e)}var s=t.extend({},t.fn.countTo.defaults,{from:t(this).data("from"),to:t(this).data("to"),speed:t(this).data("speed"),refreshInterval:t(this).data("refresh-interval"),decimals:t(this).data("decimals")},e),o=Math.ceil(s.speed/s.refreshInterval),r=(s.to-s.from)/o,a=this,l=t(this),h=0,d=s.from,u=l.data("countTo")||{};l.data("countTo",u),u.interval&&clearInterval(u.interval),u.interval=setInterval(i,s.refreshInterval),n(d)})},t.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:e,onUpdate:null,onComplete:null}}(jQuery),function(t){t.fn.hoverIntent=function(e,i,n){var s={interval:100,sensitivity:7,timeout:0};s="object"==typeof e?t.extend(s,e):t.isFunction(i)?t.extend(s,{over:e,out:i,selector:n}):t.extend(s,{over:e,out:e,selector:i});var o,r,a,l,h=function(t){o=t.pageX,r=t.pageY},d=function(e,i){return i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(a-o)+Math.abs(l-r)t?e:t>i?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){var 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");$.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"):"undefined"!=typeof $(e).attr("src")&&"img"==e.nodeName.toLowerCase()&&(t=$(e).attr("src")),-1==t.indexOf("gradient")){t=t.replace(/url\(\"/g,""),t=t.replace(/url\(/g,""),t=t.replace(/\"\)/g,""),t=t.replace(/\)/g,"");for(var n=t.split(","),s=0;s0&&-1==$.inArray(n[s],i)){var o="";browser.msie&&browser.version<9&&(o="?"+floor(3e3*random())),i.push(n[s]+o)}}}),i}function getExtension(t){var e=t.split(".").pop().toLowerCase(),i=-1!==e.indexOf("?")?e.split("?").pop():"";return e.replace(i,"")}function getTypeByExtension(t){var e,i=getExtension(t);return e=-1!==extensions.image.indexOf(i)?"image":-1!==extensions.flash.indexOf(i)?"flash":-1!==extensions.video.indexOf(i)?"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){function i(t){var e=[];return t.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(t){"/.."===t?e.pop():e.push(t)}),e.join("").replace(/^\//,"/"===t.charAt(0)?"/":"")}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)+(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 n=0,s=0,o=0,r={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},a=function(t){return t=(""+t).replace(/[_\-+]/g,"."),t=t.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),t.length?t.split("."):[-8]},l=function(t){return t?isNaN(t)?r[t]||-7:parseInt(t,10):0};for(t=a(t),e=a(e),s=max(t.length,e.length),n=0;s>n;n++)if(t[n]!=e[n]){if(t[n]=l(t[n]),e[n]=l(e[n]),t[n]e[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 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;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}}function AC_QuickTimeVersion(){return gQTGeneratorVersion}function _QTComplain(t,e){e=e.replace("%%",t),alert(e)}function _QTAddAttribute(t,e,i){var n;return n=gTagAttrs[t+e],null==n&&(n=gTagAttrs[e]),null!=n?(0==e.indexOf(t)&&null==i&&(i=e.substring(t.length)),null==i&&(i=e),i+'="'+n+'" '):""}function _QTAddObjectAttr(t,e){return 0==t.indexOf("emb#")?"":(0==t.indexOf("obj#")&&null==e&&(e=t.substring(4)),_QTAddAttribute("obj#",t,e))}function _QTAddEmbedAttr(t,e){return 0==t.indexOf("obj#")?"":(0==t.indexOf("emb#")&&null==e&&(e=t.substring(4)),_QTAddAttribute("emb#",t,e))}function _QTAddObjectParam(t,e){var i,n="",s=e?" />":">";return-1==t.indexOf("emb#")&&(i=gTagAttrs["obj#"+t],null==i&&(i=gTagAttrs[t]),0==t.indexOf("obj#")&&(t=t.substring(4)),null!=i&&(n=' i.length||0!=i.length%2)return _QTComplain(t,gArgCountErr),"";gTagAttrs=[],gTagAttrs.src=i[0],gTagAttrs.width=i[1],gTagAttrs.height=i[2],gTagAttrs.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",gTagAttrs.pluginspage="http://www.apple.com/quicktime/download/",t=i[3],(null==t||""==t)&&(t="6,0,2,0"),gTagAttrs.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version="+t;for(var n,s=4;s\n"+_QTAddObjectParam("src",e),s=" \n"}function QT_GenerateOBJECTText(){return _QTGenerate("QT_GenerateOBJECTText",!1,arguments)}var extensions={flash:["swf"],image:["bmp","gif","jpeg","jpg","png","tiff","tif","jfif","jpe"],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"]},$win=$(window),$doc=$(document),browser,transform,gpuAcceleration,fullScreenApi="",supportTouch=!!("ontouchstart"in window)&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),clickEvent=supportTouch?"itap.iLightBox":"click.iLightBox",touchStartEvent=supportTouch?"touchstart.iLightBox":"mousedown.iLightBox",touchStopEvent=supportTouch?"touchend.iLightBox":"mouseup.iLightBox",touchMoveEvent=supportTouch?"touchmove.iLightBox":"mousemove.iLightBox",abs=Math.abs,sqrt=Math.sqrt,round=Math.round,max=Math.max,min=Math.min,floor=Math.floor,random=Math.random,pluginspages={quicktime:"http://www.apple.com/quicktime/download",flash:"http://www.adobe.com/go/getflash"},iLightBox=function(t,e,i,n){var s=this;if(s.options=e,s.selector=t.selector||t,s.context=t.context,s.instant=n,i.length<1?s.attachItems():s.items=i,s.vars={total:s.items.length,start:0,current:null,next:null,prev:null,BODY:$("body"),loadRequests:0,overlay:$('
'),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},s.vars.hideableElements=s.vars.nextButton.add(s.vars.prevButton),s.normalizeItems(),s.availPlugins(),s.options.startFrom=s.options.startFrom>0&&s.options.startFrom>=s.vars.total?s.vars.total-1:s.options.startFrom,s.options.startFrom=s.options.randomStart?floor(random()*s.vars.total):s.options.startFrom,s.vars.start=s.options.startFrom,n?s.instantCall():s.patchItemsEvents(),s.options.linkId&&(s.hashChangeHandler(),$win.iLightBoxHashChange(function(){s.hashChangeHandler()})),supportTouch){var o=/(click|mouseenter|mouseleave|mouseover|mouseout)/gi,r="itap";s.options.caption.show=s.options.caption.show.replace(o,r),s.options.caption.hide=s.options.caption.hide.replace(o,r),s.options.social.show=s.options.social.show.replace(o,r),s.options.social.hide=s.options.social.hide.replace(o,r)}s.options.controls.arrows&&$.extend(s.options.styles,{nextOffsetX:0,prevOffsetX:0,nextOpacity:0,prevOpacity:0})};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"),type=t.data("type")||getTypeByExtension(URL);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,n){"string"==typeof n&&(n={url:n});var s=n.url||n.URL||null,o=n.options||{},r=n.caption||null,a=n.title||null,l=n.type?n.type.toLowerCase():getTypeByExtension(s),h="object"!=typeof s?getExtension(s):"";o.thumbnail=o.thumbnail||("image"==l?s:null),o.videoType=o.videoType||null,o.skin=o.skin||t.options.skin,o.width=o.width||null,o.height=o.height||null,o.mousewheel="undefined"!=typeof o.mousewheel?o.mousewheel:!0,o.swipe="undefined"!=typeof o.swipe?o.swipe:!0,o.social="undefined"!=typeof o.social?o.social:t.options.social.buttons&&$.extend({},{},t.options.social.buttons),"video"==l&&(o.html5video="undefined"!=typeof o.html5video?o.html5video:{},o.html5video.webm=o.html5video.webm||o.html5video.WEBM||null,o.html5video.controls="undefined"!=typeof o.html5video.controls?o.html5video.controls:"controls",o.html5video.preload=o.html5video.preload||"metadata",o.html5video.autoplay="undefined"!=typeof o.html5video.autoplay?o.html5video.autoplay:!1),o.width&&o.height||("video"==l?(o.width=1280,o.height=720):"iframe"==l?(o.width="100%",o.height="90%"):"flash"==l&&(o.width=1280,o.height=720)),delete n.url,n.index=i,n.URL=s,n.caption=r,n.title=a,n.type=l,n.options=o,n.ext=h,e.push(n)}),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,n=getViewport(),s=i.path.toLowerCase(),o=e.total>0&&t.items.filter(function(t){return-1===["image","flash","video"].indexOf(t.type)&&"undefined"==typeof t.recognized&&(i.smartRecognition||t.options.smartRecognition)}),r=o.length>0;i.mobileOptimizer&&!i.innerToolbar&&(e.isMobile=n.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-"+s),$("div.ilightbox-thumbnails-grid",e.thumbnails).empty(),e.thumbs=!0);var a="horizontal"==i.path.toLowerCase()?{left:parseInt(n.width/2-e.loader.outerWidth()/2)}:{top:parseInt(n.height/2-e.loader.outerHeight()/2)};e.loader.addClass(i.skin).css(a),e.nextButton.add(e.prevButton).addClass(i.skin),"horizontal"==s&&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;r?(t.showLoader(),$.each(o,function(){var n=function(n){var s=-1,o=(t.items.filter(function(t,e){return t.URL==n.url&&(s=e),t.URL==n.url}),t.items[s]);n&&$.extend(!0,o,{URL:n.source,type:n.type,recognized:!0,options:{html5video:n.html5video,width:"image"==n.type?0:n.width||o.width,height:"image"==n.type?0:n.height||o.height,thumbnail:o.options.thumbnail||n.thumbnail}}),l--,0==l&&(t.hideLoader(),e.dontGenerateThumbs=!1,t.generateThumbnails(),i.show.effect?setTimeout(function(){t.generateBoxes()},i.show.speed):t.generateBoxes())};t.ogpRecognition(this,n)})):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 n,s,o=this;switch(o.createUI(),t.speed=i||o.options.effects.loadedFadeSpeed,"current"==e&&(o.vars.lockWheel=t.options.mousewheel?!1:!0,o.vars.lockSwipe=t.options.swipe?!1:!0),e){case"current":n=o.vars.holder,s=o.vars.current;break;case"next":n=o.vars.nextPhoto,s=o.vars.next;break;case"prev":n=o.vars.prevPhoto,s=o.vars.prev}if(n.removeAttr("style class").addClass("ilightbox-holder"+(supportTouch?" supportTouch":"")).addClass(t.options.skin),$("div.ilightbox-inner-toolbar",n).remove(),t.title||o.options.innerToolbar){var r=o.vars.innerToolbar.clone();if(t.title&&o.options.show.title){var a=o.vars.title.clone();a.empty().html(t.title),r.append(a)}o.options.innerToolbar&&r.append(o.vars.total>1?o.vars.toolbar.clone():o.vars.toolbar),n.prepend(r)}o.loadSwitcher(t,n,s,e)},loadSwitcher:function(t,e,i,n){var s=this,o=s.options,r={element:e,position:i};switch(t.type){case"image":"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(s,s.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(s,r),s.loadImage(t.URL,function(a){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r);var l=a?a.width:400,h=a?a.height:200;e.data({naturalWidth:l,naturalHeight:h}),$("div.ilightbox-container",e).empty().append(a?'':''+o.errors.loadImage+""),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r),s.configureHolder(t,n,e)});break;case"video":e.data({naturalWidth:t.options.width,naturalHeight:t.options.height}),s.addContent(e,t),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r),s.configureHolder(t,n,e);break;case"iframe":s.showLoader(),e.data({naturalWidth:t.options.width,naturalHeight:t.options.height});var a=s.addContent(e,t);"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r),"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(s,s.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(s,r),a.bind("load",function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r),s.hideLoader(),s.configureHolder(t,n,e),a.unbind("load")});break;case"inline":var a=$(t.URL),l=s.addContent(e,t),h=findImageInElement(e);e.data({naturalWidth:s.items[i].options.width||a.outerWidth(),naturalHeight:s.items[i].options.height||a.outerHeight()}),l.children().eq(0).show(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r),"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(s,s.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(s,r),s.loadImage(h,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r),s.configureHolder(t,n,e)});break;case"flash":var a=s.addContent(e,t);e.data({naturalWidth:s.items[i].options.width||a.outerWidth(),naturalHeight:s.items[i].options.height||a.outerHeight()}),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r),s.configureHolder(t,n,e);break;case"ajax":var d=t.options.ajax||{};"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(s,s.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(s,r),s.showLoader(),$.ajax({url:t.URL||o.ajaxSetup.url,data:d.data||null,dataType:d.dataType||"html",type:d.type||o.ajaxSetup.type,cache:d.cache||o.ajaxSetup.cache,crossDomain:d.crossDomain||o.ajaxSetup.crossDomain,global:d.global||o.ajaxSetup.global,ifModified:d.ifModified||o.ajaxSetup.ifModified,username:d.username||o.ajaxSetup.username,password:d.password||o.ajaxSetup.password,beforeSend:d.beforeSend||o.ajaxSetup.beforeSend,complete:d.complete||o.ajaxSetup.complete,success:function(a,l,h){s.hideLoader();var u=$(a),c=$("div.ilightbox-container",e),p=s.items[i].options.width||parseInt(u[0].getAttribute("width")),f=s.items[i].options.height||parseInt(u[0].getAttribute("height")),m=u[0].getAttribute("width")&&u[0].getAttribute("height")?{overflow:"hidden"}:{};c.empty().append($('
').css(m).html(u)),e.show().data({naturalWidth:p||c.outerWidth(),naturalHeight:f||c.outerHeight()}).hide(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r);var g=findImageInElement(e);s.loadImage(g,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r),s.configureHolder(t,n,e)}),o.ajaxSetup.success(a,l,h),"function"==typeof d.success&&d.success(a,l,h)},error:function(a,l,h){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r),s.hideLoader(),$("div.ilightbox-container",e).empty().append(''+o.errors.loadContents+""),s.configureHolder(t,n,e),o.ajaxSetup.error(a,l,h),"function"==typeof d.error&&d.error(a,l,h)}});break;case"html":var a,u=t.URL;if(container=$("div.ilightbox-container",e),u[0].nodeName)a=u.clone();else{var c=$(u);a=c.selector?$("
"+c+"
"):c}var p=s.items[i].options.width||parseInt(a.attr("width")),f=s.items[i].options.height||parseInt(a.attr("height"));s.addContent(e,t),a.appendTo(document.documentElement).hide(),"function"==typeof o.callback.onRender&&o.callback.onRender.call(s,s.ui,i),"function"==typeof t.options.onRender&&t.options.onRender.call(s,r);var h=findImageInElement(e);"function"==typeof o.callback.onBeforeLoad&&o.callback.onBeforeLoad.call(s,s.ui,i),"function"==typeof t.options.onBeforeLoad&&t.options.onBeforeLoad.call(s,r),s.loadImage(h,function(){"function"==typeof o.callback.onAfterLoad&&o.callback.onAfterLoad.call(s,s.ui,i),"function"==typeof t.options.onAfterLoad&&t.options.onAfterLoad.call(s,r),e.show().data({naturalWidth:p||container.outerWidth(),naturalHeight:f||container.outerHeight()}).hide(),a.remove(),s.configureHolder(t,n,e)})}},configureHolder:function(t,e,i){var n=this,s=n.vars,o=n.options;if("current"!=e&&i.addClass("next"==e?"ilightbox-next":"ilightbox-prev"),"current"==e)var r=s.current;else if("next"==e)var a=o.styles.nextOpacity,r=s.next;else var a=o.styles.prevOpacity,r=s.prev;var l={element:i,position:r};n.items[r].options.width=n.items[r].options.width||0,n.items[r].options.height=n.items[r].options.height||0,"current"==e?o.show.effect?i.css(transform,gpuAcceleration).fadeIn(t.speed,function(){if(i.css(transform,""),t.caption){n.setCaption(t,i);var e=$("div.ilightbox-caption",i),s=parseInt(e.outerHeight()/i.outerHeight()*100);o.caption.start&50>=s&&e.fadeIn(o.effects.fadeSpeed)}var a=t.options.social;a&&(n.setSocial(a,t.URL,i),o.social.start&&$("div.ilightbox-social",i).fadeIn(o.effects.fadeSpeed)),n.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(n,n.ui,r),"function"==typeof t.options.onShow&&t.options.onShow.call(n,l)}):(i.show(),n.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(n,n.ui,r),"function"==typeof t.options.onShow&&t.options.onShow.call(n,l)):o.show.effect?i.fadeTo(t.speed,a,function(){"next"==e?s.nextLock=!1:s.prevLock=!1,n.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(n,n.ui,r),"function"==typeof t.options.onShow&&t.options.onShow.call(n,l)}):(i.css({opacity:a}).show(),"next"==e?s.nextLock=!1:s.prevLock=!1,n.generateThumbnails(),"function"==typeof o.callback.onShow&&o.callback.onShow.call(n,n.ui,r),"function"==typeof t.options.onShow&&t.options.onShow.call(n,l)),setTimeout(function(){n.repositionPhoto()},0)},generateBoxes:function(){var t=this,e=t.vars,i=t.options;i.infinite&&e.total>=3?(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,n=null;if(e.thumbs&&!t.vars.dontGenerateThumbs){var s=e.thumbnails,o=$("div.ilightbox-thumbnails-container",s),r=$("div.ilightbox-thumbnails-grid",o),a=0;r.removeAttr("style").empty(),$.each(t.items,function(l,h){var d=e.current==l?"ilightbox-active":"",u=e.current==l?i.thumbnails.activeOpacity:i.thumbnails.normalOpacity,c=h.options.thumbnail,p=$('
'),f=$('
');p.css({opacity:0}).addClass(d),"video"!=h.type&&"flash"!=h.type||"undefined"!=typeof h.options.icon?h.options.icon&&(f.addClass("ilightbox-thumbnail-"+h.options.icon),p.append(f)):(f.addClass("ilightbox-thumbnail-video"),p.append(f)),c&&t.loadImage(c,function(e){a++,e?p.data({naturalWidth:e.width,naturalHeight:e.height}).append(''):p.data({naturalWidth:i.thumbnails.maxWidth,naturalHeight:i.thumbnails.maxHeight}),clearTimeout(n),n=setTimeout(function(){t.positionThumbnails(s,o,r)},20),setTimeout(function(){p.fadeTo(i.effects.loadedFadeSpeed,u)},20*a)}),r.append(p)}),t.vars.dontGenerateThumbs=!0}},positionThumbnails:function(t,e,i){var n=this,s=n.vars,o=n.options,r=getViewport(),a=o.path.toLowerCase();t||(t=s.thumbnails),e||(e=$("div.ilightbox-thumbnails-container",t)),i||(i=$("div.ilightbox-thumbnails-grid",e));var l=$(".ilightbox-thumbnail",i),h="horizontal"==a?r.width-o.styles.pageOffsetX:l.eq(0).outerWidth()-o.styles.pageOffsetX,d="horizontal"==a?l.eq(0).outerHeight()-o.styles.pageOffsetY:r.height-o.styles.pageOffsetY,u="horizontal"==a?0:h,c="horizontal"==a?d:0,p=$(".ilightbox-active",i),f={};arguments.length<3&&(l.css({opacity:o.thumbnails.normalOpacity}),p.css({opacity:o.thumbnails.activeOpacity})),l.each(function(){var t=$(this),e=t.data(),i="horizontal"==a?0:o.thumbnails.maxWidth;height="horizontal"==a?o.thumbnails.maxHeight:0,dims=n.getNewDimenstions(i,height,e.naturalWidth,e.naturalHeight,!0),t.css({width:dims.width,height:dims.height}),"horizontal"==a&&t.css({"float":"left"}),"horizontal"==a?u+=t.outerWidth():c+=t.outerHeight()}),f={width:u,height:c},i.css(f),f={};var m=i.offset(),g=p.length?p.offset():{top:parseInt(d/2),left:parseInt(h/2)};m.top=m.top-$doc.scrollTop(),m.left=m.left-$doc.scrollLeft(),g.top=g.top-m.top-$doc.scrollTop(),g.left=g.left-m.left-$doc.scrollLeft(),"horizontal"==a?(f.top=0,f.left=parseInt(h/2-g.left-p.outerWidth()/2)):(f.top=parseInt(d/2-g.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,n=t.length;n>0?(i.showLoader(),$.each(t,function(s){var o=new Image;o.onload=function(){n-=1,0==n&&(i.hideLoader(),e(o))},o.onerror=o.onabort=function(){n-=1,0==n&&(i.hideLoader(),e(!1))},o.src=t[s]})):e(!1)},patchItemsEvents:function(){var t=this,e=t.vars,i=supportTouch?"itap.iL":"click.iL",n=supportTouch?"click.iL":"itap.iL";if(t.context&&t.selector){var s=$(t.selector,t.context);$(t.context).on(i,t.selector,function(){var i=$(this),n=s.index(i);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(n,t.selector,function(){return!1})}else $.each(t.itemsObject,function(s,o){o.on(i,function(){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(n,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(){var t=this;t.dispatchItemsEvents(),t.attachItems(),t.normalizeItems(),t.patchItemsEvents()},patchEvents:function(){function t(t){i.isMobile||(i.mouseID||i.hideableElements.show(),i.mouseID=clearTimeout(i.mouseID),-1===h.indexOf(t.target)&&(i.mouseID=setTimeout(function(){i.hideableElements.hide(),i.mouseID=clearTimeout(i.mouseID)},3e3)))}var e=this,i=e.vars,n=e.options,s=n.path.toLowerCase(),o=$(".ilightbox-holder"),r=fullScreenApi.fullScreenEventName+".iLightBox",a=1e3,l=verticalDistanceThreshold=100,h=[i.nextButton[0],i.prevButton[0],i.nextButton[0].firstChild,i.prevButton[0].firstChild];$win.bind("resize.iLightBox",function(){var t=getViewport();n.mobileOptimizer&&!n.innerToolbar&&(i.isMobile=t.width<=i.mobileMaxWidth),i.BODY[i.isMobile?"addClass":"removeClass"]("isMobile"),e.repositionPhoto(null),supportTouch&&(clearTimeout(i.setTime),i.setTime=setTimeout(function(){var t=getScrollXY().y;window.scrollTo(0,t-30),window.scrollTo(0,t+30),window.scrollTo(0,t)},2e3)),i.thumbs&&e.positionThumbnails()}).bind("keydown.iLightBox",function(t){if(n.controls.keyboard)switch(t.keyCode){case 13:t.shiftKey&&n.keyboard.shift_enter&&e.fullScreenAction();break;case 27:n.keyboard.esc&&e.closeAction();break;case 37:n.keyboard.left&&!i.lockKey&&e.moveTo("prev");break;case 38:n.keyboard.up&&!i.lockKey&&e.moveTo("prev");break;case 39:n.keyboard.right&&!i.lockKey&&e.moveTo("next");break;case 40:n.keyboard.down&&!i.lockKey&&e.moveTo("next")}}),fullScreenApi.supportsFullScreen&&$win.bind(r,function(){e.doFullscreen()});var d=[n.caption.show+".iLightBox",n.caption.hide+".iLightBox",n.social.show+".iLightBox",n.social.hide+".iLightBox"].filter(function(t,e,i){return i.lastIndexOf(t)===e}),u="";$.each(d,function(t,e){0!=t&&(u+=" "),u+=e}),$doc.on(clickEvent,".ilightbox-overlay",function(){n.overlay.blur&&e.closeAction()}).on(clickEvent,".ilightbox-next, .ilightbox-next-button",function(){e.moveTo("next")}).on(clickEvent,".ilightbox-prev, .ilightbox-prev-button",function(){e.moveTo("prev")}).on(clickEvent,".ilightbox-thumbnail",function(){var t=$(this),n=$(".ilightbox-thumbnail",i.thumbnails),s=n.index(t);s!=i.current&&e.goTo(s)}).on(u,".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(t){var e=$("div.ilightbox-caption",i.holder),s=$("div.ilightbox-social",i.holder),o=n.effects.fadeSpeed;i.nextLock||i.prevLock?(t.type!=n.caption.show||e.is(":visible")?t.type==n.caption.hide&&e.is(":visible")&&e.fadeOut(o):e.fadeIn(o),t.type!=n.social.show||s.is(":visible")?t.type==n.social.hide&&s.is(":visible")&&s.fadeOut(o):s.fadeIn(o)):(t.type!=n.caption.show||e.is(":visible")?t.type==n.caption.hide&&e.is(":visible")&&e.stop().fadeOut(o):e.stop().fadeIn(o),t.type!=n.social.show||s.is(":visible")?t.type==n.social.hide&&s.is(":visible")&&s.stop().fadeOut(o):s.stop().fadeIn(o))}).on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-wrapper",function(t){i.lockWheel="mouseenter"==t.type?!0:!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 t=$(this);t.hasClass("ilightbox-fullscreen")?e.fullScreenAction():t.hasClass("ilightbox-play")?(e.resume(),t.addClass("ilightbox-pause").removeClass("ilightbox-play")):t.hasClass("ilightbox-pause")?(e.pause(),t.addClass("ilightbox-play").removeClass("ilightbox-pause")):e.closeAction()}).on(touchMoveEvent,".ilightbox-overlay, .ilightbox-thumbnails-container",function(t){t.preventDefault()}),n.controls.arrows&&!supportTouch&&$doc.on("mousemove.iLightBox",t),n.controls.slideshow&&n.slideshow.pauseOnHover&&$doc.on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(t){"mouseenter"==t.type&&i.cycleID?e.pause():"mouseleave"==t.type&&i.isPaused&&e.resume()});var c=$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails");n.controls.mousewheel&&c.on("mousewheel.iLightBox",function(t,n){i.lockWheel||(t.preventDefault(),0>n?e.moveTo("next"):n>0&&e.moveTo("prev"))}),n.controls.swipe&&o.on(touchStartEvent,function(t){function r(t){var e=$(this),i=g[t],n=[v.coords[0]-u.coords[0],v.coords[1]-u.coords[1]];e[0].style["horizontal"==s?"left":"top"]=("horizontal"==s?i.left-n[0]:i.top-n[1])+"px"}function h(t){if(v){var e=t.originalEvent.touches?t.originalEvent.touches[0]:t;u={time:(new Date).getTime(),coords:[e.pageX-f,e.pageY-p]},o.each(r),t.preventDefault()}}function d(){o.each(function(){var t=$(this),e=t.data("offset")||{top:t.offset().top-p,left:t.offset().left-f},i=e.top,n=e.left;t.css(transform,gpuAcceleration).stop().animate({top:i,left:n},500,"easeOutCirc",function(){t.css(transform,"")})})}if(!(i.nextLock||i.prevLock||1==i.total||i.lockSwipe)){i.BODY.addClass("ilightbox-closedhand");var u,c=t.originalEvent.touches?t.originalEvent.touches[0]:t,p=$doc.scrollTop(),f=$doc.scrollLeft(),m=[o.eq(0).offset(),o.eq(1).offset(),o.eq(2).offset()],g=[{top:m[0].top-p,left:m[0].left-f},{top:m[1].top-p,left:m[1].left-f},{top:m[2].top-p,left:m[2].left-f}],v={time:(new Date).getTime(),coords:[c.pageX-f,c.pageY-p]};o.bind(touchMoveEvent,h),$doc.one(touchStopEvent,function(){o.unbind(touchMoveEvent,h),i.BODY.removeClass("ilightbox-closedhand"),v&&u&&("horizontal"==s&&u.time-v.timel&&abs(v.coords[1]-u.coords[1])u.coords[0]?i.current!=i.total-1||n.infinite?(i.isSwipe=!0,e.moveTo("next")):d():0!=i.current||n.infinite?(i.isSwipe=!0,e.moveTo("prev")):d():"vertical"==s&&u.time-v.timel&&abs(v.coords[0]-u.coords[0])u.coords[1]?i.current!=i.total-1||n.infinite?(i.isSwipe=!0,e.moveTo("next")):d():0!=i.current||n.infinite?(i.isSwipe=!0,e.moveTo("prev")):d():d()),v=u=undefined})}})},goTo:function(t){var e=this,i=e.vars,n=e.options,s=t-i.current;if(n.infinite&&(t==i.total-1&&0==i.current&&(s=-1),i.current==i.total-1&&0==t&&(s=1)),1==s)e.moveTo("next");else if(-1==s)e.moveTo("prev");else{if(i.nextLock||i.prevLock)return!1;"function"==typeof n.callback.onBeforeChange&&n.callback.onBeforeChange.call(e,e.ui),n.linkId&&(i.hashLock=!0,window.location.hash=n.linkId+"/"+t),e.items[t]&&(e.items[t].options.mousewheel?e.vars.lockWheel=!1:i.lockWheel=!0,i.lockSwipe=e.items[t].options.swipe?!1:!0),$.each([i.holder,i.nextPhoto,i.prevPhoto],function(t,e){e.css(transform,gpuAcceleration).fadeOut(n.effects.loadedFadeSpeed)}),i.current=t,i.next=t+1,i.prev=t-1,e.createUI(),setTimeout(function(){e.generateBoxes()},n.effects.loadedFadeSpeed+50),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(t).addClass("ilightbox-active"),e.positionThumbnails(),n.linkId&&setTimeout(function(){i.hashLock=!1},55),n.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 n.callback.onAfterChange&&n.callback.onAfterChange.call(e,e.ui)}},moveTo:function(t){var e=this,i=e.vars,n=e.options,s=n.path.toLowerCase(),o=getViewport(),r=n.effects.switchSpeed;if(i.nextLock||i.prevLock)return!1;var a="next"==t?i.next:i.prev;if(n.linkId&&(i.hashLock=!0,window.location.hash=n.linkId+"/"+a),"next"==t){if(!e.items[a])return!1;var l=i.nextPhoto,h=i.holder,d=i.prevPhoto,u="ilightbox-prev",c="ilightbox-next"}else if("prev"==t){if(!e.items[a])return!1;var l=i.prevPhoto,h=i.holder,d=i.nextPhoto,u="ilightbox-next",c="ilightbox-prev"}"function"==typeof n.callback.onBeforeChange&&n.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(r,function(){$(this).remove()}),f.length&&f.stop().fadeOut(r,function(){$(this).remove()}),e.items[a].caption){e.setCaption(e.items[a],l);var m=$("div.ilightbox-caption",l),g=parseInt(m.outerHeight()/l.outerHeight()*100);n.caption.start&&50>=g&&m.fadeIn(r)}var v=e.items[a].options.social;v&&(e.setSocial(v,e.items[a].URL,l),n.social.start&&$("div.ilightbox-social",l).fadeIn(n.effects.fadeSpeed)),$.each([l,h,d],function(t,e){e.removeClass("ilightbox-next ilightbox-prev")});var y=l.data("offset"),b=o.width-n.styles.pageOffsetX,w=o.height-n.styles.pageOffsetY,x=y.newDims.width,S=y.newDims.height,T=y.thumbsOffset,C=y.diff,_=parseInt(w/2-S/2-C.H-T.H/2),I=parseInt(b/2-x/2-C.W-T.W/2);l.css(transform,gpuAcceleration).animate({top:_,left:I,opacity:1},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){l.css(transform,"")}),$("div.ilightbox-container",l).animate({width:x,height:S},r,i.isSwipe?"easeOutCirc":"easeInOutCirc");var L=h.data("offset"),k=L.object;C=L.diff,x=L.newDims.width,S=L.newDims.height,x=parseInt(x*n.styles["next"==t?"prevScale":"nextScale"]),S=parseInt(S*n.styles["next"==t?"prevScale":"nextScale"]),_=parseInt("horizontal"==s?w/2-k.offsetY-S/2-C.H-T.H/2:w-k.offsetX-C.H-T.H/2),"prev"==t?I=parseInt("horizontal"==s?b-k.offsetX-C.W-T.W/2:b/2-x/2-C.W-k.offsetY-T.W/2):(_="horizontal"==s?_:parseInt(k.offsetX-C.H-S-T.H/2),I=parseInt("horizontal"==s?k.offsetX-C.W-x-T.W/2:b/2-k.offsetY-x/2-C.W-T.W/2)),$("div.ilightbox-container",h).animate({width:x,height:S},r,i.isSwipe?"easeOutCirc":"easeInOutCirc"),h.addClass(u).css(transform,gpuAcceleration).animate({top:_,left:I,opacity:n.styles.prevOpacity},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){h.css(transform,""),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(a).addClass("ilightbox-active"),e.positionThumbnails(),e.items[a]&&(i.lockWheel=e.items[a].options.mousewheel?!1:!0,i.lockSwipe=e.items[a].options.swipe?!1:!0),i.isSwipe=!1,"next"==t?(i.nextPhoto=d,i.prevPhoto=h,i.holder=l,i.nextPhoto.hide(),i.next=i.next+1,i.prev=i.current,i.current=i.current+1,n.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=d,i.nextPhoto=h,i.holder=l,i.prevPhoto.hide(),i.next=i.current,i.current=i.prev,i.prev=i.current-1,n.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),n.linkId&&setTimeout(function(){i.hashLock=!1},55),n.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 n.callback.onAfterChange&&n.callback.onAfterChange.call(e,e.ui)}),_="horizontal"==s?getPixel(d,"top"):parseInt("next"==t?-(w/2)-d.outerHeight():2*_),I="horizontal"==s?parseInt("next"==t?-(b/2)-d.outerWidth():2*I):getPixel(d,"left"),d.css(transform,gpuAcceleration).animate({top:_,left:I,opacity:n.styles.nextOpacity},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){d.css(transform,"")}).addClass(c)},setCaption:function(t,e){var i=$('
');t.caption&&(i.html(t.caption),$("div.ilightbox-container",e).append(i))},normalizeSocial:function(t,e){var i=this,n=(i.vars,i.options),s=window.location.href;return $.each(t,function(i,o){if(!o)return!0;var r,a,l=i.toLowerCase();switch(l){case"facebook":r="http://www.facebook.com/share.php?v=4&src=bm&u={URL}",a="Share on Facebook";break;case"twitter":r="http://twitter.com/home?status={URL}",a="Share on Twitter";break;case"googleplus":r="https://plus.google.com/share?url={URL}",a="Share on Google+";break;case"delicious":r="http://delicious.com/post?url={URL}",a="Share on Delicious";break;case"digg":r="http://digg.com/submit?phase=2&url={URL}",a="Share on Digg";break;case"reddit":r="http://reddit.com/submit?url={URL}",a="Share on reddit"}t[i]={URL:o.URL&&absolutizeURI(s,o.URL)||n.linkId&&window.location.href||"string"!=typeof e&&s||e&&absolutizeURI(s,e)||s,source:o.source||r||o.URL&&absolutizeURI(s,o.URL)||e&&absolutizeURI(s,e),text:o.text||a||"Share on "+i,width:"undefined"==typeof o.width||isNaN(o.width)?640:parseInt(o.width),height:o.height||360}}),t},setSocial:function(t,e,i){var n=this,s=$('
'),o="
    ";t=n.normalizeSocial(t,e),$.each(t,function(t,e){var i=(t.toLowerCase(),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,"+")));o+='
  • '}),o+="
",s.html(o),$("div.ilightbox-container",i).append(s)},fullScreenAction:function(){{var t=this;t.vars}fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen(document.documentElement):fullScreenApi.requestFullScreen(document.documentElement):t.doFullscreen()},doFullscreen:function(){var t=this,e=t.vars,i=getViewport(),n=t.options;if(n.fullAlone){var s=e.holder,o=t.items[e.current],r=i.width,a=i.height,l=[s,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",n.text.enterFullscreen),s.data({naturalWidth:s.data("naturalWidthOld"),naturalHeight:s.data("naturalHeightOld"),naturalWidthOld:null,naturalHeightOld:null}),$.each(l,function(t,e){e.removeClass("ilightbox-fullscreen")}),"function"==typeof n.callback.onExitFullScreen&&n.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",n.text.exitFullscreen),-1!=n.fullStretchTypes.indexOf(o.type))s.data({naturalWidthOld:s.data("naturalWidth"),naturalHeightOld:s.data("naturalHeight"),naturalWidth:r,naturalHeight:a});else{var i=o.options.fullViewPort||n.fullViewPort||"",d=r,u=a,c=s.data("naturalWidth"),p=s.data("naturalHeight");if("fill"==i.toLowerCase())u=d/c*p,a>u&&(d=a/p*c,u=a);else if("fit"==i.toLowerCase()){var f=t.getNewDimenstions(d,u,c,p,!0);d=f.width,u=f.height}else if("stretch"==i.toLowerCase())d=d,u=u;else{var m=c>d||p>u?!0:!1,f=t.getNewDimenstions(d,u,c,p,m);d=f.width,u=f.height}s.data({naturalWidthOld:s.data("naturalWidth"),naturalHeightOld:s.data("naturalHeight"),naturalWidth:d,naturalHeight:u})}$.each(l,function(t,e){e.addClass("ilightbox-fullscreen")}),"function"==typeof n.callback.onEnterFullScreen&&n.callback.onEnterFullScreen.call(t,t.ui)}}else e.isInFullScreen=e.isInFullScreen?!1:!0;t.repositionPhoto(!0)},closeAction:function(){var t=this,e=t.vars,i=t.options;$win.unbind(".iLightBox"),$doc.off(".iLightBox"),e.isInFullScreen&&fullScreenApi.cancelFullScreen(document.documentElement),$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails").off(".iLightBox"),i.hide.effect?e.overlay.stop().fadeOut(i.hide.speed,function(){e.overlay.remove(),e.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")}):(e.overlay.remove(),e.BODY.removeClass("ilightbox-noscroll").off(".iLightBox"));var n=[e.toolbar,e.holder,e.nextPhoto,e.prevPhoto,e.nextButton,e.prevButton,e.loader,e.thumbnails];$.each(n,function(t,e){e.removeAttr("style").remove()}),e.dontGenerateThumbs=e.isInFullScreen=!1,window.iLightBox=null,i.linkId&&(e.hashLock=!0,removeHash(),setTimeout(function(){e.hashLock=!1},55)),"function"==typeof i.callback.onHide&&i.callback.onHide.call(t,t.ui)},repositionPhoto:function(){var t=this,e=t.vars,i=t.options,n=i.path.toLowerCase(),s=getViewport(),o=s.width,r=s.height,a=e.isInFullScreen&&i.fullAlone||e.isMobile?0:"horizontal"==n?0:e.thumbnails.outerWidth(),l=e.isMobile?e.toolbar.outerHeight():e.isInFullScreen&&i.fullAlone?0:"horizontal"==n?e.thumbnails.outerHeight():0,h=e.isInFullScreen&&i.fullAlone?o:o-i.styles.pageOffsetX,d=e.isInFullScreen&&i.fullAlone?r:r-i.styles.pageOffsetY,u="horizontal"==n?parseInt(t.items[e.next]||t.items[e.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):30>=h/10?30:h/10):parseInt(30>=h/10?30:h/10)+a,c="horizontal"==n?parseInt(30>=d/10?30:d/10)+l:parseInt(t.items[e.next]||t.items[e.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):30>=d/10?30:d/10),p={type:"current",width:h,height:d,item:t.items[e.current],offsetW:u,offsetH:c,thumbsOffsetW:a,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"==n?{left:parseInt(h/2-e.loader.outerWidth()/2)}:{top:parseInt(d/2-e.loader.outerHeight()/2)};e.loader.css(f)},repositionEl:function(t){var e=this,i=e.vars,n=e.options,s=n.path.toLowerCase(),o="current"==t.type&&i.isInFullScreen&&n.fullAlone?t.width:t.width-t.offsetW,r="current"==t.type&&i.isInFullScreen&&n.fullAlone?t.height:t.height-t.offsetH,a=t.item,l=t.item.options,h=t.holder,d=t.offsetX||0,u=t.offsetY||0,c=t.thumbsOffsetW,p=t.thumbsOffsetH;"current"==t.type?("number"==typeof l.width&&l.width&&(o=i.isInFullScreen&&n.fullAlone&&(-1!=n.fullStretchTypes.indexOf(a.type)||l.fullViewPort||n.fullViewPort)?o:l.width>o?o:l.width),"number"==typeof l.height&&l.height&&(r=i.isInFullScreen&&n.fullAlone&&(-1!=n.fullStretchTypes.indexOf(a.type)||l.fullViewPort||n.fullViewPort)?r:l.height>r?r:l.height)):("number"==typeof l.width&&l.width&&(o=l.width>o?o:l.width),"number"==typeof l.height&&l.height&&(r=l.height>r?r:l.height)),r=parseInt(r-$(".ilightbox-inner-toolbar",h).outerHeight());var f="string"==typeof l.width&&-1!=l.width.indexOf("%")?percentToValue(parseInt(l.width.replace("%","")),t.width):h.data("naturalWidth"),m="string"==typeof l.height&&-1!=l.height.indexOf("%")?percentToValue(parseInt(l.height.replace("%","")),t.height):h.data("naturalHeight"),g="string"==typeof l.width&&-1!=l.width.indexOf("%")||"string"==typeof l.height&&-1!=l.height.indexOf("%")?{width:f,height:m}:e.getNewDimenstions(o,r,f,m),v=$.extend({},g,{});"prev"==t.type||"next"==t.type?(f=parseInt(g.width*("next"==t.type?n.styles.nextScale:n.styles.prevScale)),m=parseInt(g.height*("next"==t.type?n.styles.nextScale:n.styles.prevScale))):(f=g.width,m=g.height);var y=parseInt((getPixel(h,"padding-left")+getPixel(h,"padding-right")+getPixel(h,"border-left-width")+getPixel(h,"border-right-width"))/2),b=parseInt((getPixel(h,"padding-top")+getPixel(h,"padding-bottom")+getPixel(h,"border-top-width")+getPixel(h,"border-bottom-width")+$(".ilightbox-inner-toolbar",h).outerHeight())/2);switch(t.type){case"current":var w=parseInt(t.height/2-m/2-b-p/2),x=parseInt(t.width/2-f/2-y-c/2);break;case"next":var w=parseInt("horizontal"==s?t.height/2-u-m/2-b-p/2:t.height-d-b-p/2),x=parseInt("horizontal"==s?t.width-d-y-c/2:t.width/2-f/2-y-u-c/2);break;case"prev":var w=parseInt("horizontal"==s?t.height/2-u-m/2-b-p/2:d-b-m-p/2),x=parseInt("horizontal"==s?d-y-f-c/2:t.width/2-u-f/2-y-c/2)}h.data("offset",{top:w,left:x,newDims:v,diff:{W:y,H:b},thumbsOffset:{W:c,H:p},object:t}),t.animate>0&&n.effects.reposition?(h.css(transform,gpuAcceleration).stop().animate({top:w,left:x},n.effects.repositionSpeed,"easeOutCirc",function(){h.css(transform,"")}),$("div.ilightbox-container",h).stop().animate({width:f,height:m},n.effects.repositionSpeed,"easeOutCirc"),$("div.ilightbox-inner-toolbar",h).stop().animate({width:f},n.effects.repositionSpeed,"easeOutCirc",function(){$(this).css("overflow","visible")})):(h.css({top:w,left:x}),$("div.ilightbox-container",h).css({width:f,height:m}),$("div.ilightbox-inner-toolbar",h).css({width:f}))},resume:function(t){var e=this,i=e.vars,n=e.options;!n.slideshow.pauseTime||n.controls.slideshow&&i.total<=1||to.options.maxScale?factor=o.options.maxScale:factor=0||parseInt(PluginDetect.getVersion("Flash"))>=0?!0:!1,quicktime:parseInt(PluginDetect.getVersion("QuickTime"))>=0?!0:!1,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,e){var i,n=this;switch(e.type){case"video":var s=!1,o=e.videoType,r=e.options.html5video;("video/mp4"==o||"mp4"==e.ext||"m4v"==e.ext||r.h264)&&n.plugins.html5H264?(e.ext="mp4",e.URL=r.h264||e.URL):r.webm&&n.plugins.html5WebM?(e.ext="webm",e.URL=r.webm||e.URL):r.ogg&&n.plugins.html5Vorbis&&(e.ext="ogv",e.URL=r.ogg||e.URL),!n.plugins.html5H264||"video/mp4"!=o&&"mp4"!=e.ext&&"m4v"!=e.ext?!n.plugins.html5WebM||"video/webm"!=o&&"webm"!=e.ext?!n.plugins.html5Vorbis||"video/ogg"!=o&&"ogv"!=e.ext?!n.plugins.html5QuickTime||"video/quicktime"!=o&&"mov"!=e.ext&&"qt"!=e.ext||(s=!0,o="video/quicktime"):(s=!0,o="video/ogg"):(s=!0,o="video/webm"):(s=!0,o="video/mp4"),s?i=$("