(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":1389,"name":"Nutrisystem","cookie_name":"bounceClientVisit1389","domain":"nutrisystem.com","ct":"bind_to_domain","ally":1,"ei":1,"tcjs":"","cjs":"/*https://www.wrike.com/open.htm?id=154028565 https://www.wrike.com/open.htm?id=182987598*/\nvar bxGa = bouncex.report_ga;\nbouncex.report_ga = function(action, label, bypass) {\n var hostname = window.top.location.hostname;\n var leafGaAccount = hostname === 'leaf.nutrisystem.com' || hostname === 'numiapp.leaf.nutrisystem.com' || hostname === 'leafapp.leaf.nutrisystem.com';\n if (leafGaAccount) {\n bouncex.website.gai = 'UA-59336681-5';\n }\n bxGa(action, label, bypass);\n};\n\n\n/* 8-1-16: Autopopulating input fields when information is stored post-submit */\nif (bouncex.cookie.es && getBounceCookie('bxEmail')) {\n if (window.location.href.indexOf('nutrisystem.com/jsps_hmr/home/index.js') > -1){\n jQuery('input[name=height]').val(getBounceCookie('bxFeet'));\n jQuery('input[name=inches]').val(getBounceCookie('bxInch'));\n jQuery('input[name=weight]').val(getBounceCookie('bxWeight'));\n jQuery('input[name=email]').val(getBounceCookie('bxEmail'));\n }\n if (window.location.href.indexOf('nutrisystem.com/checkout/shipping.jsp') > -1){\n if(getBounceCookie('bxFeet')){\n jQuery('#height-in-feet').val(getBounceCookie('bxFeet'));\n }\n if(getBounceCookie('bxInch')){\n jQuery('#height-in-inches').val(getBounceCookie('bxInch'));\n }\n if(getBounceCookie('bxWeight')){\n jQuery('#current-weight').val(getBounceCookie('bxWeight'));\n }\n if(getBounceCookie('bxEmail')){\n jQuery('#email_address_persist, #email_address').val(getBounceCookie('bxEmail'));\n }\n }\n if (window.location.href.indexOf('/jsps_hmr/questionnaire/find-my-plan.jsp') > -1){\n if (getBounceCookie('bxEmail')) {\n jQuery('input[name=\"email\"], #email_address_persist, input[id=email2]').val(getBounceCookie('bxEmail'));\n }\n if (getBounceCookie('bxFeet') && getBounceCookie('bxInch') && getBounceCookie('bxWeight')) {\n jQuery('input[name=\"height\"], input[name=\"heightInFeet\"], #height-in-feet').val(getBounceCookie('bxFeet'));\n jQuery('input[name=\"inches\"], input[name=\"heightInInches\"], #height-in-inches').val(getBounceCookie('bxInch'));\n jQuery('input[name=\"weight\"], input[name=\"currentWeight\"], #current-weight').val(getBounceCookie('bxWeight'));\n }\n }\n try { jQuery('#'+getBounceCookie('bx_gender')).prop('checked', true); } catch(e) { }\n if (getBounceCookie('bx_month') && getBounceCookie('bx_day') && getBounceCookie('bx_year')) {\n var bdayString = getBounceCookie('bx_month') + '/' + getBounceCookie('bx_day') + '/' + getBounceCookie('bx_year');\n jQuery('#bDay').val(bdayString);\n }\n}\n\n// Corresponds with custom meal campaigns\nbouncex.clearMeals = function(){\n var checkForButton = setInterval(function(){\n if(jQuery('.current').length>0 && jQuery('.current').siblings('div:eq(0)').find('.clear-meal:first').length){\n jQuery('.current').siblings('div:eq(0)').find('.clear-meal:first').click();\n clearInterval(checkForButton);\n }\n }, 250);\n};\n\n\n//KK altered ISR boilerplate to track both product views (standard) and items in cart (non-standard)\n\n(function () {\n\twindow.bouncex = window.bouncex || {};\n\n\twindow.bouncex.bxISR = {\n\t\t/* --- INITIALIZATION --- */\n\t\tversion: 'Version 8.0 | 12/15/16',\n\t\tstartTime: Date.now(),\n\t\tsettings: {\n\t\t\tcurrentProduct: {},\n\t\t\tgeneral: {\n\t\t\t\tproductPageIdentifier: (jQuery('[itemprop = \"audience\"]').attr('content') == '#PRODUCTFILTER#' || jQuery('meta[property=\"og:type\"]').prop('content') == 'product'),\n\t\t\t\tmaxProducts: 20,\n\t\t\t\tcategoryHistory: JSON.parse(window.localStorage.getItem('bxCatHist')) || [],\n\t\t\t\tproductHistory: JSON.parse(window.localStorage.getItem('bxProdHist')) || [],\n\t\t\t\tcartHistory: JSON.parse(window.localStorage.getItem('bxCartHist')) || [],\n\t\t\t\tcategoryHistoryLength: 0,\n\t\t\t\tproductHistoryLength: 0,\n\t\t\t\tcartHistoryLength: 0,\n\t\t\t}\n\t\t},\n\n\t\tinit: function () {\n\t\t\tif ( this.settings.general.productPageIdentifier ) {\n\t\t\t\tthis.productMap();\n\t\t\t\tthis.setItemHistoryLengths();\n\t\t\t\tthis.trackProductHistory('product', 'bxProdHist');\n\t\t\t\tthis.trackCategoryHistory();\n\t\t\t\tthis.maxProducts();\n\t\t\t}\n\t\t\t//console.log(Date.now() - window.bouncex.bxISR.startTime, 'bxISR start');\n\t\t\tif ( window.location.pathname.indexOf('shop-a-la-carte') > -1 && jQuery('.product-detail').length ) {\n\t\t\t\tthis.trackProductPage();\n\t\t\t} else if ( window.location.pathname.indexOf('a-la-carte') > -1 && jQuery('.container.a-la-cart').length ) {\n\t\t\t\tthis.trackCategoryPage();\n\t\t\t} else if ( window.location.pathname.indexOf('cart/index') > -1 ) {\n\t\t\t\tthis.trackCartPage();\n\t\t\t}\n\t\t},\n\n // DV: Updated name and description selectors\n\t\tproductMap: function () {\n\t\t\tvar aLaCarte = jQuery('.a-la-carte-nav');\n\t\t\tvar categoryName;\n\n\t\t\tif(aLaCarte.length){\n\t\t\t\tcategoryName = 'A la Carte';\n\t\t\t}\n\n\t\t\tvar productValues = {\n\t\t\t\turl: (window.location.href),\n\t\t\t\tname: (jQuery('.product-feature h1[itemprop=\"name\"]').text().trim()),\n\t\t\t\tsku: (jQuery('input[name=\"/atg/commerce/order/purchase/CartModifierFormHandler.productIds\"]').val()),\n\t\t\t\tcategory: [{ categoryName: (categoryName), categoryUrl: (jQuery('#footer-links-my-account > li:eq(2) > a').attr('href')) }],\n\t\t\t\tdescription: (jQuery('.product-details table').text().trim()),\n\t\t\t\tprice: (jQuery('.quantity-price > .row > .col-xs-6.price-savings.col-xs-pull-6.col-sm-pull-0 > .price > strong').text()),\n\t\t\t\tmainImgUrl: (jQuery('meta[itemprop = \"image\"]').attr('content')),\n\t\t\t\ttimeStamp: Date.now(),\n\t\t\t\tviewCount: 1,\n\t\t\t\tsessionId: window.bouncex.cookie.vid\n\t\t\t};\n\n\t\t\tthis.settings.currentProduct = productValues;\n\t\t},\n\n\t\ttrackProductPage: function () {\n\t\t\tvar self = this;\n\t\t\tjQuery('#addToCart').on('submit.bxcart', function(){\n\t\t\t\tif ( !bouncex.vars.items_in_cart_new ) {\n\t\t\t\t\tdelete localStorage.bxCartHist;\n\t\t\t\t\tself.settings.general.cartHistory = [];\n\t\t\t\t}\n\t\t\t\tvar productValues = {\n\t\t\t\t\turl: window.location.href.split(/#|\\?/)[0],\n\t\t\t\t\tname: jQuery('.product-info:visible h1').text().trim(),\n\t\t\t\t\tsku: window.location.href.split('shop-a-la-carte/')[1].split('/')[0],\n\t\t\t\t\tprice: jQuery('.price').text().replace(/[^0-9\\.]/g,''),\n\t\t\t\t\tmainImgUrl: jQuery('#product-carousel img:eq(0)').attr('src'),\n\t\t\t\t\ttimeStamp: Date.now(),\n\t\t\t\t\tsessionId: window.bouncex.cookie.vid\n\t\t\t\t};\n\n\t\t\t\tself.settings.currentProduct = productValues;\n\t\t\t\tself.setItemHistoryLengths();\n\t\t\t\tself.trackProductHistory('cart', 'bxCartHist');\n\t\t\t});\n\t\t},\n\n\t\ttrackCategoryPage: function () {\n\t\t\tvar self = this;\n\t\t\tjQuery(document).on('ajaxComplete.bxcart', function(e,xhr,settings){\n\t\t\t\tif ( xhr.status == 200 && settings.url.indexOf('addToCart') > -1 ) {\n\t\t\t\t\tif ( !bouncex.vars.items_in_cart_new ) {\n\t\t\t\t\t\tdelete localStorage.bxCartHist;\n\t\t\t\t\t\tself.settings.general.cartHistory = [];\n\t\t\t\t\t}\n\t\t\t\t\tvar prodId = JSON.parse(xhr.responseText).productId,\n\t\t\t\t\t\t$item = jQuery('#' + prodId);\n\t\t\t\t\tif ( $item.length ) {\n\t\t\t\t\t\tvar productValues = {\n\t\t\t\t\t\t\turl: window.location.protocol +'//' +window.location.host + $item.find('.product-info a').attr('href'),\n\t\t\t\t\t\t\tname: $item.find('.product-info a').text().trim(),\n\t\t\t\t\t\t\tsku: prodId,\n\t\t\t\t\t\t\tprice: $item.find('.product-price').text().replace(/[^0-9\\.]/g,''),\n\t\t\t\t\t\t\tmainImgUrl: $item.find('.product-image img').attr('src'),\n\t\t\t\t\t\t\ttimeStamp: Date.now(),\n\t\t\t\t\t\t\tsessionId: window.bouncex.cookie.vid\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tself.settings.currentProduct = productValues;\n\t\t\t\t\t\tself.setItemHistoryLengths();\n\t\t\t\t\t\tself.trackProductHistory('cart', 'bxCartHist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\ttrackCartPage: function () {\n\t\t\tvar self = this;\n\t\t\tdelete localStorage.bxCartHist;\n\t\t\tself.settings.general.cartHistory = [];\n\t\t\tjQuery('.cart-item').each(function(){\n\t\t\t\tvar $item = jQuery(this);\n\t\t\t\tvar productValues = {\n\t\t\t\t\turl: false,\n\t\t\t\t\tname: $item.find('h3').text().trim(),\n\t\t\t\t\tsku: $item.find('h3 a').attr('href').match(/prodId=(\\d+)/)[1],\n\t\t\t\t\tprice: $item.find('.ala-carte-price').text().replace(/[^0-9\\.]/g,''),\n\t\t\t\t\tmainImgUrl: $item.find('.img-responsive').attr('src'),\n\t\t\t\t\ttimeStamp: Date.now(),\n\t\t\t\t\tsessionId: window.bouncex.cookie.vid\n\t\t\t\t};\n\t\t\t\tself.settings.currentProduct = productValues;\n\t\t\t\tself.setItemHistoryLengths();\n\t\t\t\tself.trackProductHistory('cart', 'bxCartHist');\n\t\t\t});\n\t\t},\n\n\t\t/* --- END OF INITIALIZATION --- */\n\t\t/* --- HELPER FUNCTIONS --- */\n\n\t\taddProductToHistory: function (product, type, ls) {\n\t\t\tvar productHistory = this.settings.general[type + 'History'];\n\t\t\tproductHistory.unshift(product);\n\t\t\tthis.setProductHistory(productHistory, type, ls);\n\t\t},\n\n\t\taddCategoryToHistory: function (currentCategory) {\n\t\t\tvar categoryHistory = this.settings.general.categoryHistory;\n\t\t\tvar newCategory = {\n\t\t\t\tcategory: currentCategory,\n\t\t\t\tviewCount: 1,\n\t\t\t\ttimeStamp: Date.now()\n\t\t\t};\n\n\t\t\tcategoryHistory.unshift(newCategory);\n\t\t\twindow.bouncex.bxISR.setCategoryHistory(categoryHistory);\n\t\t},\n\n\t\tcompareProducts: function (productA, productB) {\n\t\t\tif (productA.mainImgUrl === productB.mainImgUrl) { return true; }\n\t\t\tif (productA.sku === productB.sku) { return true; }\n\t\t\tif (productA.name === productB.name) { return true; }\n\t\t\t//KK removed for cart tracking: if (productA.url === productB.url) { return true; }\n\t\t\treturn false;\n\t\t},\n\n\t\ttrackProductHistory: function (type,ls) {\n\t\t\tvar productHistory = this.settings.general[type + 'History'];\n\t\t\tif (this.settings.general[type + 'HistoryLength'] > 0) {\n\t\t\t\tvar historyUpdated = false;\n\n\t\t\t\tfor (var i = 0; i < this.settings.general[type + 'HistoryLength']; i++) {\n\t\t\t\t\tif (this.compareProducts(productHistory[i], this.settings.currentProduct)) {\n\t\t\t\t\t\tproductHistory[i].viewCount++;\n\t\t\t\t\t\tproductHistory[i].timeStamp = Date.now();\n\t\t\t\t\t\tproductHistory.unshift(productHistory[i]);\n\n\t\t\t\t\t\tproductHistory.splice(i + 1, 1);\n\t\t\t\t\t\thistoryUpdated = true;\n\t\t\t\t\t\tthis.setProductHistory(productHistory,type,ls);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!historyUpdated) {\n\t\t\t\t\tthis.addProductToHistory(this.settings.currentProduct,type,ls);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.addProductToHistory(this.settings.currentProduct,type,ls);\n\t\t\t}\n\t\t},\n\n\t\ttrackCategoryHistory: function () {\n\t\t\tvar categoryHistory = this.settings.general.categoryHistory;\n\n\t\t\tvar currentCategoriesLength = this.settings.currentProduct.category.length;\n\t\t\tfor (var i = 0; i < currentCategoriesLength; i++) {\n\t\t\t\tvar currentCategory = this.settings.currentProduct.category[i];\n\n\t\t\t\tif (this.settings.general.categoryHistoryLength > 0) {\n\t\t\t\t\tvar historyUpdated = false;\n\t\t\t\t\tfor (var j = 0; j < this.settings.general.categoryHistoryLength; j++) {\n\t\t\t\t\t\tif (categoryHistory[j].category.categoryName === currentCategory.categoryName) {\n\t\t\t\t\t\t\tcategoryHistory[j].viewCount++;\n\t\t\t\t\t\t\tcategoryHistory[j].timeStamp = Date.now();\n\t\t\t\t\t\t\thistoryUpdated = true;\n\t\t\t\t\t\t\tthis.setCategoryHistory(categoryHistory);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!historyUpdated) {\n\t\t\t\t\t\tthis.addCategoryToHistory(currentCategory);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.addCategoryToHistory(currentCategory);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/* --- END OF HELPER FUNCTIONS --- */\n\t\t/* --- GETTER FUNCTIONS --- */\n\n\t\tgetTopCategories: function (criteria, number) {\n\t\t\tvar categories = this.settings.general.categoryHistory;\n\t\t\tif (!number) { number = categories.length; }\n\n\t\t\tif (criteria === 'views') {\n\t\t\t\treturn categories.sort(function (a, b) { return b.viewCount - a.viewCount; }).slice(0, number);\n\t\t\t} else if (criteria === 'time') {\n\t\t\t\treturn categories.sort(function (a, b) { return b.timeStamp - a.timeStamp; }).slice(0, number);\n\t\t\t} else if (criteria === 'recency') {\n\t\t\t\treturn categories.sort(function (a, b) { return b.viewCount - a.viewCount; }).slice(0, number).sort(function (c, d) { return d.timeStamp - c.timeStamp; });\n\t\t\t}\n\t\t},\n\n\t\tgetTopProducts: function (criteria, number, type, showCurrentProd) {\n\t\t if (typeof showCurrentProd === 'undefined') {\n\t\t showCurrentProd = true;\n\t\t }\n\t\t\tif (!type) { type = 'product'; }\n var products = this.settings.general[type + 'History'];\n\t\t\tif (!number) { number = products.length; }\n// \t\t\tif (!showCurrentProd) { number++; }\n\t\t\tif (criteria === 'views') {\n\t\t\t\treturn products.sort(function (a, b) { return b.viewCount - a.viewCount; }).slice(0, number);\n\t\t\t} else if (criteria === 'time') {\n\t\t\t // DV: Exclude most recently viewed product\n\t\t\t var startIndex = showCurrentProd ? 0 : 1;\n\t\t\t var endIndex = showCurrentProd ? number : number + 1;\n\t\t\t\treturn products.sort(function (a, b) { return b.timeStamp - a.timeStamp; }).slice(startIndex, endIndex);\n\t\t\t} else if (criteria === 'recency') {\n\t\t\t\treturn products.sort(function (a, b) { return b.viewCount - a.viewCount; }).slice(0, number).sort(function (c, d) { return d.timeStamp - c.timeStamp; });\n\t\t\t}\n\t\t},\n\n\t\tmaxProducts: function () {\n\t\t\tvar maxProducts = this.settings.general.maxProducts;\n\t\t\tif (this.settings.general.productHistoryLength > maxProducts) {\n\t\t\t\tvar topProducts = this.getTopProducts('time', maxProducts);\n\t\t\t\tthis.setProductHistory(topProducts, 'product', 'bxProdHist');\n\t\t\t}\n\t\t},\n\n\t\t/* --- END GETTER FUNCTIONS --- */\n\t\t/* --- SETTER FUNCTIONS --- */\n\n\t\tsetItemHistoryLengths: function () {\n\t\t\tthis.settings.general.categoryHistoryLength = this.settings.general.categoryHistory.length;\n\t\t\tthis.settings.general.productHistoryLength = this.settings.general.productHistory.length;\n\t\t\tthis.settings.general.cartHistoryLength = this.settings.general.cartHistory.length;\n\t\t},\n\n\t\tsetProductHistory: function (productHistory, type, ls) {\n\t\t\twindow.localStorage.setItem(ls, JSON.stringify(productHistory));\n\t\t\tthis.settings.general[type + 'History'] = productHistory;\n\t\t\tthis.settings.general[type + 'HistoryLength'] = productHistory.length;\n\t\t},\n\n\t\tsetCategoryHistory: function (categoryHistory) {\n\t\t\twindow.localStorage.setItem('bxCatHist', JSON.stringify(categoryHistory));\n\t\t\tthis.settings.general.categoryHistory = categoryHistory;\n\t\t\tthis.settings.general.categoryHistoryLength = categoryHistory.length;\n\t\t},\n\n\t\t/* --- END SETTER FUNCTIONS --- */\n\t\t/* --- CAMPAIGN TEMPLATING --- */\n\n // DV: Updated hoverTitle selector\n\t\tpopulateCampaignProductsV2: function (params, type) {\n\t\t\tif (!params || !params.campaignId || !params.numberProducts) { return false; }\n\t\t\tif (!params.sortBy) { params.sortBy = 'time'; }\n\t\t\tif (!params.productAction) { params.productAction = 'link'; }\n\t\t\tif (!params.linkAction) { params.linkAction = 'new'; }\n\n\t\t\tvar campaign = jQuery('#bx-campaign-' + params.campaignId);\n\t\t\tvar campaignProductArray = [];\n\n\t\t\tcampaignProductElements = {};\n\t\t\tjQuery.each(params.campaignSteps, function (x, y) {\n\n\t\t\t\tcampaignStepProductElements = [];\n\t\t\t\tfor ( var i = 0; i < params.numberProducts; i++ ) {\n\t\t\t\t\tvar campaignStepProductObject = {};\n\t\t\t\t\tif (y.productImages) {\n\t\t\t\t\t\tcampaignStepProductObject.img = campaign.find('#bx-form-' + params.campaignId + '-step-' + y.stepNumber + ' .bx-lineshape:eq(' + i +')');\n\t\t\t\t\t}\n\t\t\t\t\tif (y.productLinkElems) {\n\t\t\t\t\t\tcampaignStepProductObject.link = campaign.find('#bx-form-' + params.campaignId + '-step-' + y.stepNumber + ' .bx-group.bx-group-custom:eq('+i+')');\n\t\t\t\t\t\t// campaignStepProductObject.link = campaign.find('#bx-form-' + params.campaignId + '-step-' + y.stepNumber + ' .bx-group:eq('+i+')');\n\n\t\t\t\t\t}\n\t\t\t\t\tif (y.productHoverStates) {\n\t\t\t\t\t\tcampaignStepProductObject.hoverTitle = campaign.find('#bx-form-' + params.campaignId + '-step-' + y.stepNumber + ' .bx-group .bx-row-text-default:eq(' + i +')').find('div');\n\t\t\t\t\t}\n\n\n\t\t\t\tcampaignStepProductObject.price = campaign.find('#bx-form-' + params.campaignId + '-step-' + y.stepNumber + ' .bx-group .bx-row-line-custom:eq(' + i +')').siblings('.bx-row-text:eq(1)').find('div');\n\n\t\t\t\t\tcampaignStepProductElements.push(campaignStepProductObject);\n\n\t\t\t\t}\n\n\t\t\t\tcampaignProductElements['step-' +x] = campaignStepProductElements;\n\t\t\t});\n\n\t\t\tvar productArray = window.bouncex.bxISR.getTopProducts(params.sortBy, params.numberProducts, type, params.showCurrentProd);\n\n\t\t\tvar self = this;\n\t\t\tjQuery.each(campaignProductElements, function (x, y) {\n\t\t\t\tvar productAction = function () {};\n\n\t\t\t\tfor ( var i = 0; i < y.length; i++ ) {\n\t\t\t\t\tif (params.campaignSteps[(x.split('-')[1])].productsLink) {\n\t\t\t\t\t\tvar productLink = (productArray[i].url.indexOf('http') > -1) ? productArray[i].url : window.top.location.origin + productArray[i].url;\n\t\t\t\t\t\tproductAction = self.makeProductAction(productLink, params);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y[i].img) {\n\t\t\t\t\t\tvar imgSrc = productArray[i].mainImgUrl,\n\t\t\t\t\t\t\tproductImageElem = jQuery(y[i].img);\n\n\t\t\t\t\t\tproductImageElem.css('background-image', 'url(' + imgSrc + ')').addClass('isr-image isr' + x + '').bind('click.bx_' + params.campaignId + '_isr_' + i, productAction);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y[i].link) {\n\t\t\t\t\t\tvar prodLink = (productArray[i].url.indexOf('http') > -1) ? productArray[i].url : window.top.location.origin + productArray[i].url,\n\t\t\t\t\t\t\tproductLinkElem = jQuery(y[i].link);\n\n\t\t\t\t\t\tproductLinkElem.attr('bx-href', prodLink).bind('click.bx_' + params.campaignId + '_isr_' + i, productAction);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y[i].hoverTitle) {\n\t\t\t\t\t\tvar productTitle = productArray[i].name,\n\t\t\t\t\t\t\tproductHoverTitleElem = jQuery(y[i].hoverTitle);\n\n\t\t\t\t\t\tproductHoverTitleElem.text(productTitle).bind('click.bx_' + params.campaignId + '_isr_' + i, productAction);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (y[i].price) {\n\t\t\t\t\t\tvar productPrice = productArray[i].price,\n\t\t\t\t\t\t\tproductPriceElem = jQuery(y[i].price);\n\n\t\t\t\t\t\t\tproductPriceElem.text(productPrice);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tmakeProductAction: function (productLink, campaignParams) {\n\t\t\tvar productAction = function () {};\n\n\t\t\t\tif (campaignParams.productAction === 'link') {\n\t\t\t\t\tif (campaignParams.linkAction === 'new') {\n\t\t\t\t\t\tif (campaignParams.reportClicks) {\n\t\t\t\t\t\t\tproductAction = function () {\n\t\t\t\t\t\t\t\twindow.bouncex.report(campaignParams.campaignId, 'click');\n\t\t\t\t\t\t\t\t// setTimeout(function() {\n\t\t\t\t\t\t\t\t\twindow.top.open(productLink);\n\t\t\t\t\t\t\t\t// }, 100);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tproductAction = function () {\n\t\t\t\t\t\t\t\twindow.top.open(productLink);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (campaignParams.linkAction === 'current') {\n\t\t\t\t\t\tif (campaignParams.reportClicks) {\n\t\t\t\t\t\t\tproductAction = function () {\n\t\t\t\t\t\t\t\twindow.bouncex.report(campaignParams.campaignId, 'click');\n\t\t\t\t\t\t\t\t// setTimeout(function() {\n\t\t\t\t\t\t\t\t\twindow.top.location.replace(productLink);\n\t\t\t\t\t\t\t\t// }, 100);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tproductAction = function () {\n\t\t\t\t\t\t\t\twindow.top.location.replace(productLink);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\treturn productAction;\n\t\t}\n\t};\n\n\twindow.bouncex.bxISR.init();\n})();\n","force_https":false,"waypoints":false,"content_width":0,"gai":"UA-59336681-1","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":0,"gmp":0,"whitelist_check":0},"burls":[{"prop":"contains","val":"landingpages/product_addition.jsp?"},{"prop":"contains","val":"alacarte"},{"prop":"contains","val":"landingpages/templates/multi-product-cart.jsp"},{"prop":"contains","val":"landingpages/bmi-landing.jsp"},{"prop":"contains","val":" page=greatcareers"},{"prop":"contains","val":"http://nutrisystem.staging.wpengine.com"}],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* ---------------------------- SHARED VARIABLES ---------------------------- */\n\nvar CLEAN_URL = bouncex.utils.url.allowParams();\n\n/* --------------------------------- HELPERS -------------------------------- */\n\nfunction slugify(text) {\n return text.toLowerCase()\n // replace whitespace, dash sequences and underscores with a single dash\n .replace(/\\s+|--+|_/g, '-')\n // replace any non alphanumeric characters with an empty string\n .replace(/[^\\w\\-_]/g, '');\n}\n\nfunction getImgUrl() {\n var divBasedBackgroundSrc = (jQuery('.hero-img-dt, .unl-var div').css('background-image') || '').slice(5, -2),\n heroImgSrc = jQuery('img.hero-img').attr('src') || '',\n toolsImgSrc = jQuery('section.tools img').attr('src') || '';\n\n return divBasedBackgroundSrc || heroImgSrc || toolsImgSrc;\n}\n\nfunction formatCopy(copy) {\n return copy.replace(/\\s+/g, ' ').replace('*', '').trim();\n}\n\nfunction getProductCopy() {\n var title = jQuery('title').text().split('|')[0].trim();\n\n if (window.location.pathname.indexOf('/complete-men') > -1) {\n title = title.replace('Women', 'Men');\n }\n return formatCopy(title);\n}\n\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction initializeItemEvents() {\n if (isALaCartPage()) { return; }\n var item;\n\n bouncex.et.onTrue(\n function () {\n item = getItem();\n return !!item.id &&\n !!item.copy &&\n !!item.imageurl &&\n !!item.url;\n },\n function () {\n if (item.url.indexOf('gift-card') > -1) {\n return;\n }\n bouncex.push(['view item', { 'item:id': item.id }]);\n bouncex.push(['item', item]);\n initializeATCClickTracking(item.id);\n },\n 10\n );\n}\nfunction getItem() {\n return {\n id: getItemId(CLEAN_URL),\n copy: getProductCopy(),\n imageurl : jQuery('.showcase-img picture img').first().attr('src') || getImgUrl(),\n url: CLEAN_URL,\n instock: true,\n prehead : formatCopy(jQuery('.lead-in, #product-pane h1').first().text()),\n subhead : formatCopy(jQuery('h1 + h2').first().text()),\n category: jQuery('.breadcrumb .prev a').eq(1).text().trim() || \"Global\"\n };\n}\n\n/* ---------------------------- CATEGORY TRACKING --------------------------- */\n\nfunction getItemIdsCat() {\n var ids = [];\n jQuery('.planrows a.card-link:visible').each(function (i, e) {\n\t\tvar id = getItemId(jQuery(e).attr('href'));\n if (id && ids.indexOf(id) < 0) {\n ids.push(id);\n }\n\t});\n\n\treturn ids.join(',');\n}\nfunction getCategoryObject() {\n return {\n 'page:url': CLEAN_URL,\n 'items:ids': getItemIdsCat()\n };\n}\n\nfunction initializeCategoryEvents() {\n if (isALaCartPage()) { return; }\n var categoryObj;\n\n bouncex.et.onTrue(\n function () {\n categoryObj = getCategoryObject();\n return !!categoryObj['items:ids'].length &&\n !!categoryObj['page:url'];\n },\n function () {\n bouncex.push(['view category', categoryObj]);\n },\n 10\n );\n}\n\n/* ------------------------------- CART EVENTS ------------------------------ */\n\nfunction fireAddToCart(id) {\n bouncex.push(['add to cart', { 'item:id': id }]);\n bouncex.setVar('empty_cart_helper', true);\n}\n\nfunction initializeATCClickTracking(id) {\n bouncex.et.on(bouncex.document, 'click.bxatc', function () {\n fireAddToCart(id);\n }, '#submitBtn');\n}\n\nfunction emptyCart() {\n bouncex.et.onVarChange('items_in_cart', function (oldVal, newVal) {\n if (bouncex.vars.empty_cart_helper && newVal === false && oldVal !== false) {\n bouncex.push(['empty_cart']);\n bouncex.setVar('empty_cart_helper', false);\n }\n });\n if(jQuery('.shopping-cart p').text().indexOf('empty') > -1 && bouncex.vars.empty_cart_helper) {\n bouncex.push(['empty_cart']);\n bouncex.setVar('empty_cart_helper', false);\n }\n}\n\nfunction initializeCartEvents() {\n bouncex.et.cart.init({\n replenish: function () { },\n replenishmentType: 'single'\n });\n\n emptyCart();\n}\n\n/* --------------- CUSTOM PROSPECT-CUSTOMER SEGMENTATION -------------------- */\n\nfunction initializeReturningCustomer() {\n if (isReturningCustomer()) {\n if (!bouncex.vars.returning_cust_event) {\n bouncex.push(['is returning customer']);\n bouncex.setv('returning_cust_event', true);\n bouncex.setBounceCookie();\n }\n }\n}\n\nfunction isReturningCustomer() {\n var i = window.dataLayer.filter(function(i) {\n return 'profile' in i;\n });\n if (i.length > 0) {\n return i[0].profile && i[0].profile.userStatus;\n }\n return '';\n}\n\n/* --------------- CUSTOM A LA CART ITEM TRACKING -------------------- */\n\nfunction initializeALaCartTracking() {\n if (isALaCartPage() && bouncex.website.pts === 'product') {\n initializeALCItemEvents();\n }\n if (isALaCartPage() && bouncex.website.pts === 'category') {\n initializeALCCategoryATCEvents();\n }\n\n if (bouncex.website.pts === 'cart' || window.location.pathname.indexOf('/products/frozen') > -1) {\n initializeALCCartEvents();\n }\n}\n\nfunction isALaCartPage() {\n return jQuery('.a-la-carte-nav').length > 0;\n}\n\nfunction initializeALCItemEvents() {\n var item;\n\n bouncex.et.onTrue(\n function () {\n item = getALCItem();\n return !!item.id &&\n !!item.copy &&\n !!item.category &&\n !!item.url &&\n !!item.imageurl;\n },\n function () {\n if (item.url.indexOf('gift-card') > -1) {\n return;\n }\n bouncex.push(['item', item]);\n initializeAlacartATCClickTracking(item.id);\n },\n 10\n );\n}\n\nfunction getALCItem() {\n return {\n id: getItemId(CLEAN_URL),\n copy: jQuery('.product-info .text-capitalize').first().text(),\n category: jQuery('.breadcrumb .prev a').eq(1).text().trim(),\n url: CLEAN_URL,\n imageurl: jQuery('#product-carousel .img-responsive').attr('src'),\n instock: true\n };\n}\n\nfunction getItemId(url) {\n return url.split('/').pop().split('#')[0];\n}\n\n/* --------------- CUSTOM A LA CART CART ABANDONMENT TRACKING -------------------- */\n\nfunction initializeAlacartATCClickTracking(itemId) {\n bouncex.et.on(bouncex.document, 'click.bxatc', function () {\n fireAlcAddToCart(itemId);\n }, '#addtocart,button[id*=sticky_butt]');\n\n bouncex.et.on(jQuery('.product-info button:visible'), 'click.wkndatc', function () {\n fireAlcAddToCart(itemId);\n });\n}\n\nfunction initializeALCCategoryATCEvents() {\n bouncex.et.on(bouncex.document, 'click.bxatc', function (target) {\n var itemId = getAlcIdOnCategory(jQuery(target.target));\n fireAlcAddToCart(itemId);\n }, 'button.add-to-cart, .add-cta');\n}\n\nfunction getAlcIdOnCategory(button) {\n var url = button.parents('#productItem').find('a').attr('href');\n return getItemId(url);\n}\n\nfunction initializeALCCartEvents() {\n bouncex.on(jQuery('#cartbutton, button.add-cta, .glyphicon-plus'), 'click.bxatc', function (target) {\n var itemId = getAlcIdOnCart(jQuery(target.target));\n fireAlcAddToCart(itemId);\n });\n}\n\nfunction getAlcIdOnCart(button) {\n var name = button.parents('.cross-sell-product, .product').find('.product-name a, .title').text();\n return slugify(name);\n}\n\nfunction fireAlcAddToCart(itemId) {\n bouncex.push(['add to cart alc', { 'item:id': itemId }]);\n bouncex.setVar('empty_cart_helper', true);\n}\n\n/* --------------------- CUSTOM ADVANTAGE PLAN ATC TRACKING ----------------- */\n\nfunction initializeAdvantageTracking() {\n if (isAdvantagePlanPage()) {\n initializeAdvantageATCClickTracking();\n fireAdvantageViewItem();\n }\n}\n\nfunction isAdvantagePlanPage() {\n return window.location.pathname.indexOf('/advantage') > -1;\n}\n\nfunction initializeAdvantageATCClickTracking() {\n bouncex.et.on(jQuery('.cta-wrapper button'), 'click.wkndatc', function () {\n fireAdvantageAddToCart();\n });\n}\n\nfunction fireAdvantageAddToCart() {\n bouncex.push(['add to cart advantage', { 'item:id' : 'advantage'}]);\n bouncex.setVar('empty_cart_helper', true);\n}\n\nfunction fireAdvantageViewItem() {\n bouncex.push(['view item', { 'item:id': 'advantage' }]);\n}\n\n/* --------------------------- INITIALIZE TRACKING -------------------------- */\n\nfunction isValidDomain() {\n return CLEAN_URL.indexOf('www.nutrisystem.com') > -1;\n}\n\nfunction isEn() {\n return bouncex.html.attr('lang') === 'en';\n}\n\nfunction isValidForTracking() {\n return isValidDomain() && isEn();\n}\n\nfunction init() {\n if (!isValidForTracking()) {\n return;\n }\n\n initializeCartEvents();\n initializeReturningCustomer();\n initializeALaCartTracking();\n initializeAdvantageTracking();\n\n switch (bouncex.website.pts) {\n case 'category':\n initializeCategoryEvents();\n break;\n case 'product':\n initializeItemEvents();\n break;\n case 'cart':\n initializeATCClickTracking();\n break;\n default:\n break;\n }\n}\n\ninit();","dge":false,"bxidLoadFirst":false,"pie":false,"cme":false,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/cart"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"test."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"di."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"stage."}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.breadcrumb li').length === 2;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/referral"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/how-it-works"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/success-stories"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/menu"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/about/contact"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/profile"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout/"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"test."}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.home').length > 0;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/login"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"numiapp"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/unsubscribe"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/bmi-user"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.breadcrumb li').length === 3;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/menu"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/login"}]]}},"els":{"top_rated_product":"div#image1.item.active img.img-responsive"},"vars":[{"name":"1","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var $brokenButtons = jQuery('.bx-close-x-adaptive-1').find('.bx-close-x-adaptive-2');\n\n for (var i = 0; i < $brokenButtons.length; i++) {\n var closeId = $brokenButtons.eq(i).closest('.bx-close').attr('id');\n jQuery('#' + closeId + ' .bx-close-x-adaptive-2').parent().parent().parent().append(jQuery('#' + closeId+ ' .bx-close-x-adaptive-2'));\n }\n})();","trigger":""},{"name":"items_in_cart","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function() {\n var $miniCart = jQuery('#cart');\n var $cartItems = jQuery('.row.cart-item');\n var $shippingCartItems = jQuery('.order-item-content');\n\n if ($miniCart.length > 0) {\n return parseInt($miniCart.find('.badge').text().trim());\n } else if ($cartItems.length > 0) {\n return $cartItems.length;\n } else if ($shippingCartItems.length > 0) {\n return $shippingCartItems.length;\n }\n})();","trigger":""},{"name":"logged_in","polling":"none","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"!!bouncex.utils.getNestedProp('userDataForGTM');","trigger":""},{"name":"on_cart","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('/cart') > -1;","trigger":""},{"name":"evar18_value","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"window.s && jQuery.trim(window.s.eVar18.replace('#',''));","trigger":""},{"name":"blog_pageviews","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function () {\n if (window.location.host === 'leaf.nutrisystem.com'){\n return bouncex.vars.blog_pageviews + 1;\n }\n else {\n return window.blog_pageviews || null;\n }\n})();","trigger":""},{"name":"plan_in_cart","polling":"none","persist":"permanent","page_types":[],"testmode":true,"default":"false","code":"(function() {\n if (window.location.href.indexOf('nutrisystem.com/checkout/shipping') > -1 || window.location.href.indexOf('nutrisystem.com/cart') > -1) {\n jQuery('a.remove-from-cart:eq(0)').on('click.bx',function(){\n bouncex.setv('plan_in_cart_new',false);\n bouncex.setBounceCookie();\n }); \n var planTypes = {\n 'diabetes basic' : 'diabetes-basic',\n 'diabetes core' : 'diabetes-core',\n 'diabetes uniquely yours' : 'diabetes-uniquelyyours',\n 'basic plan' : 'basic',\n\t\t\t'core plan' : 'core',\n\t\t\t'uniquely yours ultimate' : 'uniquely yours ultimate',\n\t\t\t'uniquely yours plus plan' : 'uniquely yours plus',\n 'uniquely yours' : 'uniquely yours',\n 'vegetarian' : 'vegetarian',\n 'my personalized plan' : 'personalized'\n };\n\n var $currentPlan = jQuery('.plan-table').find('.order-item-content');\n if ($currentPlan) {\n var currentPlanName = $currentPlan.text().trim().toLowerCase();\n \n for (var plan in planTypes) {\n if (currentPlanName.indexOf(plan) > -1) {\n return planTypes[plan];\n }\n } \n return null;\n } else {\n return null;\n }\n } else if (bouncex.vars.items_in_cart === 0){\n\t\treturn false;\n\t}\n})();","trigger":""},{"name":"evar18_value_","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"","code":"window.s && jQuery.trim(window.s.eVar18.replace('#',''));","trigger":""},{"name":"ns_ca_id","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"","code":"bouncex.utils.gtmLookup('profile.campaignId') || bouncex.utils.getNestedProp('nsLayer.profile.campaignId', '');","trigger":""},{"name":"logged_in_new","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"!!bouncex.utils.getNestedProp('userDataForGTM');","trigger":""},{"name":"plan_in_cart_new","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (window.location.href.indexOf('nutrisystem.com/checkout/shipping') > -1 || window.location.href.indexOf('nutrisystem.com/cart') > -1) {\n jQuery('a.remove-from-cart:eq(0)').on('click.bx',function(){\n bouncex.setv('plan_in_cart_new',false);\n bouncex.setBounceCookie();\n }); \n var planTypes = {\n 'diabetes basic' : 'diabetes-basic',\n 'diabetes core' : 'diabetes-core',\n 'diabetes uniquely yours' : 'diabetes-uniquelyyours',\n 'basic plan' : 'basic',\n\t\t\t'core plan' : 'core',\n\t\t\t'complete plan' : 'complete',\n\t\t\t'uniquely yours ultimate' : 'uniquely yours ultimate',\n\t\t\t'uniquely yours plus plan' : 'uniquely yours plus',\n 'uniquely yours' : 'uniquely yours',\n 'vegetarian' : 'vegetarian',\n 'my personalized plan' : 'personalized'\n };\n\n var $currentPlan = jQuery('.plan-table').find('.order-item-content');\n if ($currentPlan) {\n var currentPlanName = $currentPlan.text().trim().toLowerCase();\n \n for (var plan in planTypes) {\n if (currentPlanName.indexOf(plan) > -1) {\n return planTypes[plan];\n }\n } \n return null;\n } else {\n return null;\n }\n } else if (bouncex.vars.items_in_cart === 0){\n\t\treturn false;\n\t}\n})();","trigger":""},{"name":"items_in_cart_new","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var $miniCart = jQuery('#cart');\n var $cartItems = jQuery('.row.cart-item');\n var $shippingCartItems = jQuery('.order-item-content');\n\tvar mgxCartItems = bouncex.utils.getNestedProp('MGX.PageObject.CartItems'),\n emptyCart = jQuery('li#cart span.badge b'),\n url = bouncex.utils.url.allowParams([]);\n \n if (bouncex.website.pts === 'home' && emptyCart.length < 1) {\n return 0;\n }\n\n if ($miniCart.length > 0 && bouncex.website.pts === 'home') {\n var value = $miniCart.find('.badge');\n return value.length > 0 ? Number(value.text().replace(/[^0-9]/g, '')) : null;\n } else if ($miniCart.length > 0) {\n var value = $miniCart.find('.badge:not([style*=\"background-color: rgb(255, 255, 255);\"]):contains(\"items\")');\n return value.length > 0 ? Number(value.text().split('items')[0].replace(/[^0-9.]/g, '')) : null;\n } else if (jQuery('.row p:contains(\"cart is empty\")').is(':visible')) {\n return 0;\n } else if ($cartItems.length > 0) {\n\t\tvar $itemQtyChange = $cartItems.has('.dropdown-change');\n var cartItemTotal = $cartItems.length - $itemQtyChange.length;\n\n return $itemQtyChange.toArray().reduce(function(total,item){\n return total += parseInt(jQuery(item).find('.dropdown-change').val());\n }, cartItemTotal); \n } else if ($shippingCartItems.length > 0) {\n return $shippingCartItems.toArray().reduce(function(total,item){\n if(item.tagName.toLowerCase() === 'div') {\n var count = /nbsp;.*(\\d).*nbsp/.exec(item.innerHTML);\n if(count && count.length > 1) {\n return total += parseInt(count[1]);\n }\n }\n return total += 1;\n }, 0); \n } else if(mgxCartItems) {\n return mgxCartItems.reduce(function(total,item){\n \tif(item.Quantity && item.Quantity === '') {\n \treturn total += 1;\n \t} \n\t\t\treturn total += parseInt(item.Quantity);\n });\n }\n\n\treturn null;\n})();","trigger":""},{"name":"user_status","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var nsLayerStatus = bouncex.utils.getNestedProp('', ' '),\n dataLayerStatus = (bouncex.utils.gtmLookup('profile.userStatus') || '').toLowerCase() || false;\n\n\treturn nsLayerStatus !== ' ' ? nsLayerStatus : dataLayerStatus;\n})();","trigger":""},{"name":"isr_items_tracked","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"bouncex.parseJSON(localStorage.bxProdHist).length;","trigger":""},{"name":"cart","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"","code":"null;","trigger":""},{"name":"ibx_test","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('ibx_test') > -1 || null;","trigger":""},{"name":"email_submitted","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var url = window.location.href,\n pageConfirmation = url.indexOf('health_assessment_signup_results.jsp') > -1 || url.indexOf('signed_up=true') > -1 || !isNaN(parseInt(jQuery('#bmi-results').text())),\n nativeSignup = url.indexOf('/bmi-user') > -1 && !!bouncex.getBounceCookie('attntv_mstore_email');\n\n return pageConfirmation || nativeSignup || null;\n \n})();\n","trigger":""},{"name":"cart_helper","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"alc_cart_total","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"(function(){\n if (bouncex.website.pts === 'checkout') {\n return null;\n }\n if (bouncex.website.pts === 'cart') {\n return Number(jQuery('.subtotal').text().replace(/[^0-9.]/g, ''));\n }\n return Number(jQuery('#cartTotal').text().replace(/[^0-9.]/g, '')) || null;\n})();","trigger":""},{"name":"returning_cust_event","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"updated_alc_cart","polling":"none","persist":"visit","page_types":["home"],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"utm_medium_email","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.getParam('utm_medium').indexOf('email') > -1;","trigger":""},{"name":"campaign_functional_group","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"bouncex.utils.gtmLookup('profile.campaignFunctionalGroup') || null;","trigger":""},{"name":"cart_total","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.gtmLookup('order.currentOrder.total');","trigger":"pageload"},{"name":"empty_cart_helper","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","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":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"","eventSharing":false,"shqId":"","enabled":0},"pde":false,"fmc":["US","CA"],"fme":true,"fmx":"","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":"285689802","ga4_measurement_id":"G-8P38JZ2FMB","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":"f1562c682b41d65d1608e7f2508f6d9b","creativesBaseStyles":"a53944a2","gpsAuction":"da7f2123bbe2e5d4e3b41dcea412be5c","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_57c39fe784f34ae52f7ce1dce5cbc318.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();