let id = localStorage.getItem("userid");
let stat = localStorage.getItem("status");
let userid = {
    "userid": id,
    "status": stat,
}
localStorage.setItem("userid",userid.userid);
localStorage.setItem("status",userid.status);
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({'userId' : userid});
 
  
function startTimer(duration, display) {
    var start = Date.now(),
        diff,
        minutes,
        seconds;
    function timer() {
        diff = duration - (((Date.now() - start) / 1000) | 0);
        minutes = (diff / 60) | 0;
        seconds = (diff % 60) | 0;
        minutes = minutes < 10 ? "0" + minutes : minutes;
        seconds = seconds < 10 ? "0" + seconds : seconds;
        display.textContent = seconds; 
        if (diff <= 0) {
            start = Date.now() + 1000;
        }
    };
    timer();
    setInterval(timer, 1000);
}

window.onload = function () {
    var fiveMinutes = 10,
    display = document.querySelector('#time');
    startTimer(fiveMinutes, display);
    var display1 = document.querySelector('#time2');
    startTimer(fiveMinutes, display1);
};