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