function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function shuffleArray(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } var mainNow = 0; function addTopLine(isMobile) { isMobile = isMobile ? isMobile : false; var allToday = new Date().getHours() * 100 + Math.floor(Math.random() * 1000); var now = mainNow != 0 ? mainNow : getRandomInt(45, 150); mainNow = now; var todayBuy = getRandomInt(50, 100) + new Date().getHours(); if (allToday <= todayBuy) { todayBuy = Math.floor(allToday / 2) + 2; } var allHeight = isMobile ? 34 : 36; var html = '' + '
'; $(html).appendTo($(document.body)); } function showSwimmer() { var count = mainNow != 0 ? mainNow : getRandomInt(45, 150); var bottom = 6; if ($('.delivery-notify').length) { bottom = 88; } mainNow = count; var html = '
' +
'Сейчас ' + count + ' пользователей просматривают эту страницу вместе с вами.' +
'