/*
 * Carousel Logo Showcase v1.4.1
 *
 * Copyright 2013-2020 LambertGroup
 *
 */

 (function(d){function z(a,b,k,m,f,n,l,e,g,h,r,p,c,t,q,u,w){responsiveWidth=f.parent().parent().width();b.responsiveRelativeToBrowser&&(responsiveWidth=d(window).width());b.width100Proc&&(b.width=responsiveWidth);if(b.origWidth!=responsiveWidth||b.width100Proc)b.origWidth>responsiveWidth||b.width100Proc?b.width=responsiveWidth:b.width100Proc||(b.width=b.origWidth),b.width=parseInt(b.width,10),b.height=parseInt(b.height,10),clearTimeout(a.timeoutID),x(a,b,k,l,t,r,e,u,q,p,c,h,w,g),0<b.autoPlay&&k>a.numberOfThumbsPerScreen&&
 (a.timeoutID=setTimeout(function(){v(0,r,e,u,b,k,q,a)},1E3*b.autoPlay))}function x(a,b,d,m,f,n,l,e,g,h,r,p,c,t){a.prev_numberOfThumbsPerScreen=a.numberOfThumbsPerScreen;a.numberOfThumbsPerScreen=Math.min(Math.floor((b.width-l.width()-e.width())/(b.imageWidth+2*b.border)),b.numberOfThumbsPerScreen);a.thumbMarginLeft=Math.ceil((b.width-l.width()-e.width()-(b.imageWidth+2*b.border)*a.numberOfThumbsPerScreen)/(a.numberOfThumbsPerScreen+1));f.css({"margin-left":a.thumbMarginLeft+"px"});1<a.numberOfThumbsPerScreen&&
 (a.thumbMarginLeft=Math.floor((b.width-l.width()-e.width()-(b.imageWidth+2*b.border)*a.numberOfThumbsPerScreen)/(a.numberOfThumbsPerScreen-1)),f.css({"margin-left":a.thumbMarginLeft+"px"}),n.children().first().css("margin-left","0px"));a.carouselStep=(b.imageWidth+2*b.border+a.thumbMarginLeft)*a.numberOfThumbsPerScreen;m.width(b.width);r.width(b.width);h.css("width",b.width-l.width()-e.width());b.origWidthThumbsHolderVisibleWrapper=b.origWidth-l.width()-e.width();a.numberOfThumbsPerScreen>=d&&h.css("left",
 parseInt((b.width-(f.width()+a.thumbMarginLeft)*d)/2,10)+parseInt(a.thumbMarginLeft/2,10)+"px");n.width((a.thumbMarginLeft+b.imageWidth+2*b.border)*d);y(a,b,d,m,l,e,t,p,c,n)}function v(a,b,k,m,f,n,l,e){b.css("opacity","0.5");e.isCarouselScrolling=!0;d(e.bottomNavButs[e.currentNavPage]).removeClass("bottomNavButtonON");0!=a?e.currentNavPage+=a:e.currentNavPage==Math.ceil(n/e.numberOfThumbsPerScreen)-1?e.currentNavPage=0:e.currentNavPage++;d(e.bottomNavButs[e.currentNavPage]).addClass("bottomNavButtonON");
 b.animate({opacity:1,left:-1*e.currentNavPage*e.carouselStep+"px"},500,"easeOutCubic",function(){A(e,b,k,m,f,n,l);e.isCarouselScrolling=!1;0<f.autoPlay&&n>e.numberOfThumbsPerScreen&&(clearTimeout(e.timeoutID),e.timeoutID=setTimeout(function(){v(0,b,k,m,f,n,l,e)},1E3*f.autoPlay))})}function A(a,b,d,m,f,n,l){currentCarouselLeft=b.css("left").substr(0,b.css("left").lastIndexOf("px"));0>currentCarouselLeft?d.hasClass("carouselLeftNavDisabled")&&d.removeClass("carouselLeftNavDisabled"):d.addClass("carouselLeftNavDisabled");
 Math.abs(currentCarouselLeft-a.carouselStep)<(b.children().first().width()+a.thumbMarginLeft)*n?m.hasClass("carouselRightNavDisabled")&&m.removeClass("carouselRightNavDisabled"):m.addClass("carouselRightNavDisabled")}function B(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return parseInt(a,10)}function C(a,b){a.showTooltip&&(d(".thumbsHolder_ThumbOFF",b).addClass("lbg_carousel_tooltip"),d(".lbg_carousel_tooltip").tooltip({content:function(){return d(this).attr("title")},
 position:{my:"center bottom-20",at:"center top",using:function(a,b){d(this).css(a);d("<div>").addClass("lbg_carousel_arrow").addClass(b.vertical).addClass(b.horizontal).appendTo(this)}}}))}function y(a,b,k,m,f,n,l,e,g,h,r){l.empty();for(i=0;i<Math.ceil(k/a.numberOfThumbsPerScreen);i++)e=d('<div class="bottomNavButtonOFF" rel="'+i+'"></div>'),l.append(e),g+=parseInt(e.css("padding-left").substring(0,e.css("padding-left").length-2),10)+e.width(),e.css("margin-top","50px");l.width(g);if(b.showOnInitBottomNav)switch(b.bottomNavPosition){case "left":l.css("left",
 f.width()+"px");break;case "middle":l.css("left",parseInt((m.width()-g)/2,10)+"px");break;case "right":l.css("left",b.width-n.width()-l.width()+"px");break;default:l.css("left",parseInt((m.width()-g)/2,10)+"px")}a.bottomNavButs=d(".bottomNavButtonOFF",m);d(a.bottomNavButs[a.currentNavPage]).addClass("bottomNavButtonON");a.bottomNavButs.on("mousedown",function(){if(!a.isCarouselScrolling){var e=d(this).attr("rel");e!=a.currentNavPage&&(d(a.bottomNavButs[a.currentNavPage]).removeClass("bottomNavButtonON"),
 a.currentNavPage=e-1,v(0,h,f,n,b,k,r,a))}});a.bottomNavButs.on("mouseout",function(){d(this).addClass("bottomNavButtonON")});a.bottomNavButs.on("mouseleave",function(){var b=d(this),c=b.attr("rel");a.currentNavPage!=c&&b.removeClass("bottomNavButtonON")});m=(a.currentNavPage*a.prev_numberOfThumbsPerScreen+1)/a.numberOfThumbsPerScreen;m=m===Math.floor(m)?m-1:Math.floor(m);0>m&&(m=0);m==a.currentNavPage&&h.css({left:-1*a.currentNavPage*a.carouselStep+"px"});m!=a.currentNavPage&&(d(a.bottomNavButs[a.currentNavPage]).removeClass("bottomNavButtonON"),
 a.currentNavPage=m-1,v(0,h,f,n,b,k,r,a))}d.fn.logo_carousel=function(a){a=d.extend({},d.fn.logo_carousel.defaults,a);return this.each(function(){var b=d(this);responsiveWidth=b.parent().width();a.responsiveRelativeToBrowser&&(responsiveWidth=d(window).width());a.origWidth=a.width;a.width100Proc&&(a.width=responsiveWidth);a.height=a.imageHeight+2*a.border;a.origHeight=a.height;var k=d("<div></div>").addClass("logo_carousel").addClass(a.skin),m=d('<div class="thumbsHolderWrapper"><div class="thumbsHolderVisibleWrapper"><div class="thumbsHolder"></div></div></div>');
 b.wrap(k);b.after(m);var f=b.parent(".logo_carousel");m=d(".bannerControls",f);var n=d(".thumbsHolderWrapper",f),l=d(".thumbsHolderVisibleWrapper",f),e=d(".thumbsHolder",f);var g=d('<div class="carouselLeftNav"></div>');var h=d('<div class="carouselRightNav"></div>');n.append(g);n.append(h);g.css({"margin-top":parseInt((a.height-g.height())/2,10)+"px"});h.css({"margin-top":parseInt((a.height-h.height())/2,10)+"px",right:"0"});g.css("display","none");h.css("display","none");a.showNavArrows?a.showOnInitNavArrows&&
 (g.css("display","block"),h.css("display","block")):(g.width(0),h.width(0),a.width=a.width,a.origWidth=a.width,g.width(0),h.width(0));a.responsive&&(a.origWidth!=responsiveWidth||a.width100Proc)&&(a.width=a.origWidth>responsiveWidth||a.width100Proc?responsiveWidth:a.origWidth);a.width=parseInt(a.width,10);a.height=parseInt(a.height,10);e.css("width","0px");k=d('<div class="bottomNav"></div>');b.after(k);var r=d(".bottomNav",f);r.css("display","block");r.css({bottom:a.bottomNavMarginBottom+"px",top:"auto"});
 f.width(a.width);f.height(a.height);n.width(a.width);n.height(a.height);l.height(a.height);a.showBottomNav||r.css("display","none");a.showOnInitBottomNav||r.css("left","-5000px");0==a.numberOfThumbsPerScreen&&(a.numberOfThumbsPerScreen=Math.floor((a.origWidth-g.width()-h.width())/(a.imageWidth+2*a.border)));var p=0,c={current_img_no:0,currentImg:0,currentNavPage:0,prevNavPage:0,thumbMarginLeft:0,mouseOverBanner:!1,isCarouselScrolling:!1,carouselStep:0,timeoutID:"",intervalID:"",arcInitialTime:(new Date).getTime(),
 timeElapsed:0,windowWidth:0,canvas:"",ctx:"",bannerRatio:a.origWidth/a.origHeight,numberOfThumbsPerScreen:a.numberOfThumbsPerScreen,prev_numberOfThumbsPerScreen:0,bottomNavButs:""},t=b.find("ul:first").children(),q;c.thumbMarginLeft=Math.floor((a.origWidth-g.width()-h.width()-(a.imageWidth+2*a.border)*c.numberOfThumbsPerScreen)/(c.numberOfThumbsPerScreen-1));a.centerPlugin&&f.css({margin:"0 auto"});t.each(function(){c.currentImg=d(this);c.currentImg.is("li")||(c.currentImg=c.currentImg.find("li:first"));
 c.currentImg.is("li")&&(p++,q=d('<div class="thumbsHolder_ThumbOFF" rel="'+(p-1)+'"><div class="paddingx" style="padding:'+a.border+'px">'+c.currentImg.html()+"</div></div>"),e.append(q),q.css({width:a.imageWidth+2*a.border+"px",height:a.origHeight+"px"}),-1!=a.borderColorOFF.lastIndexOf(".png")||-1!=a.borderColorOFF.lastIndexOf(".jpg")||-1!=a.borderColorOFF.lastIndexOf(".gif")?q.css({background:"url("+a.borderColorOFF+")"}):q.css({background:a.borderColorOFF}),e.css("width",e.width()+c.thumbMarginLeft+
 (a.imageWidth+2*a.border)+"px"),1>=p?q.css("margin-left","0px"):q.css("margin-left",c.thumbMarginLeft+"px"));e.css("width",e.width()-c.thumbMarginLeft+"px")});C(a,e);l.css("width",l.width()-g.width()-h.width());l.css("left",g.width());c.carouselStep=(a.imageWidth+2*a.border+c.thumbMarginLeft)*c.numberOfThumbsPerScreen;0===Math.floor(c.current_img_no/c.numberOfThumbsPerScreen)&&g.addClass("carouselLeftNavDisabled");Math.floor(c.current_img_no/c.numberOfThumbsPerScreen)==Math.floor(p/c.numberOfThumbsPerScreen)&&
 h.addClass("carouselRightNavDisabled");l.css({width:a.origWidth-g.width()-h.width(),left:g.width()+"px"});c.carouselStep=(a.imageWidth+2*a.border+c.thumbMarginLeft)*c.numberOfThumbsPerScreen;g.addClass("carouselLeftNavDisabled");c.numberOfThumbsPerScreen>=p&&(h.addClass("carouselRightNavDisabled"),g.css("display","none"),h.css("display","none"),l.css("left",parseInt((n.width()-(a.imageWidth+2*a.border+c.thumbMarginLeft)*p)/2,10)+"px"));n.css("top",a.height+"px");k=d(".thumbsHolder_ThumbOFF",e).find("img:first");
 k.css({width:a.imageWidth+"px",height:a.imageHeight+"px"});a.grayscale&&k.addClass("lbg_carousel_grayscale");c.bottomNavButs=d(".bottomNavButtonOFF",f);y(c,a,p,f,g,h,r,void 0,0,e);var u=d(".thumbsHolder_ThumbOFF",f);x(c,a,p,f,u,e,g,h,q,l,n,void 0,0,r);u=d(".thumbsHolder_ThumbOFF",f);u.on("mousedown",function(){c.effectIsRunning||d(this).attr("rel")});u.on("click",function(){if(void 0!=d(t[c.current_img_no]).attr("data-link")&&""!=d(t[c.current_img_no]).attr("data-link")){var b=a.target;void 0!=d(t[c.current_img_no]).attr("data-target")&&
 ""!=d(t[c.current_img_no]).attr("data-target")&&(b=d(t[c.current_img_no]).attr("data-target"));"_blank"==b?window.open(d(t[c.current_img_no]).attr("data-link")):window.location=d(t[c.current_img_no]).attr("data-link")}});u.on("mouseenter",function(){-1!=a.borderColorOFF.lastIndexOf(".png")||-1!=a.borderColorOFF.lastIndexOf(".jpg")||-1!=a.borderColorOFF.lastIndexOf(".gif")?u.css({background:"url("+a.borderColorOFF+")"}):u.css({background:a.borderColorOFF});var b=d(this);c.currentImg=b;c.current_img_no=
 b.attr("rel");-1!=a.borderColorON.lastIndexOf(".png")||-1!=a.borderColorON.lastIndexOf(".jpg")||-1!=a.borderColorON.lastIndexOf(".gif")?b.css({background:"url("+a.borderColorON+")"}):b.css({background:a.borderColorON});a.grayscale&&d(this).find("img:first").addClass("disabled")});u.on("mouseleave",function(){var b=d(this);-1!=a.borderColorOFF.lastIndexOf(".png")||-1!=a.borderColorOFF.lastIndexOf(".jpg")||-1!=a.borderColorOFF.lastIndexOf(".gif")?b.css({background:"url("+a.borderColorOFF+")"}):b.css({background:a.borderColorOFF});
 a.grayscale&&d(this).find("img:first").removeClass("disabled")});g.on("click",function(){c.isCarouselScrolling||(clearTimeout(c.timeoutID),currentCarouselLeft=e.css("left").substr(0,e.css("left").lastIndexOf("px")),0>currentCarouselLeft&&v(-1,e,g,h,a,p,q,c))});h.on("click",function(){c.isCarouselScrolling||(clearTimeout(c.timeoutID),currentCarouselLeft=e.css("left").substr(0,e.css("left").lastIndexOf("px")),Math.abs(currentCarouselLeft-c.carouselStep)<(q.width()+c.thumbMarginLeft)*p&&v(1,e,g,h,a,
 p,q,c))});f.on("mouseenter",function(){c.mouseOverBanner=!0;clearTimeout(c.timeoutID);a.autoHideNavArrows&&a.showNavArrows&&(g.css("display","block"),h.css("display","block"))});f.on("mouseleave",function(){c.mouseOverBanner=!1;a.autoHideNavArrows&&a.showNavArrows&&(g.css("display","none"),h.css("display","none"));0<a.autoPlay&&p>c.numberOfThumbsPerScreen&&(clearTimeout(c.timeoutID),direction=-1,h.hasClass("carouselRightNavDisabled")&&(direction=0),c.timeoutID=setTimeout(function(){v(0,e,g,h,a,p,
 q,c)},1E3*a.autoPlay))});a.enableTouchScreen&&f.swipe({swipe:function(a,b,d,e,f){c.effectIsRunning||("right"==b?g.hasClass("carouselLeftNavDisabled")||g.click():h.hasClass("carouselRightNavDisabled")||h.click())}});var w=!1;d(window).resize(function(){var k=String(navigator.userAgent).toLowerCase();if("undefined"==String(d(t[c.current_img_no]).attr("data-video-selfhosted"))||-1!=k.indexOf("android")||-1!=k.indexOf("ipad")||-1!=k.indexOf("iphone")||-1!=k.indexOf("ipod")||-1!=k.indexOf("webos")){var v=
 B();doResizeNow=!0;-1!=v&&9==v&&0==c.windowWidth&&(doResizeNow=!1);c.windowWidth==d(window).width()?(doResizeNow=!1,a.windowCurOrientation==window.orientation||-1==k.indexOf("android")&&-1==k.indexOf("ipad")&&-1==k.indexOf("iphone")&&-1==k.indexOf("ipod")&&-1==k.indexOf("webos")||(a.windowCurOrientation=window.orientation,doResizeNow=!0)):c.windowWidth=d(window).width();a.responsive&&doResizeNow&&(!1!==w&&clearTimeout(w),w=setTimeout(function(){z(c,a,p,t,b,m,f,g,r,void 0,e,l,n,u,q,h,0)},300))}});
 k=f.find("img:first");if(k[0].complete)d(".myloader",f).css("display","none"),0<a.autoPlay&&p>c.numberOfThumbsPerScreen&&(c.timeoutID=setTimeout(function(){v(0,e,g,h,a,p,q,c)},1E3*a.autoPlay));else k.on("load",function(){d(".myloader",f).css("display","none");0<a.autoPlay&&p>c.numberOfThumbsPerScreen&&(c.timeoutID=setTimeout(function(){v(0,e,g,h,a,p,q,c)},1E3*a.autoPlay))})})};d.fn.logo_carousel.defaults={skin:"black",width:960,height:384,width100Proc:!1,height100Proc:!1,autoPlay:4,numberOfThumbsPerScreen:0,
 border:0,target:"_blank",showNavArrows:!0,showOnInitNavArrows:!0,autoHideNavArrows:!1,showBottomNav:!0,showOnInitBottomNav:!0,enableTouchScreen:!0,absUrl:"",showTooltip:!0,grayscale:!1,borderColorOFF:"transparent",borderColorON:"#FF0000",imageWidth:155,imageHeight:100,responsive:!1,responsiveRelativeToBrowser:!1,centerPlugin:!1,bottomNavMarginBottom:0,bottomNavPosition:"right",origWidth:0,origHeight:0,origWidthThumbsHolderVisibleWrapper:0,windowOrientationScreenSize0:0,windowOrientationScreenSize90:0,
 windowOrientationScreenSize_90:0,windowCurOrientation:0}})(jQuery);
