(function(){var t=function(t){function e(t,e){return"string"!=typeof t&&(t=String(t)),a.substring(0,e-t.length)+t}if("undefined"==typeof $)return void alert("Countdown require jQuery");var o={container:null,deadline:null,callbackTick:function(t,e,o,n,i,r){},selectorYear:"[data-year]",selectorMonth:"[data-month]",selectorDay:"[data-day]",selectorHour:"[data-hour]",selectorMinute:"[data-minute]",selectorSecond:"[data-second]"};this.opt=$.extend(o,t),this.opt.deadline=this.opt.deadline.replace(/\-/g,"/");var n=this,i=$(this.opt.container),r=new Date(this.opt.deadline),a="000000000000000000",l=!1;this.start=function(){if(!l){l=!0,n.tick();var t=function(){n.tick(),l&&setTimeout(t,1e3)};setTimeout(t,1e3)}},this.stop=function(){l&&(l=!1)},this.tick=function(){var t=Date.parse((new Date).toString()),o=Date.parse(r.toString()),n=parseInt((o-t)/1e3);if(n>0){var a=n%60;n=Math.floor(n/60);var l=n%60;n=Math.floor(n/60);var s=n%24;n=Math.floor(n/24);var c=n%30;n=Math.floor(n/30);var d=n%12;n=Math.floor(n/12);var h=n;i.find(this.opt.selectorYear).html(h),i.find(this.opt.selectorMonth).html(e(d,2)),i.find(this.opt.selectorDay).html(e(c,2)),i.find(this.opt.selectorHour).html(e(s,2)),i.find(this.opt.selectorMinute).html(e(l,2)),i.find(this.opt.selectorSecond).html(e(a,2)),this.opt.callbackTick(h,d,c,s,a,l)}else i.find(this.opt.selectorYear).html(e(0,2)),i.find(this.opt.selectorMonth).html(e(0,2)),i.find(this.opt.selectorDay).html(e(0,2)),i.find(this.opt.selectorHour).html(e(0,2)),i.find(this.opt.selectorMinute).html(e(0,2)),i.find(this.opt.selectorSecond).html(e(0,2)),this.opt.callbackTick(0,0,0,0,0,0)}};"undefined"!=typeof module&&"object"==typeof exports&&define.cmd?module.exports=t:"function"==typeof define&&define.amd?define(function(){return t}):this.Countdown=t}).call(function(){return this||("undefined"!=typeof window?window:global)}());