(function(g){function y(){this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Mins','Secs'],labels1:['Year','Month','Week','Day','Hour','Min','Sec'],compactLabels:['y','m','w','d'],timeSeparator:':',isRTL:false};this._6={format:'dHMS',layout:'',compact:false,description:'',expiryUrl:null,alwaysExpire:false,onExpiry:null,onTick:null,serverTime:null};g.extend(this._6,this.regional[''])}var l='countdown';var m=0;var p=1;var v=2;var w=3;var q=4;var r=5;var t=6;g.extend(y.prototype,{markerClassName:'hasCountdown',setDefaults:function(c){this._c(this._6,c);z(this._6,c||{})},_e:function(c,b){c=g(c);if(c.is('.'+this.markerClassName)){return}c.addClass(this.markerClassName);if(!c[0].id){c[0].id='cdn'+new Date().getTime()}var a={};a.options=g.extend({},b);a._2=[0,0,0,0,0,0,0];this._d(a);g.data(c[0],l,a);this._7(c,a)},_7:function(c,b){var a=g(c);b=b||g.data(a[0],l);if(!b){return}a.html(this._f(b));a[(this._0(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var f=this._0(b,'onTick');if(f){f.apply(a[0],[b._4!='lap'?b._2:this._a(b,b._1,new Date())])}var e=b._4!='pause'&&(b._3?b._5.getTime()<=b._3.getTime():b._5.getTime()>=b._8.getTime());if(e){if(b._9||this._0(b,'alwaysExpire')){var d=this._0(b,'onExpiry');if(d){d.apply(a[0],[])}var i=this._0(b,'expiryUrl');if(i){window.location=i}}b._9=null}else if(b._4=='pause'){b._k=null}else{var k=this._0(b,'format');b._9=setTimeout('$.countdown._7("#'+a[0].id+'")',(k.match('s|S')?1:(k.match('m|M')?30:600))*980)}g.data(a[0],l,b)},_l:function(c,b){var a=g.data(c,l);if(a){this._c(a.options,b);z(a.options,b||{});this._d(a);g.data(c,l,a);this._7(c,a)}},_c:function(c,b){var a=false;for(var f in b){if(f.match(/[Ll]abels/)){a=true;break}}if(a){for(var f in c){if(f.match(/[Ll]abels[0-9]/)){c[f]=null}}}},_m:function(c){c=g(c);if(!c.is('.'+this.markerClassName)){return}c.removeClass(this.markerClassName).empty();var b=g.data(c[0],l);if(b._9){clearTimeout(b._9)}g.removeData(c[0],l)},_n:function(c){this._4(c,'pause')},_o:function(c){this._4(c,'lap')},_p:function(c){this._4(c,null)},_4:function(c,b){var a=g.data(c,l);if(a){if(a._4=='pause'&&!b){a._2=a._g;var f=(a._3?'-':'+');a[a._3?'_3':'_8']=this._b(f+a._2[0]+'Y'+f+a._2[1]+'O'+f+a._2[2]+'W'+f+a._2[3]+'D'+f+a._2[4]+'H'+f+a._2[5]+'M'+f+a._2[6]+'S')}a._4=b;a._g=(b=='pause'?a._2:null);g.data(c,l,a);this._7(c,a)}},_q:function(c){var b=g.data(c,l);return(!b?null:(!b._4?b._2:this._a(b,b._1,new Date())))},_0:function(c,b){return(c.options[b]!=null?c.options[b]:g.countdown._6[b])},_d:function(c){var b=new Date();var a=this._0(c,'serverTime');c._h=(a?a.getTime()-b.getTime():0);c._3=this._0(c,'since');if(c._3){c._3=this._b(c._3,null)}c._8=this._b(this._0(c,'until'),b);c._1=this._i(c)},_b:function(j,s){var u=function(c){var b=new Date();b.setTime(b.getTime()+c*1000);return b};var n=function(c,b){return 32-new Date(c,b,32).getDate()};var A=function(c){var b=new Date();var a=b.getFullYear();var f=b.getMonth();var e=b.getDate();var d=b.getHours();var i=b.getMinutes();var k=b.getSeconds();var o=/([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g;var h=o.exec(c);while(h){switch(h[2]||'s'){case's':case'S':k+=parseInt(h[1]);break;case'm':case'M':i+=parseInt(h[1]);break;case'h':case'H':d+=parseInt(h[1]);break;case'd':case'D':e+=parseInt(h[1]);break;case'w':case'W':e+=parseInt(h[1])*7;break;case'o':case'O':f+=parseInt(h[1]);e=Math.min(e,n(a,f));break;case'y':case'Y':a+=parseInt(h[1]);e=Math.min(e,n(a,f));break}h=o.exec(c)}b=new Date(a,f,e,d,i,k,0);return b};var x=(j==null?s:(typeof j=='string'?A(j):(typeof j=='number'?u(j):j)));if(x)x.setMilliseconds(0);return x},_f:function(a){a._2=periods=(a._4?a._2:this._a(a,a._1,new Date()));var f=false;var e=0;for(var d=0;d<a._1.length;d++){f|=(a._1[d]=='?'&&periods[d]>0);a._1[d]=(a._1[d]=='?'&&!f?null:a._1[d]);e+=(a._1[d]?1:0)}var i=this._0(a,'compact');var k=this._0(a,'layout');var o=(i?this._0(a,'compactLabels'):this._0(a,'labels'));var h=this._0(a,'timeSeparator');var j=this._0(a,'description')||'';var s=function(c){return(c<10?'0':'')+c};var u=function(c){var b=g.countdown._0(a,'compactLabels'+periods[c]);return(a._1[c]?periods[c]+(b?b[c]:o[c])+' ':'')};var n=function(c){var b=g.countdown._0(a,'labels'+periods[c]);return(a._1[c]?'<div class="countdown_section"><span class="countdown_amount">'+periods[c]+'</span><br/>'+(b?b[c]:o[c])+'</div>':'')};return(k?this._j(a,k,i):((i?'<div class="countdown_row countdown_amount'+(a._4?' countdown_holding':'')+'">'+u(m)+u(p)+u(v)+u(w)+(a._1[q]?s(periods[q]):'')+(a._1[r]?(a._1[q]?h:'')+s(periods[r]):'')+(a._1[t]?(a._1[q]||a._1[r]?h:'')+s(periods[t]):''):'<div class="countdown_row countdown_show'+e+(a._4?' countdown_holding':'')+'">'+n(m)+n(p)+n(v)+n(w)+n(q)+n(r)+n(t))+'</div>'+(j?'<div class="countdown_row countdown_descr">'+j+'</div>':'')))},_j:function(d,i,k){var o=(k?this._0(d,'compactLabels'):this._0(d,'labels'));var h=i;var j=function(c,b){var a=new RegExp('%'+c+'.*%'+c);var f=new RegExp('%'+c+'.*');while(true){var e=a.exec(h);if(!e){break}e[0]=e[0].substr(0,2)+e[0].substr(2).replace(f,'%'+c);h=h.replace(e[0],d._1[b]?s(e[0],c,b):'')}};var s=function(c,b,a){var f=g.countdown._0(d,(k?'compactLabels':'labels')+d._2[a]);return c.substr(2,c.length-4).replace(/%nn/g,(d._2[a]<10?'0':'')+d._2[a]).replace(/%n/g,d._2[a]).replace(/%l/g,(f?f[a]:o[a]))};j('Y',m);j('O',p);j('W',v);j('D',w);j('H',q);j('M',r);j('S',t);return h},_i:function(c){var b=this._0(c,'format');var a=[];a[m]=(b.match('y')?'?':(b.match('Y')?'!':null));a[p]=(b.match('o')?'?':(b.match('O')?'!':null));a[v]=(b.match('w')?'?':(b.match('W')?'!':null));a[w]=(b.match('d')?'?':(b.match('D')?'!':null));a[q]=(b.match('h')?'?':(b.match('H')?'!':null));a[r]=(b.match('m')?'?':(b.match('M')?'!':null));a[t]=(b.match('s')?'?':(b.match('S')?'!':null));return a},_a:function(a,f,e){a._5=e;a._5.setMilliseconds(0);var d=new Date(a._5.getTime());if(a._3&&e.getTime()<a._3.getTime()){a._5=e=d}else if(a._3){e=a._3}else{d.setTime(a._8.getTime());if(e.getTime()>a._8.getTime()){a._5=e=d}}d.setTime(d.getTime()-a._h);var i=[0,0,0,0,0,0,0];if(f[m]||f[p]){var k=Math.max(0,(d.getFullYear()-e.getFullYear())*12+d.getMonth()-e.getMonth()+(d.getDate()<e.getDate()?-1:0));i[m]=(f[m]?Math.floor(k/12):0);i[p]=(f[p]?k-i[m]*12:0);if(a._3){d.setFullYear(d.getFullYear()-i[m]);d.setMonth(d.getMonth()-i[p])}else{e=new Date(e.getTime());e.setFullYear(e.getFullYear()+i[m]);e.setMonth(e.getMonth()+i[p])}}var o=Math.floor((d.getTime()-e.getTime())/1000);var h=function(c,b){i[c]=(f[c]?Math.floor(o/b):0);o-=i[c]*b};h(v,604800);h(w,86400);h(q,3600);h(r,60);h(t,1);return i}});function z(c,b){g.extend(c,b);for(var a in b){if(b[a]==null){c[a]=null}}return c}g.fn.countdown=function(c){var b=Array.prototype.slice.call(arguments,1);if(c=='getTimes'){return g.countdown['_'+c+'Countdown'].apply(g.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof c=='string'){g.countdown['_'+c+'Countdown'].apply(g.countdown,[this].concat(b))}else{g.countdown._e(this,c)}})};g.countdown=new y()})(jQuery);