dim clasky_c
clasky_c=0
dim mydiarydate

sub dodiary(mydiary)
mydiarydate=mydiary
call writemonth(clasky_c)
end sub

sub writemonth(c)
	clasky_c=c
	dim tmpdate,tday,w,show_date,d,y,m,tmpstr,fint
	tmpdate=dateadd("m",c,now)
	y=datepart("yyyy",tmpdate)
	m=datepart("m",tmpdate)
	tday=y&"-"&m&"-1"
	tday=dateadd("d",(0-datepart("w",tday)),tday)
	tmpstr=tmpstr+"<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"">"
       tmpstr=tmpstr+"<tr height=20><td><div align=center class=red><b>日</b></div></td><td><div align=center><b>一</b></div></td><td><div align=center><b>二</b></div></td><td><div align=center><b>三</b></div></td>"
	tmpstr=tmpstr+"<td><div align=center><b>四</b></div></td><td><div align=center><b>五</b></div></td><td><div align=center><b>六</b></div></td></tr>"
	for w=1 to 6
		tmpstr=tmpstr+"<tr class=bg_tds> "
		for d=1 to 7 
			show_date=dateadd("d",(w-1)*7+d,tday)
			fint=datediff("d","2003-1-1",show_date)
				tmpstr=tmpstr+"<td><div align=""center"">"
			if datepart("m",show_date)=m then
				if InStr(mydiarydate,","&fint&",")>0 then
					tmpstr=tmpstr+"<a href=""#"" title=""点击浏览这天日记"" onclick=""show_diary1('"&fint&"')""><font color=""#ff0000"">"&datepart("d",show_date)&"</font></a>"
				else
					tmpstr=tmpstr+"<a href=""#"" title=""点击开始写这天日记"" onclick=""add_diary('"&fint&"')"">"&datepart("d",show_date)&"</a>"
				end if
			Else
				tmpstr=tmpstr+"&nbsp;"
			End if
			tmpstr=tmpstr+"</div></td>"
		next
		tmpstr=tmpstr+"</tr>"
	next	
	tmpstr=tmpstr+"</table>"
document.all("monthdate").innerHTML=tmpstr
document.all("nowmonth").innerText=y&"年"&m&"月"
end sub

