
!function(){var root=this;var defaults={el:'#ctaDetails'};var CTAView=function(options){Handlebars.registerHelper('ifCond',function(v1,operator,v2,options){switch(operator)
{case"==":return(v1==v2)?options.fn(this):options.inverse(this);case"!=":return(v1!=v2)?options.fn(this):options.inverse(this);case"===":return(v1===v2)?options.fn(this):options.inverse(this);case"!==":return(v1!==v2)?options.fn(this):options.inverse(this);case"&&":return(v1&&v2)?options.fn(this):options.inverse(this);case"||":return(v1||v2)?options.fn(this):options.inverse(this);case"<":return(v1<v2)?options.fn(this):options.inverse(this);case"<=":return(v1<=v2)?options.fn(this):options.inverse(this);case">":return(v1>v2)?options.fn(this):options.inverse(this);case">=":return(v1>=v2)?options.fn(this):options.inverse(this);default:return options.inverse(this);}});this.options=$.extend({},defaults,options);this.template=this.options.template||Handlebars.compile($('#ctaTemplate').html());this.mediator=this.options.mediator;this.$el=$(this.options.el);this.mediator.subscribe('vehicleDataRequested',this.render,this);};CTAView.prototype={render:function(data){this.$el.html(this.template(data.cta));this.$el.fadeIn();},hide:function(){this.$el.fadeOut();},show:function(){this.$el.fadeIn();}};root.CTAView=function(options){return new CTAView(options);};}.call(EP2);
