//
// Copyright(c) Coo Communications Ltd.
// Count Down Module Ver1.01
// 2001/12/31
//

function getCountDownDay()
{
	theYear	=	2002;
	theMonth=	1;
	theDate	=	1;
	comment ="<b>A Happy New Year,2002!</b>";

	theMonthName = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	today    = new Date();						//　現在の時を取得するオブジェクトを生成
	endDay   = theMonthName[theMonth-1]+" "+theDate+","+theYear;	//　指定した日付
	endToday = new Date(endDay);					//　指定した日付のオブジェクトを生成

									//　24時間×60分×60秒×1000秒=１日
	countDay   = (endToday.getTime() - today.getTime()) / (24 * 60 * 60 * 1000);	//　日付の差分を求める
	countHour  = (endToday.getTime() - today.getTime() - Math.floor(countDay) * 24 * 60 * 60 * 1000) / (60 * 60 * 1000);
	countMinut = (endToday.getTime() - today.getTime() - Math.floor(countDay) * 24 * 60 * 60 * 1000 - Math.floor(countHour) * 60 * 60 * 1000) / (60 * 1000);

	// もし、日付を超えていたら
	if ((endToday.getTime() - today.getTime())<0) {
		return comment;
	} else {
		if (Math.floor(countDay)>0) {
			return theYear+"年"+theMonth+"月"+theDate+"日まで、あと"+Math.floor(countDay)+"日"+Math.floor(countHour) +"時間"+Math.floor(countMinut) +"分";
		} else {
			return theYear+"年"+theMonth+"月"+theDate+"日まで、あと"+Math.floor(countHour) +"時間"+Math.floor(countMinut) +"分";
		}
	}
}
