var Access = {
     interval: null,

     init: function() {
          if($('odliczanie')) {
               var d = new Date()
               Access.interval = (secondsToShow - (endTime - (d.getTime()/1000).toInt()));
               Access.showTime();
          }
     },

     showTime: function() {
          setTimeout(Access.update, 500);
     },

     update: function() {
          var d = new Date()
          var t = (endTime + Access.interval - (d.getTime()/1000).toInt());
          if (t<1) window.location.reload();

          var minut = (t/60).toInt();
          var sekund = (t%60).toInt();
          $('odliczanie').setHTML( minut + ':' + (sekund < 10 ? '0' : '') + sekund );
          setTimeout(Access.update, 500);
     }
}

