KBB.createAndInit("KBB.Page.Home.Showroom",function(){"use strict";var i=document.getElementById("hpShowroom"),r=$(".js-showroom-preview-ad"),u=$(".js-showroom-featured-ad"),o=$(".js-showroom-thumnail"),s=$(".js-showroom-thumnail-area"),h=$("#iconTemplate").html(),f=$("#showroomInfoIcons"),c=$("#showroomSide"),t=i?JSON.parse(i.getAttribute("data-showroom")):[],n=t&&t.length?t[0]:null,l=$.getTouchEvent("Home.Showroom"),e=function(){n&&(n.CustomTemplate?f.empty():f.html(Mustache.render(h,n)),KBB.Page.trigger(KBB.Page.Events.ShowroomPanelChange))},a=function(){var i=$(this).parent(),f=i[0].getAttribute("data-index");n=t[f];o.removeClass("active");i.addClass("active");r.attr("id","kbbAdsHpShow0"+n.Placement+"Preview");u.attr("id","kbbAdsHpShow0"+n.Placement+"FeaturedMessage");r.find(".gpt-ad").empty();u.find(".gpt-ad").empty();c.toggleClass("ad hidden",n.CustomTemplate||n.AdType==="house");e()},v=function(){s.on(l,a);e()},y=function(){};return{init:v,teardown:y}})