// dayOfWeek.js  P. Conrad for CISC103, 09/18/2007


// function dayOfWeek
// consumes: nothing
// produces: a string representing the current day of the week (e.g. "Tuesday")

function dayOfWeek()
{
  // set up an array with all the days of the week, spelled out

  var daysOfWeek= ["Sunday","Monday","Tuesday","Wednesday",
	"Thursday","Friday","Saturday"];

  // create an object representing today's date

  var today = new Date();

  // use the "getDay()" method to get the index of today's date

  var index = today.getDay(); // returns 0 for Sunday, 1 for Monday, etc.

  // return that element of the array
  return daysOfWeek[index];
	
}
