// REFERENCE CODE: <SCRIPT LANGUAGE="JAVASCRIPT" SRC="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] = "1月"; monthNames[2] = "2月"; monthNames[3] = "3月"; monthNames[4] = "4月"; monthNames[5] = "5月";	monthNames[6] = "6月"; monthNames[7] = "7月";	monthNames[8] = "8月"; monthNames[9] = "9月"; monthNames[10] = "10月";	monthNames[11] = "11月"; monthNames[12] = "12月"
	dayNames = new MakeArray(7)
	dayNames[1] = "星期日"; dayNames[2] = "星期一";	dayNames[3] = "星期二";;dayNames[4] = "星期三";	dayNames[5] = "星期四"; dayNames[6] = "星期五";;dayNames[7] = "星期六"
	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)
}