if (!window.overrideTUK) { window.aoNewHome_disableRecent = true; (function() { /* live chat */ window.showLiveChatTests = window.showLiveChatTests || []; function liveChat_pathTest() { if ( window.location.hostname.match(/^(ao\.com|[a-z]*-aol\.ao-qa\.com)$/) == null ) { return true; } var allowedPaths = [ /^\/$/, /^\/c\//, /^\/(built\-in|cooking|cooling|computing|dishwashers|floorcare|laundry|small\-appliances|sound\-and\-vision)/, /^\/l\//, /^\/qa-nanorep/ ]; var allowed = false; var path = window.location.pathname; allowedPaths.forEach(function(r) { allowed = allowed || r.test(path); }); return allowed; } function liveChat_productTest() { var allowedPath = /^\/product\//; var allowed = false; var path = window.location.pathname; if (allowedPath.test(path)) { // first element just as a test - DELETE ON LIVE ENV var allowedSku = [ 'UE22H5610', 'ZDC8202P', 'ZOA35502XD', 'DXOC410C3', 'EWE91482W', 'EWSD61252W', 'HARG60K', 'BDVG592K', 'FS50EDOC', 'GV169TWC3W', 'HARE60K', 'CSC1365WE', 'CSS5175WE', 'CAA55', 'CS5533APW', 'GVHD913A2', 'DCUR801W', 'DFG26B1', 'DFN28R21W', 'DFC05R10W', 'DIN15R10', 'BLA-32/136I', '43AO4USB', '65AO4USB', '50AO4USB', 'DNCD91B', 'FETC70BP', 'B44M43N5GB', 'HBN331E4B', 'BRIF22300X', 'HBA13B253B', 'MS91518FFS', 'I5ESHW', 'I5GGW', 'MC50165', 'MBC55275', 'MC55244DB', 'IDC8T3B', 'MC55244D', 'LTF11M132C', 'SE39HO04UK', 'SA2844HIX', 'RSG5UCRS', 'RSA1RTMG', 'OIF22300X', 'ZCV680TCXA', 'UE19H4000', 'TX-40DS400B', 'SMV53M50GB', 'SE60FO01UK', 'SMS58M12GB', 'WMB101433LW', 'VTC581B', 'UE55KU6000', 'UE40KU6000', 'UE40KU6100', 'UE49KU6100', 'WD32HU7650', 'WMAO863P', 'WMB71543W', 'ZCI68310XA', 'ZOP37901XK' ]; var currentsku = document .querySelector('main') .getAttribute('data-product-sku'); allowedSku.forEach(function(arraySkuElement) { if (currentsku === arraySkuElement) { allowed = true; var event = new CustomEvent('defineBasketButtonState', { detail: { basketButtonState: 'absolutePositioned' } }); window.dispatchEvent(event); window.addToBasketButtonStatus = 'absolute'; } }, this); } return allowed; } window.showLiveChatTests.push(liveChat_pathTest); window.showLiveChatTests.push(liveChat_productTest); function liveChat_onDOMContentLoaded() { if (typeof window.showLiveChat !== 'undefined' && window.showLiveChat) { var allowedByFunction = false; window.showLiveChatTests.forEach(function(t) { allowedByFunction = allowedByFunction || t(); }); window.showLiveChat = window.showLiveChat && allowedByFunction; } var chatElem = document.getElementById('liveChat'); var hideClassExp = /\bliveChatHide\b/; if ( chatElem && !window.showLiveChat && !hideClassExp.test(chatElem.className) ) { chatElem.className += (chatElem.className.length ? ' ' : '') + 'liveChatHide'; } if (typeof window.broadcastLivechatAvailability === 'function') { window.broadcastLivechatAvailability( window.showLiveChat, 'override tests' ); } document.removeEventListener( 'DOMContentLoaded', liveChat_onDOMContentLoaded ); } document.addEventListener( 'DOMContentLoaded', liveChat_onDOMContentLoaded, true ); window.addEventListener('DOMContentLoaded', function () { // if (isCustomerOnCheckoutPage()) { // applyTopMessage(cybs150Error, 'warning'); // } }); })(); (function() { var testId = null; var testCount = 0; window.overrideTests = window.overrideTests || []; function runTests() { window.overrideTests = window.overrideTests.filter(function(test) { return !test(); }); if (++testCount >= 50 || !window.overrideTests.length) { clearInterval(testId); } } testId = setInterval(runTests, 50); })(); (function() { window.overrideTests = window.overrideTests || []; /* Trust Pilot Header 20161110 */ function trustPilot() { var h = document.querySelector('.promoMobileContainer .promo.trustPilot'); if (h) { h.setAttribute('target', '_blank'); h.setAttribute('href', 'https://www.trustpilot.com/review/www.ao.com'); return true; } return false; } window.overrideTests.push(trustPilot); function nanorepQA() { var path = window.location.pathname; var r = /^\/qa-nanorep/; if (r.test(path)) { try { _nRepData.kb = '897482822'; return true; } catch (e) { return false; } } else { return true; } return false; } window.overrideTests.push(nanorepQA); })(); // Product page HakYak add to basket tagging. (function() { window.addEventListener('load', function() { if ( window.AoProductPage && window.AoProductPage.HapYak && window.dcsMultiTrack ) { var pagetype = window.utag_data && window.utag_data.page_type ? window.utag_data.page_type : window.location.href; var sku = document .querySelector('.mainContainer') .getAttribute('data-product-sku'); window.addEventListener('message', function(evt) { if (evt && evt.data) { var data; if (evt.data) { try { data = JSON.parse(evt.data); } catch (e) {} } data = data || {}; if ( data.event === 'trackAction' && data.action === 'add-to-basket' ) { dcsMultiTrack( 'DCS.dcsuri', window.location.href, 'WT.dl', '99', 'WT.z_ptype', pagetype, 'WT.tx_e', 'i', 'WT.pn_sku', sku, 'WT.z_ATBLocation', 'Video | ' + sku ); } } }); } }); })(); function isCustomerOnCheckoutPage() { return ( window.location.host.indexOf('checkout') !== -1 && /^\/?v2\/app/i.test(window.location.pathname) ); } function applyTopMessage(message, icon) { var bannerIcon = icon || 'telephone'; var holder = document.createElement('div'); holder.className = 'header-warning'; holder.innerHTML = '