(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":1730,"name":"Scully & Scully","cookie_name":"bounceClientVisit1730","domain":"scullyandscully.com","ct":"bind_to_domain","ally":0,"ei":1,"tcjs":"","cjs":"// drop bxID pixel https://www.wrike.com/open.htm?id=288897818\n(function() {\n new Image().src = 'https://data.cdnbasket.net/pixel?apikey=2^HIykD&time=' + Date.now();\n})();\n\n/*\n Dev: David Andersen\n Added: 2-27-18\n Wrike: https://www.wrike.com/open.htm?id=214039613\n*/\nbouncex.sessionStore = (function() {\n\tvar sessionStorageIdentifier = 'bxSessionStore';\n\n\tfunction getSessionStore() {\n\t\tvar encodedStore = sessionStorage.getItem(sessionStorageIdentifier);\n\t\tvar decodedStore = bouncex.lz.decompressFromURI(encodedStore);\n\n\t\treturn decodedStore ? JSON.parse(decodedStore) : {};\n\t}\n\n\tfunction set(entryObj) {\n\t\tvar currentStore = getSessionStore();\n\t\tvar updatedStore = Object.assign(currentStore, entryObj);\n\t\tvar encodedStore = bouncex.lz.compressToURI(JSON.stringify(updatedStore));\n\n\t\ttry {\n\t\t\tsessionStorage.setItem(sessionStorageIdentifier, encodedStore);\n\t\t}\n\t\tcatch (e) {\n\t\t\tbouncex.err(e);\n\t\t}\n\t}\n\n\tfunction get(entryInput) {\n\t\tvar currentStore = getSessionStore();\n\t\tvar outputObject;\n\n\t\tif (typeof entryInput === 'string') {\n\t\t\treturn entryInput in currentStore ? currentStore[entryInput] : '';\n\t\t}\n\t\telse if (Array.isArray(entryInput)) {\n\t\t\toutputObject = {};\n\n\t\t\tentryInput.forEach(function(entryName) {\n\t\t\t\toutputObject[entryName] = entryName in currentStore ? currentStore[entryName] : '';\n\t\t\t});\n\n\t\t\treturn outputObject;\n\t\t}\n\t\telse {\n\t\t\treturn currentStore;\n\t\t}\n\t}\n\n\tfunction entryExists(entryName) {\n\t\treturn !!get(entryName);\n\t}\n\n\tfunction populateFields(fieldMap) {\n\t\tvar currentStore = getSessionStore();\n\n\t\tfor (var field in fieldMap) {\n\t\t\tjQuery(fieldMap[field]).val(currentStore[field]);\n\t\t}\n\t}\n\n\treturn {\n\t\tset: set,\n\t\tget: get,\n\t\tentryExists: entryExists,\n\t\tpopulateFields: populateFields\n\t};\n})();\n\n// DA - Populate email in checkout flow:\nvar canPopulateEmail = (\n\twindow.location.pathname === '/shop.axd/Checkout' &&\n\tbouncex.sessionStore.entryExists('email')\n);\n\nif (canPopulateEmail) {\n /* interval to check the form input field has loaded before attempting to autofill email */\n BxInterval.addTask(function checkForEmailInput(){\n var $emailConfirmationField = jQuery('#text-email-confirmation');\n \n if ($emailConfirmationField.length) {\n \tbouncex.sessionStore.populateFields({\n \t\t'email': '#text-email-confirmation'\n \t});\n \t\n \t/* Trigger angular email validation */\n \ttry {\n \t var emailAddress = bouncex.sessionStore.get('email');\n \t angular.element(document.querySelector('input#text-email-confirmation')).scope().emailForm.email.$viewValue = emailAddress;\n \t angular.element(document.querySelector('input#text-email-confirmation')).trigger('blur');\n \t} catch(e) {\n \t bouncex.err(e);\n \t}\n \tBxInterval.stopTask('thisTask');\n }\n }, 20, 'thisTask');\n}\n\n\n\tif(window.location.href === 'https://www.scullyandscully.com/shop.axd/LoginForm?redirect_url=http%3A%2F%2Fwww.scullyandscully.com%2F'){\n\t\tbouncex.$('#new_user').submit(function(){\n\t\t\tbouncex.setv('onboard_form_submit', true);\t\n\t\t\tbouncex.setBounceCookie();\n\t\t});\n\t}\n\t\n\t\n\t//ISR TRACKING AK\n\t\n\t(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('.content.product-detail-regular').length !== 0),\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\tcategoryHistoryLength: 0,\n\t\t\t\tproductHistoryLength: 0\n\t\t\t}\n\t\t},\n\n\t\tinit: function () {\n\t\t\tthis.productMap();\n\t\t\tthis.setItemHistoryLengths();\n\t\t\tthis.trackProductHistory();\n\t\t\tthis.trackCategoryHistory();\n\t\t\tthis.maxProducts();\n\t\t// \tconsole.log(Date.now() - window.bouncex.bxISR.startTime, 'bxISR start');\n\t\t},\n\n\t\tproductMap: function () {\n\t\t\tif (!this.settings.general.productPageIdentifier) { return; }\n\t\t\tvar prodImg = jQuery('.window > .photo > a > figure > img').attr('src');\n\t\t\tif(prodImg.indexOf('http') > -1){\n\t\t\t imgUrl = prodImg;\n\t\t\t}else{\n\t\t\t imgUrl = 'https://www.scullyandscully.com' +jQuery('.window > .photo > a > figure > img').attr('src')\n\t\t\t}\n\t\t\t\n\t\t\tvar productValues = {\n\t\t\t\turl: (bouncex.utils.url.allowParams('edp_no')),\n\t\t\t\tname: (jQuery('meta[property = \"og:title\"]').prop('content')),\n\t\t\t\tsku: (jQuery('span[itemprop=\"sku\"]').text()),\n\t\t\t\tcategory: [{ categoryName: (jQuery('.breadcrumbs.clearfix:eq(0) > span').last().text().trim()), categoryUrl: (jQuery('.breadcrumbs.clearfix:eq(0) > span > a').last().attr('href')) }],\n\t\t\t\tdescription: (jQuery('meta[property = \"og:description\"]').prop('content')),\n\t\t\t\tprice: (jQuery('meta[itemprop = \"price\"]').prop('content')),\n\t\t\t\tmainImgUrl: (imgUrl),\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\t/* --- END OF INITIALIZATION --- */\n\t\t/* --- HELPER FUNCTIONS --- */\n\n\t\taddProductToHistory: function (product) {\n\t\t\tvar productHistory = this.settings.general.productHistory;\n\t\t\tproductHistory.unshift(product);\n\t\t\tthis.setProductHistory(productHistory);\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\t//if (productA.sku === productB.sku) { return true; }\n\t\t\tif (productA.name === productB.name) { return true; }\n\t\t\tif (productA.url === productB.url) { return true; }\n\t\t\treturn false;\n\t\t},\n\n\t\ttrackProductHistory: function () {\n\t\t\tvar productHistory = this.settings.general.productHistory;\n\t\t\tif (!this.settings.general.productPageIdentifier) { return; }\n\n\t\t\tif (this.settings.general.productHistoryLength > 0) {\n\t\t\t\tvar historyUpdated = false;\n\n\t\t\t\tfor (var i = 0; i < this.settings.general.productHistoryLength; 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);\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);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.addProductToHistory(this.settings.currentProduct);\n\t\t\t}\n\t\t},\n\n\t\ttrackCategoryHistory: function () {\n\t\t\tvar categoryHistory = this.settings.general.categoryHistory;\n\t\t\tif (!this.settings.general.productPageIdentifier) { return; }\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\t\t\n\t\t/* --- END OF HELPER FUNCTIONS --- */\n\t\t/* --- GETTER FUNCTIONS --- */\n\t\t\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) {\n\t\t\tvar products = this.settings.general.productHistory;\n\t\t\tif (!number) { number = products.length; }\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\treturn products.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 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);\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},\n\n\t\tsetProductHistory: function (productHistory) {\n\t\t\twindow.localStorage.setItem('bxProdHist', JSON.stringify(productHistory));\n\t\t\tthis.settings.general.productHistory = productHistory;\n\t\t\tthis.settings.general.productHistoryLength = 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\t\tpopulateCampaignProducts: function (params) {\n\t\t\tif (!params || !params.campaignId || !params.numberProducts || !params.campaignType) { 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.hoverState) { params.hoverState = false; }\n\n\n\t\t\tvar campaign = jQuery('#campaign_' + params.campaignId + '_container_' + params.campaignType);\n\t\t\tvar campaignProductArray = [];\n\n\t\t\tfor ( var i = 0; i < params.numberProducts; i++ ) {\n\t\t\t\tvar campaignProductObject = {\n\t\t\t\t\timg: jQuery('#campaign_' + params.campaignId + '_container_' + params.campaignType + ' a[href*=isr_img' + (i + 1) + ']'),\n\t\t\t\t\tlink: jQuery('#campaign_' + params.campaignId + '_container_' + params.campaignType + ' a[href*=isr_url' + (i + 1) + ']')\n\t\t\t\t};\n\n\t\t\t\tcampaignProductArray.push(campaignProductObject);\n\t\t\t}\n\n\t\t\tvar productArray = window.bouncex.bxISR.getTopProducts(params.sortBy, params.numberProducts);\n\t\t\tjQuery.each(productArray, function (x, y) {\n\t\t\t\tvar imgSrc = y.mainImgUrl,\n\t\t\t\t\tproductLink = (y.url.indexOf('http') > -1) ? y.url : window.top.location.origin + y.url,\n\t\t\t\t\tproductImageElem = jQuery(campaignProductArray[x].img),\n\t\t\t\t\tproductLinkElem = jQuery(campaignProductArray[x].link);\n\n\n\t\t\t\tvar css = {\n\t\t\t\t\t'background-image': 'url(\\'' + imgSrc + '\\')',\n\t\t\t\t\t'background-size': 'auto 100%',\n\t\t\t\t\t'background-repeat': 'no-repeat',\n\t\t\t\t\t'background-position': 'center'\n\t\t\t\t};\n\n\t\t\t\tproductImageElem.css(css).addClass('isr-image isr' + x + '');\n\t\t\t\tif (params.productAction === 'link') {\n\t\t\t\t\tif (params.reportClicks) {\n\t\t\t\t\t\tvar productAction = 'javascript:(function () { window.bouncex.report(' + params.campaignId + ', \\'clicks\\'); setTimeout(function(){window.top.open(\\''+ productLink +'\\');}, 100); })();'; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar productAction = 'javascript:(function () { window.top.open(\\''+ productLink +'\\'); })();';\n\t\t\t\t\t}\n\n\t\t\t\t} else if (params.productAction === 'submit') {\n\t\t\t\t\tvar productAction = 'javascript:void(0);';\n\t\t\t\t\tvar msg = JSON.stringify({ source: 'bouncex', action: 'submit' });\n\t\t\t\t\tproductImageElem.on('click', function () {\n\t\t\t\t\t\twindow.bouncex.report(params.campaignId, 'clicks');\n\t\t\t\t\t\tXD.postMessage(msg, campaign);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tproductImageElem.attr('href', productAction);\n\n\t\t\t\tif (params.reportClicks) {\n\t\t\t\t\tvar linkAction = 'javascript:(function () { window.bouncex.report(' + params.campaignId + ', \\'clicks\\'); setTimeout(function(){window.top.open(\\''+ productLink +'\\');}, 100); })();';\n\t\t\t\t} else {\n\t\t\t\t\tvar linkAction = 'javascript:(function () { window.top.open(\\''+ productLink +'\\'); })();';\n\t\t\t\t}\n\n\t\t\t\tproductLinkElem.attr('href', linkAction);\n\n\t\t\t\tif (params.hoverState) {\n\t\t\t\t\tif (params.reportClicks) {\n\t\t\t\t\t\tvar hoverLinkAction = 'javascript:(function () { window.bouncex.report(' + params.campaignId + ', \\'clicks\\'); setTimeout(function(){window.top.open(\\''+ productLink +'\\');}, 100); })();';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar hoverLinkAction = 'javascript:(function () { window.top.open(\\'' + productLink + '\\'); })();';\n\t\t\t\t\t}\n\n\t\t\t\t\tproductImageElem.parent().append('
' + y.name + '
');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tpopulateCampaignProductsV2: function (params) {\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\t\t\t\t\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-row-submit:eq('+i+')').find('button');\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-line-custom:eq(' + i +')').siblings('.bx-row-text').find('div');\n\t\t\t\t\t}\n\t\t\t\t\tcampaignStepProductElements.push(campaignStepProductObject);\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);\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 productLink = (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', productLink).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\t\t\t\t}\n\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\n","force_https":false,"waypoints":false,"content_width":0,"gai":"UA-672070-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":[],"ple":false,"fbe":false,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* ---------------------------- SHARED VARIABLES ---------------------------- */\n\nvar CLEAN_URL = bouncex.utils.url.allowParams(['keywords']);\n\n/* --------------------------------- HELPERS -------------------------------- */\n\nfunction getItemImageUrl() {\n\tvar imgUrl = jQuery('.product-details-image-gallery img').attr('src');\n\treturn imgUrl && bouncex.utils.url.allowParams([], imgUrl);\n}\n\nfunction getItemIdFromUrl(url) {\n\treturn url && bouncex.utils.url.allowParams([], url).split('/').pop();\n}\n\nfunction getGroupId() {\n\tvar gidAlt = jQuery('.product-details-image-gallery img').attr('alt') || '';\n\treturn gidAlt.split('_')[0];\n}\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction getItem() {\n\treturn {\n\t\tid: CLEAN_URL.split('/').pop(),\n\t\tcopy: jQuery('[itemprop=\"name\"]').first().text(),\n\t\tcategory: jQuery('.global-views-breadcrumb-item').eq(-1).text().trim() || 'global',\n\t\turl: CLEAN_URL,\n\t\timageurl: getItemImageUrl(),\n\t\tinstock: jQuery('.cart-add-to-cart-button button').length > 0\n\t};\n}\n\nfunction fireViewItem(id, groupId) {\n\tvar pushItem = { 'item:id': id };\n\n\tif (groupId) {\n\t\tpushItem['item:itemgroupid'] = groupId;\n\t}\n\tbouncex.push(['view item', pushItem]);\n}\n\nfunction initializeItemEvents() {\n\tvar item;\n\n\tbouncex.et.onTrue(\n\t\tfunction () {\n\t\t\titem = getItem();\n\t\t\treturn (\n\t\t\t\t!!item.id &&\n\t\t\t\t!!item.copy &&\n\t\t\t\t!!item.category &&\n\t\t\t\t!!item.url &&\n\t\t\t\t!!item.imageurl\n\t\t\t);\n\t\t},\n\t\tfunction () {\n\t\t\tif (item.url.indexOf('gift-card') > -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbouncex.push(['item', item]);\n\n\t\t\titem.groupId = getGroupId();\n\t\t\tinitializeSkuEvents(item.id, item.groupId);\n\n\t\t\tfireViewItem(item.id, item.groupId);\n\t\t\tinitializeATCClickTracking(item.id);\n\t\t},\n\t\t10\n\t);\n}\n\n/* ------------------------------ SKU TRACKING ------------------------------ */\nfunction fireSelectSku(id, groupId, sku) {\n\tif (id && groupId && sku) {\n\t\tbouncex.push([\n\t\t\t'select_sku',\n\t\t\t{\n\t\t\t\t'item:id': id,\n\t\t\t\t'item:itemgroupid': groupId,\n\t\t\t\t'item:feedid': groupId + ' : ' + sku\n\t\t\t}\n\t\t]);\n\t}\n}\nfunction initializeSkuEvents(itemId, groupId) {\n\tif (jQuery('.product-details-options-selector-option-container [data-type=\"option\"]').length === 0) {\n\t\tfireSelectSku(itemId, groupId, bouncex.vars.sku);\n\t\treturn;\n\t}\n\tbouncex.et.onVarChange('sku', function (oldVal, newVal) {\n\t\tif (newVal && newVal !== oldVal) {\n\t\t\tfireSelectSku(itemId, groupId, bouncex.vars.sku);\n\t\t}\n\t});\n}\n\n/* ---------------------------- CATEGORY TRACKING --------------------------- */\n\nfunction getItemIdsCat() {\n\tvar ids = [];\n\n\tjQuery('.facets-item-cell-grid-link-image').each(function (i, e) {\n\t\tvar id = getItemIdFromUrl(jQuery(e).attr('href'));\n\n\t\tif (id && ids.indexOf(id) < 0) {\n\t\t\tids.push(id);\n\t\t}\n\t});\n\n\treturn ids.join(',');\n}\n\nfunction getCategoryObject() {\n\treturn {\n\t\t'page:url': CLEAN_URL,\n\t\t'items:ids': getItemIdsCat()\n\t};\n}\n\nfunction initializeCategoryEvents() {\n\tvar categoryObj;\n\n\tbouncex.et.onTrue(\n\t\tfunction () {\n\t\t\tcategoryObj = getCategoryObject();\n\t\t\treturn (\n\t\t\t\t!!categoryObj['items:ids'].length && !!categoryObj['page:url']\n\t\t\t);\n\t\t},\n\t\tfunction () {\n\t\t\tbouncex.push(['view category', categoryObj]);\n\t\t},\n\t\t10\n\t);\n}\n\n/* ------------------------------- CART EVENTS ------------------------------ */\n\nfunction fireAddToCart(itemId) {\n\tbouncex.push(['add to cart', { 'item:id': itemId }]);\n\n\tif (bouncex.vars.cart) {\n\t\treturn;\n\t}\n\tbouncex.setVar('cart', true);\n}\n\nfunction initializeATCClickTracking(itemId) {\n\tbouncex.et.onVisible('.cart-confirmation-modal', function () {\n\t\tfireAddToCart(itemId);\n\t});\n}\n\nfunction emptyCart() {\n\tbouncex.et.onVarChange('cart_qty', function (oldVal, newVal) {\n\t\tif (bouncex.vars.cart && newVal === 0 && oldVal > 0) {\n\t\t\tbouncex.push(['empty_cart']);\n\t\t\tbouncex.setVar('cart', false);\n\t\t}\n\t});\n}\n\nfunction initializeCartEvents() {\n\tbouncex.et.cart.init({\n\t\treplenish: function () { },\n\t\treplenishmentType: 'single'\n\t});\n\n\temptyCart();\n}\n\n/* ------------------------------ USER TRACKING ----------------------------- */\n\nfunction initializeUserTracking() {\n\tif (!bouncex.vars.logged_in || !!bouncex.vars.logged_in_identified) {\n\t\treturn;\n\t}\n\n\tvar userEmail;\n\n\tbouncex.et.onTrue(\n\t\tfunction () {\n\t\t\tuserEmail = jQuery('.overview-profile-email').first().text() || bouncex.utils.getNestedProp('loadedResourcesPromises.myAccountEnvironment.data.ENVIRONMENT.PROFILE.email');\n\t\t\treturn bouncex.utils.validate.email(userEmail);\n\t\t},\n\t\tfunction () {\n\t\t\tbouncex.push([\n\t\t\t\t'user',\n\t\t\t\t{\n\t\t\t\t\temail: userEmail,\n\t\t\t\t\tsource: 'LoggedIn'\n\t\t\t\t}\n\t\t\t]);\n\t\t\tbouncex.setVar('logged_in_identified', true);\n\t\t},\n\t\t5\n\t);\n}\n\n/* ------------------------------ QUICK VIEW ----------------------------- */\n\nfunction initQuickViewEvents() {\n\tbouncex.et.onVisible('#modal-body', function (e) {\n\t\tvar itemId = getItemIdFromUrl(e.find('.product-details-quickview-full-details').attr('href')),\n\t\t\tgroupId = getGroupId();\n\t\tif (itemId) {\n\t\t\tfireViewItem(itemId, groupId);\n\t\t\tbouncex.et.onVisible('.cart-confirmation-modal-item-name', function (e) {\n\t\t\t\tfireAddToCart(itemId);\n\t\t\t});\n\t\t}\n\t});\n}\n\n/* --------------------------- INITIALIZE TRACKING -------------------------- */\n\nfunction isValidDomain() {\n\treturn CLEAN_URL.indexOf('www.scullyandscully.com') > -1;\n}\n\nfunction isEn() {\n\treturn bouncex.html.attr('lang') === 'en-US';\n}\n\nfunction isValidForTracking() {\n\treturn isValidDomain() && isEn();\n}\n\nfunction init() {\n\tif (!isValidForTracking()) {\n\t\treturn;\n\t}\n\n\tinitializeUserTracking();\n\tinitializeCartEvents();\n\n\tswitch (bouncex.website.pts) {\n\t\tcase 'category':\n\t\tcase 'search':\n\t\t\tinitializeCategoryEvents();\n\t\t\tinitQuickViewEvents();\n\t\t\tbreak;\n\t\tcase 'product':\n\t\t\tbouncex.setTimeout2(function() { \n\t\t\t\tinitializeItemEvents();\n\t\t\t}, 1500);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n\ninit();\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/cart"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('#facet-browse').length > 0;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"?keywords"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === \"/\";"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.product-details-full').length > 0;"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"?keywords"}]]}},"els":{"CART - Checkout Button":"","CART - Promo Code Apply Button":"","CART - Promo Code Box":"","CAT - Product Grid Image":"","CAT - Quickview Box":"","CAT-AddtoCartButton":"","CAT-QuickviewAddtoCart":"","Footer":"","Navigation bar":"","PDP - Add to Cart Button":".cta.add-to-cart, .add-your-items","PDP - Color Option":"","PDP - Hero Image":"","PDP - Product Name":"","PDP - Product Price":"","PDP - Quantity Option":"","PDP - Review Stars":"","PDP - Size Option":"","PDP - Thumbnail Image":"","SEARCH - Product Grid Image":""},"vars":[{"name":"items_in_cart","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"bouncex.website.pts !== 'checkout' ? Number(jQuery('[data-type=\"mini-cart\"]').first().text().replace(/[^0-9.]/g, '')) : null;\n","trigger":""},{"name":"amount_in_cart","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"bouncex.website.pts !=='checkout' ? Number(jQuery('.header-mini-cart-subtotal-amount').first().text().replace(/[^0-9.]/g, '')) : null;\n","trigger":""},{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts !== 'checkout' ? jQuery('.header-profile-welcome-link-name').length > 0 : null;","trigger":""},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":""},{"name":"onboard_form_submit","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\tvar catalogueEl = bouncex.$('.main-content > table > tbody > tr').last().children().children('h6').length;\n\t\n\t\tif(window.location.href === 'http://www.scullyandscully.com/shop.axd/UpdateEmailPreferencesBP'){\n\t\t\treturn true;\n\t\t}else if(window.location.href === 'http://www.scullyandscully.com/shop.axd/RequestCatalog' && catalogueEl){\n\t\t\treturn true;\n\t\t}else if(window.location.href === 'https://www.scullyandscully.com/shop.axd/Checkout#/main/step2'){\n\t\t\treturn true;\n\t\t}\n\n})();","trigger":""},{"name":"exclusive","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.exclusive').length > 0;","trigger":""},{"name":"limited_edition","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.product_description_text:contains(\\'Limited Edition\\')').length > 0 || jQuery('.product_description_text:contains(\\'Limited edition\\')').length > 0;","trigger":""},{"name":"registry_page_visit","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"native_email_submitted","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('.global-views-message-success').text().toLowerCase().indexOf('email submitted') > -1 || null;","trigger":""},{"name":"pagetype","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts;","trigger":""},{"name":"prod_name","polling":"vars","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('[itemprop=\"name\"]').first().text();","trigger":""},{"name":"imageurl","polling":"vars","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.product-details-image-gallery img').attr('src');","trigger":"pageload"},{"name":"cart","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"in_stock","polling":"vars","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.cart-add-to-cart-button button').length > 0;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_qty","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts !== 'checkout' ? Number(jQuery('[data-type=\"mini-cart\"]').first().text().replace(/[^0-9.]/g, '')) : null;","trigger":"pageload"},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts !=='checkout' ? Number(jQuery('.header-mini-cart-subtotal-amount').first().text().replace(/[^0-9.]/g, '')) : null;","trigger":"pageload"},{"name":"sku","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":" jQuery('[itemprop=\"sku\"]').text().trim();","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":1,"spatm":0,"preinit_cjs":"SinglePageApp.setCustomParams({\n currentPageIdentifier: function () {\n var curPageId = document.querySelector('#content div') ? document.querySelector('#content div').getAttribute('id') : '';\n return curPageId !== 'facet-browse' ? curPageId : window.location.pathname;\n }\n});","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"","eventSharing":false,"shqId":"","enabled":0},"pde":true,"fmc":["US","CA"],"fme":true,"fmx":"","uid2":false,"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,"devMode":0},"ga4_property_id":"264898956","ga4_measurement_id":"G-QZNMYEKBW4","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":"7b352b1295e35e9c90089d9dd48e488f","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"75060a85c1a4aebcc6f779b9e84db722","onsite":"abbdf7a49be9b52b097917b7b527b262","sms":"e39203556bab2366e56296ce42e974a7","websdk":"78f2bf318353891c1dcd0884cb4c65de"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_c81e76ee00d795b1eebf8d27949f8dc5.br.js'); runtime.setAttribute('async', 'async'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_57d93646a0dec637325da61b7bb3077c.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_6ef1802500d8367a80105e664862d0d7.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() {}; }; runtime.onload = bouncex.initializeTag; document.body.appendChild(runtime); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();