var CountdownTimer={};(function($){$.fn.showCountdownTimer=function(optionParameter){var options=$.extend({},$.fn.showCountdownTimer.defaults,optionParameter);var target=new Date(options.targetDateUtc);CountdownTimer.timerLoop($(this),target,options.format,options.showLeadingZero,options.completeAction)};$.fn.showCountdownTimer.defaults={format:'%D days, %H hours, %M minutes, %S seconds',showLeadingZero:false,completeAction:'StopTimer',targetDateUtc:'01/01/2100 01:01:01 AM'}})(jQuery);CountdownTimer.addLeadingZero=function(n,showLeadingZero){if(showLeadingZero&&n<10){return"0"+n.toString()}else{return n.toString()}};CountdownTimer.getNextRefresh=function(format){if(format.indexOf('%S')>=0){return 1000}else if(format.indexOf('%M')>=0){return 5000}else if(format.indexOf('%H')>=0){return 60000}else if(format.indexOf('%D')>=0){return 300000}else{return 300000}};CountdownTimer.formatTimer=function(totalSeconds,format,showLeadingZero){var updatedString=format;if(updatedString.indexOf('%D')>=0){var days=Math.floor(totalSeconds/86400);totalSeconds=totalSeconds%86400;updatedString=updatedString.replace(/%D/g,days)}if(updatedString.indexOf('%H')>=0){var hours=Math.floor(totalSeconds/3600);totalSeconds=totalSeconds%3600;updatedString=updatedString.replace(/%H/g,hours)}if(updatedString.indexOf('%M')>=0){var minutes=Math.floor(totalSeconds/60);totalSeconds=totalSeconds%60;updatedString=updatedString.replace(/%M/g,CountdownTimer.addLeadingZero(minutes,showLeadingZero))}if(updatedString.indexOf('%S')>=0){var seconds=totalSeconds;updatedString=updatedString.replace(/%S/g,CountdownTimer.addLeadingZero(seconds,showLeadingZero))}return updatedString};CountdownTimer.timerLoop=function(jqueryNode,target,format,showLeadingZero,completeAction){var now=new Date();var millisecondsUntilTarget=new Date(target-now);var secondsUntilTarget=Math.floor(millisecondsUntilTarget.valueOf()/1000);var formattedDate;if(secondsUntilTarget<=0){if(completeAction==='StopTimer'){formattedDate=CountdownTimer.formatTimer(0,format,showLeadingZero);jqueryNode.find('.clock').html(formattedDate)}else if(completeAction==='Hide'){jqueryNode.hide()}}else{formattedDate=CountdownTimer.formatTimer(secondsUntilTarget,format,showLeadingZero);jqueryNode.find('.clock').html(formattedDate);var timerCallback=function(){CountdownTimer.timerLoop(jqueryNode,target,format,showLeadingZero,completeAction)};setTimeout(timerCallback,CountdownTimer.getNextRefresh(format))}};

// Required by the Microsoft Ajax Framework:
if ((typeof Sys !== "undefined") && (typeof Sys.Application !== "undefined")) {
    Sys.Application.notifyScriptLoaded();
}
