Function Show_cal(sYear,sMonth,sDay)
	tagPre=1
	tagNext=2

	document.all.minical.innerHTML=""
	datToday=date()

	intThisYear	=	cint("0"&sYear) '³âµµ³Ñ°Ü¹Þ±â
	intThisMonth=	cint("0"&sMonth) '¿ù ³Ñ°Ü¹Þ±â
	intThisDay	=	cint("0"&sDay)

	if intThisYear	=0 then intThisYear=Year(datToday)		'¸¸¾à ³âµµ¿Í ¿ù°ªÀ» ³Ñ°Ü¹ÞÁö ¾Ê¾Ò´Ù¸é ÇöÀç ³âµµ¸¦ ³âµµ º¯¼ö¿¡
	if intThisMonth	=0 then intThisMonth=Month(datToday)	' ÇöÀç ¿ùÀ» ¿ù º¯¼ö¿¡
	if intThisDay	=0 then intThisDay=day(datToday)		'¿À´Ã ³¯Â¥
	
	if intThisMonth=1 then
		intPrevMonth=12
		intNextMonth=2
	elseif intThisMonth=12 then
		intPrevMonth=11
		intNextMonth=1
	else
		intPrevMonth=intThisMonth-1
		intNextMonth=intThisMonth+1
	end if

	NowThisYear=Year(datToDay) ' ÇöÀç¿¬µµ°ª
	NowThisMonth=Month(datToday) 'ÇöÀç ¿ù°ª
	NowThisDay=Day(datToday) '¿À´Ã ³¯Â¥ °ª

	datFirstDay=DateSerial(intThisYear, intThisMonth, 1) '³Ñ°Ü¹ÞÀº ³¯Â¥ÀÇ ¿ùÃÊ±â°ª ÆÄ¾Ç
	intFirstWeekday=Weekday(datFirstDay, vbSunday) '³Ñ°Ü¹ÞÀº ³¯Â¥ÀÇ ÁÖÃÊ±â°ª ÆÄ¾Ç
	intSecondWeekday=intFirstWeekday
	intThirdWeekday=intFirstWeekday

	datThisDay=cdate(intThisYear&"-"&intThisMonth&"-"&intThisDay)
	intThisWeekday=Weekday(datThisDay)

	Select Case intThisWeekday
		Case 1	varThisWeekday="ÀÏ"
		Case 2	varThisWeekday="¿ù"
		Case 3	varThisWeekday="È­"
		Case 4	varThisWeekday="¼ö"
		Case 5	varThisWeekday="¸ñ"
		Case 6	varThisWeekday="±Ý"
		Case 7	varThisWeekday="Åä"
	End Select

	intPrintDay=1 'Ãâ·Â ÃÊ±âÀÏ °ªÀº 1ºÎÅÍ
	secondPrintDay=1
	thirdPrintDay=1

	Stop_Flag=0

	if intThisMonth=4 or intThisMonth=6 or intThisMonth=9 or intThisMonth=11 then  '¿ù¸» °ª °è»ê
		intLastDay=30
	elseif intThisMonth=2 and not (intThisYear mod 4) = 0 then
		intLastDay=28
	elseif intThisMonth=2 and (intThisYear mod 4) = 0 then
		if (intThisYear mod 100) = 0 then
			if (intThisYear mod 400) = 0 then
				intLastDay=29
			else
				intLastDay=28
			end if
		else
			intLastDay=29
		end if
	else
		intLastDay=31
	end if

	if intPrevMonth=4 or intPrevMonth=6 or intPrevMonth=9 or intPrevMonth=11 then  '¿ù¸» °ª °è»ê
		intPrevLastDay=30
	elseif intPrevMonth=2 and not (intPrevYear mod 4) = 0 then
		intPrevLastDay=28
	elseif intPrevMonth=2 and (intPrevYear mod 4) = 0 then
		if (intPrevYear mod 100) = 0 then
			if (intPrevYear mod 400) = 0 then
				intPrevLastDay=29
			else
				intPrevLastDay=28
			end if
		else
			intPrevLastDay=29
		end if
	else
		intPrevLastDay=31
	end if

	Stop_Flag=0

	Cal_HTML=Cal_HTML& "<table width=222 border=0 cellpadding=1 cellspacing=1  onmouseover='doOver()' onmouseout='doOut()' onclick='doClick()' style='font-size : 12;font-family:±¼¸²;'>"
	Cal_HTML=Cal_HTML& "<tr align=center>"
	Cal_HTML=Cal_HTML& "<td colspan=7 bgcolor=#756D92 >"
	Cal_HTML=Cal_HTML& "<font size=1 color=#cccccc style='cursor:hand;' title='ÀÌÀü³âµµ' OnClick='vbscript:call Show_cal("&intThisYear-1&","&intThisMonth&",1)'>¢¸</font>"
	Cal_HTML=Cal_HTML& "<font color=white><b>"&intThisYear&"³â"
	Cal_HTML=Cal_HTML& "<font size=1 color=#cccccc title='´ÙÀ½³âµµ' style='cursor:hand;' OnClick='vbscript:call Show_cal("&intThisYear+1&","&intThisMonth&",1)'>¢º</font>&nbsp;"
	Cal_HTML=Cal_HTML& "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=1 color=#cccccc style='cursor:hand;' title='ÀÌÀü´Þ' OnClick='vbscript:call monthShow_cal("&intThisYear&","&intPrevMonth&","&tagPre&")'>¢¸</font>"
	if intThisMonth <10 then 
		Cal_HTML=Cal_HTML& "0"&intThisMonth&"¿ù</b></font>"
	else Cal_HTML=Cal_HTML& intThisMonth&"¿ù</b></font>"
	end if
	Cal_HTML=Cal_HTML& "<font size=1 color=#cccccc title='´ÙÀ½´Þ' style='cursor:hand;' OnClick='vbscript:call monthShow_cal("&intThisYear&","&intNextMonth&","&tagNext&")'>¢º</font>"
	Cal_HTML=Cal_HTML& "&nbsp;</td>"
	Cal_HTML=Cal_HTML& "</tr>"
	Cal_HTML=Cal_HTML& "<tr align=center bgcolor=#C9C9F3 style='font-weight:bold'>"
	Cal_HTML=Cal_HTML& "<td>ÀÏ</td><td>¿ù</td><td>È­</td><td>¼ö</td><td>¸ñ</td><td>±Ý</td><td>Åä</td>"
	Cal_HTML=Cal_HTML& "</tr>"
	
	FOR intLoopWeek=1 to 6   'ÁÖ´ÜÀ§ ·çÇÁ ½ÃÀÛ, ÃÖ´ë 6ÁÖ

		Cal_HTML=Cal_HTML& "<tr  align=right  valign=top bgcolor=white >"
		for intLoopDay=1 to 7 '¿äÀÏ´ÜÀ§ ·çÇÁ ½ÃÀÛ, ÀÏ¿äÀÏºÎÅÍ

			if intThirdWeekDay > 1 then 'Ã¹ÁÖ½ÃÀÛÀÏÀÌ 1º¸´Ù Å©¸é
				Cal_HTML=Cal_HTML& "<td height=0>&nbsp;</td>"
				intThirdWeekDay=intThirdWeekDay-1
			else  
				if thirdPrintDay > intLastDay then 'ÀÔ·Â³¯Â¥°¡ ¿ù¸»º¸´Ù Å©´Ù¸é
					Cal_HTML=Cal_HTML& "<td >&nbsp;</td>"
				else 'ÀÔ·Â³¯Â¥°¡ ÇöÀç¿ù¿¡ ÇØ´çµÇ¸é
					Cal_HTML=Cal_HTML& "<td  title='"&intThisYear&"-"&intThisMonth&"-"&thirdPrintDay&"' style='cursor: hand;border: 1px solid white;width:18; height:12;"
					if intThisYear-NowThisYear=0 and intThisMonth-NowThisMonth=0 and thirdPrintDay-NowThisDay=0 then '¿À´Ã ³¯Â¥ÀÌ¸éÀº ±Û¾¾ÆùÆ®¸¦ ´Ù¸£°Ô
						Cal_HTML=Cal_HTML& "background-color:#C9C9F3;"
					end if
					if  intLoopDay=1 then 'ÀÏ¿äÀÏÀÌ¸é »¡°£»öÀ¸·Î
						Cal_HTML=Cal_HTML& "color:red;"
					else ' ÀÏ¿äÀÏÀÌ ¾Æ´Ñ°æ¿ì
    					if  intLoopDay=7 then 'Åä¿äÀÏÀÌ¸é ÆÄ¶õ»öÀ¸·Î
    						Cal_HTML=Cal_HTML& "color:blue;"
    					else ' ±×¿ÜÀÇ °æ¿ì
    						Cal_HTML=Cal_HTML& "color:black;"
    					end if
					end if
					Cal_HTML=Cal_HTML& "'>"&thirdPrintDay
				end if
				thirdPrintDay=thirdPrintDay+1 '³¯Â¥°ªÀ» 1 Áõ°¡

				if thirdPrintDay > intLastDay then	Stop_Flag=1	 '¸¸¾à ³¯Â¥°ªÀÌ ¿ù¸»°ªº¸´Ù Å©¸é ·çÇÁ¹® Å»Ãâ

			end if
			Cal_HTML=Cal_HTML& "</td>"
		next
		Cal_HTML=Cal_HTML& "</tr>"
		if Stop_Flag=1 then	EXIT FOR
	NEXT
	Cal_HTML=Cal_HTML& "</table>"
	Cal_HTML=Cal_HTML& ""
	Cal_HTML=Cal_HTML& ""
	document.getElementById("cal_div").innerHTML=Cal_HTML
END Function

