/**************************************************************************
 * jQuery Plugin for Carousel
 * @version: 1.0
 * @requires jQuery v1.8 or later
 * @author Krisztian Horvath
**************************************************************************/


(function(e,t){function n(e,t){var n=jQuery(t.data("left"));var i=jQuery(t.data("right"));var s=jQuery(this).find("ul");e.css({overflow:"hidden"});n.data("teaser",t);i.data("teaser",t);t.data("offset",0);r(0,e,t);jQuery(this).waitForImages(function(){r(200,e,t)});i.click(function(){var t=jQuery(this).data("teaser");t.data("offset",t.data("offset")+1);r(200,e,t)});n.click(function(){var t=jQuery(this).data("teaser");t.data("offset",t.data("offset")-1);r(200,e,t)});jQuery(window).resize(function(){clearTimeout(jQuery(window).data("teaserreset"));jQuery(window).data("teaserreset",setTimeout(function(){t.data("offset",0);r(0,e,t)},150))});for(var o=0;o<10;o++){jQuery(window).data("teaserreset",setTimeout(function(){r(200,e,t)},o*500))}}function r(n,r,i){var s=i.find("ul");var o=i.data("offset");var u=r.innerWidth();var s=i.find("ul:first");maxitem=s.find(">li").length;var a=e(i.data("right"));a.removeClass("notclickable");var f=e(i.data("left"));f.removeClass("notclickable");var l=4;if(u>980){l=4;if(o>=maxitem-4){o=maxitem-4;a.addClass("notclickable")}}if(u<981&&u>768){l=4;if(o>=maxitem-4){o=maxitem-4;a.addClass("notclickable")}}if(u<769&&u>440){l=3;if(o>=maxitem-3){o=maxitem-3;a.addClass("notclickable")}}if(u<441&&u>320){l=2;if(o>=maxitem-2){o=maxitem-2;a.addClass("notclickable")}}if(u<321){l=1;if(o==maxitem){o=maxitem-1;a.addClass("notclickable")}}if(o<=0){o=0;f.addClass("notclickable")}var c=s.find(">li:first-child").outerWidth(true)-s.find(">li:first-child").width();var h=0;if(r.data("eoffset")!=t)h=r.data("eoffset")*(l-1);var p=0;if(r.data("croffset")!=t)p=r.data("croffset");step=(u-p-(l-1)*c)/l;step=step-h;i.data("offset",o);s.find(">li").each(function(){e(this).width(step)});step=s.find("li:first").outerWidth(true);i.data("step",step);if(n==0)s.css({left:0-step*o+"px"});else s.animate({left:0-step*o+"px"},{duration:n});var d=0;if(r.data("hboffset")!=t)d=r.data("hboffset");setTimeout(function(){var t=0;s.find("li").each(function(){if(e(this).outerHeight(true)>t)t=e(this).outerHeight(true)});s.animate({height:t+d+"px"},{duration:300,queue:false});s.parent().animate({height:t+d+"px"},{duration:300,queue:false})},410)}e.fn.extend({showbizpro:function(r){var i={};r=e.extend({},e.fn.showbizpro.defaults,r);return this.each(function(){var i=e(this);if(r.entrySizeOffset!=t)i.data("eoffset",r.entrySizeOffset);if(r.containerOffsetRight!=t)i.data("croffset",r.containerOffsetRight);if(r.heightOffsetBottom!=t)i.data("hboffset",r.heightOffsetBottom);var s=i.find(".showbiz-teaser");n(i,s)})},showbizhode:function(t){return this.each(function(){var t=e(this)})},showbizorder:function(){var t=e(this);return t.data("lastorder")},showbizremix:function(t){return this.each(function(){var t=e(this)})},showbizfilter:function(t){return this.each(function(){var t=e(this)})}})})($)