jQuery(document).ready(function( $ ) {
var liftoffTime = new Date(amaucp.till_year,(amaucp.till_month-1),amaucp.till_date,amaucp.till_hour,amaucp.till_minute);
$('#defaultCountdown2').countdown({
labels: ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds'],
labels1: ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'],
until: liftoffTime,
format: 'DHMS',
onTick: watchCountdown,
layout: '
{dl}
{hl}
{ml}
{sl}
'
});
function watchCountdown(periods) {
$('.timer_unit:nth-child(1) .text_timer').text(periods[3]);
$('.timer_unit:nth-child(2) .text_timer').text(periods[4]);
$('.timer_unit:nth-child(3) .text_timer').text(periods[5]);
$('.timer_unit:nth-child(4) .text_timer').text(periods[6]);
$('.timer_unit:nth-child(1) .text').text($('.string_dl').text());
$('.timer_unit:nth-child(2) .text').text($('.string_hl').text());
$('.timer_unit:nth-child(3) .text').text($('.string_ml').text());
$('.timer_unit:nth-child(4) .text').text($('.string_sl').text());
$('.progress-bar-percent').css( "width", (100-(Math.floor((periods[6]/60)*100))) + '%');
}
});