!function(e){function n(n,a){this.element=n,this.settings=e.extend({},t,a),this._defaults=t,this._name=s,this.targetDate=null,this.targetTimezone=null,this.days=null,this.hours=null,this.minutes=null,this.seconds=null,this.milliseconds=null,this.deciseconds=null,this.intervalId=null,this.wrapsExists=new Array,this.oldValues=new Array,this.changed=!1,this.init()}var s="countEverest",t={day:1,month:1,year:2050,hour:0,minute:0,second:0,millisecond:0,timeZone:!1,daysWrapper:".ce-days",hoursWrapper:".ce-hours",minutesWrapper:".ce-minutes",secondsWrapper:".ce-seconds",decisecondsWrapper:".ce-dseconds",millisecondsWrapper:".ce-mseconds",daysLabelWrapper:".ce-days-label",hoursLabelWrapper:".ce-hours-label",minutesLabelWrapper:".ce-minutes-label",secondsLabelWrapper:".ce-seconds-label",decisecondsLabelWrapper:".ce-dseconds-label",millisecondsLabelWrapper:".ce-mseconds-label",daysLabel:"days",dayLabel:"day",hoursLabel:"hours",hourLabel:"hour",minutesLabel:"minutes",minuteLabel:"minute",secondsLabel:"seconds",secondLabel:"second",decisecondsLabel:"Deciseconds",decisecondLabel:"Decisecond",millisecondsLabel:"Milliseconds",millisecondLabel:"Millisecond",timeout:1e3,highspeedTimeout:4,leftHandZeros:!0,wrapDigits:!0,dayInMilliseconds:864e5,hourInMilliseconds:36e5,minuteInMilliseconds:6e4,secondInMilliseconds:1e3,decisecondInMilliseconds:100,onInit:null,beforeCalculation:null,afterCalculation:null,onCalculation:null,onChange:null,onComplete:null};n.prototype={init:function(){var n=this,s=n.element,t=n.settings;n.setTargetDate(new Date(t.year,t.month-1,t.day,t.hour,t.minute,t.second)),(e(s).find(t.decisecondsWrapper).length>0||e(s).find(t.millisecondsWrapper).length>0)&&(t.timeout=t.highspeedTimeout),e.isFunction(t.onInit)&&t.onInit.call(n),n.intervalId=setInterval(function(){n.calculate()},t.timeout),n.calculate()},calculate:function(){var n=this,s=n.settings,t=s.dayInMilliseconds,a=s.hourInMilliseconds,i=s.minuteInMilliseconds,l=s.secondInMilliseconds,o=s.decisecondInMilliseconds,r=n.getCurrentDate(),c=n.getTargetDate(),d=r.getTime(),u=s.timeZone===!1?0:(c.getTimezoneOffset()/60+s.timeZone)*s.hourInMilliseconds,p=c.getTime()-u,h=p-d,m=h,g=!1;e.isFunction(s.beforeCalculation)&&s.beforeCalculation.call(n),n.changed=!1;var b=Math.floor(m/t);m%=t;var f=Math.floor(m/a);m%=a;var L=Math.floor(m/i);m%=i;var w=Math.floor(m/l),D=m%l,T=Math.floor(D/o);b=n.naturalNum(b),f=n.naturalNum(f),L=n.naturalNum(L),w=n.naturalNum(w),D=n.naturalNum(D),T=n.naturalNum(T),n.days=b,n.hours=f,n.minutes=L,n.seconds=w,n.milliseconds=D,n.deciseconds=T,n.output(),Math.floor(h/s.timeout)<=0&&(g=!0,(null!=s.millisecondsWrapper||null!=s.decisecondsWrapper)&&(g=0>=h?!0:!1)),1==g&&(e.isFunction(s.onComplete)&&s.onComplete.call(n),clearInterval(n.intervalId)),e.isFunction(s.onCalculation)&&s.onCalculation.call(n),e.isFunction(s.afterCalculation)&&s.afterCalculation.call(n)},output:function(){var n=this,s=n.settings,t=n.days,a=n.hours,i=n.minutes,l=n.seconds,o=n.deciseconds,r=n.milliseconds,c=s.dayLabel,d=s.hourLabel,u=s.minuteLabel,p=s.secondLabel,h=s.decisecondLabel,m=s.millisecondsLabel,g=1==t&&null!==c?c:s.daysLabel,b=1==a&&null!==d?d:s.hoursLabel,f=1==i&&null!==u?u:s.minutesLabel,L=1==l&&null!==p?p:s.secondsLabel,w=1==o&&null!==h?h:s.decisecondsLabel,D=1==r&&null!==m?m:s.millisecondsLabel;n.writeToDom(s.daysLabelWrapper,g),n.writeToDom(s.hoursLabelWrapper,b),n.writeToDom(s.minutesLabelWrapper,f),n.writeToDom(s.secondsLabelWrapper,L),n.writeToDom(s.decisecondsLabelWrapper,w),n.writeToDom(s.millisecondsLabelWrapper,D),1==s.leftHandZeros&&(t=n.strPad(t,2),a=n.strPad(a,2),i=n.strPad(i,2),l=n.strPad(l,2),r=n.strPad(r,3)),1==s.wrapDigits&&(t=n.wrapChars(t,"ce-days-digit"),a=n.wrapChars(a,"ce-hours-digit"),i=n.wrapChars(i,"ce-minutes-digit"),l=n.wrapChars(l,"ce-seconds-digit"),o=n.wrapChars(o,"ce-dseconds-digit"),r=n.wrapChars(r,"ce-mseconds-digit")),n.writeToDom(s.daysWrapper,t),n.writeToDom(s.hoursWrapper,a),n.writeToDom(s.minutesWrapper,i),n.writeToDom(s.secondsWrapper,l),n.writeToDom(s.decisecondsWrapper,o),n.writeToDom(s.millisecondsWrapper,r),e.isFunction(s.onChange)&&1==n.changed&&s.onChange.call(n)},setTargetDate:function(e){this.targetDate=e},getTargetDate:function(){return this.targetDate},getCurrentDate:function(){return new Date},getOptions:function(){return this.settings},naturalNum:function(e){return 0>e?0:e},strPad:function(e,n,s){var t=e.toString();for(s||(s="0");t.length'+e[t]+"";return s},writeToDom:function(n,s){var t=this,a=e(t.element);t.settings,null==t.wrapsExists[n]&&(t.wrapsExists[n]=a.find(n).length>0?!0:!1),t.oldValues[n]!=s&&t.wrapsExists[n]&&(t.oldValues[n]=s,a.find(n).html(s),t.changed=!0)}},e.fn[s]=function(t){return this.each(function(){var a="plugin_";e.data(this,a+s)||e.data(this,a+s,new n(this,t))})}}(jQuery,window,document);