// REFERENCE CODE: <SCRIPT LANGUAGE="JAVASCRIPT" SRC="/scripts/date.js"></SCRIPT>

//=============================================================================
// PURPOSE: Library function for the "fncProperDate" function
// USE: Returns an array of "n" length that it is passed
// EX: varArray = new MakeArray(5)

function MakeArray(n) {
	this.length = n
	return this
}

//=============================================================================
// PURPOSE: To call a *friendly* date; "December 25th, 2000"
// USE: Call the script where you want the date
// EX: <SCRIPT LANGUAGE="JAVASCRIPT">fncProperDate();</SCRIPT>

function fncProperDate() {
	var oneDate = new Date()
	var DateText = ""
	monthNames = new MakeArray(12)
	monthNames[1] = "Janeiro"; monthNames[2] = "Fevereiro"; monthNames[3] = "Março"; monthNames[4] = "Abril"; monthNames[5] = "Maio";	monthNames[6] = "Junho"; monthNames[7] = "Julho";	monthNames[8] = "Agosto"; monthNames[9] = "Setembro"; monthNames[10] = "Outubro";	monthNames[11] = "Novembro"; monthNames[12] = "Dezembro"
	dayNames = new MakeArray(7)
	dayNames[1] = "Domingo"; dayNames[2] = "Segunda";	dayNames[3] = "Terça";;dayNames[4] = "Quarta";	dayNames[5] = "Quinta"; dayNames[6] = "Sexta";;dayNames[7] = "Sábado"
	var theDay = dayNames[oneDate.getDay() + 1]
	var theMonth = monthNames[oneDate.getMonth() + 1]
	var theYear = oneDate.getYear()
	if (theYear < 1000) { theYear += 1900 }
	TheText = theDay + " - " + theMonth + " " + oneDate.getDate() + ", " + theYear
	DateText = TheText
	document.write(DateText)
}