var resultWrapperThird = document.querySelector(".spin-result-wrapper-third");
var ruletThirst = document.querySelector("#promo2-template .rulet-img-wrapper");
function spin() {
  if (ruletThirst.classList.contains("rotated")) {
    resultWrapperThird.style.display = "block";
  } else {
    ruletThirst.classList.add("super-rotation");
    setTimeout(function () {
      resultWrapperThird.style.display = "block";
      $("#promo2-template .spin-wrapper").slideUp();
      $("#promo2-template .order_block").slideDown();
      var intr,time=600;
      //start_timer();
      intr=setInterval(function(){
        if(0<time){
        time-=1;
        var e=Math.floor(time/60),
        t=10<=(t=time-60*e)?t:"0"+t;
        if(e<0&&(e=0),$("#minpromo2").html("0"+e),$("#secpromo2").html(t),0==e&&0==t)return clearInterval(intr),!1
    }
      },1e3);
    }, 7500);
    ruletThirst.classList.add("rotated");
  }
  $("#promo2-template .cursor-text").css("pointer-events", "none");
}

var closePopup = document.querySelector("#promo2-template .close-popup");

$("#promo2-template .close-popup, #promo2-template .pop-up-button").click(function (b) {
  b.preventDefault();
  $("#promo2-template .spin-result-wrapper").fadeOut();
});

