function CountdownTimer(elm, tl, mes){
this.initialize.apply(this, arguments);
}
CountdownTimer.prototype={
initialize: function (elm, tl, mes){
this.elem=document.getElementById(elm);
this.tl=tl;
this.mes=mes;
},
countDown: function (){
var timer='';
var today=new Date();
var day=Math.floor((this.tl - today) / (24 * 60 * 60 * 1000));
var hour=Math.floor(((this.tl - today) % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000));
var min=Math.floor(((this.tl - today) % (24 * 60 * 60 * 1000)) / (60 * 1000)) % 60;
var sec=Math.floor(((this.tl - today) % (24 * 60 * 60 * 1000)) / 1000) % 60;
var me=this;
if((this.tl - today) > 0){
if(day){
timer +='<span class="cdt_num">' + day + '</span><small>日</small>';
}
if(hour){
timer +='<span class="cdt_num">' + hour + '</span><small>時間</small>';
}
timer +='<span class="cdt_num">' + this.addZero(min) + '</span><small>分</small><span class="cdt_num">' + this.addZero(sec) + '</span><small>秒</small>';
this.elem.innerHTML=timer;
setTimeout(function (){
me.countDown();
}, 10);
}else{
var countdownWrapper=this.elem.parentNode.parentNode;
countdownWrapper.className='cdt_finished';
countdownWrapper.innerHTML=this.mes;
return;
}},
addZero: function (num){
return ('0' + num).slice(-2);
}};
function CDT(){
var end=new Date('2026-07-03T11:00+09:00');
var countdownText='OPENまで';
var finishedText='2026年7月3日（金）<br>OPENいたしました';
document.getElementById('cdt_txt').innerHTML=countdownText;
var timer=new CountdownTimer('cdt_date', end, finishedText);
timer.countDown();
}
window.onload=function (){
CDT();
};