(function() { function bxBootstrap() { var re = /bot|crawl|slurp|spider|mediapartners|headlesschrome|snap-prefetch|remotasks|woorank|uptime\.com|facebookexternalhit|facebookcatalog/i; if (re.test(navigator.userAgent) || navigator.userAgent == '') { return; } if (!(window.bouncex&&bouncex.website)) { var pushedData = []; if(window.bouncex && bouncex.push && bouncex.length){ pushedData = bouncex; } window.bouncex = {}; bouncex.pushedData = pushedData; bouncex.website = {"id":292,"name":"Capitol Lighting","cookie_name":"bounceClientVisit292","domain":"1800lighting.com","ct":"fp_local_storage","ally":0,"ei":0,"tcjs":"","cjs":"//coupon auto apply wrike: https://www.wrike.com/open.htm?id=170526841\nif(typeof localStorage.bx_coupon !== 'undefined' && window.location.href.indexOf('scripts/cart.cfm') > -1){\n var couponInput = jQuery('#promo_codeB');\n var applyBtn = jQuery('#submitPromoB');\n var coupon = localStorage.bx_coupon || jQuery('.coupon').first().text();\n\n couponInput.val(coupon);\n applyBtn.click();\n}\n\n\nif (window.top.location.href.indexOf('itemsku')>=0){\n //var brand = window.top.location.href.split('/')[3].replace('%20', '-').replace(/[-]/g,' ').replace('%20', '-');\n var cat = dataLayer[0].productCategory;\n var style = window.top.location.href.split('/')[5]?window.top.location.href.split('/')[5].split('=')[1].replace('%2D','-'):'';\n\n //bouncex.setv('brand', brand);\n bouncex.setv('product_category', cat);\n bouncex.setv('style', style);\n bouncex.setBounceCookie();\n\n} else if (window.top.location.href.indexOf('/mn/')>=0){\n var cat = window.top.location.href.split('/mn/')[0].split('/')[3].replace(/[-]/g,' ');\n var style = window.top.location.href.split('/mn/')[0].split('/')[4]?window.top.location.href.split('/mn/')[0].split('/')[4].replace(/[-]/g,' '):'';\n bouncex.setv('style', style);\n bouncex.setv('product_category', cat);\n bouncex.setBounceCookie();\n}\n\nvar pageviews = bouncex.vars.page_views;\npageviews += 1;\nbouncex.setv('page_views', pageviews);\nbouncex.setBounceCookie();\n\n\n/*\n bouncex.setv('t_brand', BX.brand);\n bouncex.setv('t_category', BX.category);\n bouncex.setv('t_style', BX.style);\n bouncex.setBounceCookie();\n*/\n\nsetTimeout(function(){\n if ( bouncex.vars.pageviews >1 ){\n bouncex.reload_campaigns();\n }\n},250);\n\n// auto fill email from url in unsubscribe link\nif(window.location.href.indexOf('/myaccount/subscriptions.cfm') > -1 && bouncex.ibx._getparam('bcx_email')){\n jQuery('input[name=email]:not(.wm)').val(bouncex.ibx._getparam('bcx_email'));\n}\n \n/* cart image CV's */\nbouncex.evalCartPageItems = function(){\n var cartItems = jQuery('div.cart-item:visible');\n if(cartItems.length===0){\n bouncex.setv('img1','false');\n bouncex.setv('img2','false');\n bouncex.setv('img3','false');\n }\n if(cartItems.length>0){\n bouncex.setv('img1', location.host + cartItems.eq(0).find('img').attr('src'));\n }\n if(cartItems.length>1){\n bouncex.setv('img2', location.host + cartItems.eq(1).find('img').attr('src'));\n }else {\n bouncex.setv('img2', 'false');\n }\n if(cartItems.length>2){\n bouncex.setv('img3', location.host + cartItems.eq(2).find('img').attr('src'));\n } else {\n bouncex.setv('img3', 'false');\n }\n \n if(cartItems.length==1 && bouncex.vars.img2){\n bouncex.setv('img2', 'false');\n bouncex.setv('img3', 'false');\n } else if (cartItems.length == 2 && bouncex.vars.img3){\n bouncex.setv('img3', 'false');\n }\n bouncex.setBounceCookie();\n};\n\nbouncex.evalAddonPageItems = function(){\n var totalString = '' + bouncex.vars.img1+bouncex.vars.img2+bouncex.vars.img3;\n var imgSource = jQuery('div.imgSetter img').attr('src');\n var imgAlreadyAdded = totalString.indexOf(imgSource)>=0;\n \n if(!bouncex.vars.img1 && !imgAlreadyAdded){\n bouncex.setv('img1', location.host + imgSource);\n } else if(!bouncex.vars.img2 && !imgAlreadyAdded){\n bouncex.setv('img2', location.host + imgSource);\n } else if(!bouncex.vars.img3 && !imgAlreadyAdded){\n bouncex.setv('img3', location.host + imgSource);\n }\n bouncex.setBounceCookie();\n};\n\nvar isCartPage = location.href.indexOf('cart')>=0;\nvar isAddonPage = location.href.indexOf('item_acc')>=0;\n\nif(isCartPage){\n bouncex.evalCartPageItems();\n jQuery('[id*=removeitem]').click(function(){\n setTimeout(function(){\n bouncex.evalCartPageItems();\n },1500);\n });\n}\n\nif(isAddonPage){\n bouncex.evalAddonPageItems();\n}\n/* end cart img cv's */","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-4698722-1","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":1,"gmp":0,"whitelist_check":0},"burls":[{"prop":"contains","val":"staging"},{"prop":"contains","val":"dev0"},{"prop":"contains","val":"legacy"},{"prop":"contains","val":"stage"}],"ple":false,"fbe":false,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"//SHQ DLWATCHER\nbouncex.et.onTrue(\n function () {\n return !!bouncex.utils.getNestedProp('utils.segments.useDLWatcher', null, bouncex);\n },\n function () {\n bouncex.utils.segments.useDLWatcher();\n }, 5);\n//SHQ DLWATCHER\nvar DOMAIN = 'https://www.1800lighting.com',\n TEST_MODE = false,\n ITEM_ID_PDP_SELECTOR = 'span[itemprop=\"productID\"]',\n ITEM_ID_ATTR = 'data-masterid',\n ITEM_COPY_PDP_SELECTOR = '.product-name[itemprop=\"name\"]',\n ITEM_IMAGE_PDP_SELECTOR = 'img.primary-image',\n ITEM_CAT_PDP_SELECTOR = '[itemprop=\"category\"]',\n GRID_TILE_SELECTOR = '.product-tile__wrapper',\n CAT_TITLE_SELECTOR = 'a[role=\"banner\"]',\n CAT_CUSTOM_TITLE_SELECTOR = 'h1.category-custom-header__title',\n CAT_PAGE_ALLOWED_PARAMS = [\n 'showall',\n 'prefn1',\n 'prefv1'\n ],\n QUICKVIEW_SELECTOR = '.cl-quickview-modal',\n BREADCRUMB_SELECTOR = 'a.breadcrumb-element:visible',\n LOGGED_IN_EMAIL_SELECTOR = '.cl-account_profile-box__email-wrap',\n LPTAG_KEY = 'personal',\n REPLEN_PATH = '/on/demandware.store/Sites-CapitolLighting_US-Site/en_US/Cart-AddProduct?format=ajax',\n REPLEN_URL = DOMAIN + REPLEN_PATH,\n PID_PARAM = 'pid',\n determineTestMode = makeToggleCheck(TEST_MODE, bouncex.testmode.bxdev);\n\n/********************************** HELPERS ***********************************/\n\n// returns a bool based on a toggle set in above vars\nfunction makeToggleCheck(constantBool, conditionValue) {\n if (constantBool) {\n return !!conditionValue;\n }\n\n return true;\n}\n\nfunction isValidDomain() {\n return bouncex.utils.url.allowParams().indexOf(DOMAIN) > -1;\n}\n\nfunction getCurrentUrl() {\n return bouncex.utils.url.allowParams();\n}\n\nfunction setVarAndCookie(varName, value) {\n bouncex.setVar(varName, value);\n bouncex.setBounceCookie();\n}\n\nfunction getIdFromUrl(url) {\n var urlArr = url.split('-'),\n rawId = urlArr[urlArr.length - 1],\n id = '';\n\n if (rawId) {\n id = rawId.replace(/.html/, '');\n }\n\n return id;\n}\n\n/********************************* PDP EVENTS *********************************/\n\nfunction getItemId() {\n return jQuery(ITEM_ID_PDP_SELECTOR).attr(ITEM_ID_ATTR)\n || getIdFromUrl(getCurrentUrl());\n}\n\nfunction getItemCopy() {\n return bouncex.vars.prod_name || jQuery(ITEM_COPY_PDP_SELECTOR).text();\n}\n\nfunction getItemCategory() {\n return jQuery(ITEM_CAT_PDP_SELECTOR).attr('content');\n}\n\nfunction getItemUrl() {\n return getCurrentUrl();\n}\n\nfunction getItemImageUrl() {\n return encodeURI(jQuery(ITEM_IMAGE_PDP_SELECTOR).attr('xoriginal') || '');\n}\n\nfunction getItem() {\n return {\n id : getItemId(),\n copy : getItemCopy(),\n category : getItemCategory(),\n url : getItemUrl(),\n imageurl : getItemImageUrl(),\n price : bouncex.vars.prod_price,\n instock : bouncex.vars.in_stock\n };\n}\n\nfunction fireItemTracking(item) {\n item = bouncex.utils.addNamespace(item, 'item');\n\n bouncex.push([\n 'item',\n item\n ]);\n}\n\nfunction fireViewItem(id) {\n bouncex.push([\n 'view item',\n {\n 'item:id' : id,\n 'item:itemgroupid': id\n }\n ]);\n}\n\nfunction isValidItem(item) {\n if (item) {\n return item.id && item.imageurl;\n }\n}\n\nfunction firePdpEvents() {\n var item = getItem(),\n isValid = isValidItem(item);\n\n if (isValid) {\n fireItemTracking(item);\n fireViewItem(item.id);\n bouncex.et.setInterval(trackSelectSkuPDP(item.id));\n }\n}\n\nfunction trackSelectSkuPDP(id) {\n\treturn function() {\n\t\tif (bouncex.vars.prev_sku !== bouncex.vars.sku) {\n\t\t\tif (bouncex.vars.prev_sku && bouncex.vars.sku && bouncex.vars.variant_selected) {\n\t\t\t\tbouncex.push([\n\t\t\t\t\t'select_sku',\n\t\t\t\t\t{\n\t\t\t\t\t\t'item:id': id,\n\t\t\t\t\t\t'item:itemgroupid': id,\n\t\t\t\t\t\t'item:feedid': bouncex.vars.sku\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tbouncex.setv('prev_sku', bouncex.vars.sku);\n\t\t}\n\t};\n}\n\n/********************************* CAT EVENTS *********************************/\n\nfunction getItemIdsCat() {\n \n var ids = [],\n tiles = jQuery(GRID_TILE_SELECTOR);\n\n for (var i = 0; i < tiles.length; i++) {\n var id = jQuery(tiles[i]).attr('data-itemid');\n if (id) {\n ids[ids.length] = id;\n }\n }\n\n return ids.join(',');\n}\n\nfunction getCatUrl() {\n return bouncex.utils.url.allowParams(CAT_PAGE_ALLOWED_PARAMS);\n}\n\nfunction getCategoryTitle() {\n\n return jQuery(CAT_CUSTOM_TITLE_SELECTOR).text().trim()\n || jQuery(CAT_TITLE_SELECTOR).attr('aria-label')\n || jQuery(CAT_TITLE_SELECTOR + ' h1.clp-header-banner__title').text().trim()\n || jQuery(BREADCRUMB_SELECTOR).last().text().trim()\n || 'Capitol Lighting';\n}\n\nfunction viewItemQv() {\n var id = getItemId();\n\n if (id) {\n fireViewItem(id);\n bouncex.et.setInterval(trackSelectSkuQV(id));\n }\n}\n\nfunction fireViewCategory() {\n var catIds = getItemIdsCat(),\n catName = getCategoryTitle();\n\n if (catIds.length) {\n bouncex.push([\n 'view category',\n {\n 'items:ids' : catIds,\n 'page:url' : getCatUrl(),\n 'page:title' : catName\n }\n ]);\n }else{\n window._shq.push([\"pageView\", {\n \"pageType\": \"category\",\n \"catName\": catName,\n \"catId\": catName\n }]);\n }\n}\n\nfunction trackSelectSkuQV(id) {\n\treturn function() {\n\t\tif (bouncex.vars.prev_sku !== bouncex.vars.sku) {\n\t\t\tif (bouncex.vars.prev_sku && bouncex.vars.sku && bouncex.vars.variant_selected) {\n\t\t\t\tbouncex.push([\n\t\t\t\t\t'select_sku',\n\t\t\t\t\t{\n\t\t\t\t\t\t'item:id': id,\n\t\t\t\t\t\t'item:itemgroupid': id,\n\t\t\t\t\t\t'item:feedid': bouncex.vars.sku\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tbouncex.setv('prev_sku', bouncex.vars.sku);\n\t\t}\n\t};\n}\n\n/******************************** CART EVENTS *********************************/\n\nfunction getPidFromSettings(s) {\n return s.data\n ? bouncex.utils.url.getParam(PID_PARAM, s.data)\n : bouncex.utils.url.getParam(PID_PARAM, s.url);\n}\n\nfunction makeCartItemFromSettings(s) {\n var pid = getPidFromSettings(s),\n qty = bouncex.utils.url.getParam('Quantity', s.data) || '1',\n cartItem = {};\n\n if (pid) {\n cartItem.pid = pid;\n cartItem.qty = qty;\n }\n return cartItem;\n}\n\nfunction makeCartObj(id, cartItem) {\n var cartObj = {};\n\n if (id && cartItem) {\n cartObj['item:id'] = id;\n cartObj['cart:item'] = bouncex.stringify(cartItem);\n cartObj['cart:total'] = parseFloat(jQuery('.mini-cart-subtotals.ms-flex.cl-minicart__footer-subtotal > .value.ms-font--bold').text().replace(\"$\", '').replace(\",\",'')) || 0;\n }\n\n return cartObj;\n}\n\nfunction trackCart(e, x, s) {\n if (\n s.url.indexOf('Sites-CapitolLighting_US-Site/en_US/Cart-AddProduct') > -1\n && window.location.href.indexOf('bx_cart') === -1\n ) {\n setTimeout(function() {\n var id = getItemId(),\n cartItem = makeCartItemFromSettings(s),\n cartObj = makeCartObj(id, cartItem);\n \n if (cartObj['item:id']) {\n fireAddToCart(cartObj);\n } \n }, 1000)\n }\n}\n\nfunction fireAddToCart(cartObj) {\n bouncex.push([\n 'add to cart',\n cartObj\n ]);\n\n if (!bouncex.vars.cart) {\n setVarAndCookie('cart', true);\n }\n}\n\nfunction trackEmptyCart() {\n if (\n bouncex.vars.cart_qty === 0\n && bouncex.vars.cart\n && !bouncex.utils.url.getParam('bx_cart')\n ) {\n fireEmptyCart();\n }\n}\n\nfunction fireEmptyCart() {\n bouncex.push([\n 'empty_cart',\n {}\n ]);\n\n setVarAndCookie('cart', false);\n}\n\nfunction consolidateItems(items) {\n var itemObj = {};\n\n for (var i = 0; i < items.length; i++) {\n var pid = items[i]['pid'],\n qty = parseInt(items[i]['qty']) || 1;\n\n if (pid) {\n if (itemObj[pid]) {\n itemObj[pid] += qty;\n } else {\n itemObj[pid] = qty;\n }\n }\n }\n return itemObj;\n}\n\nfunction buildConsolidateItemsArr(itemObj) {\n var itemObjKeys = Object.keys(itemObj),\n items = [];\n\n for (var i = 0; i < itemObjKeys.length; i++) {\n var pid = itemObjKeys[i],\n qty = itemObj[pid],\n item = {};\n\n item.pid = pid;\n item.qty = qty;\n items[items.length] = item;\n }\n\n return items;\n}\n\nfunction getConsolidatedItems(items) {\n var itemObj;\n\n if (items.length) {\n itemObj = consolidateItems(items);\n items = buildConsolidateItemsArr(itemObj);\n }\n\n return items;\n}\n\nfunction replenish(cart) {\n var $deferreds = [],\n items = getConsolidatedItems(cart.items) || cart.items;\n\n for (var i = 0; i < items.length; i++ ) {\n $deferreds[$deferreds.length] = makeReplenItem(items[i]);\n }\n\n $deferreds.reduce(function(promise, func) {\n return promise.then(function() {\n return func();\n });\n }, jQuery.Deferred().resolve([]))\n .then(replenComplete);\n}\n\nfunction makeReplenItem(item) {\n var replenUrl;\n\n if (item.pid && item.qty) {\n replenUrl = REPLEN_URL + '&pid=' + item.pid;\n\n return function() {\n return jQuery.ajax({\n type : 'POST',\n url : replenUrl,\n data : 'Quantity=' + item.qty\n });\n }\n\n }\n return function(){};\n}\n\nfunction replenComplete() {\n window.location.href = window.location.pathname + '?bx_replen=true';\n}\n\n/******************************* LoggedIn User ********************************/\n\nfunction getEmailFromWindow() {\n if (\n window.lpTag\n && window.lpTag.sdes\n && typeof window.lpTag.sdes.get === 'function'\n && lpTag.sdes.get(LPTAG_KEY)[0]\n && lpTag.sdes.get(LPTAG_KEY)[0][LPTAG_KEY]\n && lpTag.sdes.get(LPTAG_KEY)[0][LPTAG_KEY].contacts\n && lpTag.sdes.get(LPTAG_KEY)[0][LPTAG_KEY].contacts[0]\n ) {\n return lpTag.sdes.get(LPTAG_KEY)[0][LPTAG_KEY].contacts[0].email;\n }\n}\n\nfunction loggedInUserTracking() {\n if (bouncex.vars.is_logged_in && !bouncex.vars.logged_in_identified) {\n var email = jQuery(LOGGED_IN_EMAIL_SELECTOR).text().trim()\n || getEmailFromWindow() ;\n\n if (email) {\n bouncex.push([\n 'user',\n {\n 'email' : email,\n 'source' : 'LoggedIn'\n }\n ]);\n\n setVarAndCookie('logged_in_identified', true);\n }\n }\n}\n\n/****************************** INITIALIZE EVENTS *****************************/\n\nfunction initializePdPEvents() {\n \n if (bouncex.website.pts === 'product') {\n firePdpEvents();\n }\n}\n\nfunction initializeCatEvents() {\n if (bouncex.website.pts === 'category') {\n fireViewCategory();\n }\n}\n\nfunction initializeViewItemQuickView() {\n if (bouncex.website.pts === 'category' || bouncex.website.pts === 'search') {\n bouncex.et.onVisible(QUICKVIEW_SELECTOR, viewItemQv);\n }\n}\n\nfunction initializeCartTracking() {\n bouncex.et.cart.init({\n replenishmentType : 'ajax',\n replenish : replenish\n });\n\n if (getCurrentUrl().indexOf('/wishlist') === -1){\n bouncex.et.on(jQuery(document), 'ajaxComplete.bx', function(e, x, s) {\n return trackCart(e, x, s);\n });\n }\n\n bouncex.et.onVarChange('cart_qty', trackEmptyCart);\n}\n\nfunction customerTypeEvent() {\n if (bouncex.vars.is_logged_in && !bouncex.vars.customer_type_tracked) {\n bouncex.push(['customer_type', {\n 'type': (dataLayer.find(e => e.customerType) || {}).customerType,\n 'show_room': dataLayer.push() || false\n }]);\n bouncex.setv('customer_type_tracked', true);\n setBounceCookie();\n }\n}\n\nfunction initializeTrackingSiteWide() {\n // The JS for the cartridge is getting delayed for some reason.\n window._shq = window._shq || [];\n \n if (isValidDomain() && determineTestMode) {\n customerTypeEvent();\n initializePdPEvents();\n initializeCatEvents();\n initializeViewItemQuickView();\n loggedInUserTracking();\n initializeCartTracking();\n }\n}\n\n/************************* INITIALIZE EVENTS SITEWIDE *************************/\n\ninitializeTrackingSiteWide();\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/scripts/cart.cfm' || window.location.pathname.indexOf('/checkout/cart/') > -1;"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"(function(){\n\tvar newSite = document.querySelectorAll('meta[name=\"format-detection\"]').length > 0;\n\tif (newSite) {\n\t\treturn document.querySelectorAll('.pt_product-search-result').length > 0 || document.querySelectorAll('.refinement').length > 0;\n\t} else {\n\t\treturn document.querySelectorAll('.block-grid-item,.brandsClass').length > 0 && window.location.pathname !== \"/\" && window.location.search.indexOf(\"?sitesearch\") === -1 && [\"/myaccount/wishlists.cfm\",\"/Capitol-Lighting-Contact/storelocations.cfm\"].indexOf(window.location.pathname) === -1;\n\t}\n})();"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/search"}]]},"checkout":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === \"/scripts/addressinfo.cfm\" || window.location.pathname === \"/scripts/billing.cfm\" || window.location.pathname.indexOf('/checkout/entry/') > -1;"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === \"/\" || document.querySelectorAll('.cl-homepage').length > 0;"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"jQuery('#product-gallery,#us-modal-body,#pdpMain').length>0;"}]]},"search":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.search.indexOf(\"?sitesearch\") !== -1 || window.location.pathname.indexOf('/search/') > -1;"}]]}},"els":{"CART - Checkout Button":"button[name*=\"checkoutCart\"]","CART - Promo Code Apply Button":"button#add-coupon","CART - Promo Code Box":"input[id*=\"couponCode\"]","CAT - Product Grid Image":"div.product-tile__thumbnail","Footer":"footer.cl-footer","Navigation bar":"header.cl-header","PDP - Add to Cart Button":"button#add-to-cart","PDP - Color Option":"div.product-variations","PDP - Hero Image":"div.product-image-container","PDP - Product Name":"h1.product-name","PDP - Product Price":"div.product-price","PDP - Quantity Option":"input#Quantity","PDP - Review Stars":"div#product-teasers","PDP - Thumbnail Image":"div.thumb-image","SEARCH - Product Grid Image":"div.product-tile__thumbnail"},"vars":[{"name":"cart_total","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function(){\n\tvar newSite = jQuery('meta[name=\"format-detection\"]').length > 0;\n\tif (newSite) {\n\t\treturn bouncex.website.pts === 'checkout' ? Number(jQuery('.order-totals-table .order-subtotal:first').text().replace(/[^0-9.]/g, '')) : Number(jQuery('.mini-cart-subtotals .value').text().replace(/[^0-9.]/g, ''));\n\t} else {\n\t\treturn bouncex.website.pts === 'cart' || bouncex.website.pts === 'checkout'? Number(jQuery('#itemsubtotalamt').text().replace(/[^0-9.]/g, '')) : Number(jQuery('.subtotal:first').text().replace(/[^0-9.]/g, ''));\n\t}\n})();","trigger":""},{"name":"search_not_found","polling":"none","persist":"","page_types":[],"testmode":false,"default":"false","code":"jQuery('.no-result-header').text().indexOf('Whoops!')===0","trigger":""},{"name":"is_logged_in","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.pathname.indexOf('myaccount') > - 1 ? true : false;","trigger":""},{"name":"product_category","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"","code":"null","trigger":""},{"name":"brand","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\tvar newSite = jQuery('meta[name=\"format-detection\"]').length > 0;\n\n\tif (newSite) {\n\t\tif (bouncex.website.pts === 'product') {\n\t\t\tvar prodNameSplit = jQuery('.product-name:visible').text().split(' ');\n\n\t\t\treturn prodNameSplit.slice(prodNameSplit.indexOf('by')+1).join(' ');\n }\n\t\treturn false;\n\t} else {\n\t\tif (window.top.location.href.indexOf('itemsku')>=0) {\n\t\t\treturn bouncex.utils.getNestedProp('top.location.href').split('/')[3].replace('%20', '-').replace(/[-]/g,' ').replace('%20', '-');\n }\n\t\treturn false;\n\t}\n})();","trigger":""},{"name":"page_views","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"0","code":"null","trigger":""},{"name":"style","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"false;","trigger":""},{"name":"t_brand","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"typeof(BX)!='undefined'?BX.brand:''","trigger":""},{"name":"t_style","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"typeof(BX)!='undefined'?BX.style:''","trigger":""},{"name":"t_category","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"typeof(BX)!='undefined'?BX.category:''","trigger":""},{"name":"on_prodcut_page","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('input[name=sa_product_id]').length > 0 ? true:false ","trigger":""},{"name":"item_sku","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"typeof(window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('ecommerce'))!='undefined'?window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('ecommerce').detail.products[0].productId:'';","trigger":""},{"name":"custid","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('customerId');","trigger":""},{"name":"t_group","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"typeof(BX)!='undefined'?(BX.group?BX.group:BX.Group):''","trigger":""},{"name":"google_pla","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"document.referrer.indexOf('google.com')>0&&document.referrer.indexOf('&ctype=5')>0","trigger":""},{"name":"level_1","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('categoryLevel1');","trigger":""},{"name":"level_2","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('categoryLevel2');","trigger":""},{"name":"level_3","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('categoryLevel3');","trigger":""},{"name":"level_4","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.google_tag_manager[\"GTM-N97F\"].dataLayer.get('categoryLevel4');","trigger":""},{"name":"utm_source","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.ibx._getparam('utm_source') || null;","trigger":""},{"name":"utm_medium","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"\nbouncex.ibx._getparam('utm_medium') || null;","trigger":""},{"name":"utm_campaign","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"\nbouncex.ibx._getparam('utm_campaign') || null;","trigger":""},{"name":"items_in_cart","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function() {\n if (bouncex.website.pts === 'checkout') {\n var ecommerceObj = bouncex.utils.gtmLookup('ecommerce');\n\n var productArray = bouncex.utils.getNestedProp('checkout.products', undefined, ecommerceObj);\n\n return productArray.reduce(function(acc, curr) {\n acc += curr.quantity;\n return acc;\n }, 0);\n }\n\n return Number(jQuery('span.item-count:first, .minicart-quantity').text().replace(/[^0-9]/g, '')) || null;\n})();","trigger":""},{"name":"img1","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"img2","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"img3","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"pre_dec_visitor","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"\t/* return true if first visit time was before Dec. 4 2016 */bouncex.cookie.fvt && bouncex.cookie.fvt < 1480852800;","trigger":""},{"name":"promo_applied","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#savingsid').is(':visible')","trigger":""},{"name":"ibx_test","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('ibx_test') > -1 || null","trigger":""},{"name":"qualifies_free_ship","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.shipping-message').text().toLowerCase().indexOf('free shipping') > -1;","trigger":""},{"name":"logged_in","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (bouncex.website.pts === 'checkout') {\n return bouncex.utils.gtmLookup('customerStatus') === 'Registered';\n }\n\n return jQuery('a.user-account span.cl-user-utility__username-span').text().indexOf('Hi,') > -1;\n})();","trigger":"pageload"},{"name":"ever_logged_in","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in ? true : null;","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('.newsletter-email-message:visible').text().indexOf('Thanks for subscribing') > -1 || null;","trigger":"pageload"},{"name":"prod_name","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? jQuery('.product-name:visible').text() : false;","trigger":"pageload"},{"name":"prod_price","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? (jQuery('.price-standard').text() || jQuery('.price-range span:first').text()).replace(/[^0-9.]/g,'') : false;","trigger":"pageload"},{"name":"in_stock","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? true : false;","trigger":"pageload"},{"name":"cart_value","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function(){\n\tvar newSite = jQuery('meta[name=\"format-detection\"]').length > 0;\n\tif (newSite) {\n\t\treturn bouncex.website.pts === 'checkout' ? Number(jQuery('.order-totals-table .order-subtotal:first').text().replace(/[^0-9.]/g, '')) : Number(jQuery('.mini-cart-subtotals .value').text().replace(/[^0-9.]/g, ''));\n\t} else {\n\t\treturn bouncex.website.pts === 'cart' || bouncex.website.pts === 'checkout'? Number(jQuery('#itemsubtotalamt').text().replace(/[^0-9.]/g, '')) : Number(jQuery('.subtotal:first').text().replace(/[^0-9.]/g, ''));\n\t}\n})();","trigger":"pageload"},{"name":"cart_qty","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function(){\n\tvar newSite = jQuery('meta[name=\"format-detection\"]').length > 0;\n\tif (newSite) {\n\t\tif (jQuery('.minicart-quantity').length > 0) {\n\t\t\treturn Number(jQuery('.minicart-quantity').text().replace(/[^0-9.]/g, ''));\n } else {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\treturn Number(jQuery('.btn-your-cart .item-count:visible').text());\n }\n})();","trigger":"pageload"},{"name":"on_product_page","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product';","trigger":"pageload"},{"name":"category_page","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'category';","trigger":"pageload"},{"name":"on_pro_site","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var proSite = dataLayer && dataLayer[0] && dataLayer[0].customerType && dataLayer[0].customerType.toLowerCase().indexOf('pro') > -1 || jQuery('.cl-top-band--pro:visible').length > 0;\n if(proSite){\n return true;\n }\n return false;\n})();","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"customer_type_tracked","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"sku","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#pid').length && jQuery('#pid').val() || null;","trigger":"pageload"},{"name":"prev_sku","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"variant_selected","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('button#add-to-cart').length && !jQuery('button#add-to-cart').hasClass('add-to-cart-btn--inactive');","trigger":"pageload"},{"name":"submitted_email_this_visit","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"customer_service_center","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(bouncex.utils.gtmLookup('sessionType') || '') === 'CUSTOMERSERVICECENTER';","trigger":"pageload"}],"dgu":"pixel.cdnwidget.com","dgp":false,"ba":{"enabled":0,"fbte":0},"biu":"assets.bounceexchange.com","bau":"api.bounceexchange.com","beu":"events.bouncex.net","ibx":{"tjs":"","cjs":"","miw":1,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"bxid":"espemailid"},"cus":"","miw_exclude":"#dwfrm_emailproduct_recipientemail, #dwfrm_emailproduct_recipientname, #dwfrm_wishlist_sendemail_recipientEmail, #dwfrm_wishlist_sendemail_recipientName","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"var segments = {\n /* PROPERTIES */\n testMode: false,\n interceptEnabled: true,\n mirrorEnabled: false,\n dlWatcherEnabled: true,\n /* METHODS */\n /* Intercept Events */\n useIntercept: function () {\n if (this.interceptEnabled) {\n bouncex.utils.shqInterceptEvent = {\n 'cartAdd': true,\n 'purchase': function (wkData) { // use as needed\n var oid = bouncex.utils.getNestedProp('obj.order_id', null, wkData) || 'no-orderid-' + Math.floor(Math.random() * 100000000);\n _shq.push(['pageView',\n {\n 'pageType': 'purchase',\n 'orderId': oid,\n 'usebasket': true\n }\n ]);\n },\n };\n }\n },\n /* Mirror Events */\n useMirror: function () {\n if (this.mirrorEnabled) {\n bouncex.utils.shqMirrorEvent = {\n };\n }\n },\n dlFuncs: function (e) {\n // Write handle methods here:\n //PDP\n if (e.event && e.event === \"ecomCheckout\" && window.pageContext.type === \"Cart\") {\n var cart = bouncex.utils.getNestedProp('ecommerce.checkout.products', [], e),\n items = [],\n cartTotal = bouncex.utils.getNestedProp('ecommerce.cartTotal', 0, e);\n cart.forEach(function (i) {\n var ProductId = i && i.id ? i.id : null,\n UnitPrice = i && i.price ? (+i.price).toFixed(2) : null,\n Quantity = i && i.quantity ? +i.quantity : null;\n if (!!ProductId && !!UnitPrice && !!UnitPrice) {\n items.push({ ProductId, UnitPrice, Quantity });\n }\n })\n if (items.length > 0) {\n _shq.push([\n \"onCartView\",\n {\n Items: items,\n Total: cartTotal,\n },\n ]);\n } else if (items.length === 0 && cart.length === 0) {\n _shq.push(['onCartEmpty']);\n } else {\n _shq.log('Cart has products, but products could not be added', 'warn', cart);\n }\n }\n if (e.event && e.event === \"ecomAdd\") {\n var cart = bouncex.utils.getNestedProp('ecommerce.add.products', [], e),\n items = [];\n cart.forEach(function (i) {\n var ProductId = i.id,\n UnitPrice = (+i.price).toFixed(2),\n Quantity = +i.quantity;\n items.push({ ProductId, UnitPrice, Quantity });\n })\n if (items.length > 0) {\n _shq.push(['onCartAdd', {\n \"Items\": items\n }]);\n } else {\n _shq.log('No items to add to cart', 'warn', cart);\n }\n }\n },\n useDLWatcher: function () {\n if (!!this.dlWatcherEnabled) {\n window.bouncex.et.onTrue(function () {\n return window.bouncex.utils.getNestedProp('window._shq.loaded') && !!window.dataLayer && !!bouncex.et.setInterval;\n }, function () {\n // instantiate DataLayerHandler Object\n var dlWatcher = new _shq.DataLayerHandler(window.dataLayer);\n // invoke watch method\n dlWatcher.watch(function (e) {\n segments.dlFuncs(e);\n }, {});\n });\n }\n },\n /* Initialize Segments Tracking */\n init: function () {\n // test mode\n if (this.testMode && !bouncex.testmode.bxdev) return;\n // attach object to window & bouncex.utils\n if (window.bouncex.utils) bouncex.utils.segments = this;\n\n // initialize intercept and mirror, comment out if not needed\n this.useIntercept();\n this.useMirror();\n }\n}\n\nsegments.init();\n\n//To use dlFuncs call this in Event Tracking\n//bouncex.utils.segments.useDLWatcher();","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Hit 'Send' to sign-up for automated, recurring Capitol Lighting mktg txts (like cart reminders) to this #, per terms.","eventSharing":true,"shqId":"i2wbb3f0yz-1","enabled":1},"pde":true,"fmc":["US","CA"],"fme":true,"fmx":"#dwfrm_emailproduct_recipientemail, #dwfrm_emailproduct_recipientname, #dwfrm_wishlist_sendemail_recipientEmail, #dwfrm_wishlist_sendemail_recipientName","sdk":{"android":{"enabled":false,"enabledVersions":[],"eventModifications":null},"ios":{"enabled":false,"enabledVersions":[],"eventModifications":null}},"onsite":{"enabled":1},"ads":{"enabled":0},"pubs":{"enabled":0},"websdk":{"enabled":0},"ga4_property_id":"270799403","ga4_measurement_id":"G-RGC5M6PSSG","tag_state_domain":"api.bounceexchange.com"} ; bouncex.tag = 'tag3'; bouncex.$ = window.jQuery; bouncex.env = 'production'; bouncex.restrictedTlds = {"casl":{"ca":1},"gdpr":{"ad":1,"al":1,"at":1,"ax":1,"ba":1,"be":1,"bg":1,"by":1,"xn--90ais":1,"ch":1,"cy":1,"cz":1,"de":1,"dk":1,"ee":1,"es":1,"eu":1,"fi":1,"fo":1,"fr":1,"uk":1,"gb":1,"gg":1,"gi":1,"gr":1,"hr":1,"hu":1,"ie":1,"im":1,"is":1,"it":1,"je":1,"li":1,"lt":1,"lu":1,"lv":1,"mc":1,"md":1,"me":1,"mk":1,"xn--d1al":1,"mt":1,"nl":1,"no":1,"pl":1,"pt":1,"ro":1,"rs":1,"xn--90a3ac":1,"ru":1,"su":1,"xn--p1ai":1,"se":1,"si":1,"sj":1,"sk":1,"sm":1,"ua":1,"xn--j1amh":1,"va":1,"tr":1}}; bouncex.client = { supportsBrotli: 1 }; bouncex.assets = {"ads":"07d5b82cf97935025a59bf55f6552b1c","creativesBaseStyles":"a53944a2","gpsAuction":"0aafcb326e2e52aae2936349578031e7","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"437a9f1c542faaacb49577b266dc4d73"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_6459738026535cda4232dc813c61447d.br.js'); runtime.setAttribute('async', 'async'); runtime.setAttribute('onload', 'bouncex.initializeTag()'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_efcf4183cfe60de21aa43976b713ebd6.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_3a843477d8e318f67237a66d0a58c542.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } window._shq = window._shq || []; var eventSharingCartridge = document.createElement('script'); eventSharingCartridge.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/wknd_audiences_2648fa8509e4b3a98a2790bb8171ddc1.js'); eventSharingCartridge.setAttribute('async', 'async'); document.body.appendChild(eventSharingCartridge); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();