function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.now();
var total = t;
var miliSeconds = t % 1000;
t = t / 1000 | 0;
var seconds = t % 60;
t = t / 60 | 0;
var minutes = t % 60;
t = t / 60 | 0;
var hours = t ;
return {
'total': total,
'hours': hours,
'minutes': minutes,
'seconds': seconds,
'miliSeconds' : miliSeconds
};
}