'); //element.hide(); } }); if (timeout_counter) clearTimeout(timeout_counter); // timeout_counter = setTimeout(function(){populateTimers()}, 5000); } function getEndTime(ends) { // get ending time var difference = ends; var showendtime = false; var has_ended = false; if (difference > 0) { var ending_time = ''; var d = 0; var days_difference = parseInt(difference / 86400); if (days_difference > 0) { ending_time = ending_time + days_difference + 'd '; d++; } difference = difference % 86400; var hours_difference = parseInt(difference / 3600); if (hours_difference > 0) { ending_time = ending_time + hours_difference + 'h '; d++; } difference = difference % 3600; var minutes_difference = parseInt(difference / 60); var seconds_difference = difference % 60; if (minutes_difference > 0) { ending_time = ending_time + minutes_difference + 'm '; d++; } if (seconds_difference > 0) { ending_time = ending_time + seconds_difference + 's '; } showendtime = true; } else { ending_time = 0; has_ended = true; } return ending_time; } $(function () { populateTimers(); });