var dataUserStats = new FormData(); dataUserStats.append('window_width', window.screen.width); dataUserStats.append('window_height', window.screen.height); dataUserStats.append('browser_information', navigator.userAgent); dataUserStats.append('referral', 'http://www.computer-bestel.nl/js/javascript-v9.js?v=21-11-1'); dataUserStats.append('current_page', current_page); var xhr = new XMLHttpRequest(); xhr.open('POST', '/AJAX/updateStatics.php', true); xhr.send(dataUserStats); var lazyLoadInstance = new LazyLoad({ // Your custom settings go here }); Number.prototype.formatMoney = function(c, d, t){ var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "." : d, t = t == undefined ? "," : t, s = n < 0 ? "-" : "", i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))), j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }; function setCookie(cname, cvalue, exdays){ var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++){ var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return ''; } function cookieLawAccept(){ d = new Date(); d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); setCookie('cookieAndPrivacy', '1', d); document.getElementById('cookiebalk').style.display = 'none'; $(".belco-69mge").css("bottom", 20 + "px"); } !function(n,o){var e=window.belcoFunction||"Belco";window[e]||(window[e]=function(n){if(void 0===window[e][n])throw new Error("Unknown method");return window[e][n].apply(window[e],Array.prototype.slice.call(arguments,1))}),window[e]._q=[];for(var i=["init","sync","track","page","open","close","toggle","on","once","off","anonymousId","customer","reset","sendMessage"],t=function(n){return function(){var o=Array.prototype.slice.call(arguments);return o.unshift(n),window[e]._q.push(o),window[e]}},w=0;w if(!getCookie('cookieAndPrivacy')) $("#cookiebalk").css("display", "block"); $("#menu_icon").click(function(){ $("#navigation #mobile_menu ul").slideToggle(400); }); $(".mobile_menu_icon").click(function(){ $("#navigation .mobile_menu ul").slideToggle(400); }); $("#account_menu").click(function(){ $("#account_navigation ul li ul").fadeToggle(200); }); $("#account_menu_2").click(function(){ $("#account_navigation_mobile ul").fadeToggle(200); }); var types = ['DOMMouseScroll', 'mousewheel']; if($.event.fixHooks){ for(var i=types.length; i;) $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; } $.event.special.mousewheel = { setup: function(){ if(this.addEventListener){ for (var i=types.length; i;) this.addEventListener( types[--i], handler, false ); } else this.onmousewheel = handler; }, teardown: function(){ if (this.removeEventListener){ for(var i=types.length; i;) this.removeEventListener( types[--i], handler, false ); } else this.onmousewheel = null; } }; $.fn.extend({ mousewheel: function(fn){ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, unmousewheel: function(fn){ return this.unbind("mousewheel", fn); } }); function handler(event){ var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; event = $.event.fix(orgEvent); event.type = "mousewheel"; if(orgEvent.wheelDelta) { delta = orgEvent.wheelDelta/120; } if(orgEvent.detail) { delta = -orgEvent.detail/3; } deltaY = delta; if(orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS){ deltaY = 0; deltaX = -1*delta; } if(orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } if(orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } args.unshift(event, delta, deltaX, deltaY); return ($.event.dispatch || $.event.handle).apply(this, args); } var rest = 0; $(".scroll_horizontal").mousewheel(function(event, delta){ if($(this).find("div").first().width() - this.scrollLeft - $(this).width() - 13 == 0 || this.scrollLeft == 0 || (delta < 0 && rest > 0) || (delta > 0 && rest < 0)) rest = 0; if($(this).find("div").first().css("max-width") != "100%"){ rest = (rest / 1.3) + (delta * 145); $(this).stop().animate({ scrollLeft: (this.scrollLeft - rest) }, 200, function() { rest = 0; }); event.preventDefault(); } }); }); productLineIndexes = {}; productLineStartPosition = {}; productLineEndIndexes = {}; function countProductIndexes(productLineID){ if($('#' + productLineID + ' .product_view_horizontal_3').length > 0){ if($("#content").outerWidth(true) >= 1200) visible = 3; else if($("#content").outerWidth(true) >= 600) visible = 2; else visible = 1; } else { if($("#content").outerWidth(true) >= 1200) visible = 4; else if($("#content").outerWidth(true) >= 600) visible = 2; else visible = 1; } productLineStartPosition[productLineID] = 0 productLineIndexes[productLineID] = $('#' + productLineID + ' .product_view_horizontal:visible').length; productLineEndIndexes[productLineID] = Math.ceil(( productLineIndexes[productLineID] / visible ) - 1); if(productLineStartPosition[productLineID] < productLineEndIndexes[productLineID]) $('#' + productLineID + ' .arrowR').css("display", "inline"); else $('#' + productLineID + ' .arrowR').css("display", "none"); if(productLineStartPosition[productLineID] == 0) $('#' + productLineID + ' .arrowL').css("display", "none"); } $(document).ready(function() { $("[class^='product-line-']").each(function(){ countProductIndexes($( this ).attr("id")); }); extraMobMargin = 16; $('.arrowR').click(function(e){ var IDToCalculate = $(this).parent().parent().attr("ID"); if(productLineStartPosition[IDToCalculate] < productLineEndIndexes[IDToCalculate]){ productLineStartPosition[IDToCalculate]++; $('#' + IDToCalculate + ' .product_view_horizontal:visible').animate({'left':'-=' + ($("#" + IDToCalculate + " .scroll_container:visible").outerWidth(true) + 4 + extraMobMargin) + 'px'}); if($('#' + IDToCalculate + ' .arrowR').is(':hidden')) $('#' + IDToCalculate + ' .arrowR').css("display", "inline"); if($('#' + IDToCalculate + ' .arrowL').is(':hidden')) $('#' + IDToCalculate + ' .arrowL').css("display", "inline"); if(productLineStartPosition[IDToCalculate] >= productLineEndIndexes[IDToCalculate] && $('#' + IDToCalculate + ' .arrowR').is(':visible')) $('#' + IDToCalculate + ' .arrowR').css("display", "none"); } }); $('.arrowL').click(function(e){ var IDToCalculate = $(this).parent().parent().attr("ID"); if(productLineStartPosition[IDToCalculate] > 0){ productLineStartPosition[IDToCalculate]--; $('#' + IDToCalculate + ' .product_view_horizontal:visible').animate({'left':'+=' + ($("#" + IDToCalculate + " .scroll_container:visible").outerWidth(true) + 4 + extraMobMargin) + 'px'}); if($('#' + IDToCalculate + ' .arrowR').is(':hidden')) $('#' + IDToCalculate + ' .arrowR').css("display", "inline"); if($('#' + IDToCalculate + ' .arrowL').is(':hidden')) $('#' + IDToCalculate + ' .arrowL').css("display", "inline"); if(productLineStartPosition[IDToCalculate] <= 0 && $('#' + IDToCalculate + ' .arrowL').is(':visible')) $('#' + IDToCalculate + ' .arrowL').css("display", "none"); } }); });