var sxUsageTracking=function(l){var a=this;a.config=l;a.currentQueryId=-1;a.currentPage=-1;a.startTime=-1;a.queryLog="/queries/##C_ID##/logQuery";a.eventLog="/queries/##C_ID##/clickfeedback";a.eventLogImg="/queries/##C_ID##/interaction/##QUERYID##/##TIME##/##QUERY##/##TYPE##/##PAGE##/##TIMESINCESEARCH##";a.context=void 0;a.triedQueryLogSendings=0;a.registeredHandlerFunctions={};a.registerEvents=function(){a.intervalHolder={};for(var b=0;ba.startTime|| 0==a.startTime.toString().length)a.startTime=(new Date).getTime(),a.deleteCookie("sxLatestStartTime"),a.setCookie("sxLatestStartTime",a.startTime);return a.startTime};a.handleImgEvent=function(b,c){if(void 0!==a.currentQueryId&&0!==a.currentQueryId.length){var d=void 0===b.negationScope||0==b.negationScope.length?void 0:a.findAncestorById(c.srcElement.activeElement,b.negationScope);void 0!==b.pageCallback&&"function"===typeof b.pageCallback&&(a.currentPage=b.pageCallback(c,b,a));a.config.debugLogging&& console.log("sx: sending sxUt for "+b.type);if(null===d||void 0===d)c=a.eventLogImg.replace("##C_ID##",a.config.customerId),c=c.replace("##QUERYID##",a.currentQueryId).replace("##TIME##",(new Date).getTime().toString()).replace("##QUERY##",encodeURIComponent(void 0!==a.currentQuery&&0 0){ return parseInt(search[0].split("=")[1]); } return 1; }, negationScope: '', disableBeforeUnload: true },{ type: 'sxToShoppingBasket', event: 'click', preSelector: '#cart_quantity', selector: '#btn_cart', handler: 'handleEvent', relevantContextCallback: function(eventObj){ return true; }, articleNumberCallback: function(event, eventObj, self){ var el = document.querySelector("#content-inner > .container .def-well-col-right small.text-muted"); var ano = -1; if(el && el.innerText && el.innerText.split(": ").length>1){ ano = el.innerText.split(": ")[1]; } return ano; }, groupIdCallback: function(event, envetObj, self){ return window.product_id || -1; }, productPositionCallback: function(event, eventObj, self){ return -1; }, negationScope: '', disableBeforeUnload: true },/*{ type: 'sxBuyButtonPressed', event: 'click', interval: 100, relevantIntervalContextCallback: function(eventObj){ return window.location.href.indexOf("/checkout.php")!==-1; }, preSelector: '#buy-button-next', selector: 'button', handler: 'handleEvent', relevantContextCallback: function(){ return document.querySelectorAll("#buy-button-next button").length > 0; }, multipleArticleNumberCallback: function(event, eventObj, self){ var ano = []; if(document.getElementById("shopping-cart-table")){ document.querySelectorAll(".copythis").forEach(function(item){ ano.push(item.innerText); }); } return ano; }, multipleGroupIdCallback: function(event, eventObj, self){ return []; }, productPositionCallback: function(event, eventObj, self){ return 9999999; }, negationScope: '', disableBeforeUnload: true },*/{ type: 'sxLeaveSerp', event: 'click', preSelector: 'window', selector: '', handler: 'handleImgEvent', relevantContextCallback: function(eventObj){ var body = document.body ? document.body : document.querySelector("body"); return body && body.className.split(" ").indexOf("pagetype-search")!==-1 && document.getElementsByClassName("product-item-redesign").length > 0; }, articleNumberCallback: function(event, eventObj, self){ return -1; }, productPositionCallback: function(event, eventObj, self){ return -1; }, pageCallback: function(event, eventObj, self){ var search = window.location.search.replace("?","").split("&"); search = search.filter(function(el){return el.indexOf("page")===0}); if(search.length > 0){ return parseInt(search[0].split("=")[1]); } return 1; }, negationScope: '#content-inner', disableBeforeUnload: false }] } ).init();