/** * LC Lightbox - LITE * yet.. another jQuery lightbox.. or not? * * @version : 1.2.9 * @copyright : Luca Montanari aka LCweb * @website : https://lcweb.it * @requires : jQuery v1.7 or later * Released under the MIT license */ (function(b){lcl_objs=[];lcl_is_active=lcl_shown=!1;lcl_slideshow=void 0;lcl_on_mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);lcl_hashless_url=lcl_deeplink_tracked=lcl_curr_vars=lcl_curr_opts=lcl_curr_obj=!1;lcl_url_hash="";lc_lightbox=function(k,C){if("string"!=typeof k&&("object"!=typeof k||!k.length))return!1;var w=!1;b.each(lcl_objs,function(b,h){if(JSON.stringify(h)==JSON.stringify(k))return w=h,!1});if(!1===w){var v=new D(k,C);lcl_objs.push(v); return v}return w};lcl_destroy=function(k){k=b.inArray(k,lcl_objs);-1!==k&&lcl_objs.splice(k,1)};var D=function(k,C){var w=b.extend({gallery:!0,gallery_hook:"rel",live_elements:!0,preload_all:!1,global_type:"image",src_attr:"href",title_attr:"title",txt_attr:"data-lcl-txt",author_attr:"data-lcl-author",slideshow:!0,open_close_time:400,ol_time_diff:100,fading_time:80,animation_time:250,slideshow_time:6E3,autoplay:!1,counter:!1,progressbar:!0,carousel:!0,max_width:"93%",max_height:"93%",wrap_padding:!1, ol_opacity:.7,ol_color:"#111",ol_pattern:!1,border_w:0,border_col:"#ddd",padding:0,radius:0,shadow:!0,remove_scrollbar:!0,wrap_class:"",skin:"light",data_position:"over",cmd_position:"inner",ins_close_pos:"normal",nav_btn_pos:"normal",txt_hidden:500,show_title:!0,show_descr:!0,show_author:!0,thumbs_nav:!0,tn_icons:!0,tn_hidden:500,thumbs_w:110,thumbs_h:110,thumb_attr:!1,thumbs_maker_url:!1,fullscreen:!1,fs_img_behavior:"fit",fs_only:500,browser_fs_mode:!0,socials:!1,fb_share_params:!1,txt_toggle_cmd:!0, download:!1,touchswipe:!0,mousewheel:!0,modal:!1,rclick_prevent:!1,elems_parsed:function(){},html_is_ready:function(){},on_open:function(){},on_elem_switch:function(){},slideshow_start:function(){},slideshow_end:function(){},on_fs_enter:function(){},on_fs_exit:function(){},on_close:function(){}},C),v={elems:[],is_arr_instance:"string"!=typeof k&&"undefined"==typeof k[0].childNodes?!0:!1,elems_count:"string"!=typeof k&&"undefined"==typeof k[0].childNodes?k.length:b(k).length,elems_selector:"string"== typeof k?k:!1,elem_index:!1,gallery_hook_val:!1,preload_all_used:!1,img_sizes_cache:[],inner_cmd_w:!1,txt_exists:!1,txt_und_sizes:!1,force_fullscreen:!1,html_style:"",body_style:""};"string"==typeof k&&(k=b(k));var l=b.data(k,"lcl_settings",w),h=b.data(k,"lcl_vars",v),z=function(b){if("string"!=typeof b)return b;for(var c=0,e=0,f=b.toString().length;ec?-1*c:c},D=function(c){var d=!1;b.each(h.elems,function(b,f){if(f.hash==c)return d=f,!1});return d},B= function(c){if(!c)return c;c=c.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");return b.trim(c)},E=function(c,d){var e=l[d];return-1!==e.indexOf("> ")?c.find(e.replace("> ","")).length?b.trim(c.find(e.replace("> ","")).html()):"":"undefined"!=typeof c.attr(e)?B(c.attr(e)):""},X=function(c){var d=l,e=[];c.each(function(){var c=b(this),g=c.attr(d.src_attr),m=z(g);if(h.gallery_hook_val&&c.attr(d.gallery_hook)!=h.gallery_hook_val)return!0; m=D(m);if(!m){m=g;var k=c.data("lcl-type");"undefined"==typeof k?k=l.global_type:(m=m.toLowerCase(),k=/^(http|https)?:\/\/(?:[a-z\-]+\.)+[a-z]{2,6}(?:\/[^\/#?]+)+\.(?:jpe?g|gif|png)$/.test(m)?"image":"unknown");"unknown"!=k?(m={src:g,type:k,hash:d.deeplink?z(g):!1,title:d.show_title?E(c,"title_attr"):"",txt:d.show_descr?E(c,"txt_attr"):"",author:d.show_author?E(c,"author_attr"):"",thumb:d.thumb_attr&&"undefined"!=typeof d.thumb_attr?c.attr(d.thumb_attr):"",width:"image"!=k&&"undefined"!=typeof c.data("lcl-w")? c.data("lcl-w"):!1,height:"image"!=k&&"undefined"!=typeof c.data("lcl-h")?c.data("lcl-h"):!1,force_over_data:"undefined"!=typeof c.data("lcl-force-over-data")?parseInt(c.data("lcl-force-over-data"),10):"",force_outer_cmd:"undefined"!=typeof c.data("lcl-outer-cmd")?c.data("lcl-outer-cmd"):""},m.download="image"==k?"undefined"!=typeof c.data("lcl-path")?c.data("lcl-path"):g:!1):m={src:g,type:k,hash:d.deeplink?z(g):!1}}e.push(m)});2>e.length&&b(".lcl_prev, .lcl_next, #lcl_thumb_nav").remove();if(!e.length)return!1; h.elems=e;return!0},K=function(){if(2>h.elems.length||!l.gallery)return!1;0").bind("load",function(){f.img_sizes_cache[g]={w:this.width,h:this.height};c&&d==f.elem_index&& L()}).attr("src",g):((c||"undefined"!=typeof e)&&b("#lcl_loader").addClass("no_loader"),c&&L())},M=function(c,d){var e=b.data(c,"lcl_settings"),f=b.data(c,"lcl_vars");if(f.is_arr_instance){var g=[];b.each(c,function(c,d){var f={},h="undefined"==typeof d.type&&e.global_type?e.global_type:!1;"undefined"!=typeof d.type&&(h=d.type);h&&-1!==b.inArray(h,["image"])?"undefined"!=typeof d.src&&d.src&&(f.src=d.src,f.type=h,f.hash=z(d.src),f.title="undefined"==typeof d.title?"":B(d.title),f.txt="undefined"== typeof d.txt?"":B(d.txt),f.author="undefined"==typeof d.author?"":B(d.author),f.width="undefined"==typeof d.width?!1:d.width,f.height="undefined"==typeof d.height?!1:d.height,f.force_over_data="undefined"==typeof d.force_over_data?!1:parseInt(d.force_over_data,10),f.force_outer_cmd="undefined"==typeof d.force_outer_cmd?!1:d.force_outer_cmd,f.thumb="undefined"==typeof d.thumb?!1:d.thumb,f.download="image"==h?"undefined"!=typeof d.download?d.download:d.src:!1,g.push(f)):(f={src:f.src,type:"unknown", hash:e.deeplink?z(f.src):!1},g.push(f))});f.elems=g}else{var m=c;e.live_elements&&f.elems_selector&&(m=d&&e.gallery&&e.gallery_hook&&"undefined"!=typeof b(k[0]).attr(e.gallery_hook)?f.elems_selector+"["+e.gallery_hook+"="+d.attr(e.gallery_hook)+"]":f.elems_selector,m=b(m));if(!X(m))return(!e.live_elements||e.live_elements&&!f.elems_selector)&&console.error("LC Lightbox - no valid elements found"),!1}e.preload_all&&!f.preload_all_used&&(f.preload_all_used=!0,b(document).ready(function(c){b.each(f.elems, function(b,c){y(!1,b)})}));"function"==typeof e.elems_parsed&&e.elems_parsed.call(null,l,h);f.is_arr_instance||(m=f.elems_selector?b(f.elems_selector):c,m.first().trigger("lcl_elems_parsed",[f.elems]));return!0};M(k);var G=function(c,d){if(lcl_shown||lcl_is_active)return!1;lcl_is_active=lcl_shown=!0;lcl_curr_obj=c;l=b.data(c,"lcl_settings");h=b.data(c,"lcl_vars");lcl_curr_opts=l;lcl_curr_vars=h;var e=l,f=h,g="undefined"!=typeof d?d:!1;if(!h)return console.error("LC Lightbox - cannot open. Object not initialized"), !1;f.gallery_hook_val=g&&e.gallery&&e.gallery_hook&&"undefined"!=typeof g.attr(e.gallery_hook)?g.attr(e.gallery_hook):!1;if(!M(c,d))return!1;if(g)b.each(f.elems,function(b,c){if(c.src==g.attr(e.src_attr))return f.elem_index=b,!1});else if(parseInt(f.elem_index,10)>=f.elems_count)return console.error("LC Lightbox - selected index does not exist"),!1;y(!1);Y();Z();f.force_fullscreen&&F(!0,!0);b("#lcl_thumbs_nav").length&&aa();y(!0);K()},N=function(){b("#lcl_wrap").removeClass("lcl_pre_show").addClass("lcl_shown"); b("#lcl_loader").removeClass("lcl_loader_pre_first_el")},Y=function(){var c=l,d=h,e=[],f="";"number"==typeof document.documentMode&&(b("body").addClass("lcl_old_ie"),"outer"!=c.cmd_position&&(c.nav_btn_pos="normal"));b("#lcl_wrap").length&&b("#lcl_wrap").remove();b("body").append('
'); b("#lcl_wrap").attr("data-lcl-max-w",c.max_width).attr("data-lcl-max-h",c.max_height);e.push("lcl_"+c.ins_close_pos+"_close lcl_nav_btn_"+c.nav_btn_pos+" lcl_"+c.ins_close_pos+"_close lcl_nav_btn_"+c.nav_btn_pos);(!0===c.tn_hidden||"number"==typeof c.tn_hidden&&(b(window).width()d.elems.length||!c.gallery)&&b(".lcl_counter").remove();d.force_fullscreen=!1;if(!c.fullscreen)b(".lcl_fullscreen").remove(); else if(!0===c.fs_only||"number"==typeof c.fs_only&&(b(window).width()d.elems.length||!c.gallery?b(".lcl_prev, .lcl_play, .lcl_next").remove():"middle"==c.nav_btn_pos&&(f+=".lcl_prev, .lcl_next {margin: "+c.padding+"px;}");!c.thumbs_nav||2>h.elems.length||!c.gallery?b("#lcl_thumbs_nav, .lcl_thumbs_toggle").remove():(b("#lcl_thumbs_nav").css("height",c.thumbs_h),g=b("#lcl_thumbs_nav").outerHeight(!0)-c.thumbs_h, f+="#lcl_window {margin-top: "+-1*(c.thumbs_h-g)+"px;}",f+=".lcl_tn_hidden.lcl_outer_cmd:not(.lcl_fullscreen_mode) #lcl_window {margin-bottom: "+-1*b(".lcl_close").outerHeight(!0)+"px;}");e.push("lcl_txt_"+c.data_position+" lcl_"+c.skin);f+="#lcl_overlay {background-color: "+c.thumbs_h+"px; opacity: "+c.ol_opacity+";}";c.ol_pattern&&b("#lcl_overlay").addClass("lcl_pattern_"+c.ol_pattern);c.modal&&b("#lcl_overlay").addClass("lcl_modal");c.wrap_padding&&(f+="#lcl_wrap {padding: "+c.wrap_padding+";}"); c.border_w&&(f+="#lcl_window {border: "+c.border_w+"px solid "+c.border_col+";}");c.padding&&(f+="#lcl_subj, #lcl_txt, #lcl_nav_cmd {margin: "+c.padding+"px;}");c.radius&&(f+="#lcl_window, #lcl_contents_wrap {border-radius: "+c.radius+"px;}");c.shadow&&(f+="#lcl_window {box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);}");"inner"==c.cmd_position&&"corner"==c.ins_close_pos&&(f+="#lcl_corner_close {top: "+-1*(c.border_w+Math.ceil(b("#lcl_corner_close").outerWidth()/2))+"px;right: "+-1*(c.border_w+Math.ceil(b("#lcl_corner_close").outerHeight()/ 2))+";}",b("#lcl_nav_cmd > *:not(.lcl_close)").length||(f+="#lcl_wrap:not(.lcl_fullscreen_mode):not(.lcl_forced_outer_cmd) #lcl_nav_cmd {display: none;}"));b("#lcl_inline_style").length&&b("#lcl_inline_style").remove();b("head").append('");c.remove_scrollbar&&(h.html_style="undefined"!=typeof jQuery("html").attr("style")?jQuery("html").attr("style"):"",h.body_style="undefined"!=typeof jQuery("body").attr("style")?jQuery("body").attr("style"):"",f=b(window).width(),b("html").css("overflow","hidden"),b("html").css({"margin-right":b(window).width()-f,"touch-action":"none"}),b("body").css({overflow:"visible","touch-action":"none"}));f=h.elems[d.elem_index];"image"!=f.type||"image"==f.type&&"undefined"!=typeof d.img_sizes_cache[f.src]? e.push("lcl_show_already_shaped"):N();b("#lcl_wrap").addClass(e.join(" "));"function"==typeof c.html_is_ready&&c.html_is_ready.call(null,l,h);h.is_arr_instance||(h.elems_selector?b(h.elems_selector):lcl_curr_obj).first().trigger("lcl_html_is_ready",[l,h])},ba=function(c){var d=b(c)[0],e=null;d.addEventListener("touchstart",function(b){1===b.targetTouches.length&&(e=b.targetTouches[0].clientY)},!1);d.addEventListener("touchmove",function(b){if(1===b.targetTouches.length){var c=b.targetTouches[0].clientY- e;0===d.scrollTop&&0c&&b.preventDefault()}},!1)},L=function(){if(!lcl_shown)return!1;var c=h,d=c.elems[c.elem_index];b("#lcl_wrap").attr("lc-lelem",c.elem_index);l.carousel||(b("#lcl_wrap").removeClass("lcl_first_elem lcl_last_elem"),c.elem_index?c.elem_index==c.elems.length-1&&b("#lcl_wrap").addClass("lcl_last_elem"):b("#lcl_wrap").addClass("lcl_first_elem"));b(document).trigger("lcl_before_populate_global",[d,c.elem_index]);var e= h.elem_index;b("#lcl_elem_wrap").removeAttr("style").removeAttr("class").empty();b("#lcl_wrap").attr("lcl-type",d.type);b("#lcl_elem_wrap").addClass("lcl_"+d.type+"_elem");switch(d.type){case "image":b("#lcl_elem_wrap").css("background-image","url('"+d.src+"')");break;default:b("#lcl_elem_wrap").html('

Error loading the resource ..
')}if(lcl_curr_opts.download)if(d.download){b(".lcl_download").show();var f=d.download.split("/");f=f[f.length-1];b(".lcl_download").html('')}else b(".lcl_download").hide();b(".lcl_counter").html(e+1+" / "+h.elems.length);H(d)&&"unknown"!=d.type?(b("#lcl_wrap").removeClass("lcl_no_txt"),b(".lcl_txt_toggle").show(),d.title&&b("#lcl_txt").append('

'+d.title+"

"),d.author&&b("#lcl_txt").append('
by '+d.author+"
"),d.txt&&b("#lcl_txt").append('
'+d.txt+"
"),d.txt&&(d.title&&d.author?b("#lcl_txt h5").addClass("lcl_txt_border"): b("#lcl_txt h3").length?b("#lcl_txt h3").addClass("lcl_txt_border"):b("#lcl_txt h5").addClass("lcl_txt_border"))):(b(".lcl_txt_toggle").hide(),b("#lcl_wrap").addClass("lcl_no_txt"));ba("#lcl_txt");c.is_arr_instance||(e=c.elems_selector?b(c.elems_selector):lcl_curr_obj,e.first().trigger("lcl_before_show",[d,c.elem_index]));b(document).trigger("lcl_before_show_global",[d,c.elem_index]);b("#lcl_wrap").hasClass("lcl_pre_first_el")&&("function"==typeof l.on_open&&l.on_open.call(null,l,h),c.is_arr_instance|| (e=c.elems_selector?b(c.elems_selector):lcl_curr_obj,e.first().trigger("lcl_on_open",[d,c.elem_index])));x(d);b("#lcl_subj").removeClass("lcl_switching_el")},H=function(b){return b.title||b.txt||b.author?!0:!1},O=function(c,d,e){var f=0,g=b("#lcl_wrap"),h=b(window).width()-parseInt(g.css("padding-left"),10)-parseInt(g.css("padding-right"),10);g=b(window).height()-parseInt(g.css("padding-top"),10)-parseInt(g.css("padding-bottom"),10);!isNaN(parseFloat(c))&&isFinite(c)?f=parseInt(c,10):-1!==c.toString().indexOf("%")? f=("w"==d?h:g)*(parseInt(c,10)/100):-1!==c.toString().indexOf("vw")?f=h*(parseInt(c,10)/100):-1!==c.toString().indexOf("vh")&&(f=g*(parseInt(c,10)/100));"undefined"==typeof e&&("w"==d&&f>h&&(f=h),"h"==d&&f>g&&(f=g));return f},x=function(c,d,e){var f=l,g=h;"undefined"==typeof d&&(d={});var k=(e=b(".lcl_fullscreen_mode").length?!0:!1)?0:2*parseInt(f.border_w,10)+2*parseInt(f.padding,10);"undefined"!=typeof d.side_txt_checked||"undefined"!=typeof d.no_txt_under&&d.no_txt_under||b("#lcl_wrap").removeClass("lcl_force_txt_over"); var n=b(".lcl_force_txt_over").length||b(".lcl_hidden_txt").length||-1===b.inArray(f.data_position,["rside","lside"])||!H(c)?0:b("#lcl_txt").outerWidth();var u=e||!b("#lcl_thumbs_nav").length||b(".lcl_tn_hidden").length?0:b("#lcl_thumbs_nav").outerHeight(!0)-parseInt(b("#lcl_wrap").css("padding-bottom"),10);var p=!e&&b(".lcl_outer_cmd").length?b(".lcl_close").outerHeight(!0)+parseInt(b("#lcl_nav_cmd").css("padding-top"),10)+parseInt(b("#lcl_nav_cmd").css("padding-bottom"),10):0;var q=k+n;u=k+u+p; var r=b("#lcl_wrap").attr("data-lcl-max-w");p=b("#lcl_wrap").attr("data-lcl-max-h");q=e?b(window).width():Math.floor(O(r,"w"))-q;p=e?b(window).height():Math.floor(O(p,"h"))-u;if("object"==typeof g.txt_und_sizes){if(q=g.txt_und_sizes.w,u=g.txt_und_sizes.h,"image"==c.type)var t=g.img_sizes_cache[c.src]}else switch(c.type){case "image":b("#lcl_elem_wrap").css("bottom",0);if("undefined"==typeof g.img_sizes_cache[c.src])return!1;t=g.img_sizes_cache[c.src];t.w<=q?(q=t.w,u=t.h):u=Math.floor(t.h/t.w*q);u> p&&(u=p,q=Math.floor(t.w/t.h*u));if(H(c)&&!b(".lcl_hidden_txt").length&&"under"==f.data_position&&"undefined"==typeof d.no_txt_under)return P(q,u,p),b(document).off("lcl_txt_und_calc").on("lcl_txt_und_calc",function(){if(g.txt_und_sizes)return"no_under"==g.txt_und_sizes&&(d.no_txt_under=!0),x(g.elems[g.elem_index],d)}),!1;b("#lcl_subj").css("maxHeight","none");break;default:q=280,u=125}if(("rside"==f.data_position||"lside"==f.data_position)&&!b(".lcl_no_txt").length&&"undefined"==typeof d.side_txt_checked&& (t="image"==c.type?g.img_sizes_cache[c.src]:"",(p=c.force_over_data)||(p=400),"image"==c.type&&t.w>p&&t.h>p&&!ca(c,p,q+k,u+k,n)))return d.side_txt_checked=!0,x(c,d);g.txt_und_sizes=!1;if("undefined"==typeof d.inner_cmd_checked&&("inner"==f.cmd_position||c.force_outer_cmd)&&da(c,q))return d.inner_cmd_checked=!0,x(c,d);b("#lcl_wrap").removeClass("lcl_pre_first_el");b("#lcl_window").css({width:e?"100%":q+k+n,height:e?"100%":u+k});b(".lcl_show_already_shaped").length&&setTimeout(function(){b("#lcl_wrap").removeClass("lcl_show_already_shaped"); N()},10);Q();"undefined"!=typeof lcl_size_n_show_timeout&&clearTimeout(lcl_size_n_show_timeout);k=b(".lcl_first_sizing").length?f.open_close_time+20:f.animation_time;if(b(".lcl_browser_resize").length||b(".lcl_toggling_fs").length||e)k=0;lcl_size_n_show_timeout=setTimeout(function(){lcl_is_active&&(lcl_is_active=!1);b(".lcl_first_sizing").length&&f.autoplay&&1= e&&-1.15<=e&&350>=h&&350>=d?b(".lcl_image_elem").css("background-size","cover"):b(".lcl_image_elem").css("background-size","contain")}}else b(".lcl_image_elem").css("background-size","cover");b("#lcl_wrap").removeClass("lcl_first_sizing lcl_switching_elem lcl_is_resizing lcl_browser_resize");b("#lcl_loader").removeClass("no_loader");b(document).trigger("lcl_resized_window")},k)};b(window).resize(function(){if(!lcl_shown||k!=lcl_curr_obj||b(".lcl_toggling_fs").length)return!1;b("#lcl_wrap").addClass("lcl_browser_resize"); "undefined"!=typeof lcl_rs_defer&&clearTimeout(lcl_rs_defer);lcl_rs_defer=setTimeout(function(){lcl_resize()},50)});var P=function(c,d,e,f){var g="undefined"==typeof f?1:f,k=b(".lcl_fullscreen_mode").length;b("#lcl_txt").outerHeight();var n=c/d;if(k&&b("#lcl_thumbs_nav").length)return b("#lcl_wrap").addClass("lcl_force_txt_over"),b("#lcl_subj").css("maxHeight","none"),b("#lcl_txt").css({right:0,width:"auto"}),h.txt_und_sizes="no_under",b(document).trigger("lcl_txt_und_calc"),!1;b("#lcl_wrap").removeClass("lcl_force_txt_over").addClass("lcl_txt_under_calc"); k?b("#lcl_txt").css({right:0,width:"auto"}):b("#lcl_txt").css({right:"auto",width:c});"undefined"!=typeof lcl_txt_under_calc&&clearInterval(lcl_txt_under_calc);lcl_txt_under_calc=setTimeout(function(){var m=Math.ceil(b("#lcl_txt").outerHeight()),p=d+m-e;if(k)return b("#lcl_wrap").removeClass("lcl_txt_under_calc"),b("#lcl_subj").css("maxHeight","calc(100% - "+m+"px)"),h.txt_und_sizes={w:c,h:d},b(document).trigger("lcl_txt_und_calc"),!1;if(0f)){m=d-p;p=Math.floor(m*n); var q=h.elems[h.elem_index].force_over_data;q||(q=400);return pe.elems.length||!l.gallery||b(".lcl_switching_elem").length)return!1;if("next"==c)if(e.elem_index==e.elems.length-1){if(!f)return!1;c=0}else c=e.elem_index+1;else if("prev"==c)if(e.elem_index)c=e.elem_index-1;else{if(!f)return!1;c=e.elems.length-1}else if(c=parseInt(c,10),0>c||c>=e.elems.length||c==e.elem_index)return!1;"undefined"!=typeof lcl_slideshow&&("undefined"==typeof d||!f&&c==e.elems.length-1)&&lcl_stop_slideshow();lcl_is_active=!0;R(c);y(!1,c,!0);b("#lcl_wrap").addClass("lcl_switching_elem"); setTimeout(function(){b("#lcl_wrap").removeClass("lcl_playing_video");"html"==e.elems[e.elem_index].type&&(b("#lcl_window").css("height",b("#lcl_contents_wrap").outerHeight()),b("#lcl_contents_wrap").css("maxHeight","none"));"function"==typeof l.on_elem_switch&&l.on_elem_switch.call(null,l,h,c);!e.is_arr_instance&&lcl_curr_obj&&(e.elems_selector?b(e.elems_selector):lcl_curr_obj).first().trigger("lcl_on_elem_switch",[e.elem_index,c]);b("#lcl_wrap").removeClass("lcl_no_txt lcl_loading_iframe");b("#lcl_txt").empty(); e.elem_index=c;y(!0);K()},l.fading_time)},S=function(c){var d=l;if(!d.progressbar)return!1;c=c?0:d.animation_time+d.fading_time;var e=d.slideshow_time+d.animation_time-c;b("#lcl_progressbar").length||b("#lcl_wrap").append('
');"undefined"!=typeof lcl_pb_timeout&&clearTimeout(lcl_pb_timeout);lcl_pb_timeout=setTimeout(function(){b("#lcl_progressbar").stop(!0).removeAttr("style").css("width",0).animate({width:"100%"},e,"linear",function(){b("#lcl_progressbar").fadeTo(0, 0)})},c)},I=function(){if(!lcl_shown)return!1;"function"==typeof l.on_close&&l.on_close.call(null,l,h);h.is_arr_instance||(h.elems_selector?b(h.elems_selector):lcl_curr_obj).first().trigger("lcl_on_close");b(document).trigger("lcl_on_close_global");b("#lcl_wrap").removeClass("lcl_shown").addClass("lcl_is_closing lcl_tn_hidden");lcl_stop_slideshow();b(".lcl_fullscreen_mode").length&&T();setTimeout(function(){b("#lcl_wrap, #lcl_inline_style").remove();l.remove_scrollbar&&(jQuery("html").attr("style", h.html_style),jQuery("body").attr("style",h.body_style));b(document).trigger("lcl_closed_global");lcl_is_active=lcl_shown=lcl_curr_vars=lcl_curr_opts=lcl_curr_obj=!1},l.open_close_time+80);"undefined"!=typeof lcl_size_check&&clearTimeout(lcl_size_check)},F=function(c,d){"undefined"==typeof d&&(d=!1);if(!lcl_shown||!l.fullscreen||!d&&lcl_is_active)return!1;var e=l,f=h;b("#lcl_wrap").addClass("lcl_toggling_fs");e.browser_fs_mode&&"undefined"!=typeof c&&(document.documentElement.requestFullscreen?document.documentElement.requestFullscreen(): document.documentElement.msRequestFullscreen?document.documentElement.msRequestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT));setTimeout(function(){b("#lcl_wrap").addClass("lcl_fullscreen_mode");x(f.elems[f.elem_index]);b(document).on("lcl_resized_window",function(){b(document).off("lcl_resized_window");(d||"under"== lcl_curr_opts.data_position&&!b(".lcl_force_txt_over").length)&&x(lcl_curr_vars.elems[lcl_curr_vars.elem_index]);setTimeout(function(){b("#lcl_wrap").removeClass("lcl_toggling_fs")},150)})},d?e.open_close_time:e.fading_time);"function"==typeof e.on_fs_enter&&e.on_fs_enter.call(null,e,f);h.is_arr_instance||lcl_curr_obj.first().trigger("lcl_on_fs_enter")},U=function(c){if(!lcl_shown||!l.fullscreen||lcl_is_active)return!1;var d=l;b("#lcl_wrap").addClass("lcl_toggling_fs");b("#lcl_window").fadeTo(70, 0);setTimeout(function(){if(d.browser_fs_mode&&"undefined"!=typeof c){T();var e=250}else e=0;b("#lcl_wrap").removeClass("lcl_fullscreen_mode");setTimeout(function(){x(h.elems[h.elem_index]);var c=c||navigator.userAgent;c=-1
    ');b("#lcl_thumbs_nav").attr("rel",e);b.each(h.elems, function(f,g){if("unknown"!=g.type){c||(d&&d!=g.type?c=!0:d=g.type);var k="",n="";tpc="";if(g.thumb)n=g.thumb,k="style=\"background-image: url('"+g.thumb+"');\"";else{switch(g.type){case "image":n=g.src;break;case "youtube":n=g.poster?g.poster:"https://img.youtube.com/vi/"+g.video_id+"/maxresdefault.jpg";break;case "vimeo":g.poster?n=g.poster:"undefined"==typeof h.vimeo_thumb_cache[g.src]?(tpc="lcl_tn_preload",b.getJSON("https://www.vimeo.com/api/v2/video/"+g.video_id+".json?callback=?",{format:"json"}, function(c){V(c[0].thumbnail_large,f,e);h.vimeo_thumb_cache[g.src]=c[0].thumbnail_large;b(".lcl_tn_inner li[rel="+f+"]").attr("style",b(".lcl_tn_inner li[rel="+f+"]").attr("style")+" background-image: url('"+c[0].thumbnail_large+"');")})):n=h.vimeo_thumb_cache[g.src];break;case "video":case "iframe":case "html":g.poster&&(n=g.poster);break;case "dailymotion":n=g.poster?g.poster:"http://www.dailymotion.com/thumbnail/video/"+g.video_id}n&&(l.thumbs_maker_url&&(g.poster||-1===b.inArray(g.type,["youtube", "vimeo","dailymotion"]))&&(n=l.thumbs_maker_url.replace("%URL%",encodeURIComponent(n)).replace("%W%",l.thumbs_w).replace("%H%",l.thumbs_h)),k="style=\"background-image: url('"+n+"');\"",-1===b.inArray(g.type,["youtube","vimeo","dailymotion"])||g.poster||(h.elems[f].vid_poster=n))}if(("html"==g.type||"iframe"==g.type)&&!k)return!0;var u="video"!=g.type||k?"":'';tpc="lcl_tn_preload";b(".lcl_tn_inner").append('
  • "+u+"
  • ");tpc&&V(n,f,e)}});if(2>b(".lcl_tn_inner > li").length)return b("#lcl_thumbs_nav").remove(),!1;b(".lcl_tn_inner > li").css("width",l.thumbs_w);lcl_on_mobile||b(".lcl_tn_inner").lcl_smoothscroll(.3,400,!1,!0);c&&l.tn_icons&&b(".lcl_tn_inner").addClass("lcl_tn_mixed_types");setTimeout(function(){R(h.elem_index)},300)},V=function(c,d,e){b("").bind("load",function(){if(!h)return!1;h.img_sizes_cache[c]={w:this.width,h:this.height};b("#lcl_thumbs_nav[rel="+e+"] li[rel="+d+"]").removeClass("lcl_tn_preload"); setTimeout(function(){Q();J()},500)}).attr("src",c)},W=function(){var c=0;b(".lcl_tn_inner > li").each(function(){c+=b(this).outerWidth(!0)});return c},Q=function(){if(!b("#lcl_thumbs_nav").length)return!1;W()>b(".lcl_tn_inner").width()?b("#lcl_thumbs_nav").addClass("lcl_tn_has_arr"):b("#lcl_thumbs_nav").removeClass("lcl_tn_has_arr")},J=function(){var c=b(".lcl_tn_inner").scrollLeft();c?b(".lcl_tn_prev").removeClass("lcl_tn_disabled_arr").stop(!0).fadeTo(150,1):b(".lcl_tn_prev").addClass("lcl_tn_disabled_arr").stop(!0).fadeTo(150, .5);c>=W()-b(".lcl_tn_inner").width()?b(".lcl_tn_next").addClass("lcl_tn_disabled_arr").stop(!0).fadeTo(150,.5):b(".lcl_tn_next").removeClass("lcl_tn_disabled_arr").stop(!0).fadeTo(150,1)};b(document).on("lcl_smoothscroll_end",".lcl_tn_inner",function(b){if(k!=lcl_curr_obj)return!0;J()});var R=function(c){var d=b(".lcl_tn_inner > li[rel="+c+"]");if(!d.length)return!1;var e=0;b(".lcl_tn_inner > li").each(function(d,f){if(b(this).attr("rel")==c)return e=d,!1});var f=b(".lcl_tn_inner > li").last().outerWidth(), g=parseInt(b(".lcl_tn_inner > li").last().css("margin-left"),10);b(".lcl_tn_inner").width();var h=Math.floor((b(".lcl_tn_inner").width()-f-g)/2);f=f*e+g*(e-1)+Math.floor(g/2)-h;b(".lcl_tn_inner").stop(!0).animate({scrollLeft:f},500,function(){b(".lcl_tn_inner").trigger("lcl_smoothscroll_end");b("#lcl_thumbs_nav").removeClass("lcl_pre_tn_scroll")});b(".lcl_tn_inner > li").removeClass("lcl_sel_thumb");d.addClass("lcl_sel_thumb")};b.fn.lcl_smoothscroll=function(c,d,e,f){if(lcl_on_mobile)return!1;this.off("mousemove mousedown mouseup mouseenter mouseleave"); var g=this,h="undefined"!=typeof e&&e?!1:!0,k="undefined"!=typeof f&&f?!1:!0,l=!1,p=!1,q=0,r=0,t=0,v=0;g.mousemove(function(b){!0===p&&(g.stop(!0),h&&g.scrollLeft(v+(r-b.pageX)),k&&g.scrollTop(t+(q-b.pageY)))});g.mouseover(function(){l&&clearTimeout(l)});g.mouseout(function(){l=setTimeout(function(){l=p=!1},500)});g.mousedown(function(b){"undefined"!=typeof lc_sms_timeout&&clearTimeout(lc_sms_timeout);p=!0;t=g.scrollTop();v=g.scrollLeft();q=b.pageY;r=b.pageX});g.mouseup(function(e){p=!1;var f=g.scrollTop(), l=-1*(t-f);f+=l*c;var m=g.scrollLeft(),n=-1*(v-m);m+=n*c;if(3>l&&-3n&&-3a&&!d.is("#lcl_window");a++)if(d[0].scrollHeight>d.outerHeight()){e=!1;break}else d=d.parent();e&&(c.preventDefault(),c=c.originalEvent.deltaY,0c.animation_time?c.animation_time:150,g=0;d&&!e?b("#lcl_subj").fadeTo(f,0):e||(b("#lcl_contents_wrap").fadeTo(f,0),g=f);setTimeout(function(){b("#lcl_wrap").toggleClass("lcl_hidden_txt")},g);e||(lcl_is_active=!0,b("#lcl_wrap").addClass("lcl_toggling_txt"),setTimeout(function(){lcl_is_active=!1;lcl_resize()},c.animation_time),setTimeout(function(){b("#lcl_wrap").removeClass("lcl_toggling_txt");d&&!e?b("#lcl_subj").fadeTo(f,1):e||b("#lcl_contents_wrap").fadeTo(f,1)},2*c.animation_time+50))}else b("#lcl_wrap").toggleClass("lcl_hidden_txt")}); b(document).on("click",".lcl_play",function(c){if(k!=lcl_curr_obj)return!0;b(".lcl_is_playing").length?lcl_stop_slideshow():lcl_start_slideshow()});b(document).on("click",".lcl_elem",function(c){if(k!=lcl_curr_obj)return!0;b(".lcl_playing_video").length||-1===b.inArray(b("#lcl_wrap").attr("lcl-type"),["video"])||(lcl_stop_slideshow(),b("#lcl_wrap").addClass("lcl_playing_video"))});b(document).on("click",".lcl_socials",function(c){if(k!=lcl_curr_obj)return!0;if(b(".lcl_socials > div").length)b(".lcl_socials_tt").removeClass("lcl_show_tt"), setTimeout(function(){b(".lcl_socials").removeClass("lcl_socials_shown").empty()},260);else{var d=lcl_curr_vars.elems[lcl_curr_vars.elem_index];c=encodeURIComponent(window.location.href);var e=encodeURIComponent(d.title).replace(/'/g,"\\'"),f=encodeURIComponent(d.txt).replace(/'/g,"\\'");if("image"==d.type)var g=d.src;else g=d.poster?d.poster:!1,g||"undefined"==typeof d.vid_poster||(g=d.vid_poster);var h='
    ';if(lcl_curr_opts.fb_share_params){var l= c+(-1===window.location.href.indexOf("?")?"%3F":"%26");l+=encodeURIComponent(lcl_curr_opts.fb_share_params.replace("%TITLE%",e).replace("%DESCR%",f).replace("%IMG%",g));h+='"}else h+='"; h+='";lcl_on_mobile&&(h+='
    ');g&&(h+='");h+="
    ";b(".lcl_socials").addClass("lcl_socials_shown").html(h);setTimeout(function(){b(".lcl_socials_tt").addClass("lcl_show_tt")},20);if(lcl_curr_opts.fb_direct_share)b(document).off("click",".lcl_fb").on("click",".lcl_fb",function(b){FB.ui({method:"share_open_graph",action_type:"og.shares",action_properties:JSON.stringify({object:{"og:url":window.location.href,"og:title":d.title,"og:description":d.txt, "og:image":g}})},function(b){window.close()})})}});b(document).on("click",".lcl_fullscreen",function(c){if(k!=lcl_curr_obj)return!0;b(".lcl_fullscreen_mode").length?U(!0):F(!0)});b(document).on("click",".lcl_thumbs_toggle",function(c){if(k!=lcl_curr_obj)return!0;c=b(".lcl_fullscreen_mode").length;b("#lcl_wrap").addClass("lcl_toggling_tn").toggleClass("lcl_tn_hidden");c||setTimeout(function(){lcl_resize()},160);setTimeout(function(){b("#lcl_wrap").removeClass("lcl_toggling_tn")},lcl_curr_opts.animation_time+ 50)});w=lcl_on_mobile?" click":"";b(document).on("lcl_tn_elem_click"+w,".lcl_tn_inner > li",function(c){if(k!=lcl_curr_obj)return!0;c=b(this).attr("rel");r(c)});b(document).on("click",".lcl_tn_prev:not(.lcl_tn_disabled_arr)",function(c){if(k!=lcl_curr_obj)return!0;b(".lcl_tn_inner").stop(!0).animate({scrollLeft:b(".lcl_tn_inner").scrollLeft()-lcl_curr_opts.thumbs_w-10},300,"linear",function(){b(".lcl_tn_inner").trigger("lcl_smoothscroll_end")})});b(document).on("click",".lcl_tn_next:not(.lcl_tn_disabled_arr)", function(c){if(k!=lcl_curr_obj)return!0;b(".lcl_tn_inner").stop(!0).animate({scrollLeft:b(".lcl_tn_inner").scrollLeft()+lcl_curr_opts.thumbs_w+10},300,"linear",function(){b(".lcl_tn_inner").trigger("lcl_smoothscroll_end")})});b(document).on("wheel","#lcl_thumbs_nav.lcl_tn_has_arr",function(c){if(k!=lcl_curr_obj)return!0;c.preventDefault();0b.scale&&zoom(!1);setTimeout(function(){lcl_is_pinching=!1},300)},20)},touchStart:function(b){lcl_touchstartX=b.changedTouches[0].clientX},touchEnd:function(c){var d=lcl_touchstartX- c.changedTouches[0].clientX;if((-50>d||50d?r("prev"):r("next")},c)}}})},A=function(){if(!lcl_curr_obj)return!1;h=b.data(lcl_curr_obj,"lcl_vars");l=b.data(lcl_curr_obj,"lcl_settings");return h?!0:(console.error("LC Lightbox. Object not initialized"), !1)};lcl_open=function(c,d){var e=h=b.data(c,"lcl_vars");if(e){if("undefined"==typeof e.elems[d])return console.error("LC Lightbox - cannot open. Unexisting index"),!1;e.elem_index=d;$clicked_obj=e.is_arr_instance?!1:b(c[d]);return G(c,$clicked_obj)}console.error("LC Lightbox - cannot open. Object not initialized");return!1};lcl_resize=function(){if(!lcl_shown||lcl_is_active||!A())return!1;var c=h;"undefined"!=typeof lcl_size_check&&clearTimeout(lcl_size_check);lcl_size_check=setTimeout(function(){b("#lcl_wrap").addClass("lcl_is_resizing"); J();return x(c.elems[c.elem_index])},20)};lcl_close=function(){return lcl_shown&&!lcl_is_active&&A()?I():!1};lcl_switch=function(b){return lcl_shown&&!lcl_is_active&&A()?r(b):!1};lcl_start_slideshow=function(c){if(!lcl_shown||"undefined"==typeof c&&"undefined"!=typeof lcl_slideshow||!A())return!1;var d=l;if(!d.carousel&&h.elem_index==h.elems.length-1)return!1;"undefined"!=typeof lcl_slideshow&&clearInterval(lcl_slideshow);b("#lcl_wrap").addClass("lcl_is_playing");var e=d.animation_time+d.slideshow_time; S(!0);lcl_slideshow=setInterval(function(){S(!1);r("next",!0)},e);"undefined"==typeof c&&("function"==typeof d.slideshow_start&&d.slideshow_start.call(null,d,h),h.is_arr_instance||(h.elems_selector?b(h.elems_selector):lcl_curr_obj).first().trigger("lcl_slideshow_start",[e]));return!0};lcl_stop_slideshow=function(){if(!lcl_shown||"undefined"==typeof lcl_slideshow||!A())return!1;var c=l;if(!c)return console.error("LC Lightbox. Object not initialized"),!1;clearInterval(lcl_slideshow);lcl_slideshow=void 0; b("#lcl_wrap").removeClass("lcl_is_playing");b("#lcl_progressbar").stop(!0).animate({marginTop:-3*b("#lcl_progressbar").height()},300,function(){b(this).remove()});"function"==typeof c.slideshow_end&&c.slideshow_end.call(null,l,h);h.is_arr_instance||(h.elems_selector?b(h.elems_selector):lcl_curr_obj).first().trigger("lcl_slideshow_end",[]);return!0};return k}})(jQuery);