// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + ", " +
         months[now.getMonth()] + " " +
         date + ", " +
         (fourdigits(now.getYear())) ;

// Print out the data.

      
function displayDate(){
		document.write(today);
}


function addClass(anElement, aClass)
{
  if (anElement)
  { 
    if (anElement.className)
    {
      var currentClasses = ' ' + anElement.className + ' ';
      var theClass = ' ' + aClass + ' ';
      if (currentClasses.indexOf(theClass) == -1)
      {
        anElement.className = anElement.className + theClass;
      }
    }
    else
    {
      anElement.className = aClass;
    }
  }
}

function removeClass(anElement, aClass)
{
  var currentClasses = ' ' + anElement.className + ' ';
  var theClass = ' ' + aClass + ' ';
  if (currentClasses.indexOf(theClass) != -1)
  {
    anElement.className = currentClasses.replace(theClass,'');
  }
}

function addClassById(anId, aClass)
{
  var elt = document.getElementById(anId);
  if (elt)
    addClass(elt, aClass);
}

function removeClassById(anId, aClass)
{
  var elt = document.getElementById(anId);
  if (elt)
    removeClass(elt, aClass);
}

function mouseOver (anElement, aNewClass, aOldClass)
{
    var element = document.getElementById(anElement);
    if (!element)
		return;
	
	removeClassById(anElement,aOldClass);
	addClassById(anElement,aNewClass);
}

function mouseOut (anElement, aNewClass, aOldClass)
{
    var element = document.getElementById(anElement);
    if (!element)
		return;
	
	removeClassById(anElement,aOldClass);
	addClassById(anElement,aNewClass);
}