/*
 

*<SCRIPT language=JavaScript>document.write(printDate());</SCRIPT>


*调用的是以下函数：(可以存为一个JS文件，然后在使用页调用）
*/

var arrMonth	= new Array();
var arrWDay		= new Array();
var dateNow		= new Date();
var arrNo		= 1;

var strDFormat	= "%4年%2%3日";

arrNo = 1;
arrMonth[arrNo] = new arrItem(arrNo++, " 1月");
arrMonth[arrNo] = new arrItem(arrNo++, " 2月");
arrMonth[arrNo] = new arrItem(arrNo++, " 3月");
arrMonth[arrNo] = new arrItem(arrNo++, " 4月");
arrMonth[arrNo] = new arrItem(arrNo++, " 5月");
arrMonth[arrNo] = new arrItem(arrNo++, " 6月");
arrMonth[arrNo] = new arrItem(arrNo++, " 7月");
arrMonth[arrNo] = new arrItem(arrNo++, " 8月");
arrMonth[arrNo] = new arrItem(arrNo++, " 9月");
arrMonth[arrNo] = new arrItem(arrNo++, "10月");
arrMonth[arrNo] = new arrItem(arrNo++, "11月");
arrMonth[arrNo] = new arrItem(arrNo++, "12月");

arrNo = 0;
arrWDay[arrNo] = new arrItem(arrNo++, "Sunday");
arrWDay[arrNo] = new arrItem(arrNo++, "Monday");
arrWDay[arrNo] = new arrItem(arrNo++, "Tuesday");
arrWDay[arrNo] = new arrItem(arrNo++, "Wednesday");
arrWDay[arrNo] = new arrItem(arrNo++, "Thursday");
arrWDay[arrNo] = new arrItem(arrNo++, "Friday");
arrWDay[arrNo] = new arrItem(arrNo++, "Saturday");

function arrItem(intCount, strValue){
		this.intCount       = intCount;
		this.strValue       = strValue;
}


function getIntDate(){
	var intDate		= dateNow.getDate();
	return intDate;
}

function getIntMonth(){
	var intMonth	= dateNow.getMonth() + 1;
	return intMonth;
}

function getIntYear(){
	var intYear		= dateNow.getFullYear();
	if ( intYear < 999 ){
		intYear += 1900;
	}
	return intYear;
}

function getIntWDay(){
	var intWDay		= dateNow.getDay();
	return intWDay;
}

function printDate(){
	var intDay		= getIntDate();
	var intMonth	= getIntMonth();
	var intYear		= getIntYear();

	var strMonth	= arrMonth[intMonth].strValue;
	var strDay		= arrWDay[getIntWDay()].strValue;

	strResult = strDFormat.replace(/\%2/i, strMonth);
	strResult = strResult.replace(/\%3/i, intDay);
	strResult = strResult.replace(/\%4/i, intYear);
	strResult = strResult.replace(/\%5/i, strDay);
	strResult = strResult.replace(/\%6/i, intMonth);

	return strResult;
}

