function findThanksgiving(){
   dtThanksgiving = new Date();
   dtThanksgiving.setMonth(10);  // November
   dtThanksgiving.setDate(1);
   // Find first Thursday.
   while( dtThanksgiving.getDay() != 4){
      dtThanksgiving.setDate( dtThanksgiving.getDate() + 1 ) ;
   }
   // Add 3 weeks.
   dtThanksgiving.setDate( dtThanksgiving.getDate() + 21 );

}

function getDate(){
	msPerDay = 24 * 60 * 60 * 1000 ;
	timeLeft = (BigDay.getTime() - today.getTime());
	e_daysLeft = timeLeft / msPerDay;
	daysLeft = Math.round(e_daysLeft);
}

findThanksgiving();

today = new Date();
var thanksgiving = dtThanksgiving;
var curr_year = today.getFullYear();
var christmas = "December 25, " + curr_year;


BigDay = new Date(thanksgiving);
getDate();

if (daysLeft > 1) {
	document.write("There are only " + daysLeft + " days "  + " left until Thanksgiving");
} else if (daysLeft === 1) {
	document.write("Tomorrow is Thanksgiving");
} else if (daysLeft === 0) {
	document.write("Today is Thanksgiving");
} else  {
	BigDay = new Date(christmas);
	getDate();
	if (daysLeft > 1) {
		document.write("There are only " + daysLeft + " days "  + " left until Christmas");
	} else if (daysLeft === 1) {
		document.write("Today is Christmas Eve");
	} else if (daysLeft === 0) {
		document.write("Today is Christmas!");
	} else {
		BigDay = new Date(thanksgiving);
		getDate();
		daysLeft2 = daysLeft + 365;
		document.write("There are only " + daysLeft2 + " days "  + " left until Thanksgiving");
	}
}



