/* slideShowIndicator.js */
(function(a){function b(a,b){this.slideShow=a,this.container=jQuery("#"+b),this.init()}b.prototype={init:function(){var a=this;jQuery("#heroSlideShow").bind("SlidesLoaded",function(b,c){a.onSlidesLoaded()})},onSlidesLoaded:function(){var b=this,c=this.slideShow.slides.length;for(var d=0;d<c;d++)this.container.append('<a class="imageRotator_indicator" rel="'+d+'">'+d+"</a>");jQuery("a[rel=0]").addClass("active"),this.container.children("a").click(function(){b.onIndicatorClicked(this)}),a("#heroSlideShow").bind("changing",function(a,c){b.onSlideChanged(c)})},onIndicatorClicked:function(b){b=jQuery(b);if(b.hasClass("active"))return;a("#heroSlideShow").trigger("show",{slideIndex:parseInt(b.attr("rel"))})},onSlideChanged:function(a){var b="a[rel="+a.nextSlide+"]",c="a[rel="+a.previousSlide+"]";jQuery(b).addClass("active"),jQuery(c).removeClass("active")}},window.SlideShowIndicator=b})(jQuery);
/* RibbonIndicator.js */
(function(a){function b(b,c,d,e,f){var g=e?e:77,h=f?f:100;this.aspectRatio=d?d:2.35,this.slideShow=b,this.container=a("#"+c),this.dimensions={imageHeight:g/d,imageWidth:g,imageSelectedHeight:h/d,imageSelectedWidth:h,imageLeftMargin:4,thumbBorderThickness:3,viewPortPadding:35},this.animationDelayMs=200,this.selectedIndex=0,this.highlightedIndex=0,this.highlightTimer=undefined,this.init()}b.prototype={init:function(){var b=this;a("#heroSlideShow").bind("SlidesLoaded",function(a,c){b.onSlidesLoaded()})},onSlidesLoaded:function(){var b=this;this.container.append('<div id="slide-left" class="btn-next">&#x25BA;</div>'),this.container.append('<div id="slide-right" class="btn-prev">&#x25C4;</div>'),this.container.append('<div class="view-port"></div>'),this.container.find(".view-port").append("<ul></ul>");var c=this.slideShow.slides.length;for(var d=0;d<c;d++)this.container.find(".view-port ul").append('<li class="imageRotator_thumb" data-position="'+d+'"></li>'),this.container.find("ul > li.imageRotator_thumb[data-position='"+d+"']").append(this.slideShow.slides[d].find("img").clone().css({height:this.dimensions.imageHeight,width:this.dimensions.imageWidth}));this.initStyles(),this.highlightThumbnail(this.selectedIndex),this.container.find("ul > li.imageRotator_thumb").click(function(){b.onIndicatorClicked(this)}).mouseover(function(){b.onMouseOver(this)}).mouseout(function(){b.onMouseOut(this)}),this.container.find("#slide-left").click(function(){b.slide("L")}),this.container.find("#slide-right").click(function(){b.slide("R")}),a("#heroSlideShow").bind("changing",function(a,c){b.onSlideChanged(c)})},calculateViewPortSize:function(a){var b=this.dimensions.imageLeftMargin,c=this.dimensions.imageWidth,d=this.dimensions.imageSelectedWidth,e=2*this.dimensions.thumbBorderThickness,f=Math.floor((a-d-e)/(c+b+e)),g=f*(c+b+e)+d+e;return g},initStyles:function(){var b=this.dimensions.thumbBorderThickness,c=this.dimensions.imageLeftMargin,d=this.dimensions.viewPortPadding,e=this.dimensions.imageSelectedHeight+b*2+2,f=a("#heroSlideShow").width(),g=a("#heroSlideShow").width()-d*2,h=this.calculateViewPortSize(g);d+=(g-h)/2,this.container.css({position:"absolute",bottom:"20px",left:"0px",margin:0,border:0,overflow:"visible","white-space":"nowrap",width:f+"px",height:e}),this.container.find(".view-port").css({position:"absolute",bottom:"0px",overflow:"hidden",left:d+"px",margin:"0",padding:"0",width:h+"px",height:e+"px"}),this.container.find(".view-port > ul").css({"list-style-type":"none",position:"absolute",bottom:"0px",left:"0px",margin:"0",padding:"0"}).find("li").css({display:"inline"}).find("img").css({"margin-right":c+"px",border:b+"px solid #ffffff"}),this.container.find(".view-port > ul > li:last-child img").css("margin","0px"),this.container.find("#slide-left").css({right:d-15+"px"}),this.container.find("#slide-right").css({left:d-15+"px"})},onMouseOver:function(b){this.highlightedIndex=parseInt(a(b).attr("data-position")),this.highlightThumbnail()},onMouseOut:function(a){this.hightlightTimer&&clearTimeout(this.hightlightTimer),this.highlightedIndex=this.selectedIndex,this.highlightThumbnail()},onIndicatorClicked:function(b){this.selectSlide(parseInt(a(b).attr("data-position"))),a("#heroSlideShow").trigger("show",{slideIndex:this.selectedIndex})},centerSelection:function(){var a=this,b=a.container.find(".view-port ul"),c=b.position().left,d=this.container.find("ul > li.imageRotator_thumb[data-position='"+this.selectedIndex+"']"),e=d.width(),f=d.position().left,g=b.parent().width(),h=(g-e)/2,i=h-f,j=i-c;a.slideOver(j,!1)},slide:function(a){var b=this,c=b.dimensions.imageSelectedWidth+b.dimensions.thumbBorderThickness*2+b.dimensions.imageLeftMargin;a=="L"?b.slideOver(-1*c,!0):a=="R"&&b.slideOver(c,!0)},slideOver:function(a,b){var c=this,d=c.container.find(".view-port ul"),e=d.position(),f=e.left,g=f+a,h=c.container.find(".view-port").width(),i=0,j=d.width()>h?h-d.width():0;g>i?g=i:g<j&&(g=j),g==f?b&&c.bounce(a<0?-20:20,d):d.animate({left:g+"px"},c.animationDelayMs)},bounce:function(a,b){var c=this,d=b.position().left;b.animate({left:d+a+"px"},c.animationDelayMs/2,"linear",function(){b.animate({left:d+"px"},c.animationDelayMs/2)})},highlightThumbnail:function(){var b=this,c=function(){a("li.imageRotator_thumb[data-position='"+b.highlightedIndex+"'] > img").animate({height:b.dimensions.imageSelectedHeight+"px",width:b.dimensions.imageSelectedWidth+"px"},b.animationDelayMs),b.container.find("ul > li.imageRotator_thumb").each(function(){var c=parseInt(a(this).attr("data-position")),d=a(this).width();c!=b.highlightedIndex&&d!=b.dimensions.imageWidth&&b.unhighlightThumbnail(c)})};b.highlightTimer!=undefined&&clearTimeout(b.hightlightTimer),b.highlightTimer=setTimeout(c,100)},unhighlightThumbnail:function(b){a("li.imageRotator_thumb[data-position='"+b+"'] > img").animate({height:this.dimensions.imageHeight+"px",width:this.dimensions.imageWidth+"px"},this.animationDelayMs)},selectSlide:function(a){this.selectedIndex=a,this.highlightedIndex=this.selectedIndex,this.highlightThumbnail(),this.centerSelection()},onSlideChanged:function(a){this.selectSlide(a.nextSlide)}},window.RibbonIndicator=b})(jQuery);
/* jquery.SlideShow.js */
(function(a){a.fn.SlideShow=function(b,d){if(!b||!b.length){a(this[0]).html('<h1 class="noSlides" style="width:100%; text-align:center;"><span>No slides defined</span></h1>');return}var e=a(this[0]),f=new c(d);return e.extend(f),e.slides=b,e.slideCount=0,e.preloadSlide(b[0]),e};var b={firstSlide:0,eventNamespaceRoot:"com.cobalt.ws.widgets.slideshow",transitionSpeed:500,transition:function(b,c,d){a.isFunction(d)||(d=a.noop),b&&b.fadeOut(this.transitionSpeed),c.fadeIn(this.transitionSpeed,d)}};a.SlideShow=function(c,d){this.options=a.extend({},b,d||{})};var c=a.SlideShow;c.fn=c.prototype={SlideShow:"0.0.1"},c.fn.extend=c.extend=a.extend,c.fn.extend({preloadSlide:function(b){var c=a("<img/>"),d=this;c.load(function(a){d.onPreloadComplete()}),c.attr("src",b.imageUrl)},onPreloadComplete:function(){this.initialize().start(this.options.firstSlide).trigger("SlidesLoaded",this)},initialize:function(){var b=this,c=a(this);return this.currentSlide=0,this.paused=!0,this.slides=this.SlideCanvas(this.slides,{canvasHtml:'<div class="slide"></div>'}),a("#heroSlideShow").bind("show",function(a,c){b.showSlide.call(b,c.slideIndex)}).bind("prev",function(a,b){c.prev()}).bind("next",function(a,b){s.next()}).trigger("init",{slideCount:this.slides.length}),this},paused:!1,slides:{},start:function(a){var b=this;return b.paused=!1,b.currentSlideIndex=null,b.currentSlide=null,b.hover(function(){b.pause.apply(b)},function(){b.resume.apply(b)}),b.showSlide(b.options.firstSlide),this},pause:function(b){if(this.paused)return;this.paused=!0,window.clearTimeout(this.timer),a("#heroSlideShow").trigger("pause",{slideIndex:this.currentSlideIndex})},resume:function(b){if(!this.paused)return;this.paused=!1,this.queueNextSlide(),a("#heroSlideShow").trigger("resume",{slideIndex:this.currentSlideIndex})},next:function(){var a=this.currentSlideIndex+1;a>=this.slides.length&&(a=0),this.showSlide(a)},prev:function(){var a=this.currentSlideIndex-1;a<0&&(a=this.slides.length-1),this.showSlide(a)},queueNextSlide:function(){if(this.paused)return;var a=this;this.timer=window.setTimeout(function(){a.next()},this.currentSlide.delay)},showSlide:function(b){window.clearTimeout(this.timer);var c=this,d=this.currentSlide,e=this.currentSlideIndex;this.currentSlideIndex=b,this.currentSlide=this.slides[this.currentSlideIndex],a("#heroSlideShow").trigger("changing",{previousSlide:e,nextSlide:c.currentSlideIndex}),this.options.transition(d,this.currentSlide,function(){a("#heroSlideShow").trigger("displayed",{previousSlide:e,nextSlide:c.currentSlideIndex}),c.queueNextSlide()})}})})(jQuery);
/* jquery.SlideCanvas.js */
(function(a){var b={canvasHtml:'<div class="slide"></div>',eventNamespaceRoot:"com.cobalt.ws.widgets.slide"};a.fn.SlideCanvas=function(c,d){var e=a.extend({},b,d||{}),f=a(this),g=[];return a.each(c,function(){var b=a(e.canvasHtml).css({position:"absolute",top:"0px",left:"0"}).appendTo(f).hide();b.extend(b,new a.SlideCanvas(this,e)),b.drawSlideCanvas(),g.push(b)}),a(g)};var c={delay:5e3,id:null,cta1Enabled:!1,cta1Link:"#",cta1AltText:undefined,cta1Target:"_self",cta2Enabled:!1,cta2Link:"#",cta2AltText:undefined,cta2Target:"_self",cta3Enabled:!1,cta3Link:"#",cta3AltText:undefined,cta3Target:"_self",imageUrl:"#",imageAltText:undefined,imageLink:undefined,imageLinkAltText:undefined,imageLinkTarget:"_self",thumbUrl:"#",thumbAltText:undefined,thumbLink:undefined,thumbLinkAltText:undefined,thumbLinkTarget:"_self",disclaimerEnabled:!1,blockLinkText:undefined,blockLinkClass:undefined,blockText:undefined,blockTextClass:undefined};a.SlideCanvas=function(b,d){this.options=d,this.params=a.extend({},c,b),this.id=this.params.id,this.delay=this.params.delay,this.ready=!0,a("#heroSlideShow").trigger("ready")};var d=a.SlideCanvas;d.fn=d.prototype={SlideCanvas:"0.0.2"},d.fn.extend=d.extend=a.extend,d.fn.extend({ready:!1,fqEventName:function(a){var b=[];return b.push(this.options.eventNamespaceRoot),this.params.id&&b.push(this.params.id),b.push(a),b.join(".")},drawSlideCanvas:function(){var b=this.params,c=this.htmlImage(b.imageUrl,b.imageAltText,b.imageLink,b.imageLinkAltText,b.imageLinkTarget);b.cta1Enabled&&(c+=this.htmlLink(b.cta1Link,b.cta1LinkText,b.cta1AltText,b.cta1Target,"ctaButton ctaButton1 brandButton primary")),b.cta2Enabled&&(c+=this.htmlLink(b.cta2Link,b.cta2LinkText,b.cta2AltText,b.cta2Target,"ctaButton ctaButton2 brandButton primary")),b.cta3Enabled&&(c+=this.htmlLink(b.cta3Link,b.cta3LinkText,b.cta3AltText,b.cta3Target,"ctaButton ctaButton3 brandButton primary")),b.disclaimerEnabled&&(c+=this.htmlLinkBlock(b.blockLinkText,b.blockLinkClass,b.blockText,b.blockTextClass)),a(c).appendTo(this)},htmlImage:function(a,b,c,d,e){var f="";return c&&(f+='<a href="'+c+'"',d&&(f+=' title="'+d+'"'),e&&(f+=' target="'+e+'"'),f+=">"),f+='<img src="'+a+'"',b&&(f+=' alt="'+b+'"',f+=' title="'+b+'"'),f+="/>",c&&(f+="</a>"),f},htmlLink:function(a,b,c,d,e){var f="";return f+='<a href="'+a+'"',e&&(f+=' class="'+e+'"'),c&&(f+=' title="'+c+'"'),d&&(f+=' target="'+d+'"'),f+=">",b&&(f+=b),f+="</a>",f},htmlLinkBlock:function(a,b,c,d){var e="";return e+="<div",b&&(e+=' class="'+b+'"'),e+=">"+a+"</div><div",d&&(e+=' class="'+d+'"'),e+=">"+c+"</div>",e},isReady:function(){var b=!0;a("img",this).each(function(){b=b&&this.complete})},thumbCanvasHtml:function(a,b){var c="";return c+="<img",b&&(c+=' height="'+b+'"'),a&&(c+=' width="'+a+'"'),this.params.thumbAltText&&(c+=' title="'+this.params.thumbAltText+'"'),c+=' src="'+this.thumbImage.src+'" />',c}})})(jQuery);
/* Slide.js */
Cobalt.Widgets.Slide=function(a,b,c,d){undefined===d&&(d={}),this.className="Cobalt.Widgets.Slide",this.instanceId=0,this.slideGroup=a,this.id=b,this.enabled=undefined===d.enabled?!1:d.enabled,this.active=undefined===d.active?!1:d.active,this.name=undefined===d.name?"&lt; New Slide &gt;":d.name,this.heroImagePath=undefined===d.heroImagePath?undefined:d.heroImagePath,this.heroAltText=undefined===d.heroAltText?undefined:d.heroAltText,this.heroEnabled=undefined===d.heroEnabled?!1:d.heroEnabled,this.heroLink=undefined===d.heroLink?undefined:d.heroLink,this.heroLinkAltText=undefined===d.heroLinkAltText?undefined:d.heroLinkAltText,this.heroLinkTarget=undefined===d.heroLinkTarget?"_self":d.heroLinkTarget,this.cta1Enabled=undefined===d.cta1Enabled?!1:d.cta1Enabled,this.cta1Link=undefined===d.cta1Link?undefined:d.cta1Link,this.cta1AltText=undefined===d.cta1AltText?undefined:d.cta1AltText,this.cta1Target=undefined===d.cta1Target?"_self":d.cta1Target,this.cta2Enabled=undefined===d.cta2Enabled?!1:d.cta2Enabled,this.cta2Link=undefined===d.cta2Link?undefined:d.cta2Link,this.cta2AltText=undefined===d.cta2AltText?undefined:d.cta2AltText,this.cta2Target=undefined===d.cta2Target?"_self":d.cta2Target,this.cta3Enabled=undefined===d.cta3Enabled?!1:d.cta3Enabled,this.cta3Link=undefined===d.cta3Link?undefined:d.cta3Link,this.cta3AltText=undefined===d.cta3AltText?undefined:d.cta3AltText,this.cta3Target=undefined===d.cta3Target?"_self":d.cta3Target,this.disclaimerEnabled=undefined===d.disclaimerEnabled?!1:d.disclaimerEnabled,this.disclaimerLinkText=undefined===d.blockLinkText?undefined:d.blockLinkText,this.disclaimerText=undefined===d.blockText?undefined:d.blockText,this.duration=undefined===d.duration?4:d.duration,this.fieldName=null,this.slideChooserId=c?parseInt(c,10):0,this.created=(new Date).getTime(),this.startDate=-1,this.endDate=-1,this.promotion=undefined,this.optInDealerGroup=undefined,this.optOutDealerGroup=undefined,this.jquery=undefined,this.errorList=undefined,this.init=function(){this.fieldName=this.getFormFieldName()},this.slideGroup!==undefined&&this.id!==undefined&&this.slideChooserId!==undefined&&this.init()},undefined==Cobalt.Widgets.SlideGlobals&&(Cobalt.Widgets.SlideGlobals={}),Cobalt.Widgets.Slide.prototype.hasDisclaimer=function(){var a=this;return a.disclaimerLinkText||a.disclaimerText?!0:!1},Cobalt.Widgets.Slide.prototype.disclaimerIsValid=function(){return this.errorList==undefined&&(this.errorList={}),!this.errorList.disclaimer},Cobalt.Widgets.Slide.prototype.hasErrors=function(){this.errorList==undefined&&(this.errorList={});var a=0;for(i in this.errorList)return!0;return!1},Cobalt.Widgets.Slide.prototype.validatePromotion=function(){},Cobalt.Widgets.Slide.prototype.validateDisclaimer=function(){var a=this;this.errorList==undefined&&(this.errorList={});var b=!1;this.hasDisclaimer()&&this.disclaimerLinkText&&this.disclaimerText?b=!0:this.hasDisclaimer()||(b=!0),b?(this.setDisclaimerEnabled(this.hasDisclaimer()?!0:!1),a.errorList["disclaimer"]!=undefined&&delete a.errorList.disclaimer):(this.errorList.disclaimer="The disclaimer text is invalid.",this.setDisclaimerEnabled(!1)),jQuery(window).trigger("SlideValidate",a)},Cobalt.Widgets.Slide.prototype.validateTimeRange=function(a){var b=this;this.errorList==undefined&&(this.errorList={});var c=!0;this.startDate!=-1&&this.startDate>(new Date).getTime()&&(this.errorList.time="The slide display period has not started.",c=!1),this.endDate!=-1&&this.endDate<(new Date).getTime()&&(this.errorList.time="The slide is expired.",c=!1),c&&b.errorList["time"]!=undefined&&delete b.errorList.time,jQuery(window).trigger("SlideValidate",b)},Cobalt.Widgets.Slide.prototype.validateImage=function(){var a=this;this.errorList==undefined&&(this.errorList={});try{var b="The slides image link is broken";if(a.heroImagePath==undefined){a.errorList.image=b,jQuery(window).trigger("SlideValidate",a);return}var c=jQuery("<img/>");c.load(function(c){c.type=="error"&&(a.errorList.image=b),jQuery(window).trigger("SlideValidate",a)}),c.error(function(){a.errorList.image=b,jQuery(window).trigger("SlideValidate",a)}),c.attr("src",CobaltWSM.wsDocument.ContextManager.getAssetServerUrl()+a.heroImagePath)}catch(d){}},Cobalt.Widgets.Slide.prototype.validate=function(){if(!this.enabled)return;this.errorList={},this.validateImage(),this.validateTimeRange(),this.validateDisclaimer(),this.validatePromotion()},Cobalt.Widgets.Slide.prototype.setPromotion=function(a){this.promotion=a,this.validatePromotion()},Cobalt.Widgets.Slide.prototype.setOptInDealerGroup=function(a){this.optInDealerGroup=a},Cobalt.Widgets.Slide.prototype.setOptOutDealerGroup=function(a){this.optOutDealerGroup=a},Cobalt.Widgets.Slide.prototype.getFormattedDate=function(a){var b;if(a!=-1&&a==parseInt(a))try{var c=new Date;c.setTime(a),b=c.format("mm/dd/yyyy")}catch(d){}return b},Cobalt.Widgets.Slide.prototype.getFormattedStartDate=function(){return this.getFormattedDate(this.startDate)},Cobalt.Widgets.Slide.prototype.getFormattedEndDate=function(){return this.getFormattedDate(this.endDate)},Cobalt.Widgets.Slide.prototype.getTimestampFromDate=function(a){var b;try{b=(new Date(a)).getTime()}catch(c){b=-1}return undefined===b&&(b=-1),b},Cobalt.Widgets.Slide.prototype.setStartDateFromString=function(a){return this.setStartDate(this.getTimestampFromDate(a))},Cobalt.Widgets.Slide.prototype.setEndDateFromString=function(a){return this.setEndDate(this.getTimestampFromDate(a))},Cobalt.Widgets.Slide.prototype.doDisplay=function(){return!this.hasErrors()},Cobalt.Widgets.Slide.prototype.erase=function(){this.setInstanceId(parseInt(this.instanceId,10)+1);var a=["className","instanceId","slideGroup","id","slideChooserId","fieldName"],b=["enabled","active","heroEnabled","cta1Enabled","cta2Enabled","cta3Enabled","disclaimerEnabled"],c={name:"&lt; New Slide &gt;",heroLinkTarget:"_self",cta1Target:"_self",cta2Target:"_self",cta3Target:"_self",duration:4,created:(new Date).getTime(),startDate:-1,endDate:-1};for(i in this)if(typeof this[i]!="function"&&jQuery.inArray(i,a)==-1){var d="set"+i.charAt(0).toUpperCase()+i.slice(1),e="";jQuery.inArray(i,b)!=-1?e=!1:undefined!==c[i]?e=c[i]:e=undefined,this[d]!==undefined&&typeof this[d]=="function"?this[d](e):this[i]=e}},Cobalt.Widgets.Slide.prototype.getDisplayName=function(){return this.name?this.name.replace(/\s*\&gt\;/,"").replace(/\&lt\;\s*/,""):""},Cobalt.Widgets.Slide.prototype.getFormFieldName=function(){var a="sc"+this.slideChooserId+"_slide"+this.getUID();return a},Cobalt.Widgets.Slide.prototype.getUID=function(){return this.slideGroup+"-"+this.id+"-"+this.instanceId},Cobalt.Widgets.Slide.prototype.setInstanceId=function(a){this.instanceId=a?a:undefined},Cobalt.Widgets.Slide.prototype.setEnabled=function(a){this.enabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setActive=function(a){this.active=a?!0:!1},Cobalt.Widgets.Slide.prototype.setName=function(a){this.name=a?a:undefined},Cobalt.Widgets.Slide.prototype.setHeroImagePath=function(a){var b=this;this.heroImagePath=a,this.errorList==undefined&&(this.errorList={}),this.heroImagePath?undefined!==b.errorList.image&&delete b.errorList.image:this.errorList.image="The image is not valid.",jQuery(window).trigger("SlideValidate",b)},Cobalt.Widgets.Slide.prototype.setHeroAltText=function(a){this.heroAltText=a},Cobalt.Widgets.Slide.prototype.setHeroEnabled=function(a){this.heroEnabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setHeroLink=function(a){this.heroLink=a},Cobalt.Widgets.Slide.prototype.setHeroLinkAltText=function(a){this.heroLinkAltText=a},Cobalt.Widgets.Slide.prototype.setHeroLinkTarget=function(a){this.heroLinkTarget=a},Cobalt.Widgets.Slide.prototype.setCta1Enabled=function(a){this.cta1Enabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setCta1Link=function(a){this.cta1Link=a},Cobalt.Widgets.Slide.prototype.setCta1AltText=function(a){this.cta1AltText=a},Cobalt.Widgets.Slide.prototype.setCta1Target=function(a){this.cta1Target=a?a:undefined},Cobalt.Widgets.Slide.prototype.setCta2Enabled=function(a){this.cta2Enabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setCta2Link=function(a){this.cta2Link=a},Cobalt.Widgets.Slide.prototype.setCta2AltText=function(a){this.cta2AltText=a},Cobalt.Widgets.Slide.prototype.setCta2Target=function(a){this.cta2Target=a?a:undefined},Cobalt.Widgets.Slide.prototype.setCta3Enabled=function(a){this.cta3Enabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setCta3Link=function(a){this.cta3Link=a},Cobalt.Widgets.Slide.prototype.setCta3AltText=function(a){this.cta3AltText=a},Cobalt.Widgets.Slide.prototype.setCta3Target=function(a){this.cta3Target=a?a:undefined},Cobalt.Widgets.Slide.prototype.setDisclaimerEnabled=function(a){this.disclaimerEnabled=a?!0:!1},Cobalt.Widgets.Slide.prototype.setDisclaimerLinkText=function(a){this.disclaimerLinkText=a,this.validateDisclaimer()},Cobalt.Widgets.Slide.prototype.setDisclaimerText=function(a){this.disclaimerText=a,this.validateDisclaimer()},Cobalt.Widgets.Slide.prototype.setDuration=function(a){var b=a?a:undefined,c=parseInt(b);b==c&&c>0&&c<=60&&(this.duration=a)},Cobalt.Widgets.Slide.prototype.setFieldName=function(a){this.fieldName=a},Cobalt.Widgets.Slide.prototype.setCreated=function(a){var b=a?a:undefined,c=parseInt(b);b==c&&(this.created=a)},Cobalt.Widgets.Slide.prototype.setStartDate=function(a){if(a===undefined||a==""||isNaN(a))a=-1;var b=a?a:undefined,c=parseInt(b,10);b===c&&(this.startDate=a),this.validateTimeRange()},Cobalt.Widgets.Slide.prototype.setEndDate=function(a){if(a===undefined||a==""||isNaN(a))a=-1;var b=a,c=parseInt(b,10);b===c&&(this.endDate=a,this.validateTimeRange())};
/* SlideDescriptor.js */
Cobalt.Widgets.SlideDescriptor=function(a){if(a instanceof Cobalt.Widgets.Slide)this.getList=function(){return a.slideGroup},this.getIndex=function(){return a.id},this.getInstanceId=function(){return a.instanceId},this.getUID=function(){return a.getUID()},this.getSlide=function(){return a};else throw new Error("slide must be an instance of Cobalt.Widgets.Slide")};
/* SlideList.js */
Cobalt.Widgets.SlideList=function(){this.className="Cobalt.Widgets.SlideList",this.slides=[]},Cobalt.Widgets.SlideList.prototype.validateSlides=function(a){for(var b=0;b<this.slides.length;b++)this.slides[b].validate()},Cobalt.Widgets.SlideList.prototype.pushSlides=function(a){index=this.slides.length;if(index<0||index>this.slides.length)throw new Error("The index is out of bounds");if(a instanceof Cobalt.Widgets.Slide){var b=this.slides[index];return this.slides[index]=a,b}throw new Error("slide must be an instance of Cobalt.Widgets.Slide")},Cobalt.Widgets.SlideList.prototype.add=function(a){this.pushSlides(a)},Cobalt.Widgets.SlideList.prototype.get=function(a){return a===null||a===undefined?undefined:(a=parseInt(a,10),a<0||a>this.slides.length-1?undefined:this.slides[a])},Cobalt.Widgets.SlideList.prototype.size=function(){return this.slides.length},Cobalt.Widgets.SlideList.prototype.findSlide=function(a){for(var b=0;b<this.slides.length;b++){var c=this.slides[b];if(c.getUID()==a)return c}return undefined},Cobalt.Widgets.SlideList.prototype.containsSlide=function(a){if(a!=null&&a!==undefined&&a instanceof Cobalt.Widgets.Slide){var b=this.findSlide(a.getUID());return undefined===b?!1:!0}return!1};
/* SlideGroup.js */
Cobalt.Widgets.SlideGroup=function(){this.className="Cobalt.Widgets.SlideGroup",this.maxActive=12,this.flattenedOrder="",this.order=[],this.lists={},this.listeners=[]},Cobalt.Widgets.SlideGroup.prototype.validateSlides=function(){for(var a in this.lists)this.lists[a].validateSlides()},Cobalt.Widgets.SlideGroup.prototype.addChangeListener=function(a){if(typeof a!="function")throw new Error("addChangeListener will only take a function as an argument");this.listeners[this.listeners.length]=a},Cobalt.Widgets.SlideGroup.prototype.fireChangeEvent=function(){for(var a=0;a<this.listeners.length;a++){var b=this.listeners[a];b()}},Cobalt.Widgets.SlideGroup.prototype.addList=function(a,b){if(a===null||a===undefined||(a+"").length<1)throw new Error("null or undefined value not allowed");a+="";if(b==undefined)b=new Cobalt.Widgets.SlideList;else if(!(b instanceof Cobalt.Widgets.SlideList))throw new Error("list must be an instance of Cobalt.Widgets.SlideList");if(undefined!==this.lists[a])throw new Error("Cannot add list as it already exists");while(b.size()<2)b.add(new Cobalt.Widgets.Slide(a,b.size(),0));this.lists[a]=b},Cobalt.Widgets.SlideGroup.prototype.setMaxActive=function(a){if(a===null||a===undefined)throw new Error("null or undefined value not allowed");if(!(a+"").match(/^\d+$/))throw new Error("setMaxActive may only be called with a number");a=parseInt(a);if(a<0)throw new Error("setMaxActive number may not be less then 0");this.maxActive=a},Cobalt.Widgets.SlideGroup.prototype.setFlattenedOrder=function(a){if(a===null||a===undefined)throw new Error("null or undefined value not allowed");this.flattenedOrder=a,this.fireChangeEvent()},Cobalt.Widgets.SlideGroup.prototype.storeFlattenedOrder=function(a){var b="";for(var c=0;c<this.order.length;c++)b.length>0&&(b+=","),b+=this.order[c].getUID();this.setFlattenedOrder(b)},Cobalt.Widgets.SlideGroup.prototype.pushOrder=function(a){var b,c,d,e=this.order.length;if(!(this instanceof Cobalt.Widgets.SlideGroup))throw new Error("'this' must be an instance of Cobalt.Widgets.SlideGroup");if(this.order.length+1>this.maxActive)throw new Error("The maximum number of this type of active slides has been reached");if(e===null||e===undefined)throw new Error("The index may not be empty");e=parseInt(e,10);if(e<0||e>this.order.length)throw new Error("The index is out of bounds");if(!(a instanceof Cobalt.Widgets.SlideDescriptor))throw new Error("descriptor must be an instance of Cobalt.Widgets.SlideDescriptor");d=!1;for(b in this.lists)c=this.lists[b],c instanceof Cobalt.Widgets.SlideList&&c.containsSlide(a.getSlide())&&(d=!0);if(!d)throw new Error("The slide was not in the any of the lists");for(b=0;b<this.order.length;b++)if(this.order[b].getUID()==a.getUID())throw new Error("The slide is already in rotation");a.getSlide().setActive(!0),this.order[e]=a,this.storeFlattenedOrder()},Cobalt.Widgets.SlideGroup.prototype.addToOrder=function(a){this.pushOrder(a)},Cobalt.Widgets.SlideGroup.prototype.getNumLists=function(){var a=0;for(var b in this.lists)a++;return a},Cobalt.Widgets.SlideGroup.prototype.getList=function(a){return undefined!==this.lists[a]&&this.lists[a]instanceof Cobalt.Widgets.SlideList?this.lists[a]:undefined},Cobalt.Widgets.SlideGroup.prototype.getSlide=function(a,b){var c=this.getList(a);return undefined===c?undefined:c.get(b)},Cobalt.Widgets.SlideGroup.prototype.size=function(a){if(a==undefined){var b=0;for(var c in this.lists)b+=this.lists[c].size();return b}var d=this.getList(a);return undefined!==d?d.size():undefined},Cobalt.Widgets.SlideGroup.prototype.getSlideByOrder=function(a){return a===null||a===undefined?undefined:(a=parseInt(a,10),a<0||a>this.order.length?undefined:this.order[a]==undefined?undefined:this.order[a].getSlide())},Cobalt.Widgets.SlideGroup.prototype.getSlideOrder=function(a){if(a!=null&&a!==undefined&&a instanceof Cobalt.Widgets.Slide){for(var b=0;b<this.order.length;b++)if(a.getUID()==this.order[b].getUID())return b;return undefined}return undefined},Cobalt.Widgets.SlideGroup.prototype.orderSlides=function(){var a,b,c,d,e,f,g,h,i;this.order=[],c=this.flattenedOrder.length>0?this.flattenedOrder.split(/\,/):[];for(a=0;a<c.length;a++){b=c[a].split(/\-/),f=b[0],g=b[1],h=b[2],d=this.getSlide(f,g);if(d!==undefined&&parseInt(d.instanceId,10)==parseInt(h,10)&&d.active==1&&d.enabled==1&&this.order.length<parseInt(this.maxActive,10))try{this.addToOrder(new Cobalt.Widgets.SlideDescriptor(d))}catch(j){}}for(f in this.lists)if(this.lists.hasOwnProperty(f)){e=this.getList(f);if(undefined!==e)for(a=0;a<e.size();a++)d=e.get(a),d.enabled!=0&&undefined===this.getSlideOrder(d)&&d.setActive(!1)}this.storeFlattenedOrder()},Cobalt.Widgets.SlideGroup.prototype.addToRotation=function(a){this.addToOrder(new Cobalt.Widgets.SlideDescriptor(a))},Cobalt.Widgets.SlideGroup.prototype.removeFromRotation=function(a){if(a!=null&&a!==undefined&&a instanceof Cobalt.Widgets.Slide){var b,c,d;for(var e=0;e<this.order.length;e++){b=this.order[e];if(b.getUID()==a.getUID())return c=e>0?this.order.slice(0,e):[],d=e<this.order.length-1?this.order.slice(e+1):[],this.order=c.concat(d),this.storeFlattenedOrder(),a.setActive(!1),!0}return!1}return!1},Cobalt.Widgets.SlideGroup.prototype.swapSlide=function(a,b){if(a===null||a===undefined)throw new Error("The fromIndex may not be empty");if(b===null||b===undefined)throw new Error("The toIndex may not be empty");a=parseInt(a,10),b=parseInt(b,10);if(a<0||a>this.order.length)throw new Error("The fromIndex is out of bounds");if(b<0||b>this.order.length)throw new Error("The toIndex is out of bounds");var c=this.order[a],d=this.order[b];this.order[b]=c,this.order[a]=d,this.storeFlattenedOrder()},Cobalt.Widgets.SlideGroup.prototype.moveUpSlide=function(a){var b=this.getSlideOrder(a);return undefined!==b&&b!=0?(this.swapSlide(b,parseInt(b,10)-1),!0):!1},Cobalt.Widgets.SlideGroup.prototype.moveDownSlide=function(a){var b=this.getSlideOrder(a);return undefined===b||b>=this.order.length-1?!1:(this.swapSlide(b,parseInt(b,10)+1),!0)};
/* SlideCollection.js */
Cobalt.Widgets.SlideCollection=function(){this.flattenedOrder="",this.className="Cobalt.Widgets.SlideCollection",this.imageWidth=940,this.imageHeight=300,this.layoutName="default",this.indicatorStyle="dots",this.defaultGroupMaxActive=20,this.defaultGroupFlattenedOrder="",this.defaultGroupModelSlides=[],this.defaultGroupDealerSlides=[],this.cicGroupMaxActive=24,this.cicGroupFlattenedOrder="",this.cicGroupCicSlides=[],this.viewType="display",this.promotions=undefined,this.siteGroups=undefined,this.validatedSlides=0;var a;while(this.defaultGroupModelSlides.length<2)a=this.defaultGroupModelSlides.length,this.defaultGroupModelSlides[a]=new Cobalt.Widgets.Slide("model",a,0);while(this.defaultGroupDealerSlides.length<2)a=this.defaultGroupDealerSlides.length,this.defaultGroupDealerSlides[a]=new Cobalt.Widgets.Slide("dealer",a,0);while(this.cicGroupCicSlides.length<2)a=this.cicGroupCicSlides.length,this.cicGroupCicSlides[a]=new Cobalt.Widgets.Slide("cic",a,0);this.composeObject=function(){var a=this;this.order=[],this.defaultGroup=new Cobalt.Widgets.SlideGroup,this.defaultGroup.maxActive=this.defaultGroupMaxActive,this.defaultGroup.flattenedOrder=this.defaultGroupFlattenedOrder,this.defaultGroup.addList("model"),this.defaultGroup.addList("dealer"),this.defaultGroup.lists.model.slides=this.defaultGroupModelSlides,this.defaultGroup.lists.dealer.slides=this.defaultGroupDealerSlides,this.defaultGroup.addChangeListener(function(a){return function(){a.orderSlides()}}(this)),this.defaultGroup.lists.model.pushSlides=function(b){a.pushDefaultGroupModelSlides(b)},this.defaultGroup.lists.dealer.pushSlides=function(b){a.pushDefaultGroupDealerSlides(b)},this.defaultGroup.setFlattenedOrder=function(b){if(b===null||b===undefined)throw new Error("null or undefined value not allowed");a.setDefaultGroupFlattenedOrder(b),this.flattenedOrder=b,this.fireChangeEvent()},this.cicGroup=new Cobalt.Widgets.SlideGroup,this.cicGroup.maxActive=24,this.cicGroup.flattenedOrder=this.cicGroupFlattenedOrder,this.cicGroup.addList("cic"),this.cicGroup.lists.cic.slides=this.cicGroupCicSlides,this.cicGroup.addChangeListener(function(a){return function(){a.orderSlides()}}(this)),this.cicGroup.lists.cic.pushSlides=function(b){a.pushCicGroupCicSlides(b)},this.cicGroup.setFlattenedOrder=function(b){if(b===null||b===undefined)throw new Error("null or undefined value not allowed");a.setCicGroupFlattenedOrder(b),this.flattenedOrder=b,this.fireChangeEvent()},this.flattenedOrder="",this.defaultGroup.orderSlides(),this.cicGroup.orderSlides()}},undefined==Cobalt.Widgets.SlideGlobals&&(Cobalt.Widgets.SlideGlobals={}),Cobalt.Widgets.SlideGlobals.availablePromotions=[],Cobalt.Widgets.SlideCollection.prototype.validateSlides=function(){this.defaultGroup.validateSlides(),this.cicGroup.validateSlides()},Cobalt.Widgets.SlideCollection.prototype.setFlattenedOrder=function(a){if(a===null||a===undefined)throw new Error("null or undefined value not allowed");this.flattenedOrder=a},Cobalt.Widgets.SlideCollection.prototype.setPromotions=function(a){if(a!==undefined&&!a instanceof Array)throw new Error("setPromotions can only take an undefined value or an array value");this.promotions=a},Cobalt.Widgets.SlideCollection.prototype.setSiteGroups=function(a){if(a!==undefined&&!a instanceof Array)throw new Error("setPromotions can only take an undefined value or an array value");this.siteGroups=a},Cobalt.Widgets.SlideCollection.prototype.setDefaultGroupFlattenedOrder=function(a){if(a===null||a===undefined)throw new Error("null or undefined value not allowed");this.defaultGroupFlattenedOrder=a},Cobalt.Widgets.SlideCollection.prototype.setCicGroupFlattenedOrder=function(a){if(a===null||a===undefined)throw new Error("null or undefined value not allowed");this.cicGroupFlattenedOrder=a},Cobalt.Widgets.SlideCollection.prototype.pushDefaultGroupModelSlides=function(a){var b=this.defaultGroupModelSlides.length;if(a instanceof Cobalt.Widgets.Slide)this.defaultGroupModelSlides[b]=a;else throw new Error("slide must be an instance of Cobalt.Widgets.Slide")},Cobalt.Widgets.SlideCollection.prototype.pushDefaultGroupDealerSlides=function(a){var b=this.defaultGroupDealerSlides.length;if(a instanceof Cobalt.Widgets.Slide)this.defaultGroupDealerSlides[b]=a;else throw new Error("slide must be an instance of Cobalt.Widgets.Slide")},Cobalt.Widgets.SlideCollection.prototype.pushCicGroupCicSlides=function(a){var b=this.cicGroupCicSlides.length;if(a instanceof Cobalt.Widgets.Slide)this.cicGroupCicSlides[b]=a;else throw new Error("slide must be an instance of Cobalt.Widgets.Slide")},Cobalt.Widgets.SlideCollection.prototype.storeFlattenedOrder=function(a){var b="";for(var c=0;c<this.order.length;c++)b.length>0&&(b+=","),b+=this.order[c].getUID();this.setFlattenedOrder(b)},Cobalt.Widgets.SlideCollection.prototype.getSlideByOrder=function(a){return a===null||a===undefined?undefined:(a=parseInt(a,10),a<0||a>this.order.length?undefined:this.order[a]==undefined?undefined:this.order[a].getSlide())},Cobalt.Widgets.SlideCollection.prototype.getSlideOrder=function(a){if(a!=null&&a!==undefined&&a instanceof Cobalt.Widgets.Slide){for(var b=0;b<this.order.length;b++)if(a.getUID()==this.order[b].getUID())return b;return undefined}return undefined},Cobalt.Widgets.SlideCollection.prototype.orderSlides=function(){var a,b,c;b=0,this.order=[],c=0;while(b<2&&c<this.defaultGroup.order.length)c<this.defaultGroup.order.length&&this.isDisplayable(this.defaultGroup.order[c].getSlide())&&(this.order[b]=this.defaultGroup.order[c],b++),c++;for(a=0;a<this.cicGroup.order.length;a++){var d=!0;if(this.viewType!="config"){var e=this.cicGroup.order[a].getSlide();e.validateTimeRange(),e.doDisplay()||(d=!1)}d&&this.isDisplayable(this.cicGroup.order[a].getSlide())&&(this.order[b]=this.cicGroup.order[a],b++)}while(c<this.defaultGroup.order.length)this.isDisplayable(this.defaultGroup.order[c].getSlide())&&(this.order[b]=this.defaultGroup.order[c],b++),c++;this.storeFlattenedOrder()},Cobalt.Widgets.SlideCollection.prototype.isDisplayable=function(a){if(this.promotions==undefined||!(this.promotions instanceof Array))this.promotions=[];if(this.viewType!="config"){a.validateTimeRange();if(!a.doDisplay())return!1}if(this.isMasterSite())return!0;if(a===undefined)return!1;var b=a.promotion===undefined?"":a.promotion;if(a.slideGroup=="cic"&&b.length>0&&this.promotions!=undefined){var c=!1;for(i=0;i<this.promotions.length;i++)if(this.promotions[i].title!==undefined&&this.promotions[i].title==b){c=!0;break}if(!c)return!1}var d=a.optInDealerGroup===undefined?"":a.optInDealerGroup,e=a.optOutDealerGroup===undefined?"":a.optOutDealerGroup;if(a.slideGroup=="cic"&&(d.length>0||e.length>0)&&this.siteGroups!=undefined){var f=!1,g=!1;for(i=0;i<this.siteGroups.length;i++)this.siteGroups[i]!==undefined&&this.siteGroups[i]==d&&(f=!0),this.siteGroups[i]!==undefined&&this.siteGroups[i]==e&&(g=!0);if(d.length>0&&!f)return!1;if(e.length>0&&g)return!1}return!0},Cobalt.Widgets.SlideCollection.prototype.isMasterSite=function(){var a=typeof CobaltWSM=="undefined"||typeof CobaltWSM.wsDocument=="undefined"?ContextManager:CobaltWSM.wsDocument.ContextManager,b=a.getSiteType(),c=new RegExp("[\\?&]fromPage+=([^&#]*)"),d=c.exec(parent.window.location.href);return d!==null&&d[1]=="MASTER"||b=="MASTER"},Cobalt.Widgets.SlideCollection.prototype.distillData=function(a){if(a===undefined)return[];var b=[];for(var c in a){if(!(a[c]instanceof Array))return[];for(var d=0;d<a[c].length;d++){var e=a[c][d];e.campaign.active&&(b[b.length]=e.campaign.campaignTitle)}}return b},Cobalt.Widgets.SlideCollection.prototype.findAvailablePromotions=function(){var a=this};

