function go(theForm)
	cname		=	theForm.to_name.value
	cyear		=	theForm.to_year.value
	cmonth		=	theForm.to_month.value
	cday		=	theForm.to_day.value
	cname2		=	theForm.to_name2.value
	cyear2		=	theForm.to_year2.value
	cmonth2		=	theForm.to_month2.value
	cday2		=	theForm.to_day2.value
 	if cname = "" then
		msgbox("³²ÀÚºÐÀÇ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
		exit function
  end if
	if isnumeric(cyear) then
		if cyear > 2040 or cyear < 1920 then
			msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ³âµµ '" & cyear & "'À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ³âµµ '" & cyear & "'À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if
	if isnumeric(cmonth) then
		if cmonth > 12 or cmonth < 1 then
			msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ¿ù '" & cmonth & "'À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ¿ù '" & cmonth & "'À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if
	if isnumeric(cday) then
		if cday > 31 or cday < 1 then
			msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ÀÏ '" & cday & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("³²ÀÚºÐÀÇ ÅÂ¾î³­ ÀÏ '" & cday & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if

	if theForm.month_type.selectedIndex = 1 then
		if cday > 30 then
			msgbox("³²ÀÚºÐÀÇ À½·Â¿¡ 30ÀÏ ÀÌ»óÀÌ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.")
			exit function
		end if
	else
		if not chkDate1() then
			msgbox("³²ÀÚºÐÀÇ ÀÔ·ÂµÈ ³¯Â¥ '" & cyear & "-" & cmonth & "-" & cday & "'Àº Á¤»óÀûÀÎ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù." & vbcrlf & vbcrlf & "´Ù½ÃÇÑ¹ø Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.")
			exit function
		end if
	end if
	'form.to_month.value = Right("0" & form.to_month.value, 2)
	'form.to_day.value = Right("0" & form.to_day.value, 2)

 	if cname2 = "" then
		msgbox("¿©ÀÚºÐÀÇ ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
		exit function
  end if
	if isnumeric(cyear2) then
		if cyear2 > 2040 or cyear2 < 1920 then
			msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ³âµµ '" & cyear2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ³âµµ '" & cyear2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if
	if isnumeric(cmonth2) then
		if cmonth2 > 12 or cmonth2 < 1 then
			msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ¿ù '" & cmonth2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ¿ù'" & cmonth2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if
	if isnumeric(cday2) then
		if cday2 > 31 or cday2 < 1 then
			msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ÀÏ '" & cday2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
			exit function
		end if
	else
		msgbox("¿©ÀÚºÐÀÇ ÅÂ¾î³­ ¿ù '" & cday2 & "' À»  È®ÀÎÇÏ¿© ÁÖ½Ê½Ã¿ä")
		exit function
	end if

	if theForm.month_type2.selectedIndex = 1 then
		if cday2 > 30 then
			msgbox("¿©ÀÚºÐÀÇ À½·Â¿¡ 30ÀÏ ÀÌ»óÀÌ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.")
			exit function
		end if
	else
		if not chkDate2() then
			msgbox("¿©ÀÚºÐÀÇ ÀÔ·ÂµÈ ³¯Â¥ '" & cyear2 & "-" & cmonth2 & "-" & cday2 & "'Àº Á¤»óÀûÀÎ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù." & vbcrlf & vbcrlf & "´Ù½ÃÇÑ¹ø Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.")
			exit function
		end if
	end if
	'form.to_month2.value = Right("0" & form.to_month2.value, 2)
	'form.to_day2.value = Right("0" & form.to_day2.value, 2)

	go = 1
	'form.submit()
end function
function chkDate1()
	if isDate(form.to_year.value & "-" & form.to_month.value & "-" & form.to_day.value) then 
		'form.to_year.value = year(Cdate(form.to_year.value & "-" & form.to_month.value & "-" & form.to_day.value))
		'form.to_month.value = Right("0" & form.to_month.value, 2)
		'form.to_day.value = Right("0" & form.to_day.value, 2)
		chkDate1 = true
	else
		chkDate1 = false
	end if
end function
function chkDate2()
	if isDate(form.to_year2.value & "-" & form.to_month2.value & "-" & form.to_day2.value) then 
		'form.to_year2.value = year(Cdate(form.to_year2.value & "-" & form.to_month2.value & "-" & form.to_day2.value))
		'form.to_month2.value = Right("0" & form.to_month2.value, 2)
		'form.to_day2.value = Right("0" & form.to_day2.value, 2)
		chkDate2 = true
	else
		chkDate2 = false
	end if
end function