var AjaxGallery=function($gallery,confOverrides){confOverrides=confOverrides||{};var sel={galleryContainer:".gallery-wrap"};var $el=$gallery.find(sel.galleryContainer);var hOwl=function(eventName){return function(){priv.events.owl[eventName](arguments)}};var conf={gemiusCode:undefined,adProvider:"iprom",preloadCount:2,preloadRetryAttempts:2,totalSlides:undefined,autoInit:true,forceRemoveAds:false,headerHeight:0,footerHeight:0,useFakeVideoSubtilesForCORS:true,captureVideoFramesForPlaceholders:true, preventSlideSwitchBeforeCurrentImgLoad:false,resizingOptions:{maxWidth:Number.MAX_SAFE_INTEGER,limitHeightByViewport:true,sameHeightFixedPreResizable:false,sameHeightFixedPostResizable:true,sameHeightResizable:false,applyFocusVerticalCentering:true,applyFocusHorizontalCentering:false,maxHeightResizable:false,allowedFocusEnlargementMultiplier:1},publicEvents:{onBeforePrivInit:undefined,onAfterPrivInit:undefined,onBeforeOwlInitialized:undefined,onAfterOwlInitialized:undefined,onBeforeOwlTranslate:undefined, onAfterOwlTranslate:undefined,onBeforeOwlTranslated:undefined,onAfterOwlTranslated:undefined,onBeforeOwlResize:undefined,onAfterOwlResize:undefined},sideAdsPlacement:"aside",slideBannerZone:undefined,sideBannerZone:undefined,unhide:"",remove:"",mouseWheelNavigation:false,owl:{items:1,margin:0,stagePadding:0,loop:true,center:true,startPosition:undefined,nav:true,dots:false,rewind:false,rewindNav:false,animateOut:false,animateIn:false,mouseDrag:false,touchDrag:true,pullDrag:true,freeDrag:false,stageElement:"ul", itemElement:"li",navContainer:".nav-template",navElement:"div",navText:['',''],callbacks:true, onInitialized:hOwl("onInitialized"),onTranslated:hOwl("onTranslated"),onTranslate:hOwl("onTranslate"),onResize:hOwl("onResize"),onDrag:hOwl("onDrag"),onDragged:hOwl("onDragged")},layout:{desktop:{resizingOptions:{maxWidth:1092},mouseWheelNavigation:false,applyFocusVerticalCentering:true,owl:{animateOut:"fadeOut",animateIn:"fadeIn",mouseDrag:false,touchDrag:false,pullDrag:false,freeDrag:false,navText:['', '']}},desktopSmall:{resizingOptions:{maxWidth:846},mouseWheelNavigation:false,applyFocusVerticalCentering:true,owl:{animateOut:"fadeOut",animateIn:"fadeIn",mouseDrag:false,touchDrag:false,pullDrag:false,freeDrag:false,navText:['', '']}},mobile:{sideAdsPlacement:"bottom",resizingOptions:{maxWidth:Number.MAX_SAFE_INTEGER,limitHeightByViewport:false,sameHeightFixedPreResizable:false,sameHeightFixedPostResizable:false,sameHeightResizable:false,applyFocusVerticalCentering:false,applyFocusHorizontalCentering:false}}, tablet:{sideAdsPlacement:"bottom",resizingOptions:{maxWidth:Number.MAX_SAFE_INTEGER,limitHeightByViewport:false,sameHeightFixedPreResizable:false,sameHeightFixedPostResizable:false,sameHeightResizable:false,applyFocusVerticalCentering:false,applyFocusHorizontalCentering:false}}}};$.extend(true,conf,confOverrides);var layoutConfOverride=conf.layout.hasOwnProperty(ntlib.conf.initialLayoutVariant)?conf.layout[ntlib.conf.initialLayoutVariant]:{};$.extend(true,conf,layoutConfOverride);var log=[];var showLogMessages= false;var priv={};$.extend(priv,{$getEl:function(){return $el},$getGallery:function(){return $gallery},init:function(){priv.log.add("init()");priv.helpers.execPublicEvent("onBeforePrivInit",arguments);$("body").css("visibility","hidden");priv.$getGallery().removeClass("no-js");priv.$getGallery().find(".js-less-nav").addClass("hide");priv.$getGallery().find(".slide").removeClass("hide");var toUnhide=conf["unhide"].split(",");$.each(toUnhide,function(name,value){$(value).removeClass("hide")});var toRemove= conf["remove"].split(",");$.each(toRemove,function(name,value){$(value).remove()});priv.uniqueSlides.init();priv.cleanup.init();if(conf.adProvider==="dfp"&&typeof window.ntAds==="object"&&typeof window.ntAds._cfg==="object")window.ntAds.display([conf.slideBannerZone,conf.sideBannerZone]);$(window).trigger("ajaxGallery:initialized")},uniqueSlides:function(){return window.ntapp.AjaxGalleryLib.uniqueSlides(priv,conf)}(),cleanup:function(){return window.ntapp.AjaxGalleryLib.cleanup(priv,conf)}(),initStep2:function(){$("body").on("ntAds.placementRendered", function(event,placement){if(typeof placement==="object"&&placement.hasOwnProperty("isEmpty")&&placement.hasOwnProperty("getAlias"))if(placement.isEmpty()==true)if(placement.getAlias()!="aside-1")priv.banner.remove.zoneAds(placement.getAlias())});var AjaxGallery_allow_next_keydown=false;$(document).on("keydown",function(e){if(!AjaxGallery_allow_next_keydown){setTimeout(function(){AjaxGallery_allow_next_keydown=false},500);AjaxGallery_allow_next_keydown=true;priv.item.callItemEvent("onKeyDown",priv.helpers.getCurrentItem(), e)}});priv.helpers.execPublicEvent("onAfterPrivInit",arguments)},events:function(){return window.ntapp.AjaxGalleryLib.events(priv,conf)}(),thumbStrip:function(){return window.ntapp.AjaxGalleryLib.thumbStrip(priv,conf)}(),preloading:function(){return window.ntapp.AjaxGalleryLib.preloading(priv,conf)}(),helpers:function(){return window.ntapp.AjaxGalleryLib.helpers(priv,conf)}(),banner:function(){return window.ntapp.AjaxGalleryLib.banner(priv,conf)}(),video:function(){return window.ntapp.AjaxGalleryLib.video(priv, conf)}(),zoom:function(){return window.ntapp.AjaxGalleryLib.zoom(priv,conf)}(),statistics:function(){return window.ntapp.AjaxGalleryLib.statistics(priv,conf)}(),item:function(){return window.ntapp.AjaxGalleryLib.item(priv,conf)}(),log:{add:function(msg,severity){severity=severity||"warn";log.push(msg);try{if(showLogMessages)console[severity]("LOG: "+msg)}catch(e){console.log("SEVERITY: ",arguments)}}}});var api={owl:undefined,conf:conf,events:priv.events["public"],helpers:priv.helpers,flows:priv.video.videoHandles, priv:priv};if(conf.hasOwnProperty("autoInit")&&conf.autoInit)priv.init();return api}; $(document).ready(function(){window.blockMenuHeaderScroll=false;var mc=new Hammer(document);mc.on("swipeleft swiperight panleft panright",function(ev){window.blockMenuHeaderScroll=true});mc.on("swipeup swipedown panup pandown",function(ev){window.blockMenuHeaderScroll=false});$(window).on("touchend",function(){blockMenuHeaderScroll=false});$(".owl-carousel")[0].addEventListener("touchmove",function(evt){if(blockMenuHeaderScroll)evt.preventDefault()},{passive:false})}); window.ntapp.AjaxGalleryLib=function(lib){var attr={item:{type:"data-media-type"},uniquePlaceholder:{ids:"data-unique-ids"}};lib.cleanup=function(priv,conf){return{init:function(){priv.log.add("cleanup::init()");priv.cleanup.gc.sendRequests();$.when.apply($,priv.cleanup.gc.promises).then(function(){priv.log.add("cleanup:: gc - modify");priv.item.each(function(info){priv.cleanup.gc.modifyForbiddenSlide(info)},false,false,true,false,"cleanup: gc loop");priv.log.add("cleanup:: post/pre resizable");priv.cleanup.addPrePostResizable(); priv.log.add("cleanup:: initStep2()");priv.initStep2();priv.log.add("cleanup:: initOwl()");priv.helpers.initOwl()})},gc:{promises:[],failedIds:[],sendRequests:function(){for(var i in window.ag_videoConfigs)if(window.ag_videoConfigs.hasOwnProperty(i)&&window.ag_videoConfigs[i].hasOwnProperty("local")&&window.ag_videoConfigs[i].local.gc!==false){var gcUrl=window.location.protocol+"//"+window.location.host+"/bin/player/flowplayer/gc.php?media_id="+i;priv.cleanup.gc.promises.push(function(id){return $.ajax({url:gcUrl, dataType:"json",method:"POST",success:function(data,textStatus,jqXHR){if(data.gc===false)priv.cleanup.gc.failedIds.push(id)},error:function(jqXHR,textStatus,errorThrown){priv.cleanup.gc.failedIds.push(id)}})}(i))}},modifyForbiddenSlide:function(info){if(info.type=="video"&&priv.cleanup.gc.failedIds.indexOf(info.entityId)!==-1){var errorImgUrl="//image.dnevnik.hr/media/document/61554966.png";delete priv.uniqueSlides.detached[info.ids];info.$element.parent().attr(attr.item.type,"img");info.$element.attr(attr.item.type, "img");info.$element.find("["+attr.uniquePlaceholder.ids+"]").remove();info.$focus.removeAttr("src");info.$resizable.addClass("image-area");info.$focus.removeAttr("data-src");info.$focus.removeAttr("data-src-ng");info.$focus.attr("data-width",1600);info.$focus.attr("data-height",888.8888888888889);if(priv.$getEl().attr("data-initial-slide")==info.index){priv.preloading.inProgressMediaIds.push(info.entityId);priv.preloading.finishedLoadingMediaIds.push(info.entityId);info.$focus.attr("src",errorImgUrl)}else info.$focus.attr("data-src", errorImgUrl);info.$element.css("display","");priv.uniqueSlides.$root.find("["+attr.uniquePlaceholder.ids+'="'+info.ids+'"]').remove();delete window.ag_videoConfigs[info.entityId];priv.item.cache.invalidateItem(info)}}},addPrePostResizable:function(){priv.item.each(function(info){priv.cleanup.processInfo(info);if(info.unique){info=priv.item.info(info.$element,true,true,false,"cleanup: Unique after processInfo");priv.cleanup.processInfo(info)}},false,true,false,false,"cleanup: adding pre/post resizable")}, processInfo:function(info){if(info.hasOwnProperty("$resizable")&&typeof info.$resizable==="object"){if(!info.hasOwnProperty("$fixedPreResizable")||typeof info.$fixedPreResizable!=="object"){var $fixedPreResizable=$('
').append(info.$resizable.prevAll().not('[ag-sizing="resizable"]').not('[ag-sizing="ignore"]').detach());$fixedPreResizable.insertBefore(info.$resizable)}if(!info.hasOwnProperty("$fixedPostResizable")||typeof info.$fixedPostResizable!=="object"){var $fixedPostResizable= $('
').append(info.$resizable.nextAll().not('[ag-sizing="resizable"]').not('[ag-sizing="ignore"]').detach());$fixedPostResizable.insertAfter(info.$resizable)}priv.item.cache.invalidateItem(info)}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var sel={uniqueSlidesWrapperId:"unique-slides-wrapper"};var attr={uniquePlaceholder:{ids:"data-unique-ids"}};lib.uniqueSlides=function(priv,conf){return{detached:{},$root:undefined,getSlideIdentifier:function($slide){var contentIds="";var $uniquePlaceholder=$slide.find("["+attr.uniquePlaceholder.ids+"]").first();if($uniquePlaceholder.length)contentIds=$uniquePlaceholder.attr(attr.uniquePlaceholder.ids);else{$slide.find("[id]").each(function(){contentIds+= "#"+$(this).attr("id")});contentIds=contentIds.substring(1)}return contentIds==""?undefined:contentIds},init:function(){priv.log.add("uniqueSlides::init()");if(typeof priv.uniqueSlides.$root==="undefined"){priv.uniqueSlides.$root=$('
');priv.$getGallery().prepend(priv.uniqueSlides.$root);priv.log.add("uniqueSlides::init() - EACH START");priv.item.each(function(info){if(info.unique===true)if(priv.item.type.unique.placeholder.hasOwnProperty(info.type)&&typeof priv.item.type.unique.placeholder[info.type]=== "function"){if(!priv.uniqueSlides.detached.hasOwnProperty(info.ids)){var $contanerCopy=$(info.$element.get()[0].cloneNode(false)).addClass("hide").attr(attr.uniquePlaceholder.ids,info.ids);var $content=info.$element.children().detach();$contanerCopy.append($content);priv.uniqueSlides.$root.append($contanerCopy);priv.uniqueSlides.detached[info.ids]={content:$content,isPlaced:false,linkedElements:[],initialContent:$content.clone()}}var placeholderData=priv.item.type.unique.placeholder[info.type](info); info.$element.empty().append(placeholderData.$placeholder);priv.uniqueSlides.detached[info.ids].linkedElements.push(info.$element)}},false,true,false,false,"uniqueSlides:init loop");priv.log.add("uniqueSlides::init() - EACH END")}},place:function(info){if(priv.uniqueSlides.detached.hasOwnProperty(info.ids)){var $uniqueWrapper=priv.uniqueSlides.$root.find("["+attr.uniquePlaceholder.ids+'="'+info.ids+'"]');info.$original.css("display","none");info.$clones.each(function(){$(this).css("display","none")}); $uniqueWrapper.removeClass("hide");priv.uniqueSlides.detached[info.ids].isPlaced=true;priv.item.callItemEvent("onUniquePlaced",info)}},detach:function(info){if(info.unique===false)return;priv.item.callItemEvent("onUniqueDetach",info);info.$original.css("display","block");info.$clones.each(function(){$(this).css("display","block")});priv.uniqueSlides.$root.find("["+attr.uniquePlaceholder.ids+'="'+info.ids+'"]').addClass("hide");priv.uniqueSlides.detached[info.ids].isPlaced=false;priv.item.callItemEvent("onUniqueDetached", info)},detachAll:function(){$.each(priv.uniqueSlides.detached,function(name,value){if(value.isPlaced===true)$.each(value.linkedElements,function(index,$value){priv.uniqueSlides.detach(priv.item.info($value,false,false,false,"Unique detach all"))})})}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var attr={item:{index:"data-slide-index"},gallery:{slideCount:"data-slide-count",startSlide:"data-initial-slide"}};lib.helpers=function(priv,conf){return{calc:{indexDiff:function(idx0,idx1){idx0=parseInt(idx0,10);idx1=parseInt(idx1,10);var totalItems=conf.totalSlides;var circular=conf.owl.loop;var currentDirection=-1;if(circular&&Math.abs(idx0-idx1)*2>totalItems)if(idx0>idx1)idx0=idx0-totalItems;else if(idx00){ret.width=cHeight*pAspect;ret.height=cHeight}else{ret.width=cWidth;ret.height=cWidth/pAspect}return ret}return{width:cWidth,height:cHeight}}},galleryOffsetTop:function(){conf.headerHeight= priv.$getEl().offset().top;return conf.headerHeight},galleryOffsetBottom:function(){var footerHeight=0;priv.$getEl().nextAll().each(function(){if($(this).css("display")!=="none"&&$(this).attr("id")!=="unique-slides-wrapper")footerHeight+=$(this).outerHeight(true)});conf.footerHeight=footerHeight;return conf.footerHeight},maxLayoutWidth:function(){return Math.min(parseInt(priv.$getEl().css("width"),10),conf["resizingOptions"]["maxWidth"])}},isArgumentsObject:function(testCase,checkIndices){checkIndices= checkIndices||false;if(typeof testCase==="object")if(!Array.isArray(testCase))if(testCase.hasOwnProperty("length")&&testCase.hasOwnProperty(0)){if(checkIndices)for(var i in testCase)if(i!=="length"&&!priv.helpers.isNumeric(i))return false;return true}return false},isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},getCurrentItem:function(){var ret=undefined;if(priv.$getEl().find(".owl-item.active").length===0){var startSlideIdx=parseInt(priv.$getEl().attr(attr.gallery.startSlide),10)|| 0;var selector=".slide["+attr.item.index+"="+startSlideIdx+"]";ret=priv.$getEl().find(selector).first()}else ret=priv.$getEl().find(".owl-item.active").first();var galleryHeader=$(".gallery-header");if(ret.find(".image-area img").length>0){var isLandscape=ret.find("img").first().width()>ret.find("img").first().height();if(galleryHeader.length>0&&isLandscape&&!galleryHeader.hasClass("enter-landscape"))galleryHeader.addClass("enter-landscape");else if(galleryHeader.length>0&&!isLandscape&&galleryHeader.hasClass("enter-landscape"))galleryHeader.removeClass("enter-landscape")}else if(galleryHeader.length> 0&&galleryHeader.hasClass("enter-landscape")&&ret.find(".image-area img").length>0)galleryHeader.removeClass("enter-landscape");else if(galleryHeader.length>0&&ret.data("media-type")=="ad")galleryHeader.addClass("enter-landscape");ret=priv.item.info(ret,false,false,false,"getCurrentItem()");return ret},getOwlConf:function(){var layoutVariant=ntlib.conf.initialLayoutVariant;if(conf.layout.hasOwnProperty(layoutVariant)&&conf.layout[layoutVariant].hasOwnProperty("owl"))$.extend(conf.owl,conf.layout[layoutVariant].owl); var hasVideos=priv.$getEl().find('.slide[data-media-type="video"]').length?true:false;if(!hasVideos);return conf.owl},initOwl:function(){priv.log.add("about to initOwl");conf.totalSlides=parseInt(priv.$getEl().attr(attr.gallery.slideCount),10)||priv.$getEl().find(".slide").not(".cloned").length;conf.owl.startPosition=parseInt(priv.$getEl().attr(attr.gallery.startSlide),10)||0;priv.$getGallery().parents().each(function(){$(this).data("bck-overflow",$(this).css("overflow"));$(this).css("overflow","hidden")}); priv.owl=priv.$getGallery().find(".owl-carousel");var cfg=priv.helpers.getOwlConf();priv.owl.owlCarousel(cfg);priv.$getGallery().parents().each(function(){$(this).css("overflow",$(this).data("bck-overflow"))})},positionNavigation:function(){if(ntlib.conf.initialLayoutVariant==="mobile"||ntlib.conf.initialLayoutVariant==="tablet"){var focusHeight=parseInt(priv.helpers.getCurrentItem().$element.children().first().css("height"),10);if(focusHeight){var navHeight=priv.$getGallery().find(".nav-template").outerHeight(true)|| 48;priv.$getGallery().find(".nav-template").css("position","absolute").css("top",focusHeight+conf.headerHeight-navHeight)}}},captureVideoFrame:function(video,format,quality,canvasDimensions){if(typeof video==="string")video=document.getElementById(video);format=format||"jpeg";quality=quality||.92;if(!video||format!=="png"&&format!=="jpeg")return false;canvasDimensions=canvasDimensions||{width:video.videoWidth,height:video.videoHeight};var canvas=document.createElement("CANVAS");canvas.setAttribute("crossorigin", "anonymous");canvas.width=canvasDimensions.width;canvas.height=canvasDimensions.height;canvas.getContext("2d").drawImage(video,0,0,canvasDimensions.width,canvasDimensions.height);var dataUri=undefined;var blob=undefined;try{dataUri=canvas.toDataURL("image/"+format,quality);var data=dataUri.split(",")[1];var mimeType=dataUri.split(";")[0].slice(5);var bytes=window.atob(data);var buf=new ArrayBuffer(bytes.length);var arr=new Uint8Array(buf);for(var i=0;i");priv.$getGallery().prepend($zoomContainer);priv.zoom.activeApi=window.ntapp.imageZoom.setup({imageWidth:500,imageContainer:$zoomContainer.get(0),imgUrl:allImgVariants})},reset:function(){if(typeof priv.zoom.activeApi=== "object")priv.zoom.remove()},remove:function(){if(typeof priv.zoom.activeApi==="object")priv.zoom.activeApi.remove()},isInProgress:function(){if(typeof priv.zoom.activeApi==="object")return priv.zoom.activeApi.isInProgress();else return false}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.statistics=function(priv,conf){return{pageview:{all:function(){priv.statistics.pageview.analytics();priv.statistics.pageview.gemius();priv.statistics.pageview.upScore();priv.statistics.pageview.dotmetrics()},analytics:function(){var fullUri=window.location.href;if(window.hasOwnProperty("ga")){ga("set","page",fullUri);ga("send","pageview")}},gemius:function(){var gemiusCode=conf["gemiusCode"];if(typeof gemiusCode!=="undefined"){if(typeof window.pp_gemius_hit=== "function")pp_gemius_hit(gemiusCode)}else console.log("Missing gemius code in conf!")},dotmetrics:function(){if(window.hasOwnProperty("dm")&&window.dm.hasOwnProperty("AjaxEvent")&&window.dm.hasOwnProperty("ntDotmetricsSectionID"))dm.AjaxEvent("pageview",null,dm.ntDotmetricsSectionID);else console.log("Cant send dotmetrics pageview!",window.hasOwnProperty("dm")&&window.dm.hasOwnProperty("AjaxEvent")&&window.dm.hasOwnProperty("ntDotmetricsSectionID"))},upScore:function(){var fullUri=window.location.href; var galleryId=parseInt(window.location.pathname.match(/(\d+)\.html/)[1]);if(typeof window.upScore==="function")upScore.reinit({"object_type":"gallery","object_id":galleryId,"object_url":fullUri,"sequence":priv.helpers.getCurrentItem().index+1})}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.preloading=function(priv,conf){return{inProgressMediaIds:[],finishedLoadingMediaIds:[],processNextItem:function(){var bestMatch=undefined;priv.item.each(function(info){bestMatch=bestMatch||info;if(info.hasOwnProperty("preloading")&&info.preloading===true&&info.preloadFailsCountscreenWidth&&widthretWidth){retUrl=mediaData[key];retWidth=width}}if(!!returnExtendedInfo)return{width:retWidth,src:retUrl};else return retUrl}}}; return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var sel={currentSlideIndex:".current-slide-index",sideBanner:".gallery-aside"};var lastIdx=undefined;var isDraging=false;lib.events=function(priv,conf){return{"public":{switchCurrent:function(info){info=info||priv.helpers.getCurrentItem();if(typeof info==="undefined")return;if(priv.item.type.state.hasOwnProperty(info.type))var cantSwitch=typeof priv.item.type.state[info.type].cantChangeSlide==="function"?priv.item.type.state[info.type].cantChangeSlide(info):undefined; cantSwitch=!!cantSwitch;return{next:function(){if(!cantSwitch)priv.owl.trigger("next.owl")},prev:function(){if(!cantSwitch)priv.owl.trigger("prev.owl")}}}},owl:{onInitialized:function(){priv.log.add("owl-event: onInitialized()");var activeInfo=priv.helpers.getCurrentItem();if(conf["mouseWheelNavigation"]===true)priv.owl.on("mousewheel",".owl-stage",function(e){if(e.deltaY>0)priv.events["public"].switchCurrent().next();else priv.events["public"].switchCurrent().prev();e.preventDefault()});priv.$getEl().on("touchstart mousedown", function(e){var info=priv.helpers.getCurrentItem();if(priv.item.type.state.hasOwnProperty(info.type))var cantSwitch=typeof priv.item.type.state[info.type].cantChangeSlide==="function"?priv.item.type.state[info.type].cantChangeSlide(info):undefined;cantSwitch=!!cantSwitch;if(cantSwitch)e.stopPropagation()});priv.item.each(function(info){info.$element.closest(".owl-item").attr("data-media-type",info.type)},false,true,false,false,"events: onInitialised adding bobos media type class");priv.owl.on("click", ".owl-stage",function(e){priv.item.callItemEvent("onClick",priv.helpers.getCurrentItem(),e)});priv.helpers.execPublicEvent("onBeforeOwlInitialized",arguments);if(activeInfo.type==="img"&&activeInfo.src){priv.preloading.inProgressMediaIds.push(activeInfo.entityId);var tmpImg=new Image;tmpImg.onload=priv.item.type.preloading.handlers.done(activeInfo).success.img;tmpImg.onerror=priv.item.type.preloading.handlers.done(activeInfo).error.img;tmpImg.src=activeInfo.src}else priv.preloading.processNextItem(); setTimeout(function(){if(typeof window.canRunAds==="undefined"||(conf.forceRemoveAds===true||ntapp.ads.hasOwnProperty("gotConf")&&ntapp.ads.gotConf===false)){priv.banner.remove.slideAndAside();$(".gallery-page").addClass("gallery-no-ads");console.log("gallery-no-ads 1")}priv.events.owl.onResize();if(ntlib.conf.initialLayoutVariant=="mobile"||ntlib.conf.initialLayoutVariant=="tablet"){var boundIds=[];priv.item.each(function(info){if(info.type=="ad"&&boundIds.indexOf(info.ids)===-1){var mc=new Hammer.Manager(info.$elementContent.parent().get()[0], {domEvents:false});mc.add(new Hammer.Swipe({event:"swipe",threshold:30,velocity:.3,direction:Hammer.DIRECTION_HORIZONTAL}));mc.on("swipe",function(ev){if(ev.direction===2)priv.events["public"].switchCurrent(info).next();else if(ev.direction===4)priv.events["public"].switchCurrent(info).prev()});boundIds.push(info.ids)}},false,true,false,false,"events: onInitialised timeout adding swipe binding to ads")}priv.$getGallery().find(".owl-next").off().click(function(e){priv.events["public"].switchCurrent().next(); e.preventDefault();e.stopPropagation();return false});priv.$getGallery().find(".owl-prev").off().click(function(e){priv.events["public"].switchCurrent().prev();e.preventDefault();e.stopPropagation();return false});priv.helpers.execPublicEvent("onAfterOwlInitialized",arguments);$("body").css("visibility","visible")},0)},onDrag:function(){isDraging=true;priv.events.owl.onTranslate()},onDragged:function(){isDraging=false},onTranslate:function(){priv.log.add("owl-event: onTranslate()");priv.helpers.execPublicEvent("onBeforeOwlTranslate", arguments);$(priv.$getGallery().find(".nav-template").get(0)).addClass("can-hide");if(conf["sideAdsPlacement"]=="bottom")if($(sel.sideBanner).css("display")!="none"){$(sel.sideBanner).data("bck-display",$(sel.sideBanner).css("display"));$(sel.sideBanner).css("display","none")}priv.zoom.reset();priv.uniqueSlides.detachAll();priv.helpers.execPublicEvent("onAfterOwlTranslate",arguments)},onTranslated:function(){priv.log.add("owl-event: onTranslated()");var currentSlideInfo=priv.helpers.getCurrentItem(); if(currentSlideInfo.index!=lastIdx){priv.helpers.execPublicEvent("onBeforeOwlTranslated",[currentSlideInfo]);try{window.history.replaceState({},"",currentSlideInfo.uri)}catch(error){}$(sel.currentSlideIndex).text(currentSlideInfo.index+1);priv.preloading.processNextItem()}if(currentSlideInfo.unique===true)priv.uniqueSlides.place(currentSlideInfo);if(currentSlideInfo.index!=lastIdx){priv.banner.position.aside(currentSlideInfo);priv.banner.invalidateZone(conf["sideBannerZone"]);priv.banner.refresh.allInvalidated(); lastIdx=currentSlideInfo.index;priv.helpers.execPublicEvent("onAfterOwlTranslated",[currentSlideInfo]);priv.statistics.pageview.all()}},onResize:function(){priv.log.add("owl-event: onResize()");var currentInfo=priv.helpers.getCurrentItem();if(ntlib.conf.initialLayoutVariant!==ntlib.events.resize.getLayoutVariant($(window).width())){$("body").empty().append($('

Prilago\u0111avanje...

')); priv.item.callItemEvent("onLayoutReload",currentInfo);window.location.reload()}$("body").css("visibility","hidden");priv.helpers.execPublicEvent("onBeforeOwlResize",arguments);var galleryOffset=priv.$getGallery().offset();var elOffset=priv.$getEl().offset();var placeholderOffset={top:elOffset.top-galleryOffset.top,left:elOffset.left-galleryOffset.left};priv.uniqueSlides.$root.css("position","absolute").css("top",0).css("left",0).css("bottom",0).css("right",0).css("margin-top",placeholderOffset.top); var resizeOptions=priv.item.resize.getOptions();priv.item.each(function(info){priv.item.resize.clearInfoCss(info);info.$element.css("max-width",resizeOptions.maxWidth);info.$element.css("width",info.$element.width());if(info.unique){info.$elementContent.closest(".slide").removeClass("hide");info.$elementContent.closest(".slide").css("max-width",resizeOptions.maxWidth);info.$elementContent.closest(".slide").css("width",info.$elementContent.closest(".slide").width());info.$elementContent.closest(".slide").addClass("hide")}}, false,true,false,false,"events: onResize clearing old rules");var slideApis=[];priv.item.each(function(info){slideApis.push(info);if(info.unique)slideApis.push(priv.item.info(info.$element,true,true,false,"events: onResize getting unique info"))},false,true,false,false,"events: onResize collecting slide apis");priv.item.resizeSlides(slideApis);priv.owl.trigger("refresh.owl.carousel");if(currentInfo.unique===true)priv.uniqueSlides.place(currentInfo);priv.banner.position.aside(currentInfo);priv.helpers.execPublicEvent("onAfterOwlResize", arguments);$("body").css("visibility","visible")}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var sel={slideBanner:".ag-banner",sideBanner:".gallery-aside",itemsContainer:".owl-stage"};lib.banner=function(priv,conf){return{_invalidated:[],invalidateZone:function(zoneId){if(typeof zoneId==="undefined")return;if(conf.adProvider==="iprom")zoneId=parseInt(zoneId,10);if(typeof zoneId!=="undefined"&&priv.banner._invalidated.indexOf(zoneId)===-1)priv.banner._invalidated.push(zoneId)},refresh:{allInvalidated:function(){if(priv.banner.refresh.hasOwnProperty(conf.adProvider))return priv.banner.refresh[conf.adProvider].allInvalidated(); else console.log("undefined ad provider "+conf.adProvider)},iprom:{slide:function(){if(window.hasOwnProperty("canRunAds")&&canRunAds&&"object"===typeof ipromAS)ipromAS.reloadZones([conf["slideBannerZone"]])},aside:function(){if(window.hasOwnProperty("canRunAds")&&canRunAds&&"object"===typeof ipromAS)ipromAS.reloadZones([conf["sideBannerZone"]])},slideAndAside:function(){if(window.hasOwnProperty("canRunAds")&&canRunAds&&"object"===typeof ipromAS)ipromAS.reloadZones([conf["sideBannerZone"],conf["slideBannerZone"]])}, allInvalidated:function(){if(window.hasOwnProperty("canRunAds")&&canRunAds&&"object"===typeof ipromAS){ipromAS.reloadZones(priv.banner._invalidated);priv.banner._invalidated=[]}}},dfp:{allInvalidated:function(){if(window.hasOwnProperty("ntAds")&&window.ntAds.hasOwnProperty("reload")){ntAds.reload(priv.banner._invalidated);priv.banner._invalidated=[]}}}},position:{slide:function(info){},aside:function(info){if(conf["sideAdsPlacement"]=="bottom"){var slideHeight=info.$elementContent.closest(".slide").offset().top+ info.$elementContent.closest(".slide").outerHeight();$(sel.sideBanner).css("position","absolute").css("top",slideHeight);if($(sel.sideBanner).data("bck-display"))$(sel.sideBanner).css("display",$(sel.sideBanner).data("bck-display"))}}},remove:{slideAndAside:function(){priv.banner.remove.slide();priv.banner.remove.aside()},slide:function(){conf["slideBannerZone"]=undefined;priv.banner.remove.allSlideAds();priv.banner._invalidated=[]},aside:function(){$(sel.sideBanner).remove();conf["sideBannerZone"]= undefined;priv.banner._invalidated=[];$(".gallery-page").addClass("gallery-no-ads");console.log("gallery-no-ads 2");priv.events.owl.onResize()},zoneAds:function(zone){if(zone==conf["slideBannerZone"])priv.banner.remove.slide();else if(zone==conf["sideBannerZone"])priv.banner.remove.aside()},allSlideAds:function(){console.log("REMOVING ALL SLIDE ADS!!!");var ids=[];priv.$getEl().find(sel.itemsContainer).children().not(".cloned").has(".banner-holder").each(function(){ids.push(priv.item.info($(this), false,false,false,"banner: removing all slide ads").index)});priv.item.remove(ids)}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var sel={flowplayerMainVideo:"video.jw-video"};lib.video=function(priv,conf){return{videoHandles:{},videosReady:[],videosFailed:[],videosSeeking:[],videosEnded:[],videosFirstFrame:[],play:function(info){var initRequired=!priv.video.videoHandles.hasOwnProperty(info.entityId);if(initRequired){info.videoConf.autostart=false;if(typeof window.ntVideo==="object"){info.videoConf.intl=info.videoConf.intl||{};info.videoConf.intl.hr=window.ntVideo.getTranslations().hr}var videoApi= priv.video.videoHandles[info.entityId]=jwplayer(info.$focus.get(0));videoApi.setup(info.videoConf);videoApi.on("ready",function(){priv.item.callItemEvent("onReady",info,arguments)});videoApi.on("seek",function(){priv.item.callItemEvent("onSeek",info,arguments)});videoApi.on("play",function(){priv.item.callItemEvent("onPlay",info,arguments)});videoApi.on("pause",function(){priv.item.callItemEvent("onPause",info,arguments)});videoApi.on("seeked",function(){priv.item.callItemEvent("onSeekEnd",info,arguments)}); videoApi.on("setupError",function(){priv.item.callItemEvent("onError",info,arguments)});videoApi.on("time",function(e){priv.item.callItemEvent("onProgress",info,arguments)});videoApi.on("firstFrame",function(e){priv.item.callItemEvent("onFirstFrame",info,arguments)});videoApi.on("complete",function(e){priv.item.callItemEvent("onFinish",info,arguments)})}priv.video.videoHandles[info.entityId].play()},pause:function(info){if(typeof priv.video.videoHandles[info.entityId]!=="undefined")priv.video.videoHandles[info.entityId].pause()}, togglePlayback:function(info){if(typeof priv.video.videoHandles[info.entityId]!=="undefined"){var api=priv.video.videoHandles[info.entityId];if(api.getState()==="paused"||priv.video.videosEnded.indexOf(info.entityId)!==-1)priv.video.play(info);else priv.video.pause(info)}},getApi:function(info){if(priv.video.videoHandles.hasOwnProperty(info.entityId))return priv.video.videoHandles[info.entityId]},$getVideoElement:function(info){return info.$elementContent.find(sel.flowplayerMainVideo)}}};return lib}(window.ntapp.AjaxGalleryLib|| {}); window.ntapp.AjaxGalleryLib=function(lib){lib.thumbStrip=function(priv,conf){return{place:function(){var infos=[];priv.item.each(function(info){if(info.type!=="ad")infos.push(info)});priv.thumbStrip.create(infos)},create:function(infos,height){height=height||100;var $container=$("
    ",{"class":"thumbStrip owl-carousel",css:{"position":"fixed","overflow":"hidden","bottom":"0px","left":"0px","width":"100%","z-index":"500"}});var currentSlide=priv.helpers.getCurrentItem();for(var i in infos){var thumbCss={width:Math.round(height* infos[i].width/infos[i].height)+"px",height:height};if(i==currentSlide.index)thumbCss["border"]="1px solid red";var $img=$("",{src:priv.item.type.thumbnail[infos[i].type](infos[i]),css:thumbCss});(function(info){$img.on("click",function(){if(typeof priv.item.type.state[currentSlide.type]==="object"&&typeof priv.item.type.state[currentSlide.type].cantChangeSlide==="function"&&!priv.item.type.state[currentSlide.type].cantChangeSlide(currentSlide)){var slideToGo=info.index;currentSlide=info;priv.events.owl.onTranslate(); priv.owl.trigger("to.owl.carousel",[slideToGo,0,true]);priv.events.owl.onTranslated();$(this).closest(".thumbStrip").find(".thumb img").css("border","");$(this).css("border","1px solid red")}})})(infos[i]);var $li=$("
  • ",{"class":"thumb thumb-"+infos[i].type,"data-index":infos[i].index,css:{}}).append($img);$container.append($li)}$("body").append($container);var thumbApi=$container.owlCarousel({autoWidth:true});thumbApi.trigger("to.owl.carousel",[currentSlide.index,0,true])}}};return lib}(window.ntapp.AjaxGalleryLib|| {}); window.ntapp.AjaxGalleryLib=function(lib){var sel={itemsContainer:".owl-stage"};var attr={item:{type:"data-media-type",index:"data-slide-index",preloadFailsCount:"data-preload-fail-count"}};lib.item=function(priv,conf){return $.extend(true,lib.item,{cache:{_infoCache:{unique:{},placeholder:{}},getCachedInfo:function(index,calc,usePlaceholderContent,writable,getClone){writable=writable||false;calc=calc||false;usePlaceholderContent=usePlaceholderContent||false;getClone=parseInt(getClone,10)||false;var cacheBase= priv.item.cache._infoCache;var usedCache=usePlaceholderContent?cacheBase["placeholder"]:cacheBase["unique"];var ret=undefined;if(typeof usedCache[index]==="object"){if(writable)ret=usedCache[index];else{ret={};$.extend(ret,usedCache[index])}if(calc){var tmpCalcDiff=undefined;var currentInfo=priv.helpers.getCurrentItem();ret["tmpCalcDiff"]=priv.helpers.calc.indexDiff(index,currentInfo.index)}if(writable&&Object.hasOwnProperty("seal"))Object.seal(ret);else if(!writable&&Object.hasOwnProperty("freeze"))Object.freeze(ret)}return ret}, setCachedInfo:function(info){if(info.isPlaceholder)priv.item.cache._infoCache["placeholder"][info.index]=info;else priv.item.cache._infoCache["unique"][info.index]=info},invalidateItem:function(indexOrInfo,isPlaceholder){isPlaceholder=isPlaceholder||false;var index=undefined;if(priv.helpers.isNumeric(indexOrInfo))index=indexOrInfo;else{index=indexOrInfo.index;isPlaceholder=indexOrInfo.isPlaceholder}var cacheBase=priv.item.cache._infoCache;var usedCache=isPlaceholder?cacheBase["placeholder"]:cacheBase["unique"]; if(usedCache.hasOwnProperty(index))usedCache[index]=undefined},invalidateAllItems:function(){}},info:function($item,calc,usePlaceholderContent,skipCache,reason){calc=calc||false;usePlaceholderContent=usePlaceholderContent||false;skipCache=skipCache||false;$item=$item.hasClass("slide")?$item:$item.children().first();var index=parseInt($item.attr(attr.item.index),10);if(!priv.helpers.isNumeric(index))console.log("INDEX = NaN:",arguments);if(!skipCache){var cached=priv.item.cache.getCachedInfo(index, calc,usePlaceholderContent);if(typeof cached==="object");}var type=$item.attr(attr.item.type);var preloadFails=parseInt($item.attr(attr.item.preloadFailsCount),10)||0;var uri=$item.attr("href");var tmpCalcDiff=undefined;if(calc){var currentInfo=priv.helpers.getCurrentItem();tmpCalcDiff=priv.helpers.calc.indexDiff(index,currentInfo.index)}var fixedHeight=0;$item.children().not('[ag-sizing="resizable"]').not('[ag-sizing="ignore"]').each(function(){fixedHeight+=$(this).outerHeight(true)});var contentIds= priv.uniqueSlides.getSlideIdentifier($item);var $original=priv.$getEl().find(".slide["+attr.item.index+'="'+index+'"]').parent().not(".cloned").find(".slide["+attr.item.index+'="'+index+'"]');var $clones=priv.$getEl().find(".slide["+attr.item.index+'="'+index+'"]').parent(".cloned").find(".slide["+attr.item.index+'="'+index+'"]');var isClone=$item.parent().hasClass("cloned");var $itemContent=$item.children();if(!usePlaceholderContent&&typeof priv.uniqueSlides.detached[contentIds]==="object"&&priv.uniqueSlides.detached[contentIds].hasOwnProperty("content"))var $itemContent= priv.uniqueSlides.detached[contentIds].content;var $resizable=$itemContent.filter('[ag-sizing="resizable"]');if($resizable.length>1){var $resizableOverlays=$resizable.slice(1);$resizable=$resizable.first();$resizableOverlays.addClass("resizable-overlay")}var preResizableFixedHeight=0;$resizable.prevAll().not('[ag-sizing="resizable"]').not('[ag-sizing="ignore"]').each(function(){preResizableFixedHeight+=$(this).outerHeight(true)});var postResizableFixedHeight=0;$resizable.nextAll().not('[ag-sizing="resizable"]').not('[ag-sizing="ignore"]').each(function(){postResizableFixedHeight+= $(this).outerHeight(true)});var ret={type:type,isClone:isClone,index:index,$clones:$clones,$original:$original,preloadFailsCount:preloadFails,uri:uri,tmpCalcDiff:tmpCalcDiff,fixedHeight:fixedHeight,preResizableFixedHeight:preResizableFixedHeight,postResizableFixedHeight:postResizableFixedHeight,$resizable:$resizable.length?$resizable:undefined,$resizableOverlays:$resizableOverlays,$element:$item,$elementContent:$itemContent,unique:typeof contentIds!=="undefined",ids:contentIds,preserveFocusAR:false, $fixedPreResizable:$itemContent.filter(".fixedPreResizable").length>0?$itemContent.filter(".fixedPreResizable").first():undefined,$fixedPostResizable:$itemContent.filter(".fixedPostResizable").length>0?$itemContent.filter(".fixedPostResizable").first():undefined,isPlaceholder:usePlaceholderContent};if(priv.item.type.info.hasOwnProperty(type))ret=priv.item.type.info[type](ret);if(!skipCache&&typeof cached==="object");priv.item.cache.setCachedInfo(ret);return ret},$element:function(info){return info.$element}, each:function(f,doClones,calc,usePlaceholderContent,skipCache,reason){doClones=doClones||false;calc=calc||true;usePlaceholderContent=usePlaceholderContent||false;skipCache=skipCache||false;var $slides=priv.$getEl().find(".slide");$slides.each(function(){if(doClones||!$(this).parent().hasClass("cloned"))f(priv.item.info($(this),calc,usePlaceholderContent,skipCache,reason))})},callItemEvent:function(eventName,info,evtArgs){if(priv.helpers.isArgumentsObject(evtArgs)){var a=Array.prototype.slice.call(evtArgs); a=a.sort();a.unshift(info);a.unshift(eventName);return priv.item.type.callItemEvent.apply(null,a)}else return priv.item.type.callItemEvent.apply(null,arguments)},remove:function(slideIdx){if(typeof slideIdx!=="object")slideIdx=[slideIdx];var currentSlideIdx=priv.helpers.getCurrentItem().index;var slidesRemoved=0;var lastRemoved=0;for(var i in slideIdx)if(slideIdx.hasOwnProperty(i)&&parseInt(slideIdx[i],10)){var toRemoveIdx=parseInt(slideIdx[i],10);priv.$getEl().find(sel.itemsContainer).find(".slide").each(function(){var oldIdx= parseInt($(this).attr("data-slide-index"),10);if(oldIdx>toRemoveIdx){$(this).attr("data-slide-index",oldIdx-1);if(oldIdx===currentSlideIdx&&!$(this).parent().hasClass("cloned"))currentSlideIdx--}});for(var j in slideIdx){var c=parseInt(slideIdx[j],10);if(c>toRemoveIdx)slideIdx[j]=c-1}priv.owl.trigger("remove.owl.carousel",toRemoveIdx);slidesRemoved++}conf.totalSlides=conf.totalSlides-slidesRemoved;$(".slide-count").text(conf.totalSlides);priv.owl.trigger("refresh.owl.carousel");priv.owl.trigger("to.owl.carousel", [currentSlideIdx,0,true]);$(".current-slide-index").text(currentSlideIdx+1)},discover:function(){return window.ntapp.AjaxGalleryLib.item.discover(priv,conf)}(),resize:function(){return window.ntapp.AjaxGalleryLib.item.resize(priv,conf)}(),filter:function(){return window.ntapp.AjaxGalleryLib.item.filter(priv,conf)}(),resizeSlides:function(infos){$.each(infos,function(index,info){var modResize=info.isPlaceholder?priv.item.type.resizing.placeholder:priv.item.type.resizing;if(modResize.hasOwnProperty(info.type))modResize[info.type](info, infos);else modResize._default(info,infos)})},type:function(){return window.ntapp.AjaxGalleryLib.item.type(priv,conf)}()})};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.discover=function(priv,conf){return{area:function(info,x,y,areaDefinitions,useFocusArea){var $slide=info.$elementContent.closest(".slide");if(useFocusArea)$slide=info.$focus;if(typeof $slide==="undefined")return[];var slideOffset=$slide.offset();if(xslideWidth*areaDefinitions[i].x.min&&xslideHeight*areaDefinitions[i].y.min&&y2*resizeContext.fixedHeightAllAvg)ret.exceptional.push(info);else ret.normal.push(info)});return ret},infosByType:function(infos,type){var ret=[];$.each(infos,function(index,info){if(info.type==type)ret.push(info)});return ret}}};return lib}(window.ntapp.AjaxGalleryLib|| {}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=function(priv,conf){return $.extend(lib.item.type,{info:function(){return window.ntapp.AjaxGalleryLib.item.type.info(priv,conf)}(),state:function(){return window.ntapp.AjaxGalleryLib.item.type.state(priv,conf)}(),preloading:function(){return window.ntapp.AjaxGalleryLib.item.type.preloading(priv,conf)}(),callItemEvent:function(eventName,info,evtArgs){var args=Array.prototype.slice.call(arguments,1);if(priv.item.type.events.hasOwnProperty(info.type)&&priv.item.type.events[info.type].hasOwnProperty(eventName))return priv.item.type.events[info.type][eventName].apply(null, args);else if(priv.item.type.events.hasOwnProperty("_default")&&priv.item.type.events._default.hasOwnProperty(eventName))return priv.item.type.events._default[eventName].apply(null,args)},events:function(){return window.ntapp.AjaxGalleryLib.item.type.events(priv,conf)}(),resizing:function(){return window.ntapp.AjaxGalleryLib.item.type.resizing(priv,conf)}(),thumbnail:function(){return window.ntapp.AjaxGalleryLib.item.type.thumbnail(priv,conf)}(),unique:function(){return window.ntapp.AjaxGalleryLib.item.type.unique(priv, conf)}()})};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var attr={item:{ipromZone:"data-iadserver-zone",entityId:"data-entity-id"}};lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.info=function(priv,conf){return{img:function(info){info=info||{};var $imgEl=info.$elementContent.find("img").first();info["entityId"]=info.$element.attr(attr.item.entityId);info["src"]=$imgEl.attr("data-src");if($imgEl.attr("data-src-ng")){var widthOverride=$imgEl.attr("data-src-force-width");info["forcedWidth"]=widthOverride; var imageSizes=JSON.parse($imgEl.attr("data-src-ng"));var tmp;if(tmp=priv.preloading.selectAppropriateSource(imageSizes,widthOverride))info["src"]=tmp}info["preloading"]=$imgEl.attr("src")?false:true;info["width"]=parseInt($imgEl.attr("data-width"),10);info["height"]=parseInt($imgEl.attr("data-height"),10);info["imageSizes"]=imageSizes;var largestImgSize=priv.preloading.selectAppropriateSource(imageSizes,Number.MAX_SAFE_INTEGER,true);var zoomSizes={};zoomSizes[largestImgSize["width"]]=largestImgSize["src"]; if($imgEl.attr("data-src-ng-zoom")){tmp=JSON.parse($imgEl.attr("data-src-ng-zoom"));if(typeof tmp==="object"){var oneBigger=undefined;zoomSizes={};for(var i in tmp){var idx=parseInt(i,10);if(tmp.hasOwnProperty(i)&&idx&&idxidx)oneBigger=idx}if(oneBigger)zoomSizes[oneBigger]=tmp[oneBigger]}}info["zoomSizes"]=zoomSizes;info["$focus"]=$imgEl;info["preserveFocusAR"]=true;return info},video:function(info){info=info||{};info["entityId"]= info.$element.attr(attr.item.entityId);info["videoConf"]=ag_videoConfigs[info.entityId];info["isPlaying"]=info.$elementContent.find(".flowplayer").hasClass("is-paused")?false:true;info["preloading"]=info.$elementContent.find(".flowplayer").children().length?false:true;info["width"]=720;info["height"]=400;info["preserveFocusAR"]=true;info["$focus"]=info.$elementContent.filter('[ag-sizing="resizable"]').children().first();return info},ad:function(info){info=info||{};info["zoneId"]=info.$elementContent.find("["+ attr.item.ipromZone+"]").attr(attr.item.ipromZone);return info}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.events=function(priv,conf){return $.extend(lib.item.type.events,{_default:function(){return window.ntapp.AjaxGalleryLib.item.type.events._default(priv,conf)}(),img:function(){return window.ntapp.AjaxGalleryLib.item.type.events.img(priv,conf)}(),video:function(){return window.ntapp.AjaxGalleryLib.item.type.events.video(priv,conf)}(),ad:{onClick:function(info,e){return priv.item.type.events.img.onClick(info, e)},onUniqueDetached:function(info){priv.banner.invalidateZone(conf["slideBannerZone"])}}})};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.resizing=function(priv,conf){return{_default:function(info,infos){var resizeOptions=priv.item.resize.getOptions();var resizeContext=priv.item.resize.getContext(infos,resizeOptions);var resizeRules=priv.item.resize.getRules(info,resizeContext,resizeOptions);priv.item.resize.applyInfoCss(info,resizeRules)},img:function(info,infos){var resizeOptions=priv.item.resize.getOptions();var imgInfos= priv.item.filter.infosByType(infos,"img");var resizeContext=priv.item.resize.getContext(imgInfos,resizeOptions);var filtered=priv.item.filter.exceptionalInfos(imgInfos,resizeContext);if(filtered.exceptional.length>0)$.each(filtered.exceptional,function(index,exceptInfo){if(info.index===exceptInfo.index)resizeContext=priv.item.resize.getContext([info],resizeOptions);else resizeContext=priv.item.resize.getContext(filtered.normal,resizeOptions)});else resizeContext=priv.item.resize.getContext(infos, resizeOptions);var resizeRules=priv.item.resize.getRules(info,resizeContext,resizeOptions);priv.item.resize.applyInfoCss(info,resizeRules)},video:function(info,infos){var resizeOptions=priv.item.resize.getOptions();resizeOptions.sameHeightFixedPreResizable=false;resizeOptions.sameHeightFixedPostResizable=false;resizeOptions.sameHeightResizable=false;resizeOptions.allowedFocusEnlargementMultiplier=2;var resizeContext=priv.item.resize.getContext([info],resizeOptions);var resizeRules=priv.item.resize.getRules(info, resizeContext,resizeOptions);priv.item.resize.applyInfoCss(info,resizeRules)},placeholder:{_default:function(info,infos){return priv.item.type.resizing._default(info,infos)},img:function(info,infos){return priv.item.type.resizing.img(info,infos)},video:function(info,infos){return priv.item.type.resizing.video(info,infos)}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.thumbnail=function(priv,conf){return{video:function(info,maxWidth,maxHeight,allowReturnCanvasElement){allowReturnCanvasElement=allowReturnCanvasElement||false;maxWidth=maxWidth||200;maxHeight=maxHeight||200;var mainVideo=priv.video.$getVideoElement(info)[0];if(!mainVideo)return info.videoConf.image;var videoSize=priv.helpers.calc.containerSizeFittingPicture(maxWidth,maxHeight)(info.width, info.height);var $displayElement=undefined;var posterUrl=undefined;if(conf.captureVideoFramesForPlaceholders===true&&priv.video.videosFirstFrame.indexOf(info.entityId)!==-1)try{var captureData=priv.helpers.captureVideoFrame(mainVideo,"png",.92,videoSize);if(typeof captureData.blob!=="undefined")try{var objectURL=URL.createObjectURL(captureData.blob);posterUrl=objectURL}catch(err){posterUrl=info.videoConf.image;$displayElement=captureData.canvas}else if(typeof captureData.canvas==="object")$displayElement= captureData.canvas;else posterUrl=info.videoConf.image}catch(error){posterUrl=info.videoConf.image}else posterUrl=info.videoConf.image;var ret;if(typeof posterUrl==="undefined"&&allowReturnCanvasElement)ret=$displayElement;else if(typeof posterUrl==="string")ret=posterUrl;else ret=info.videoConf.image;return ret},img:function(info){return info.src}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.state=function(priv,conf){return{video:{cantChangeSlide:function(info){var fpApi=priv.video.getApi(info);if(typeof fpApi!=="undefined"){var videoFailed=priv.video.videosFailed.indexOf(info.entityId)!==-1;var videoReady=priv.video.videosReady.indexOf(info.entityId)!==-1;var videoSeeking=fpApi.hasOwnProperty("seeking")?fpApi.seeking:priv.video.videosSeeking.indexOf(info.entityId)!==-1;var buffering= fpApi.getState()=="buffering";var paused=fpApi.getState()=="paused";var canChange=!videoFailed&&(videoReady&&!videoSeeking&&!buffering);return!canChange}return true}},img:{cantChangeSlide:function(info){if(!priv.zoom.isInProgress()&&conf.preventSlideSwitchBeforeCurrentImgLoad===true)return priv.preloading.finishedLoadingMediaIds.indexOf(info.entityId)===-1;else return false}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var attr={item:{preloadFailsCount:"data-preload-fail-count"}};lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.preloading=function(priv,conf){return{handlers:{start:{img:function(info){var tmpImg=new Image;var handlers=priv.item.type.preloading.handlers.done(info);tmpImg.onload=handlers.success.img;tmpImg.onerror=handlers.error.img;tmpImg.src=info.src;var $imgs=$().add(info.$original.find("img")).add(info.$clones.find("img"));$imgs.each(function(){$(this).attr("width", "").attr("height","");$(this).attr("src",info.src)})},video:function(info){priv.preloading.processNextItem()}},done:function(info){return{success:{img:function(){priv.preloading.finishedLoadingMediaIds.push(info.entityId);priv.item.cache.invalidateItem(info);priv.preloading.processNextItem()}},error:{img:function(){var retryCount=info.preloadFailsCount;retryCount++;info.$element.attr(attr.item.preloadFailsCount,retryCount);priv.preloading.processNextItem()}}}}}}};return lib}(window.ntapp.AjaxGalleryLib|| {}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.unique=function(priv,conf){return{placeholder:{video:function(info){var detachedInfo=priv.uniqueSlides.detached[info.ids];var pictureUrl=priv.item.type.thumbnail.video(info,detachedInfo.videoWidth,detachedInfo.videoHeight);var $displayElement=$('
    ');var placeholder='
';var ret=$(placeholder).add($displayElement);return{$placeholder:ret,focusSrc:pictureUrl}},ad:function(info){return{$placeholder:$('
\n'+'\t\t\n'+'\t\t\n'+'\t\t\n'+'\t\t\n'+ "\t
"),focusSrc:undefined}}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.events=lib.item.type.events||{};lib.item.type.events._default=function(priv,conf){return{onKeyDown:function(info,e){if(e.which===37){priv.events["public"].switchCurrent(info).prev();e.preventDefault();return false}else if(e.which===39){priv.events["public"].switchCurrent(info).next();e.preventDefault();return false}}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.events=lib.item.type.events||{};lib.item.type.events.img=function(priv,conf){return{onClick:function(info,e){var areaDefinitions={prev:{x:{min:0,max:.5},y:{min:0,max:1}},next:{x:{min:.5,max:1},y:{min:0,max:1}}};var mobileAreaDefinitions={zoom:{x:{min:0,max:1},y:{min:0,max:1}}};if(ntlib.conf.initialLayoutVariant=="mobile")areaDefinitions=mobileAreaDefinitions;var actions=priv.item.discover.area(info, e.clientX,e.clientY,areaDefinitions,true);if(actions.length===1){var action=actions[0];switch(action){case "prev":priv.events["public"].switchCurrent(info).prev();break;case "next":priv.events["public"].switchCurrent(info).next();break;case "zoom":priv.zoom.activate(info);break}}return false}}};return lib}(window.ntapp.AjaxGalleryLib||{}); window.ntapp.AjaxGalleryLib=function(lib){var sel={flowplayerMainVideo:"video.jw-video"};lib.item=lib.item||{};lib.item.type=lib.item.type||{};lib.item.type.events=lib.item.type.events||{};lib.item.type.events.video=function(priv,conf){return{onKeyDown:function(info,e){if(priv.video.videoHandles.hasOwnProperty(info.entityId)&&typeof e==="object"&&typeof e.which!=="undefined"){var videoApi=priv.video.videoHandles[info.entityId];if(e.which==32){priv.video.togglePlayback(info);e.preventDefault();return false}else if(e.which=== 65||e.which===100){videoApi.seek(videoApi.getPosition()-5);e.preventDefault();return false}else if(e.which===68||e.which===102){videoApi.seek(videoApi.getPosition()+5);e.preventDefault();return false}else if(e.which===38||e.which===87){videoApi.setVolume(videoApi.getVolume()+10);e.preventDefault();return false}else if(e.which===40||e.which===83){videoApi.setVolume(videoApi.getVolume()-10);e.preventDefault();return false}else if(e.which===37){priv.events["public"].switchCurrent(info).prev();e.preventDefault(); return false}else if(e.which===39){priv.events["public"].switchCurrent(info).next();e.preventDefault();return false}}},onClick:function(info,e){var areaDefinitions={pause:{x:{min:0,max:1},y:{min:0,max:1}}};var mobileAreaDefinitions={pause:{x:{min:0,max:1},y:{min:0,max:.9}},controls:{x:{min:0,max:1},y:{min:.9,max:1}}};var tabletAreaDefinitions={pause:{x:{min:0,max:1},y:{min:.1,max:.9}}};if(ntlib.conf.initialLayoutVariant=="mobile")areaDefinitions=mobileAreaDefinitions;else if(ntlib.conf.initialLayoutVariant== "tablet")areaDefinitions=tabletAreaDefinitions;var actions=priv.item.discover.area(info,e.clientX,e.clientY,areaDefinitions,true);if(actions.length===1){var action=actions[0];switch(action){case "controls":info.$elementContent.closest(".slide").toggleClass("show-video-controls");break;case "pause":priv.video.togglePlayback(info);break;case "prev":priv.events["public"].switchCurrent(info).prev();break;case "next":priv.events["public"].switchCurrent(info).next();break}}return false},onTranslated:function(info){}, onUniquePlaced:function(info){if(typeof priv.video.videoHandles[info.entityId]!=="undefined")var vApi=priv.video.videoHandles[info.entityId];else;priv.video.play(info)},onUniqueDetach:function(info){var mainVideo=priv.video.$getVideoElement(info);priv.uniqueSlides.detached[info.ids].videoWidth=mainVideo.width();priv.uniqueSlides.detached[info.ids].videoHeight=mainVideo.height()},onUniqueDetached:function(info){info.$element.removeClass("show-video-controls");priv.video.pause(info);var placeholderData= priv.item.type.unique.placeholder.video(info);info.$original.find(".focus").attr("src",placeholderData.focusSrc);info.$clones.find(".focus").attr("src",placeholderData.focusSrc)},onReady:function(info){if(!!conf.captureVideoFramesForPlaceholders){var mainVideo=info.$elementContent.find(sel.flowplayerMainVideo).get()[0];if(mainVideo){mainVideo.setAttribute("crossorigin","anonymous");var src=mainVideo.getAttribute("src")||priv.video.videoHandles[info.entityId].getConfig().file;if(!!src){mainVideo.setAttribute("src", "");mainVideo.setAttribute("src",src)}var seekTime=localStorage.getItem("ag-video-seek--"+info.entityId);if(seekTime)priv.video.videoHandles[info.entityId].seek(seekTime);if(priv.video.videosReady.indexOf(info.entityId)===-1)priv.video.videosReady.push(info.entityId);info=priv.helpers.getCurrentItem();priv.item.type.resizing.video(info,[info])}else console.log("GOT NO MAIN VIDEO!!!")}},onPlay:function(info,evtData){if(!evtData.viewable)if(info.index!==priv.helpers.getCurrentItem().index)priv.video.pause(info); var idx=undefined;if((idx=priv.video.videosEnded.indexOf(info.entityId))>=0)priv.video.videosEnded.splice(idx,1)},onPause:function(info,evtData){},onCompleted:function(info,evtData){},onFirstFrame:function(info,evtData){console.log("onFirstFrame "+info.entityId+" video!");if(priv.video.videosFirstFrame.indexOf(info.entityId)===-1)priv.video.videosFirstFrame.push(info.entityId)},onLayoutReload:function(info){var $mainVid=info.$elementContent.find(sel.flowplayerMainVideo);localStorage.setItem("ag-video-seek--"+ info.entityId,$mainVid.get()[0].currentTime)},onProgress:function(info){if(typeof priv.video.videoHandles[info.entityId]==="object"&&typeof priv.video.videoHandles[info.entityId].getCurrentTime==="function")localStorage.setItem("ag-video-seek--"+info.entityId,priv.video.videoHandles[info.entityId].getCurrentTime())},onFinish:function(info){localStorage.removeItem("ag-video-seek--"+info.entityId);if(priv.video.videosEnded.indexOf(info.entityId)===-1)priv.video.videosEnded.push(info.entityId)},onSeek:function(info, position,offset){if(priv.video.videosSeeking.indexOf(info.entityId)===-1)priv.video.videosSeeking.push(info.entityId)},onSeekEnd:function(info){var idx=undefined;if((idx=priv.video.videosSeeking.indexOf(info.entityId))>=0)priv.video.videosSeeking.splice(idx,1)},onError:function(info){console.log("VIDEO ERROR!!!");if(priv.video.videosFailed.indexOf(info.entityId)===-1)priv.video.videosFailed.push(info.entityId)}}};return lib}(window.ntapp.AjaxGalleryLib||{});