(function($){lcl_objs=[];lcl_shown=!1;lcl_is_active=!1;lcl_slideshow=undefined;lcl_on_mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);lcl_curr_obj=!1;lcl_curr_opts=!1;lcl_curr_vars=!1;lcl_deeplink_tracked=!1;lcl_hashless_url=!1;lcl_url_hash='';var lb_code='
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
';lc_lightbox=function(obj,lcl_settings){if(typeof(obj)!='string'&&(typeof(obj)!='object'||!obj.length)){return!1} var already_init=!1;$.each(lcl_objs,function(i,v){if(JSON.stringify(v)==JSON.stringify(obj)){already_init=v;return!1}});if(already_init===!1){var instance=new lcl(obj,lcl_settings);lcl_objs.push(instance);return instance} return already_init};lcl_destroy=function(instance){var index=$.inArray(instance,lcl_objs);if(index!==-1){lcl_objs.splice(index,1)}};var lcl=function(obj,settings){var lcl_settings=$.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:6000,autoplay:!1,counter:!1,progressbar:!0,carousel:!0,max_width:'93%',max_height:'93%',wrap_padding:!1,ol_opacity:0.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(){},},settings);var lcl_vars={elems:[],is_arr_instance:(typeof(obj)!='string'&&typeof(obj[0].childNodes)=='undefined')?!0:!1,elems_count:(typeof(obj)!='string'&&typeof(obj[0].childNodes)=='undefined')?obj.length:$(obj).length,elems_selector:(typeof(obj)=='string')?obj:!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:'',};if(typeof(obj)=='string'){obj=$(obj)} var lcl_ai_opts=$.data(obj,'lcl_settings',lcl_settings);var lcl_ai_vars=$.data(obj,'lcl_vars',lcl_vars);var get_hash=function(str){if(typeof(str)!='string'){return str} var hash=0,i=0,len=str.toString().length;while(i').replace(/&/g,'&').replace(/"/g,'"').replace(/'/g,"'");return $.trim(str)};var attr_or_selector_data=function($elem,subj_key){var o=lcl_ai_opts;var subj=o[subj_key];if(subj.indexOf('> ')!==-1){return($elem.find(subj.replace('> ','')).length)?$.trim($elem.find(subj.replace('> ','')).html()):''}else{return(typeof($elem.attr(subj))!='undefined')?revert_html_entit($elem.attr(subj)):''}};var setup_elems_obj=function($subj){var o=lcl_ai_opts;var new_elems=[];$subj.each(function(){var $e=$(this);var src=$e.attr(o.src_attr);var hash=get_hash(src);if(lcl_ai_vars.gallery_hook_val&&$e.attr(o.gallery_hook)!=lcl_ai_vars.gallery_hook_val){return!0} var already_man=obj_already_man(hash);if(already_man){var el=already_man}else{var type=el_type_finder(src,$e.data('lcl-type'));if(type!='unknown'){var el={src:src,type:type,hash:(o.deeplink)?get_hash(src):!1,title:(o.show_title)?attr_or_selector_data($e,'title_attr'):'',txt:(o.show_descr)?attr_or_selector_data($e,'txt_attr'):'',author:(o.show_author)?attr_or_selector_data($e,'author_attr'):'',thumb:(o.thumb_attr&&typeof(o.thumb_attr)!='undefined')?$e.attr(o.thumb_attr):'',width:(type!='image'&&typeof($e.data('lcl-w'))!='undefined')?$e.data('lcl-w'):!1,height:(type!='image'&&typeof($e.data('lcl-h'))!='undefined')?$e.data('lcl-h'):!1,force_over_data:(typeof($e.data('lcl-force-over-data'))!='undefined')?parseInt($e.data('lcl-force-over-data'),10):'',force_outer_cmd:(typeof($e.data('lcl-outer-cmd'))!='undefined')?$e.data('lcl-outer-cmd'):'',};if(type=='image'){el.download=(typeof($e.data('lcl-path'))!='undefined')?$e.data('lcl-path'):src}else{el.download=!1}}else{var el={src:src,type:type,hash:(o.deeplink)?get_hash(src):!1}}} new_elems.push(el)});if(new_elems.length<2){$('.lcl_prev, .lcl_next, #lcl_thumb_nav').remove()} if(!new_elems.length){return!1} lcl_ai_vars.elems=new_elems;return!0};var el_type_finder=function(src,forced_type){if(typeof(forced_type)=='undefined'){forced_type=lcl_ai_opts.global_type;return forced_type} src=src.toLowerCase();var img_regex=/^(http|https)?:\/\/(?:[a-z\-]+\.)+[a-z]{2,6}(?:\/[^\/#?]+)+\.(?:jpe?g|gif|png)$/;if(img_regex.test(src)){return'image'} return'unknown'};var close_img_preload=function(){if(lcl_ai_vars.elems.length<2||!lcl_ai_opts.gallery){return!1} if(lcl_ai_vars.elem_index>0){maybe_preload(!1,(lcl_ai_vars.elem_index-1))} if(lcl_ai_vars.elem_index!=(lcl_ai_vars.elems.length-1)){maybe_preload(!1,(lcl_ai_vars.elem_index+1))}};var maybe_preload=function(show_when_ready,el_index,cache_check){var v=lcl_ai_vars;if(typeof(el_index)=='undefined'){el_index=v.elem_index} if(typeof(el_index)=='undefined'){return!1} if(v.elems[el_index].type=='image'){var to_preload=(v.elems[el_index].type=='image')?v.elems[el_index].src:v.elems[el_index].poster}else{var to_preload=''} if(to_preload&&typeof(v.img_sizes_cache[to_preload])=='undefined'){$('').bind("load",function(){v.img_sizes_cache[to_preload]={w:this.width,h:this.height};if(show_when_ready&&el_index==v.elem_index){show_element()}}).attr('src',to_preload)}else{if(show_when_ready||typeof(cache_check)!='undefined'){$('#lcl_loader').addClass('no_loader')} if(show_when_ready){show_element()}}};var elems_parsing=function(inst_obj,$clicked_obj){var o=$.data(inst_obj,'lcl_settings');var vars=$.data(inst_obj,'lcl_vars');if(vars.is_arr_instance){var elems=[];$.each(inst_obj,function(i,v){var el={};var el_type=(typeof(v.type)=='undefined'&&o.global_type)?o.global_type:!1;if(typeof(v.type)!='undefined'){el_type=v.type} if(el_type&&$.inArray(el_type,['image'])!==-1){if(typeof(v.src)!='undefined'&&v.src){el.src=v.src;el.type=el_type;el.hash=get_hash(v.src);el.title=(typeof(v.title)=='undefined')?'':revert_html_entit(v.title);el.txt=(typeof(v.txt)=='undefined')?'':revert_html_entit(v.txt);el.author=(typeof(v.author)=='undefined')?'':revert_html_entit(v.author);el.width=(typeof(v.width)=='undefined')?!1:v.width;el.height=(typeof(v.height)=='undefined')?!1:v.height;el.force_over_data=(typeof(v.force_over_data)=='undefined')?!1:parseInt(v.force_over_data,10);el.force_outer_cmd=(typeof(v.force_outer_cmd)=='undefined')?!1:v.force_outer_cmd;el.thumb=(typeof(v.thumb)=='undefined')?!1:v.thumb;if(el_type=='image'){el.download=(typeof(v.download)!='undefined')?v.download:v.src}else{el.download=!1} elems.push(el)}}else{var el={src:el.src,type:'unknown',hash:(o.deeplink)?get_hash(el.src):!1};elems.push(el)}});vars.elems=elems}else{var $subj=inst_obj;if(o.live_elements&&vars.elems_selector){var consider_group=($clicked_obj&&o.gallery&&o.gallery_hook&&typeof($(obj[0]).attr(o.gallery_hook))!='undefined')?!0:!1;var sel=(consider_group)?vars.elems_selector+'['+o.gallery_hook+'='+$clicked_obj.attr(o.gallery_hook)+']':vars.elems_selector;$subj=$(sel)} if(!setup_elems_obj($subj)){if(!o.live_elements||(o.live_elements&&!vars.elems_selector)){console.error('LC Lightbox - no valid elements found')} return!1}} if(o.preload_all&&!vars.preload_all_used){vars.preload_all_used=!0;$(document).ready(function(e){$.each(vars.elems,function(i,v){maybe_preload(!1,i)})})} if(typeof(o.elems_parsed)=='function'){o.elems_parsed.call(null,lcl_ai_opts,lcl_ai_vars)} if(!vars.is_arr_instance){var $subj=(vars.elems_selector)?$(vars.elems_selector):inst_obj;$subj.first().trigger('lcl_elems_parsed',[vars.elems])} return!0};elems_parsing(obj);var open_lb=function(inst_obj,$clicked_obj){if(lcl_shown||lcl_is_active){return!1} lcl_shown=!0;lcl_is_active=!0;lcl_curr_obj=inst_obj;lcl_ai_opts=$.data(inst_obj,'lcl_settings');lcl_ai_vars=$.data(inst_obj,'lcl_vars');lcl_curr_opts=lcl_ai_opts;lcl_curr_vars=lcl_ai_vars;var o=lcl_ai_opts;var v=lcl_ai_vars;var $co=(typeof($clicked_obj)!='undefined')?$clicked_obj:!1;if(!lcl_ai_vars){console.error('LC Lightbox - cannot open. Object not initialized');return!1} v.gallery_hook_val=($co&&o.gallery&&o.gallery_hook&&typeof($co.attr(o.gallery_hook))!='undefined')?$co.attr(o.gallery_hook):!1;if(!elems_parsing(inst_obj,$clicked_obj)){return!1} if($co){$.each(v.elems,function(i,e){if(e.src==$co.attr(o.src_attr)){v.elem_index=i;return!1}})}else{if(parseInt(v.elem_index,10)>=v.elems_count){console.error('LC Lightbox - selected index does not exist');return!1}} maybe_preload(!1);setup_code();touch_events();if(v.force_fullscreen){enter_fullscreen(!0,!0)} if($('#lcl_thumbs_nav').length){setup_thumbs_nav()} maybe_preload(!0);close_img_preload()};var rm_pre_show_classes=function(){$('#lcl_wrap').removeClass('lcl_pre_show').addClass('lcl_shown');$('#lcl_loader').removeClass('lcl_loader_pre_first_el')};var setup_code=function(){var o=lcl_ai_opts;var v=lcl_ai_vars;var wrap_classes=[];var css='';if(typeof(document.documentMode)=='number'){$('body').addClass('lcl_old_ie');if(o.cmd_position!='outer'){o.nav_btn_pos='normal'}} if($('#lcl_wrap').length){$('#lcl_wrap').remove()} $('body').append(lb_code);$('#lcl_wrap').attr('data-lcl-max-w',o.max_width).attr('data-lcl-max-h',o.max_height);wrap_classes.push('lcl_'+o.ins_close_pos+'_close lcl_nav_btn_'+o.nav_btn_pos+' lcl_'+o.ins_close_pos+'_close lcl_nav_btn_'+o.nav_btn_pos);if(o.tn_hidden===!0||(typeof(o.tn_hidden)=='number'&&($(window).width() *:not(.lcl_close)').length){css+='#lcl_wrap:not(.lcl_fullscreen_mode):not(.lcl_forced_outer_cmd) #lcl_nav_cmd {'+'display: none;'+'}'}} if($('#lcl_inline_style').length){$('#lcl_inline_style').remove()} $('head').append('');if(o.remove_scrollbar){lcl_ai_vars.html_style=(typeof(jQuery('html').attr('style'))!='undefined')?jQuery('html').attr('style'):'';lcl_ai_vars.body_style=(typeof(jQuery('body').attr('style'))!='undefined')?jQuery('body').attr('style'):'';var orig_page_w=$(window).width();$('html').css('overflow','hidden');$('html').css({'margin-right':($(window).width()-orig_page_w),'touch-action':'none'});$('body').css({'overflow':'visible','touch-action':'none'})} var el=lcl_ai_vars.elems[v.elem_index];if(el.type!='image'||(el.type=='image'&&typeof(v.img_sizes_cache[el.src])!='undefined')){wrap_classes.push('lcl_show_already_shaped')}else{rm_pre_show_classes()} $('#lcl_wrap').addClass(wrap_classes.join(' '));if(typeof(o.html_is_ready)=='function'){o.html_is_ready.call(null,lcl_ai_opts,lcl_ai_vars)} if(!lcl_ai_vars.is_arr_instance){var $subj=(lcl_ai_vars.elems_selector)?$(lcl_ai_vars.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_html_is_ready',[lcl_ai_opts,lcl_ai_vars])}};var no_body_touch_scroll=function(selector){var _overlay=$(selector)[0];var _clientY=null;_overlay.addEventListener('touchstart',function(event){if(event.targetTouches.length===1){_clientY=event.targetTouches[0].clientY}},!1);_overlay.addEventListener('touchmove',function(event){if(event.targetTouches.length===1){disableRubberBand(event)}},!1);function disableRubberBand(event){var clientY=event.targetTouches[0].clientY-_clientY;if(_overlay.scrollTop===0&&clientY>0){event.preventDefault()} if(isOverlayTotallyScrolled()&&clientY<0){event.preventDefault()}} function isOverlayTotallyScrolled(){return _overlay.scrollHeight-_overlay.scrollTop<=_overlay.clientHeight}};var show_element=function(){if(!lcl_shown){return!1} var v=lcl_ai_vars;var el=v.elems[v.elem_index];$('#lcl_wrap').attr('lc-lelem',v.elem_index);if(!lcl_ai_opts.carousel){$('#lcl_wrap').removeClass('lcl_first_elem lcl_last_elem');if(!v.elem_index){$('#lcl_wrap').addClass('lcl_first_elem')}else if(v.elem_index==(v.elems.length-1)){$('#lcl_wrap').addClass('lcl_last_elem')}} $(document).trigger('lcl_before_populate_global',[el,v.elem_index]);populate_lb(el);if(!v.is_arr_instance){var $subj=(v.elems_selector)?$(v.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_before_show',[el,v.elem_index])} $(document).trigger('lcl_before_show_global',[el,v.elem_index]);if($('#lcl_wrap').hasClass('lcl_pre_first_el')){if(typeof(lcl_ai_opts.on_open)=='function'){lcl_ai_opts.on_open.call(null,lcl_ai_opts,lcl_ai_vars)} if(!v.is_arr_instance){var $subj=(v.elems_selector)?$(v.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_on_open',[el,v.elem_index])}} size_elem(el);$('#lcl_subj').removeClass('lcl_switching_el')};var elem_has_txt=function(el){return(el.title||el.txt||el.author)?!0:!1};var populate_lb=function(el){var el_index=lcl_ai_vars.elem_index;$('#lcl_elem_wrap').removeAttr('style').removeAttr('class').empty();$('#lcl_wrap').attr('lcl-type',el.type);$('#lcl_elem_wrap').addClass('lcl_'+el.type+'_elem');switch(el.type){case 'image':$('#lcl_elem_wrap').css('background-image','url(\''+el.src+'\')');break;default:$('#lcl_elem_wrap').html('

Error loading the resource ..
');break} if(lcl_curr_opts.download){if(el.download){$('.lcl_download').show();var arr=el.download.split('/');var filename=arr[(arr.length-1)];$('.lcl_download').html('')}else{$('.lcl_download').hide()}} $('.lcl_counter').html((el_index+1)+' / '+lcl_ai_vars.elems.length);if(elem_has_txt(el)&&el.type!='unknown'){$('#lcl_wrap').removeClass('lcl_no_txt');$('.lcl_txt_toggle').show();if(el.title){$('#lcl_txt').append('

'+el.title+'

')} if(el.author){$('#lcl_txt').append('
by '+el.author+'
')} if(el.txt){$('#lcl_txt').append('
'+el.txt+'
')} if(el.txt){if(el.title&&el.author){$('#lcl_txt h5').addClass('lcl_txt_border')}else{if($('#lcl_txt h3').length){$('#lcl_txt h3').addClass('lcl_txt_border')}else{$('#lcl_txt h5').addClass('lcl_txt_border')}}}}else{$('.lcl_txt_toggle').hide();$('#lcl_wrap').addClass('lcl_no_txt')} no_body_touch_scroll('#lcl_txt')};var css_size_to_px=function(size,dimension,ignore_max){var px=0;var $wrap=$('#lcl_wrap');var win_w=$(window).width()-parseInt($wrap.css('padding-left'),10)-parseInt($wrap.css('padding-right'),10);var win_h=$(window).height()-parseInt($wrap.css('padding-top'),10)-parseInt($wrap.css('padding-bottom'),10);if(!isNaN(parseFloat(size))&&isFinite(size)){px=parseInt(size,10)}else if(size.toString().indexOf('%')!==-1){var val=(dimension=='w')?win_w:win_h;px=val*(parseInt(size,10)/100)}else if(size.toString().indexOf('vw')!==-1){px=win_w*(parseInt(size,10)/100)}else if(size.toString().indexOf('vh')!==-1){px=win_h*(parseInt(size,10)/100)} if(typeof(ignore_max)=='undefined'){if(dimension=='w'&&px>win_w){px=win_w} if(dimension=='h'&&px>win_h){px=win_h}} return px};var size_elem=function(el,flags,txt_und_sizes){var o=lcl_ai_opts;var v=lcl_ai_vars;var w,h;if(typeof(flags)=='undefined'){flags={}} var fs_mode=($('.lcl_fullscreen_mode').length)?!0:!1;var add_space=(fs_mode)?0:((parseInt(o.border_w,10)*2)+(parseInt(o.padding,10)*2));if(typeof(flags.side_txt_checked)=='undefined'&&(typeof(flags.no_txt_under)=='undefined'||!flags.no_txt_under)){$('#lcl_wrap').removeClass('lcl_force_txt_over')} var side_txt=(!$('.lcl_force_txt_over').length&&!$('.lcl_hidden_txt').length&&$.inArray(o.data_position,['rside','lside'])!==-1&&elem_has_txt(el))?$('#lcl_txt').outerWidth():0;var thumbs_nav=(!fs_mode&&$('#lcl_thumbs_nav').length&&!$('.lcl_tn_hidden').length)?$('#lcl_thumbs_nav').outerHeight(!0)-parseInt($('#lcl_wrap').css('padding-bottom'),10):0;var cmd_h=(!fs_mode&&$('.lcl_outer_cmd').length)?$('.lcl_close').outerHeight(!0)+parseInt($('#lcl_nav_cmd').css('padding-top'),10)+parseInt($('#lcl_nav_cmd').css('padding-bottom'),10):0;var horiz_add_space=add_space+side_txt;var vert_add_space=add_space+thumbs_nav+cmd_h;var max_w_attr=$('#lcl_wrap').attr('data-lcl-max-w');var max_h_attr=$('#lcl_wrap').attr('data-lcl-max-h');var max_w=(fs_mode)?$(window).width():Math.floor(css_size_to_px(max_w_attr,'w'))-horiz_add_space;var max_h=(fs_mode)?$(window).height():Math.floor(css_size_to_px(max_h_attr,'h'))-vert_add_space;if(typeof(v.txt_und_sizes)=='object'){w=v.txt_und_sizes.w;h=v.txt_und_sizes.h;if(el.type=='image'){var img_sizes=v.img_sizes_cache[el.src]}}else{switch(el.type){case 'image':$('#lcl_elem_wrap').css('bottom',0);if(typeof(v.img_sizes_cache[el.src])=='undefined'){return!1} var img_sizes=v.img_sizes_cache[el.src];if(img_sizes.w<=max_w){w=img_sizes.w;h=img_sizes.h}else{w=max_w;h=Math.floor(w*(img_sizes.h/img_sizes.w))} if(h>max_h){h=max_h;w=Math.floor(h*(img_sizes.w/img_sizes.h))} if(elem_has_txt(el)&&!$('.lcl_hidden_txt').length&&o.data_position=='under'&&typeof(flags.no_txt_under)=='undefined'){txt_under_h(w,h,max_h);$(document).off('lcl_txt_und_calc').on('lcl_txt_und_calc',function(){if(v.txt_und_sizes){if(v.txt_und_sizes=='no_under'){flags.no_txt_under=!0} return size_elem(v.elems[v.elem_index],flags)}});return!1}else{$('#lcl_subj').css('maxHeight','none')} break;default:w=280;h=125;break}} if((o.data_position=='rside'||o.data_position=='lside')&&!$('.lcl_no_txt').length&&typeof(flags.side_txt_checked)=='undefined'){var sto_w=w+add_space;var sto_h=h+add_space;var img_sizes=(el.type=='image')?v.img_sizes_cache[el.src]:'';var tot=el.force_over_data;if(!tot){tot=400} if(el.type=='image'&&img_sizes.w>tot&&img_sizes.h>tot){if(!side_to_over_txt(el,tot,sto_w,sto_h,side_txt)){flags.side_txt_checked=!0;return size_elem(el,flags)}}} v.txt_und_sizes=!1;if(typeof(flags.inner_cmd_checked)=='undefined'&&(o.cmd_position=='inner'||el.force_outer_cmd)&&inner_to_outer_cmd(el,w)){flags.inner_cmd_checked=!0;return size_elem(el,flags)} $('#lcl_wrap').removeClass('lcl_pre_first_el');$('#lcl_window').css({width:(fs_mode)?'100%':w+add_space+side_txt,height:(fs_mode)?'100%':h+add_space});if($('.lcl_show_already_shaped').length){setTimeout(function(){$('#lcl_wrap').removeClass('lcl_show_already_shaped');rm_pre_show_classes()},10)} thumbs_nav_arrows_vis();if(typeof(lcl_size_n_show_timeout)!='undefined'){clearTimeout(lcl_size_n_show_timeout)} var timing=($('.lcl_first_sizing').length)?o.open_close_time+20:o.animation_time;if($('.lcl_browser_resize').length||$('.lcl_toggling_fs').length||fs_mode){timing=0} lcl_size_n_show_timeout=setTimeout(function(){if(lcl_is_active){lcl_is_active=!1} if($('.lcl_first_sizing').length){if(o.autoplay&&v.elems.length>1&&(o.carousel||v.elem_index<(v.elems.length-1))){lcl_start_slideshow()}} if(el.type=='image'){if($('.lcl_fullscreen_mode').length){fs_img_manag(img_sizes)}else{$('.lcl_image_elem').css('background-size','cover')}} $('#lcl_wrap').removeClass('lcl_first_sizing lcl_switching_elem lcl_is_resizing lcl_browser_resize');$('#lcl_loader').removeClass('no_loader');$(document).trigger('lcl_resized_window')},timing)};$(window).resize(function(){if(!lcl_shown||obj!=lcl_curr_obj||$('.lcl_toggling_fs').length){return!1} $('#lcl_wrap').addClass('lcl_browser_resize');if(typeof(lcl_rs_defer)!='undefined'){clearTimeout(lcl_rs_defer)} lcl_rs_defer=setTimeout(function(){lcl_resize()},50)});var txt_under_h=function(curr_w,curr_h,max_height,recursive_count){var rc=(typeof(recursive_count)=='undefined')?1:recursive_count;var fs_mode=$('.lcl_fullscreen_mode').length;var old_txt_h=Math.ceil($('#lcl_txt').outerHeight());var w_ratio=curr_w/curr_h;if(fs_mode&&$('#lcl_thumbs_nav').length){$('#lcl_wrap').addClass('lcl_force_txt_over');$('#lcl_subj').css('maxHeight','none');$('#lcl_txt').css({'right':0,'width':'auto'});lcl_ai_vars.txt_und_sizes='no_under';$(document).trigger('lcl_txt_und_calc');return!1} $('#lcl_wrap').removeClass('lcl_force_txt_over').addClass('lcl_txt_under_calc');if(!fs_mode){$('#lcl_txt').css({'right':'auto','width':curr_w})}else{$('#lcl_txt').css({'right':0,'width':'auto'})} if(typeof(lcl_txt_under_calc)!='undefined'){clearInterval(lcl_txt_under_calc)} lcl_txt_under_calc=setTimeout(function(){var txt_h=Math.ceil($('#lcl_txt').outerHeight());var overflow=(curr_h+txt_h)-max_height;if(fs_mode){$('#lcl_wrap').removeClass('lcl_txt_under_calc');$('#lcl_subj').css('maxHeight','calc(100% - '+txt_h+'px)');lcl_ai_vars.txt_und_sizes={w:curr_w,h:curr_h};$(document).trigger('lcl_txt_und_calc');return!1} if(overflow>0&&(typeof(recursive_count)=='undefined'||recursive_count<10)){var new_h=curr_h-overflow;var new_w=Math.floor(new_h*w_ratio);var tot=lcl_ai_vars.elems[lcl_ai_vars.elem_index].force_over_data;if(!tot){tot=400} if(new_w=v.elems.length||new_el==v.elem_index){return!1}} if(typeof(lcl_slideshow)!='undefined'){if(typeof(slideshow_switch)=='undefined'||(!carousel&&new_el==(v.elems.length-1))){lcl_stop_slideshow()}} lcl_is_active=!0;thumbs_nav_scroll_to_item(new_el);maybe_preload(!1,new_el,!0);$('#lcl_wrap').addClass('lcl_switching_elem');setTimeout(function(){$('#lcl_wrap').removeClass('lcl_playing_video');if(v.elems[v.elem_index].type=='html'){$('#lcl_window').css('height',$('#lcl_contents_wrap').outerHeight());$('#lcl_contents_wrap').css('maxHeight','none')} if(typeof(lcl_ai_opts.on_elem_switch)=='function'){lcl_ai_opts.on_elem_switch.call(null,lcl_ai_opts,lcl_ai_vars,new_el)} if(!v.is_arr_instance&&lcl_curr_obj){var $subj=(v.elems_selector)?$(v.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_on_elem_switch',[v.elem_index,new_el])} $('#lcl_wrap').removeClass('lcl_no_txt lcl_loading_iframe');$('#lcl_txt').empty();v.elem_index=new_el;maybe_preload(!0);close_img_preload()},lcl_ai_opts.fading_time)};var temp_slideshow_stop=function(){if(typeof(lcl_slideshow)=='undefined'){return!1} clearInterval(lcl_slideshow)};var progbar_animate=function(first_run){var o=lcl_ai_opts;if(!o.progressbar){return!1} var delay=(first_run)?0:(o.animation_time+o.fading_time);var time=o.slideshow_time+o.animation_time-delay;if(!$('#lcl_progressbar').length){$('#lcl_wrap').append('
')} if(typeof(lcl_pb_timeout)!='undefined'){clearTimeout(lcl_pb_timeout)} lcl_pb_timeout=setTimeout(function(){$('#lcl_progressbar').stop(!0).removeAttr('style').css('width',0).animate({width:'100%'},time,'linear',function(){$('#lcl_progressbar').fadeTo(0,0)})},delay)};var close_lb=function(){if(!lcl_shown){return!1} if(typeof(lcl_ai_opts.on_close)=='function'){lcl_ai_opts.on_close.call(null,lcl_ai_opts,lcl_ai_vars)} if(!lcl_ai_vars.is_arr_instance){var $subj=(lcl_ai_vars.elems_selector)?$(lcl_ai_vars.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_on_close')} $(document).trigger('lcl_on_close_global');$('#lcl_wrap').removeClass('lcl_shown').addClass('lcl_is_closing lcl_tn_hidden');lcl_stop_slideshow();if($('.lcl_fullscreen_mode').length){exit_browser_fs()} setTimeout(function(){$('#lcl_wrap, #lcl_inline_style').remove();if(lcl_ai_opts.remove_scrollbar){jQuery('html').attr('style',lcl_ai_vars.html_style);jQuery('body').attr('style',lcl_ai_vars.body_style)} $(document).trigger('lcl_closed_global');lcl_curr_obj=!1;lcl_curr_opts=!1;lcl_curr_vars=!1;lcl_shown=!1;lcl_is_active=!1},(lcl_ai_opts.open_close_time+80));if(typeof(lcl_size_check)!='undefined'){clearTimeout(lcl_size_check)}};var enter_fullscreen=function(set_browser_status,on_opening){if(typeof(on_opening)=='undefined'){on_opening=!1} if(!lcl_shown||!lcl_ai_opts.fullscreen||(!on_opening&&lcl_is_active)){return!1} var o=lcl_ai_opts;var v=lcl_ai_vars;$('#lcl_wrap').addClass('lcl_toggling_fs');if(o.browser_fs_mode&&typeof(set_browser_status)!='undefined'){if(document.documentElement.requestFullscreen){document.documentElement.requestFullscreen()}else if(document.documentElement.msRequestFullscreen){document.documentElement.msRequestFullscreen()}else if(document.documentElement.mozRequestFullScreen){document.documentElement.mozRequestFullScreen()}else if(document.documentElement.webkitRequestFullscreen){document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}} var timing=(on_opening)?o.open_close_time:o.fading_time;setTimeout(function(){$('#lcl_wrap').addClass('lcl_fullscreen_mode');size_elem(v.elems[v.elem_index]);$(document).on('lcl_resized_window',function(){$(document).off('lcl_resized_window');if(on_opening||(lcl_curr_opts.data_position=='under'&&!$('.lcl_force_txt_over').length)){size_elem(lcl_curr_vars.elems[lcl_curr_vars.elem_index])} setTimeout(function(){$('#lcl_wrap').removeClass('lcl_toggling_fs')},150)})},timing);if(typeof(o.on_fs_enter)=='function'){o.on_fs_enter.call(null,o,v)} if(!lcl_ai_vars.is_arr_instance){lcl_curr_obj.first().trigger('lcl_on_fs_enter')}};var fs_img_manag=function(img_sizes){var behav=lcl_ai_opts.fs_img_behavior;if($('.lcl_fullscreen_mode').length&&img_sizes.w<=$('#lcl_subj').width()&&img_sizes.h<=$('#lcl_subj').height()){$('.lcl_image_elem').css('background-size','auto');return!1} if(behav=='fit'){$('.lcl_image_elem').css('background-size','contain')}else if(behav=='fill'){$('.lcl_image_elem').css('background-size','cover')}else{if(typeof(img_sizes)=='undefined'){$('.lcl_image_elem').css('background-size','cover');return!1} var ratio_diff=($(window).width()/$(window).height())-(img_sizes.w/img_sizes.h);var w_diff=$(window).width()-img_sizes.w;var h_diff=$(window).height()-img_sizes.h;if((ratio_diff<=1.15&&ratio_diff>=-1.15)&&(w_diff<=350&&h_diff<=350)){$('.lcl_image_elem').css('background-size','cover')}else{$('.lcl_image_elem').css('background-size','contain')}}};var exit_fullscreen=function(set_browser_status){if(!lcl_shown||!lcl_ai_opts.fullscreen||lcl_is_active){return!1} var o=lcl_ai_opts;$('#lcl_wrap').addClass('lcl_toggling_fs');$('#lcl_window').fadeTo(70,0);setTimeout(function(){if(o.browser_fs_mode&&typeof(set_browser_status)!='undefined'){exit_browser_fs();var browser_fs_timing=250}else{var browser_fs_timing=0} $('#lcl_wrap').removeClass('lcl_fullscreen_mode');setTimeout(function(){size_elem(lcl_ai_vars.elems[lcl_ai_vars.elem_index]);var userAgent=userAgent||navigator.userAgent;var ie11_time=(userAgent.indexOf("MSIE ")>-1||userAgent.indexOf("Trident/")>-1)?100:0;setTimeout(function(){$('#lcl_window').fadeTo(30,1);$('#lcl_wrap').removeClass('lcl_toggling_fs')},300+ie11_time)},browser_fs_timing)},70);if(typeof(o.on_fs_exit)=='function'){o.on_fs_exit.call(null,lcl_ai_opts,lcl_ai_vars)} if(!lcl_ai_vars.is_arr_instance){var $subj=(lcl_ai_vars.elems_selector)?$(lcl_ai_vars.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_on_fs_exit')}};var exit_browser_fs=function(){if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}};var setup_thumbs_nav=function(){var mixed_types=!1;var tracked_type=!1;var uniq_id=Date.now();$('#lcl_thumbs_nav').append('
    ');$('#lcl_thumbs_nav').attr('rel',uniq_id);$.each(lcl_ai_vars.elems,function(i,v){if(v.type!='unknown'){if(!mixed_types){if(!tracked_type||tracked_type==v.type){tracked_type=v.type}else{mixed_types=!0}} var bg='',bg_img='';tpc='';if(v.thumb){bg_img=v.thumb;bg='style="background-image: url(\''+v.thumb+'\');"'}else{switch(v.type){case 'image':bg_img=v.src;break;case 'youtube':bg_img=(v.poster)?v.poster:'https://img.youtube.com/vi/'+v.video_id+'/maxresdefault.jpg';break;case 'vimeo':if(v.poster){bg_img=v.poster;break}else{if(typeof(lcl_ai_vars.vimeo_thumb_cache[v.src])=='undefined'){tpc='lcl_tn_preload';$.getJSON('https://www.vimeo.com/api/v2/video/'+v.video_id+'.json?callback=?',{format:"json"},function(data){thumbs_nav_img_preload(data[0].thumbnail_large,i,uniq_id);lcl_ai_vars.vimeo_thumb_cache[v.src]=data[0].thumbnail_large;$('.lcl_tn_inner li[rel='+i+']').attr('style',$('.lcl_tn_inner li[rel='+i+']').attr('style')+' background-image: url(\''+data[0].thumbnail_large+'\');')})}else{bg_img=lcl_ai_vars.vimeo_thumb_cache[v.src]}} break;case 'video':case 'iframe':case 'html':if(v.poster){bg_img=v.poster}break;case 'dailymotion':bg_img=(v.poster)?v.poster:'http://www.dailymotion.com/thumbnail/video/'+v.video_id;break} if(bg_img){if(lcl_ai_opts.thumbs_maker_url&&(v.poster||$.inArray(v.type,['youtube','vimeo','dailymotion'])===-1)){var base=lcl_ai_opts.thumbs_maker_url;bg_img=base.replace('%URL%',encodeURIComponent(bg_img)).replace('%W%',lcl_ai_opts.thumbs_w).replace('%H%',lcl_ai_opts.thumbs_h)} bg='style="background-image: url(\''+bg_img+'\');"';if($.inArray(v.type,['youtube','vimeo','dailymotion'])!==-1&&!v.poster){lcl_ai_vars.elems[i].vid_poster=bg_img}}} if((v.type=='html'||v.type=='iframe')&&!bg){return!0} var vp=(v.type=='video'&&!bg)?'':'';tpc='lcl_tn_preload';$('.lcl_tn_inner').append('
  • '+vp+'
  • ');if(tpc){thumbs_nav_img_preload(bg_img,i,uniq_id)}}});if($('.lcl_tn_inner > li').length<2){$('#lcl_thumbs_nav').remove();return!1} $('.lcl_tn_inner > li').css('width',lcl_ai_opts.thumbs_w);if(!lcl_on_mobile){$('.lcl_tn_inner').lcl_smoothscroll(0.3,400,!1,!0)} if(mixed_types&&lcl_ai_opts.tn_icons){$('.lcl_tn_inner').addClass('lcl_tn_mixed_types')} setTimeout(function(){thumbs_nav_scroll_to_item(lcl_ai_vars.elem_index)},300)};var thumbs_nav_img_preload=function(img_url,el_index,uniq_id){$('').bind("load",function(){if(!lcl_ai_vars){return!1} lcl_ai_vars.img_sizes_cache[img_url]={w:this.width,h:this.height};$('#lcl_thumbs_nav[rel='+uniq_id+'] li[rel='+el_index+']').removeClass('lcl_tn_preload');setTimeout(function(){thumbs_nav_arrows_vis();thumbs_nav_arrows_opacity()},500)}).attr('src',img_url)};var thumbs_nav_elems_w=function(){var thumbs_w=0;$('.lcl_tn_inner > li').each(function(){thumbs_w=thumbs_w+$(this).outerWidth(!0)});return thumbs_w};var thumbs_nav_arrows_vis=function(){if(!$('#lcl_thumbs_nav').length){return!1} if(thumbs_nav_elems_w()>$('.lcl_tn_inner').width()){$('#lcl_thumbs_nav').addClass('lcl_tn_has_arr')}else{$('#lcl_thumbs_nav').removeClass('lcl_tn_has_arr')}};var thumbs_nav_arrows_opacity=function(){var sl=$('.lcl_tn_inner').scrollLeft();if(!sl){$('.lcl_tn_prev').addClass('lcl_tn_disabled_arr').stop(!0).fadeTo(150,0.5)}else{$('.lcl_tn_prev').removeClass('lcl_tn_disabled_arr').stop(!0).fadeTo(150,1)} if(sl>=(thumbs_nav_elems_w()-$('.lcl_tn_inner').width())){$('.lcl_tn_next').addClass('lcl_tn_disabled_arr').stop(!0).fadeTo(150,0.5)}else{$('.lcl_tn_next').removeClass('lcl_tn_disabled_arr').stop(!0).fadeTo(150,1)}};$(document).on('lcl_smoothscroll_end','.lcl_tn_inner',function(e){if(obj!=lcl_curr_obj){return!0} thumbs_nav_arrows_opacity()});var thumbs_nav_scroll_to_item=function(elem_id){var $subj=$('.lcl_tn_inner > li[rel='+elem_id+']');if(!$subj.length){return!1} var id=0;$('.lcl_tn_inner > li').each(function(i,v){if($(this).attr('rel')==elem_id){id=i;return!1}});var elem_w=$('.lcl_tn_inner > li').last().outerWidth();var margin=parseInt($('.lcl_tn_inner > li').last().css('margin-left'),10);var wrap_w=$('.lcl_tn_inner').width();var to_center=Math.floor(($('.lcl_tn_inner').width()-elem_w-margin)/2);var new_offset=((elem_w*id)+margin*(id-1))+Math.floor(margin/2)-to_center;$('.lcl_tn_inner').stop(!0).animate({"scrollLeft":new_offset},500,function(){$('.lcl_tn_inner').trigger('lcl_smoothscroll_end');$('#lcl_thumbs_nav').removeClass('lcl_pre_tn_scroll')});$('.lcl_tn_inner > li').removeClass('lcl_sel_thumb');$subj.addClass('lcl_sel_thumb')};$.fn.lcl_smoothscroll=function(ratio,duration,ignoreX,ignoreY){if(lcl_on_mobile){return!1} this.off("mousemove mousedown mouseup mouseenter mouseleave");var $subj=this,trackX=(typeof(ignoreX)=='undefined'||!ignoreX)?!0:!1,trackY=(typeof(ignoreY)=='undefined'||!ignoreY)?!0:!1,mouseout_timeout=!1,curDown=!1,curYPos=0,curXPos=0,startScrollY=0,startScrollX=0,scrollDif=0;$subj.mousemove(function(m){if(curDown===!0){$subj.stop(!0);if(trackX){$subj.scrollLeft(startScrollX+(curXPos-m.pageX))} if(trackY){$subj.scrollTop(startScrollY+(curYPos-m.pageY))}}});$subj.mouseover(function(){if(mouseout_timeout){clearTimeout(mouseout_timeout)}});$subj.mouseout(function(){mouseout_timeout=setTimeout(function(){curDown=!1;mouseout_timeout=!1},500)});$subj.mousedown(function(m){if(typeof(lc_sms_timeout)!='undefined'){clearTimeout(lc_sms_timeout)} curDown=!0;startScrollY=$subj.scrollTop();startScrollX=$subj.scrollLeft();curYPos=m.pageY;curXPos=m.pageX});$subj.mouseup(function(m){curDown=!1;var currScrollY=$subj.scrollTop();var scrollDiffY=(startScrollY-currScrollY)*-1;var newScrollY=currScrollY+(scrollDiffY*ratio);var currScrollX=$subj.scrollLeft();var scrollDiffX=(startScrollX-currScrollX)*-1;var newScrollX=currScrollX+(scrollDiffX*ratio);if((scrollDiffY<3&&scrollDiffY>-3)&&(scrollDiffX<3&&scrollDiffX>-3)){$(m.target).trigger('lcl_tn_elem_click');return!1} if(scrollDiffY>20||scrollDiffX>20){var anim_obj={};if(trackY){anim_obj.scrollTop=newScrollY} if(trackX){anim_obj.scrollLeft=newScrollX} $subj.stop(!0).animate(anim_obj,duration,'linear',function(){$subj.trigger('lcl_smoothscroll_end')})}})};if(!lcl_vars.is_arr_instance){if(lcl_settings.live_elements&&lcl_vars.elems_selector){$(document).off('click',lcl_vars.elems_selector).on('click',lcl_vars.elems_selector,function(e){e.preventDefault();var vars=$.data(obj,'lcl_vars');vars.elems_count=$(lcl_vars.elems_selector).length;open_lb(obj,$(this));obj.first().trigger('lcl_clicked_elem',[$(this)])})}else{obj.off('click');obj.on('click',function(e){e.preventDefault();open_lb(obj,$(this));obj.first().trigger('lcl_clicked_elem',[$(this)])})}} $(document).on('click','#lcl_overlay:not(.lcl_modal), .lcl_close, #lcl_corner_close',function(e){if(obj!=lcl_curr_obj){return!0} close_lb()});$(document).on('click','.lcl_prev',function(e){if(obj!=lcl_curr_obj){return!0} switch_elem('prev')});$(document).on('click','.lcl_next',function(e){if(obj!=lcl_curr_obj){return!0} switch_elem('next')});$(document).bind('keydown',function(e){if(lcl_shown){if(obj!=lcl_curr_obj){return!0} if(e.keyCode==39){e.preventDefault();switch_elem('next')}else if(e.keyCode==37){e.preventDefault();switch_elem('prev')}else if(e.keyCode==27){e.preventDefault();close_lb()}else if(e.keyCode==122&&lcl_ai_opts.fullscreen){if(typeof(lcl_fs_key_timeout)!='undefined'){clearTimeout(lcl_fs_key_timeout)} lcl_fs_key_timeout=setTimeout(function(){if($('.lcl_fullscreen_mode').length){exit_fullscreen()}else{enter_fullscreen()}},50)}}});$(document).on('wheel','#lcl_overlay, #lcl_window, #lcl_thumbs_nav:not(.lcl_tn_has_arr)',function(e){if(obj!=lcl_curr_obj||!lcl_curr_opts.mousewheel){return!0} var $target=$(e.target);if(!$target.is('#lcl_window')&&!$target.parents('#lcl_window').length){e.preventDefault();var delta=e.originalEvent.deltaY;if(delta>0){switch_elem('next')}else{switch_elem('prev')}}else{var perform=!0;for(a=0;a<20;a++){if($target.is('#lcl_window')){break} if($target[0].scrollHeight>$target.outerHeight()){perform=!1;break}else{$target=$target.parent()}} if(perform){e.preventDefault();var delta=e.originalEvent.deltaY;if(delta>0){switch_elem('next')}else{switch_elem('prev')}}}});$(document).on('click','.lcl_image_elem',function(e){if(obj!=lcl_curr_obj){return!0} lcl_img_click_track=setTimeout(function(){if(!$('.lcl_zoom_wrap').length){switch_elem('next')}},250)});$(document).on('dblclick','.lcl_image_elem',function(e){if(obj!=lcl_curr_obj){return!0} if(!lcl_curr_opts.img_zoom){return!0} if(!$('.lcl_zoom_icon').length){return!0} if(typeof(lcl_img_click_track)!='undefined'){clearTimeout(lcl_img_click_track);zoom(!0)}});$(document).on('click','.lcl_txt_toggle',function(e){if(obj!=lcl_curr_obj){return!0} var o=lcl_ai_opts;if(!lcl_is_active&&!$('.lcl_no_txt').length&&!$('.lcl_toggling_txt').length){if(o.data_position!='over'){var txt_on_side=(o.data_position=='rside'||o.data_position=='lside')?!0:!1;var forced_over=$('.lcl_force_txt_over').length;var timing=(o.animation_time<150)?o.animation_time:150;var classes_delay=0;if(txt_on_side&&!forced_over){$('#lcl_subj').fadeTo(timing,0)}else{if(!forced_over){$('#lcl_contents_wrap').fadeTo(timing,0);classes_delay=timing}} setTimeout(function(){$('#lcl_wrap').toggleClass('lcl_hidden_txt')},classes_delay);if(!forced_over){lcl_is_active=!0;$('#lcl_wrap').addClass('lcl_toggling_txt');setTimeout(function(){lcl_is_active=!1;lcl_resize()},o.animation_time);setTimeout(function(){$('#lcl_wrap').removeClass('lcl_toggling_txt');if(txt_on_side&&!forced_over){$('#lcl_subj').fadeTo(timing,1)}else{if(!forced_over){$('#lcl_contents_wrap').fadeTo(timing,1)}}},(o.animation_time*2)+50)}}else{$('#lcl_wrap').toggleClass('lcl_hidden_txt')}}});$(document).on('click','.lcl_play',function(e){if(obj!=lcl_curr_obj){return!0} if($('.lcl_is_playing').length){lcl_stop_slideshow()}else{lcl_start_slideshow()}});$(document).on('click','.lcl_elem',function(e){if(obj!=lcl_curr_obj){return!0} if(!$('.lcl_playing_video').length&&$.inArray($('#lcl_wrap').attr('lcl-type'),['video'])!==-1){lcl_stop_slideshow();$('#lcl_wrap').addClass('lcl_playing_video')}});var lcl_iframe_click=function(){if(typeof(lcl_iframe_click_intval)!='undefined'){clearInterval(lcl_iframe_click_intval)} lcl_iframe_click_intval=setInterval(function(){var $ae=$(document.activeElement);if($ae.is('iframe')&&$ae.hasClass('lcl_elem')&&($('.lcl_youtube_elem').length||$('.lcl_vimeo_elem').length||$('.lcl_dailymotion_elem').length)){lcl_stop_slideshow();$('#lcl_wrap').addClass('lcl_playing_video');clearInterval(lcl_iframe_click_intval)}},300)};$(document).on('click','.lcl_socials',function(e){if(obj!=lcl_curr_obj){return!0} if(!$('.lcl_socials > div').length){var el=lcl_curr_vars.elems[lcl_curr_vars.elem_index];var page_url=encodeURIComponent(window.location.href);var title=encodeURIComponent(el.title).replace(/'/g,"\\'");var descr=encodeURIComponent(el.txt).replace(/'/g,"\\'");if(el.type=='image'){var img=el.src}else{var img=(el.poster)?el.poster:!1;if(!img&&typeof(el.vid_poster)!='undefined'){img=el.vid_poster}} var code='
    ';if(lcl_curr_opts.fb_share_params){var share_url=page_url;share_url+=(window.location.href.indexOf('?')===-1)?'%3F':'%26';share_url+=encodeURIComponent(lcl_curr_opts.fb_share_params.replace('%TITLE%',title).replace('%DESCR%',descr).replace('%IMG%',img));code+=''}else{code+=''} code+='';if(lcl_on_mobile){code+='
    '} if(img){code+=''} code+='
    ';$('.lcl_socials').addClass('lcl_socials_shown').html(code);setTimeout(function(){$('.lcl_socials_tt').addClass('lcl_show_tt')},20);if(lcl_curr_opts.fb_direct_share){$(document).off('click','.lcl_fb').on('click','.lcl_fb',function(e){FB.ui({method:'share_open_graph',action_type:'og.shares',action_properties:JSON.stringify({object:{'og:url':window.location.href,'og:title':el.title,'og:description':el.txt,'og:image':img,}})},function(response){window.close()})})}}else{$('.lcl_socials_tt').removeClass('lcl_show_tt');setTimeout(function(){$('.lcl_socials').removeClass('lcl_socials_shown').empty()},260)}});$(document).on('click','.lcl_fullscreen',function(e){if(obj!=lcl_curr_obj){return!0} if($('.lcl_fullscreen_mode').length){exit_fullscreen(!0)}else{enter_fullscreen(!0)}});$(document).on('click','.lcl_thumbs_toggle',function(e){if(obj!=lcl_curr_obj){return!0} var fs_mode=$('.lcl_fullscreen_mode').length;$('#lcl_wrap').addClass('lcl_toggling_tn').toggleClass('lcl_tn_hidden');if(!fs_mode){setTimeout(function(){lcl_resize()},160)} setTimeout(function(){$('#lcl_wrap').removeClass('lcl_toggling_tn')},lcl_curr_opts.animation_time+50)});var tn_track_touch=(lcl_on_mobile)?' click':'';$(document).on('lcl_tn_elem_click'+tn_track_touch,'.lcl_tn_inner > li',function(e){if(obj!=lcl_curr_obj){return!0} var elem_id=$(this).attr('rel');switch_elem(elem_id)});$(document).on('click','.lcl_tn_prev:not(.lcl_tn_disabled_arr)',function(e){if(obj!=lcl_curr_obj){return!0} $('.lcl_tn_inner').stop(!0).animate({"scrollLeft":($('.lcl_tn_inner').scrollLeft()-lcl_curr_opts.thumbs_w-10)},300,'linear',function(){$('.lcl_tn_inner').trigger('lcl_smoothscroll_end')})});$(document).on('click','.lcl_tn_next:not(.lcl_tn_disabled_arr)',function(e){if(obj!=lcl_curr_obj){return!0} $('.lcl_tn_inner').stop(!0).animate({"scrollLeft":($('.lcl_tn_inner').scrollLeft()+lcl_curr_opts.thumbs_w+10)},300,'linear',function(){$('.lcl_tn_inner').trigger('lcl_smoothscroll_end')})});$(document).on('wheel','#lcl_thumbs_nav.lcl_tn_has_arr',function(e){if(obj!=lcl_curr_obj){return!0} e.preventDefault();var delta=e.originalEvent.deltaY;if(delta>0){$('.lcl_tn_prev:not(.lcl_tn_disabled_arr)').trigger('click')}else{$('.lcl_tn_next:not(.lcl_tn_disabled_arr)').trigger('click')}});$(document).on("contextmenu","#lcl_wrap *",function(){if(obj!=lcl_curr_obj){return!0} if(lcl_ai_opts.rclick_prevent){return!1}});$(window).on('touchmove',function(e){var $t=$(e.target);if(!lcl_shown||!lcl_on_mobile){return!0} if(obj!=lcl_curr_obj){return!0} if(!$(e.target).parents('#lcl_window').length&&!$(e.target).parents('#lcl_thumbs_nav').length){e.preventDefault()}});var touch_events=function(){if(typeof(AlloyFinger)!='function'){return!1} lcl_is_pinching=!1;var el=document.querySelector('#lcl_wrap');var af=new AlloyFinger(el,{singleTap:function(e){if($(e.target).attr('id')=='lcl_overlay'&&!lcl_ai_opts.modal){lcl_close()}},doubleTap:function(e){e.preventDefault();zoom(!0)},pinch:function(e){e.preventDefault();lcl_is_pinching=!0;if(typeof(lcl_swipe_delay)!='undefined'){clearTimeout(lcl_swipe_delay)} if(typeof(lcl_pinch_delay)!='undefined'){clearTimeout(lcl_pinch_delay)} lcl_pinch_delay=setTimeout(function(){if(e.scale>1.2){zoom(!0)}else if(e.scale<0.8){zoom(!1)} setTimeout(function(){lcl_is_pinching=!1},300)},20)},touchStart:function(e){lcl_touchstartX=e.changedTouches[0].clientX},touchEnd:function(e){var diff=lcl_touchstartX-e.changedTouches[0].clientX;if((diff<-50||diff>50)&&!lcl_is_pinching){if($(e.target).parents('#lcl_thumbs_nav').length){return!1} if($(e.target).parents('.lcl_zoom_wrap').length){return!1} var delay=($(e.target).parents('.lcl_zoomable').length)?250:0;if(typeof(lcl_swipe_delay)!='undefined'){clearTimeout(lcl_swipe_delay)} lcl_swipe_delay=setTimeout(function(){if(diff<-50){switch_elem('prev')}else{switch_elem('next')}},delay)}}})};var set_curr_vars=function(){if(!lcl_curr_obj){return!1} lcl_ai_vars=$.data(lcl_curr_obj,'lcl_vars');lcl_ai_opts=$.data(lcl_curr_obj,'lcl_settings');if(!lcl_ai_vars){console.error('LC Lightbox. Object not initialized');return!1} return!0};lcl_open=function(obj,index){lcl_ai_vars=$.data(obj,'lcl_vars');var v=lcl_ai_vars;if(!v){console.error('LC Lightbox - cannot open. Object not initialized');return!1}else if(typeof(v.elems[index])=='undefined'){console.error('LC Lightbox - cannot open. Unexisting index');return!1}else{v.elem_index=index;$clicked_obj=(v.is_arr_instance)?!1:$(obj[index]);return open_lb(obj,$clicked_obj)}};lcl_resize=function(){if(!lcl_shown||lcl_is_active||!set_curr_vars()){return!1} var v=lcl_ai_vars;if(typeof(lcl_size_check)!='undefined'){clearTimeout(lcl_size_check)} lcl_size_check=setTimeout(function(){$('#lcl_wrap').addClass('lcl_is_resizing');thumbs_nav_arrows_opacity();var el=v.elems[v.elem_index];return size_elem(el)},20)};lcl_close=function(){if(!lcl_shown||lcl_is_active||!set_curr_vars()){return!1} return close_lb()};lcl_switch=function(new_el){if(!lcl_shown||lcl_is_active||!set_curr_vars()){return!1} return switch_elem(new_el)};lcl_start_slideshow=function(restart){if(!lcl_shown||(typeof(restart)=='undefined'&&typeof(lcl_slideshow)!='undefined')||!set_curr_vars()){return!1} var o=lcl_ai_opts;if(!o.carousel&&lcl_ai_vars.elem_index==(lcl_ai_vars.elems.length-1)){return!1} if(typeof(lcl_slideshow)!='undefined'){clearInterval(lcl_slideshow)} $('#lcl_wrap').addClass('lcl_is_playing');var time=o.animation_time+o.slideshow_time;progbar_animate(!0);lcl_slideshow=setInterval(function(){progbar_animate(!1);switch_elem('next',!0)},time);if(typeof(restart)=='undefined'){if(typeof(o.slideshow_start)=='function'){o.slideshow_start.call(null,o,lcl_ai_vars)} if(!lcl_ai_vars.is_arr_instance){var $subj=(lcl_ai_vars.elems_selector)?$(lcl_ai_vars.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_slideshow_start',[time])}} return!0};lcl_stop_slideshow=function(){if(!lcl_shown||typeof(lcl_slideshow)=='undefined'||!set_curr_vars()){return!1} var o=lcl_ai_opts;if(!o){console.error('LC Lightbox. Object not initialized');return!1} clearInterval(lcl_slideshow);lcl_slideshow=undefined;$('#lcl_wrap').removeClass('lcl_is_playing');$('#lcl_progressbar').stop(!0).animate({'marginTop':($('#lcl_progressbar').height()*-3)},300,function(){$(this).remove()});if(typeof(o.slideshow_end)=='function'){o.slideshow_end.call(null,lcl_ai_opts,lcl_ai_vars)} if(!lcl_ai_vars.is_arr_instance){var $subj=(lcl_ai_vars.elems_selector)?$(lcl_ai_vars.elems_selector):lcl_curr_obj;$subj.first().trigger('lcl_slideshow_end',[])} return!0};return obj}})(jQuery)