
/* ------------------------------END : message.plugin.js ---------------------------------------- */

/* ------------------------------START : timer.plugin.js ---------------------------------------- */
(function($){$.fn.countDown=function(options){config={};$.extend(config,options);diffSecs=this.setCountDown(config);if(config.onComplete)
{$.data($(this)[0],'callback',config.onComplete);}
if(config.omitWeeks)
{$.data($(this)[0],'omitWeeks',config.omitWeeks);}
$(this).doCountDown($(this).attr('id'),diffSecs,500);return this;};$.fn.stopCountDown=function(){clearTimeout($.data(this[0],'timer'));};$.fn.startCountDown=function(){this.doCountDown($(this).attr('id'),$.data(this[0],'diffSecs'),500);};$.fn.setCountDown=function(options){var targetTime=new Date();if(options.targetDate)
{targetTime=new Date(options.targetDate.month+'/'+options.targetDate.day+'/'+options.targetDate.year+' '+options.targetDate.hour+':'+options.targetDate.min+':'+options.targetDate.sec+(options.targetDate.utc?' UTC':''));}
else if(options.targetOffset)
{targetTime.setFullYear(options.targetOffset.year+targetTime.getFullYear());targetTime.setMonth(options.targetOffset.month+targetTime.getMonth());targetTime.setDate(options.targetOffset.day+targetTime.getDate());targetTime.setHours(options.targetOffset.hour+targetTime.getHours());targetTime.setMinutes(options.targetOffset.min+targetTime.getMinutes());targetTime.setSeconds(options.targetOffset.sec+targetTime.getSeconds());}
var nowTime=new Date();if(options.fromDate)
{nowTime=new Date(options.fromDate.month+'/'+options.fromDate.day+'/'+options.fromDate.year+' '+options.fromDate.hour+':'+options.fromDate.min+':'+options.fromDate.sec+(options.fromDate.utc?' UTC':''));}
diffSecs=Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);$.data(this[0],'diffSecs',diffSecs);return diffSecs;};$.fn.doCountDown=function(id,diffSecs,duration){$this=$('#'+id);if(diffSecs<=0)
{diffSecs=0;if($.data($this[0],'timer'))
{clearTimeout($.data($this[0],'timer'));}}
secs=diffSecs%60;mins=Math.floor(diffSecs/60)%60;hours=Math.floor(diffSecs/60/60)%24;if($.data($this[0],'omitWeeks')==true)
{days=Math.floor(diffSecs/60/60/24);weeks=Math.floor(diffSecs/60/60/24/7);}
else
{days=Math.floor(diffSecs/60/60/24);weeks=Math.floor(diffSecs/60/60/24/7);}
hours=(days*24)+hours+(weeks*7*24);hours1=(hours%24);if(weeks==0&&days==0&&hours==0&&mins==0&&secs==0){window.location.reload(true);}
$this.dashChangeTo(id,'seconds_dash',secs,duration?duration:800);$this.dashChangeTo(id,'minutes_dash',mins,duration?duration:1200);$this.dashChangeTo(id,'hours_dash',hours1,duration?duration:1200);if(days!=0)
{$this.dashChangeTo(id,'days_dash',days,duration?duration:1200);}
else
{$('#dayschange').hide();$('#'+id+" .days_dash").hide();}
$this.dashChangeTo(id,'weeks_dash',weeks,duration?duration:1200);$.data($this[0],'diffSecs',diffSecs);if(diffSecs>0)
{e=$this;t=setTimeout(function(){e.doCountDown(id,diffSecs-1)},1000);$.data(e[0],'timer',t);}
else if(cb=$.data($this[0],'callback'))
{$.data($this[0],'callback')();}};$.fn.dashChangeTo=function(id,dash,n,duration){$this=$('#'+id);if(n<10){n="0"+n;}
$('#'+id+' .'+dash+' .digit:eq(0)').html(n);};$.fn.digitChangeTo=function(digit,n,duration){if(!duration)
{duration=800;}
if($(digit+' div.top').html()!=n+'')
{$(digit+' div.top').css({'display':'none'});$(digit+' div.top').html((n?n:'0')).slideDown(duration);$(digit+' div.bottom').animate({'height':''},duration,function(){$(digit+' div.bottom').html($(digit+' div.top').html());$(digit+' div.bottom').css({'display':'block','height':''});$(digit+' div.top').hide().slideUp(10);});}};})(jQuery);

/* ------------------------------END : timer.plugin.js ---------------------------------------- */
