function Countdown (el, date, hours, minutes, seconds)
{
   this.el = get_by_id(el);
   this.timestamp = new Date(date);
   this.hours = hours;
   this.minutes = minutes;
   this.seconds = seconds;

   this.display();

   return this;
}

Countdown.prototype = {

   el : null,
   timestamp : 0,
   hours : false,
   minutes : false,
   seconds : false,

   display : function ()
   {
      kill_children(this.el);
      make_text(this.getTime(), this.el);
   },

   tick : function ()
   {
      this.display();
   },

   getTime : function ()
   {
      var now = new Date();

      var diff = Math.floor((this.timestamp - now.getTime()) / 1000);

      if (diff < 1) return '';

      var days = Math.floor(diff / (60 * 60 * 24));
      var temp = diff - (days * 60 * 60 * 24);

      var hours = Math.floor(temp / (60 * 60));
      var temp = temp - (hours * 60 * 60);

      var mins = Math.floor(temp / 60);
      var secs = temp - (mins * 60);

      var str = new Array();

      if (days > 0)
         str.push(days + " day" + (days != 1 ? "s" : ""));

      if (this.hours && hours > 0)
         str.push(hours + " hour" + (hours != 1 ? "s" : ""));

      if (this.minutes && mins > 0)
         str.push(mins + " minute" + (mins != 1 ? "s" : ""));

      if (this.seconds)
         str.push(secs + " second" + (secs != 1 ? "s" : ""));

      return str.join(", ");
   }
}