now = new Date();				// now = today's date
newyear = new Date("Jan 1 00:00:00 2000");	// newyear = date of new year 2000
year = now.getFullYear();			// year = this year
year++;						// year = next year
newyear.setFullYear(year);			// change newyear to next year
seconds = (newyear - now) / 1000;		//
days = seconds / 60 / 60 / 24;			// calculate days to new year
days = Math.floor(days);			//
document.write("There are " + days + " days to the end of the year.");
