function t_initZoom(){if($('[data-zoomable="yes"]').length){$('[data-zoomable="yes"]').addClass("t-zoomable");$("body").append('
\
\
\
\
\
\
\
\
');t_showZoom();$('.t-zoomer__close, .t-zoomer__bg').click(function(e){$('body').removeClass("t-zoomer__show");$('body').removeClass("t-zoomer__show_fixed");$(document).unbind('keydown')})}} function t_showZoom(){$('.t-zoomable').click(function(e){$("body").addClass("t-zoomer__show");$(".t-zoomer__container").html('');var id=$(this).closest(".r").attr("id"),images=$("#"+id+"").find(".t-zoomable");images.each(function(){var images_urls=$(this).attr('data-img-zoom-url').split(',');if($(this).is("img")){var imgdescr=$(this).attr('alt')} if($(this).is("div")){var imgdescr=$(this).attr('title')} images_urls.forEach(function(){if(typeof imgdescr!=="undefined"&&imgdescr!==!1){$(".t-carousel__zoomer__inner").append("")}else{$(".t-carousel__zoomer__inner").append("")}})});var image_descr=$(".t-carousel__zoomer__item");image_descr.each(function(){$(this).css("display","block");var height=$(this).find(".t-zoomer__comments").height();$(this).css("display","");var image_active=$(this).find(".t-carousel__zoomer__wrapper");image_active.css("bottom",height)});var target_url=$(this).attr("data-img-zoom-url"),target_img=$(".t-carousel__zoomer__img[src=\""+target_url+"\"]"),slideItem=$(".t-carousel__zoomer__item"),target=target_img.closest(slideItem);target.show(0);slideItem.each(function(){$(this).attr("data-zoomer-slide-number",$(this).index())});pos=$(".t-carousel__zoomer__item:visible").attr("data-zoomer-slide-number");$('.t-carousel__zoomer__control_right').click(function(){pos=(pos+1)%slideItem.length;slideItem.hide(0).eq(pos).show(0)});$('.t-carousel__zoomer__control_left').click(function(){pos=(pos-1)%slideItem.length;slideItem.hide(0).eq(pos).show(0)});$(document).keydown(function(e){if(e.keyCode==37){pos=(pos-1)%slideItem.length;slideItem.hide(0).eq(pos).show(0)} if(e.keyCode==39){pos=(pos+1)%slideItem.length;slideItem.hide(0).eq(pos).show(0)} if(e.keyCode==27){$('body').removeClass("t-zoomer__show");$('body').removeClass("t-zoomer__show_fixed");$(document).unbind('keydown')}});var defaultSwipe;$(".t-carousel__zoomer__inner").bind('touchstart',function(e){defaultSwipe=e.originalEvent.touches[0].clientX});$(".t-carousel__zoomer__inner").bind('touchend',function(e){var swiped=e.originalEvent.changedTouches[0].clientX;if(defaultSwipe>swiped+50){pos=(pos-1)%slideItem.length;slideItem.hide(0).eq(pos).show(0)}else if(defaultSwipe1){$('body').addClass("t-zoomer__show_fixed")}else{$(".t-carousel__zoomer__control").css("display","none")} $('.t-carousel__zoomer__inner').click(function(e){$('body').removeClass("t-zoomer__show");$('body').removeClass("t-zoomer__show_fixed");$(document).unbind('keydown')});var lastScrollTop=0;$(window).scroll(function(event){var st=$(this).scrollTop();if(st>lastScrollTop){$('body').not('.t-zoomer__show_fixed').removeClass("t-zoomer__show");$(document).unbind('keydown')} lastScrollTop=st})})} $(document).ready(function(){setTimeout(function(){t_initZoom()},500)})