// JavaScript functions

function daysuntil(theyear, themonth, theday) {
   var now = new Date();
   var thefuture = new Date();
   thefuture.setFullYear(theyear);
   thefuture.setMonth(themonth);
   thefuture.setDate(theday);
   var days = Math.floor((thefuture.getTime() - now.getTime()) / (1000 * 60 * 60 * 24));
   return days
}

function dayssince(theyear, themonth, theday) {
   var now = new Date();
   var thepast = new Date();
   thepast.setFullYear(theyear);
   thepast.setMonth(themonth);
   thepast.setDate(theday);
   var days = Math.floor((now.getTime() - thepast.getTime()) / (1000 * 60 * 60 * 24));
   return days
}
