function init_countdown(id,element,datetime,fullmode){
var endDate = datetime;
if(!fullmode){
$(element).countdown({ date: endDate });
}else{
$(element).countdown({
date: endDate,
render: function(data) {
var el = $(this.el);
el.empty()
.append("<div>" + this.leadingZeros(data.years, 4) + " <span>years</span></div>")
.append("<div>" + this.leadingZeros(data.days, 3) + " <span>days</span></div>")
.append("<div>" + this.leadingZeros(data.hours, 2) + " <span>hrs</span></div>")
.append("<div>" + this.leadingZeros(data.min, 2) + " <span>min</span></div>")
.append("<div>" + this.leadingZeros(data.sec, 2) + " <span>sec</span></div>");
}
});
}
}
$(function(){
var mode=1;
$.each($('.countdown'), function() {
var _element = '.countdown-'+$(this).attr("id");
var _id = $(this).attr("id");
if($(_element).length > 0){
var _datetime = $(_element).attr('data-expiration');
init_countdown(_id,_element,_datetime,false(mode^=1));
}
});
});