// NREL footer page last updated

//get today's date, including the day of the week
var thedate = new Date();
var theday = thedate.getDay();


// Change the date to the previous Friday's date
switch (theday)
{
	case 1: //Monday
		var updated = thedate - 259200000;
		break;
	case 2: //Tuesday
		var updated = thedate - 345600000;
		break;
	case 3: //Wednesday
		var updated = thedate - 432000000;
		break;
	case 4: //Thursday
		var updated = thedate - 518400000;
		break;
	case 5: //Friday
		var updated = thedate;
		break;
	case 6: //Saturday
		var updated = thedate - 86400000;
		break;
	case 0: //Sunday
		var updated = thedate - 172800000;
		break;
}

//change into a date
var thenewdate = new Date(updated);

//set the format for the footer
var yearnow = thenewdate.getFullYear();
var monthnow = thenewdate.getMonth() +1 ;
var datenow = thenewdate.getDate();

//write it to the screen
document.write(monthnow+"/"+datenow+"/"+yearnow);