(function(b){Widget=function(a,d){this.id=a;this.context=b("#"+a);this.config=d};Widget.prototype.defaults={autoRotateInterval:5,rotateMode:"auto",widgetSize:"large",widgetDisplay:1,showCategoryTabs:"tabs"};Widget.prototype.getConfig=function(a){return"undefined"==typeof this.config[a]?this.defaults[a]:this.config[a].$};Widget.prototype.getRotate=function(){return"auto"==this.getConfig("rotateMode")?this.getConfig("autoRotateInterval"):0};Widget.prototype.callback=function(a){var d="undefined"!=typeof Cobalt.WSM, c=a.buttonNext.add(a.buttonPrev);a.stopAuto();c.hide().bind("click",function(){a.startAuto(0)});a.container.hover(function(){!d&&a.stopAuto();b(".jcarousel-prev,.jcarousel-next",a.container).not('[disabled="disabled"]').stop().fadeTo("fast",1)},function(){!d&&a.startAuto();b(".jcarousel-prev,.jcarousel-next",a.container).not('[disabled="disabled"]').stop().fadeTo("slow",0)})};Widget.prototype.showType=function(a){var d=this,c=b("#"+a),a=c.data("jcarousel");a.container.show();a.reload();a.startAuto(); window.setTimeout(function(){d.containers.not(c).each(function(){var a=b(this).data("jcarousel");a.stopAuto();a.container.hide()})},100)};Widget.prototype.init=function(){var a=this,d=this.tabs=b(".special-tabs",a.context),c=this.containers=b(".special-container",a.context),e="undefined"!=typeof Cobalt.WSM;c.each(function(){var d=b(this),c=d.find("li").length>a.getConfig("widgetDisplay")?"circular":null;d.jcarousel({auto:parseInt(a.getRotate()),wrap:c,scroll:parseInt(a.getConfig("widgetDisplay")), initCallback:a.callback,buttonNextHTML:"<div>&#x25BA;</div>",buttonPrevHTML:"<div>&#x25C4;</div>"})});b("span",d).click(function(){var c=b(this);d.find("span").addClass("standard").removeClass("secondary");c.addClass("secondary").removeClass("standard");a.showType(c.data("special-type"))});b.support.opacity||b("div.special-footer",a.context).hover(function(){b(this).parents(".jcarousel-clip").siblings().stop(!0,!0).hide()},function(){b(this).parents(".jcarousel-clip").siblings().stop(!0,!0).show()}); e?c.length&&c.first().data("jcarousel").stopAuto():d.length?d.find(":first").click():c.length&&c.first().data("jcarousel").startAuto()};window.SpecialsRotatorWidget=Widget;b(function(){b(window).trigger("SpecialsRotatorWidget.loaded")})})(jQuery);

