// JavaScript Document
var now = new Date();
// Array list of days.
var days = new Array('Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado');
// Array list of months.
var months = new Array('Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
var hour = now.getHours()
var congratulation
if (hour < 24)
  congratulation = "Boa Noite"
if (hour < 18)
  congratulation = "Boa Tarde"
if (hour < 12)
  congratulation = "Bom Dia"

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + ", " +
              date + " de " + months[now.getMonth()] + " de " +
                (fourdigits(now.getYear())) ;

// Print out the data.
//document.write("" +today + " - " + congratulation);
//  End -->
