<%

'#######################################################################################
'다비치 설문 유형
'VARIABLE : 변수 명
'ATTRIBUTE: 속성
'TEXT : 질문 TEXT
'MIDTEXT : 중분류 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function DAQTemplate1(VARIABLE,ATTRIBUTE,TEXT,MIDTEXT,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim ATStr,A_COD,A1,A2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR,COL
	Dim GTStr,TTStr,xCnt
	Dim WidthV,HeightV,CTV,LTV
	Dim XVX,GWD
	Dim HDStr
	Dim ATCnt

	GWD = 12 '그룹 타이틀 영역
	HeightV = "45px"
	OSTR = ""

	'
	QName = ""

	ATSTr = Split(ATTRIBUTE,LABELSPLITTER)

	SBody = ""
	JBody = ""

	For xCnt=0 To UBound(ATStr)

	If VarType(ATStr)<>0 And VarType(ATStr)<>1 Then
		A_COD = Split(ATStr(xCnt),CODESPLITTER)
		A1 = A_COD(0)
		A2 = A_COD(1)

		DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & A1 & """>" & vbCRLF

		If xCnt=0 Then
			DSTR = DSTR & "						<TD class=""ATTHeader"" style=""text-align:center;"" rowspan="""&UBound(ATStr)+1&""">" & MIDTEXT & "</TD>" & vbCrLF	
		End If
		
		If InStr(A2,"*OTHER")>0 Then
			DSTR = DSTR & "						<TD class=""ATTHeader""><label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label>&nbsp;"
			DSTR = DSTR & "<input type=""text"" name=""T" & VARIABLE & "_" & A1 & """ id=""T" & VARIABLE & "_" & A1 & """ value="""" maxlength=""50"" style='vertical-align: top;width:150px;'/>"
			DSTR = DSTR & vbtab&vbtab&vbtab&vbtab&vbtab&vbtab &"</TD>" & vbCrLF
		Else
			DSTR = DSTR & "						<TD class=""ATTHeader""><label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label></TD>" & vbCrLF
		End If
		
		'#####################################################################################
		'중요도 부분 코딩
		'#####################################################################################
		DSTR = DSTR & "						<td>" & vbCrLF
		DSTR = DSTR & "						<select name=""" & VARIABLE & "_A" & A1 & """ id=""" & VARIABLE & "_A" & A1 & """>" & vbCrLF
		DSTR = DSTR & "							<option value="""">--</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""1"">대</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""2"">중</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""3"">소</option>" & vbCrLF
		DSTR = DSTR & "						</select>" & vbCrLF
		DSTR = DSTR & "						</td>" & vbCrLF

		VAR = VAR & VARIABLE & "_A" & A1 & ","
		
		If InStr(A2,"*OTHER")>0 Then
			JBody = JBody & "	if (($(""#" & VARIABLE & "_A" & A1 & """).val()=="""") && ($(""#T" & VARIABLE & "_" & A1 & """).val!=""""))" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 중요도를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_A" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		Else
			JBody = JBody & "	if ($(""#" & VARIABLE & "_A" & A1 & """).val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 중요도를 선택해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_A" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		End IF
		
		'#####################################################################################
		'실현시기 연도 코딩
		'설문지 순서대로 나타남
		'#####################################################################################
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_B" & A1 & "_1"" id=""" & VARIABLE & "_B" & A1 & "_1"" value="""" maxlength=""2"" size=""5""/>년</td>" & vbCrLF
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_B" & A1 & "_2"" id=""" & VARIABLE & "_B" & A1 & "_2"" value="""" maxlength=""2"" size=""5""/>년</td>" & vbCrLF
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_B" & A1 & "_3"" id=""" & VARIABLE & "_B" & A1 & "_3"" value="""" maxlength=""2"" size=""5""/>년</td>" & vbCrLF
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_B" & A1 & "_4"" id=""" & VARIABLE & "_B" & A1 & "_4"" value="""" maxlength=""2"" size=""5""/>년</td>" & vbCrLF
		
		VAR = VAR & VARIABLE & "_B" & A1 & "_1,"
		VAR = VAR & VARIABLE & "_B" & A1 & "_2,"
		VAR = VAR & VARIABLE & "_B" & A1 & "_3,"
		VAR = VAR & VARIABLE & "_B" & A1 & "_4,"

		If InStr(A2,"*OTHER")>0 Then
			JBody = JBody & "	if ($(""#T" & VARIABLE & "_" & A1 & """).val()!="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		if ($(""#" & VARIABLE & "_B" & A1 & "_1"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술적 개발 시기 -세계를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_B" & A1 & "_1"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF & vbCRLF

			JBody = JBody & "		if ($(""#" & VARIABLE & "_B" & A1 & "_2"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술적 개발 시기 -국내를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_B" & A1 & "_2"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF & vbCRLF

			JBody = JBody & "		if ($(""#" & VARIABLE & "_B" & A1 & "_3"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 사회 경제적 활용 시기 -세계를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_B" & A1 & "_3"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF & vbCRLF

			JBody = JBody & "		if ($(""#" & VARIABLE & "_B" & A1 & "_4"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 사회 경제적 활용 시기 -국내를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_B" & A1 & "_4"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF
			JBody = JBody & "	}" & vbCRLF
		Else
			JBody = JBody & "	if ($(""#" & VARIABLE & "_B" & A1 & "_1"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술적 개발 시기 -세계를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_B" & A1 & "_1"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF

			JBody = JBody & "	if ($(""#" & VARIABLE & "_B" & A1 & "_2"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술적 개발 시기 -국내를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_B" & A1 & "_2"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF

			JBody = JBody & "	if ($(""#" & VARIABLE & "_B" & A1 & "_3"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 사회 경제적 활용 시기 -세계를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_B" & A1 & "_3"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF

			JBody = JBody & "	if ($(""#" & VARIABLE & "_B" & A1 & "_4"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 사회 경제적 활용 시기 -국내를 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_B" & A1 & "_4"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		End IF

		'#####################################################################################
		'기술 획득 방식 평가 코딩
		'#####################################################################################
		DSTR = DSTR & "						<td>" & vbCrLF
		DSTR = DSTR & "						<select name=""" & VARIABLE & "_C"& A1 & """ id=""" & VARIABLE & "_C" & A1 & """>" & vbCrLF
		DSTR = DSTR & "							<option value="""">--</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""1"">민간주도개발</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""2"">정부주도개발</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""3"">정부민간공동 개발</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""4"">기술도입 및 국제협력</option>" & vbCrLF
		DSTR = DSTR & "						</select>" & vbCrLF
		DSTR = DSTR & "						</td>" & vbCrLF

		VAR = VAR & VARIABLE & "_C" & A1 & ","
		
		If InStr(A2,"*OTHER")>0 Then
			JBody = JBody & "	if (($(""#" & VARIABLE & "_C" & A1 & """).val()=="""") && ($(""#T" & VARIABLE & "_" & A1 & """).val!=""""))" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술획득방식을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_C" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		Else
			JBody = JBody & "	if ($(""#" & VARIABLE & "_C" & A1 & """).val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 기술획득방식을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_C" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		End If

		'#####################################################################################
		'기술 획득 방식 평가 코딩
		'#####################################################################################
		DSTR = DSTR & "						<td>" & vbCrLF
		DSTR = DSTR & "						<select name="""& VARIABLE & "_D" & A1 & """ id=""" & VARIABLE & "_D" & A1 & """>" & vbCrLF
		DSTR = DSTR & "							<option value="""">--</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""1"">대</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""2"">중</option>" & vbCrLF
		DSTR = DSTR & "							<option value=""3"">소</option>" & vbCrLF
		DSTR = DSTR & "						</select>" & vbCrLF
		DSTR = DSTR & "						</td>" & vbCrLF

		VAR = VAR & VARIABLE & "_D" & A1 & ","
		
		If InStr(A2,"*OTHER")>0 Then
			JBody = JBody & "	if (($(""#" & VARIABLE & "_D" & A1 & """).val()=="""") && ($(""#T" & VARIABLE & "_" & A1 & """).val!=""""))" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 정부개입 필요성을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_D" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		Else
			JBody = JBody & "	if ($(""#" & VARIABLE & "_D" & A1 & """).val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 정부개입 필요성을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_D" & A1 & """).focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		End If

		'#####################################################################################
		'기술수준 평가 코딩
		'#####################################################################################
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_E" & A1 & "_1"" id=""" & VARIABLE & "_E" & A1 & "_1"" value="""" maxlength=""3"" size=""5""/></td>" & vbCrLF
		DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_E" & A1 & "_2"" id=""" & VARIABLE & "_E" & A1 & "_2"" value="""" maxlength=""3"" size=""5""/></td>" & vbCrLF
		
		VAR = VAR & VARIABLE & "_E" & A1 & "_1,"
		VAR = VAR & VARIABLE & "_E" & A1 & "_2,"

		If InStr(A2,"*OTHER")>0 Then
			JBody = JBody & "	if ($(""#T" & VARIABLE & "_" & A1 & """).val()!="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		if ($(""#" & VARIABLE & "_E" & A1 & "_1"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 최고기술 보유국 기술수준을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_E" & A1 & "_1"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF & vbCRLF

			JBody = JBody & "		if ($(""#" & VARIABLE & "_E" & A1 & "_2"").val()=="""")" & vbCrLF
			JBody = JBody & "		{" & vbCrLF
			JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 국내 수준을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "			$(""#" & VARIABLE & "_E" & A1 & "_2"").focus();" & vbCRLF
			JBody = JBody & "			return;" & vbCRLF
			JBody = JBody & "		}" & vbCRLF
			JBody = JBody & "	}" & vbCRLF
		Else
			JBody = JBody & "	if ($(""#" & VARIABLE & "_E" & A1 & "_1"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 최고기술 보유국 기술수준을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_E" & A1 & "_1"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF

			JBody = JBody & "	if ($(""#" & VARIABLE & "_E" & A1 & "_2"").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""] 국내 수준을 응답해 주십시오."");" & vbCRLF
			JBody = JBody & "		$(""#" & VARIABLE & "_E" & A1 & "_2"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF
		End If

		If InStr(A2,"*OTHER")>0 Then
			VAR = VAR & "T" & VARIABLE & "_" & A1 & ","
		End If

		DSTR = DSTR & "					</TR>"
		DSTR = DSTR & "" & LABELSPLITTER		
	End If

	Next

	'#####################################################################################
	'자바스크립트 입력부 숫자로 제한함
	'#####################################################################################
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF
	Response.Write "	$(document).ready(function(){" & vbCrLf

	For xCnt=0 To UBound(ATStr)
		A_COD = Split(ATStr(xCnt),CODESPLITTER)
		A1 = A_COD(0)
		A2 = A_COD(1)

		If VarType(ATStr)<>0 And VarType(ATStr)<>1 Then
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_1"").numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_2"").numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_3"").numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_4"").numeric();" & vbCrLF

			Response.Write "		$(""#" & VARIABLE & "_E" & A1 & "_1"").numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_E" & A1 & "_2"").numeric();" & vbCrLF

			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_1"").css(""ime-mode"",""disabled"");" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_2"").css(""ime-mode"",""disabled"");" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_3"").css(""ime-mode"",""disabled"");" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_B" & A1 & "_4"").css(""ime-mode"",""disabled"");" & vbCrLF

			Response.Write "		$(""#" & VARIABLE & "_E" & A1 & "_1"").css(""ime-mode"",""disabled"");" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_E" & A1 & "_2"").css(""ime-mode"",""disabled"");" & vbCrLF
		End If
	Next

	Response.Write "	});" & vbCRLF
	Response.Write "//-->" & vbCRLF
	Response.Write "</script>" & vbCrLF

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab02' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "				<colgroup>" & vbCRLF
	SBody = SBody & "					<col width=""50""/>" & vbCRLF
	SBody = SBody & "					<col width=""*""/>" & vbCRLF
	SBody = SBody & "					<col width=""40""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "					<col width=""150""/>" & vbCRLF
	SBody = SBody & "					<col width=""40""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "					<col width=""60""/>" & vbCRLF
	SBody = SBody & "				</colgroup>" & vbCRLF

	SBody = SBody & "				<tr>" & vbCRLF
	SBody = SBody & "					<td rowspan=""3"">중분류</td>" & vbCRLF
	SBody = SBody & "					<td rowspan=""3"">기술 과제명</td>" & vbCRLF
	SBody = SBody & "					<td rowspan=""3"">중요도</td>" & vbCRLF
	SBody = SBody & "					<td colspan=""4"">실현시기 (연도)</td>" & vbCRLF
	SBody = SBody & "					<td rowspan=""3"">기술<br/>획득<br/>방식</td>" & vbCRLF
	SBody = SBody & "					<td rowspan=""3"">정부<br/>개입<br/>필요성</td>" & vbCRLF
	SBody = SBody & "					<td colspan=""2"" rowspan=""2"">기술수준</td>" & vbCRLF
	SBody = SBody & "				</tr>" & vbCRLF
	SBody = SBody & "				<tr>" & vbCRLF
	SBody = SBody & "					<td colspan=""2"">기술적 개발 시기</td>" & vbCRLF
	SBody = SBody & "					<td colspan=""2"">사회 경제적 활용 시기</td>" & vbCRLF
	SBody = SBody & "				</tr>" & vbCRLF
	SBody = SBody & "				<tr>" & vbCRLF
	SBody = SBody & "					<td>세계</td>" & vbCRLF
	SBody = SBody & "					<td>국내</td>" & vbCRLF
	SBody = SBody & "					<td>세계</td>" & vbCRLF
	SBody = SBody & "					<td>국내</td>" & vbCRLF
	SBody = SBody & "					<td>최고기술<br/>보유국</td>" & vbCRLF
	SBody = SBody & "					<td>국내<br/>수준</td>" & vbCRLF
	SBody = SBody & "				</tr>" & vbCRLF

	ESTR = Split(DSTR,LABELSPLITTER)

	For iCnt=0 To UBound(ESTR)
		If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 Then
			SBody = SBody & ESTR(iCnt) & vbCRLF
		End If
	Next

	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'속성형태 라디오 - 가로보기
'VARIABLE : 변수 명
'CODES : 코드 라벨
'ATTRIBUTE: 속성
'TEXT : 질문 TEXT
'STEPFLAG : 스텝여부
'MCNT : 속성을 동일하게 응답하는 갯수 확인용
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'QuestionSingleLotte : 예 또는 아니오 응답시 스텝 중지
'DIS : 0일경우 예를 응답하면 아니오 비활성화 , 1일 경우 아니오를 응답하면 예를 비활성화
'(예 : SQ9[0].checked==true;일 경우 SQ9[1].disabled==true)
'#######################################################################################
Function QuestionSingleLotte(VARIABLE,CODES,ATTRIBUTE,TEXT,STEPFLAG,MCNT,DIS,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim ATStr,A_COD,A1,A2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR,COL
	Dim WidthV,HeightV,CTV,LTV
	Dim XVX
	Dim HDStr
	Dim ATCnt

	Dim DisNum

	If DIS = 0 Then
		DisNum = 1
	Else
		DisNum = 0
	End if

	HeightV = "45px"
	OSTR = ""
	ATCnt = MCNT

	Select Case SKIN
		Case "PANEL"
			QName = "Q1"
		Case "PROGRESS"
			QName = "Q1"
		Case "LOTTE"
			QName = "Q3"
		Case "GMI"
			QName = "Q2"
		Case Else
			QName = "Q3"
	End Select

	ITStr = Split(CODES,LABELSPLITTER)
	ATStr = Split(ATTRIBUTE,LABELSPLITTER)
	COL = UBound(ITStr)
	CTV = Col

	Select Case COL
		Case 1
			XVX = 20
		Case 2
			XVX = 40
		Case 3
			XVX = 40
		Case 4
			XVX = 40
		Case 5
			XVX = 60
		Case 6
			XVX = 50
		Case 7
			XVX = 50
		Case 8
			XVX = 60
		Case 9
			XVX = 60
		Case 10
			XVX = 70
		Case Else
			XVX = 70
	End Select
	

	WidthV = FormatNumber(CDbl(XVX/COL),2)

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF
	
	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "			<div style='text-align:right;width:98%;height:30px;'>" & vbCRLF
	SBody = SBody & "				<input type='button' value='다시입력' onclick='Resets();'>" & vbCRLF
	SBody = SBody & "			</div>" & vbCRLF

	DSTR = ""	
	HDSTR = ""


	For cCnt=0 To UBound(ATStr)

		If VarType(ATStr(cCnt))<>0 And VarType(ATStr(cCnt))<>1 And ATStr(cCnt)<>"" Then
			A_COD = Split(ATStr(cCnt),CODESPLITTER)
			A1 = A_COD(0)
			A2 = A_COD(1)



			'Header TR 라인 생성
			If cCnt=0 Then								
				HDSTR = "					<TR id=""HCOL" & VARIABLE & "_" & A1 & """>" & vbCRLF
				HDSTR = HDSTR & "						<TH>&nbsp;</TH>" & vbCRLF
			End If
			
			If cCnt>0 And STEPFLAG Then
				DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & A1 & """ style=""display:none;"">" & vbCRLF				
			Else
				DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & A1 & """>" & vbCRLF
			End If

			If InStr(A2,"*OTHER")>0 Then
				DSTR = DSTR & "						<TD class=""ATTHeader""><label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label>&nbsp;"
				DSTR = DSTR & "<input type=""text"" name=""T" & VARIABLE & "_" & A1 & """ id=""T" & VARIABLE & "_" & A1 & """ value="""" maxlength=""50"" style='vertical-align: top;width:200px;'/>&nbsp;"
				DSTR = DSTR & vbtab&vbtab&vbtab&vbtab&vbtab&vbtab & "<input type=""button"" name=""RE" & VARIABLE & "_" & A1 & """ id=""RE" & VARIABLE & "_" & A1 & """ value=""기타 취소"" onclick=""ResetETCRadio('T" & VARIABLE & "_" & A1 & "','" & VARIABLE & "_" & A1 & "')"" style=""cursor:pointer;""/>"
				DSTR = DSTR & vbtab&vbtab&vbtab&vbtab&vbtab&vbtab &"</TD>" & vbCrLF
			Else
				DSTR = DSTR & "						<TD class=""ATTHeader""><label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label></TD>" & vbCrLF
			End IF

			For iCnt=0 To UBound(ITStr)
				If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 Then
					V_COD = Split(ITStr(iCnt),CODESPLITTER)
					V1 = V_COD(0)
					V2 = V_COD(1)					
					
					DSTR = DSTR & "						<TD style=""text-align:center;"">"
					DSTR = DSTR & "<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & A1 & CHR(34) & " id=""" & VARIABLE & "_" & A1 & "_" & V1 & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " OnClick="&Chr(34)&"clickTD(" & VARIABLE & "_" & A1&","& iCnt &",'" & A1 &"')"&Chr(34)&" /></TD>" & vbCRLF

					If cCnt=0 Then
						HDSTR = HDSTR & "						<TH>" & Replace(Replace(V2,"*OTHER",""),"*NONE","") & "<br>(" & V1 & ")" & "</TH>" & vbCrLF
					End If
				End IF
			Next

			If cCnt=0 Then
				HDSTR = HDSTR & "					</TR>" & VBCRLF
			End If

			DSTR = DSTR & "					</TR>"
			DSTR = DSTR & "" & LABELSPLITTER
			VAR = VAR & VARIABLE & "_" & A1 & ","

			If InStr(A2,"*OTHER")>0 Then
				VAR = VAR & "T" & VARIABLE & "_" & A1 & ","

				JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		if ($(""#T" & VARIABLE & "_" & A1 & """).val()!="""")"& vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert($(""#L" & VARIABLE & "_" & A1 & """).text()+""의 기타내용을 입력하셨습니다. 삭제해 주시기 바랍니다."");" & vbCrLF
				JBody = JBody & "			$(""#T" & VARIABLE & "_" & A1 & """).focus();" & vbCrLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCRLF 
				JBody = JBody & "	else" & vbCRLF 
				JBody = JBody & "	{" & vbCRLF 
				JBody = JBody & "		if ($(""#T" & VARIABLE & "_" & A1 & """).val()=="""")"& vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert($(""#L" & VARIABLE & "_" & A1 & """).text()+""의 기타내용을 응답해 주십시오."");" & vbCrLF
				JBody = JBody & "			$(""#T" & VARIABLE & "_" & A1 & """).focus();" & vbCrLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCRLF & vbCRLF
			Else
				If cCnt=0 Then
					JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]" & " 질문에 응답해 주십시오. " & Chr(34) & ");" & vbCRLF
					JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE & "_" & A1 &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF
				Else
					JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & CInt(A1)-1 & Chr(34) &")=="& CInt(DIS)+1 &")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF
					JBody = JBody & "		{" & vbCrLF
					JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]" & " 질문에 응답해 주십시오. " & Chr(34) & ");" & vbCRLF
					JBody = JBody & "			$(" & Chr(34) & "input[name=" & VARIABLE & "_" & A1 &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
					JBody = JBody & "			return;" & vbCRLF
					JBody = JBody & "		}" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF
				End if
			End IF

		End IF
	Next

	If ATCnt>0 Then
		Response.Write vbCrLF
		Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCRLF
		Response.Write "	var " & VARIABLE & "Flag;" & vbCrLf
		Response.Write "	" & VARIABLE & "Flag=false;" & vbCrLf
		Response.Write "//-->" & vbCRLF
		Response.Write "</script>" & vbCrLF

		JBody = JBody & "	if ((" & VARIABLE & "Flag==false) && (RadioArrayCnt(""" & Left(VAR,Len(VAR)-1) & ""","&ATCnt&")))" & vbCrLF
		JBody = JBody & "	{" & vbCrLF
		JBody = JBody & "		alert(" & Chr(34) & "다시 한번 문항을 자세히 읽고 질문에 응답해 주시기 바랍니다." & Chr(34) & ");" & vbCRLF
		JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE & "_" & A1 &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
		JBody = JBody & "		" & VARIABLE & "Flag=true;" & vbCrLF
		JBody = JBody & "		return;" & vbCRLF
		JBody = JBody & "	}" & vbCRLF & vbCRLF
	End IF

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab02' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	SBody = SBody & "						<col width=""*""/>" & vbCRLF
	For iCnt=0 To Col
		SBody = SBody & "						<col width=" & Chr(34) & WidthV & "%" & Chr(34) &"/>" & vbCRLF
	Next	
	SBody = SBody & "					</colgroup>" & vbCRLF	
	SBody = SBody & HDSTR
	ESTR = Split(DSTR,LABELSPLITTER)

	For iCnt=0 To UBound(ESTR)
		If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 Then
			SBody = SBody & ESTR(iCnt) & vbCRLF
		End If
	Next

	If iCnt>5 Then
	SBody = SBody & HDSTR
	End IF
	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	'자바스크립트 처리 부분
	
	If STEPFLAG Then
		Response.Write vbCrLF
		Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCRLF
		Response.Write "	$(document).ready(function(){" & vbCrLf

	'	Response.Write vbCrLF
	'	For iCnt=0 To UBound(ATStr)
	'		If VarType(ATStr(iCnt))<>0 And VarType(ATStr(iCnt))<>1 Then		
	'			A_COD = Split(ATStr(iCnt),CODESPLITTER)
	'			A1 = A_COD(0)
	'			A2 = A_COD(1)
	'			Response.Write "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").click(function(){" & vbCrLF
	'			Response.Write "			$(""#" & VARIABLE & "_table tr:nth-child(" & iCnt+3 & ")"").show();" & vbCrLF
	'			Response.Write "		});" & vbCrLF
	'		End If
	'	Next

		Response.Write "	});" & vbCrLF

		Response.Write " function Resets()" & vbCRLF
		Response.Write " {" & vbCRLF
	
		Response.Write vbCRLF
		For iCnt=0 To UBound(ATStr)
			If VarType(ATStr(iCnt))<>0 And VarType(ATStr(iCnt))<>1 Then		
				A_COD = Split(ATStr(iCnt),CODESPLITTER)
				A1 = A_COD(0)
				A2 = A_COD(1)
				
				Response.Write " $(""input[name="& VARIABLE & "_" & A1 &"]"").removeAttr(""checked"");" & vbCRLF
				Response.Write " $(""input[name="& VARIABLE & "_" & A1 &"]"").removeAttr(""disabled"");" & vbCRLF
				Response.Write " $(""#COL" & VARIABLE & "_" & CInt(A1)+1 &""").css(""display"",""none"");" & vbCRLF
			End If
		Next		
		Response.Write "}" & vbCRLF

		Response.Write " function clickTD(val,num,vid){" & vbCRLF
		Response.Write " var nVid = parseFloat(vid)+1;" & vbCRLF
		Response.Write "	val[num].checked=true;" & vbCRLF
		Response.Write "	if(num=="& CInt(DIS) &"){" & vbCRLF
		Response.Write "		val["& CInt(DisNum) &"].disabled=true;" & vbCRLF
		
		Response.Write "		$(""#COL"& VARIABLE & "_""+nVid).css(""display"","""");" & vbCRLF
		Response.Write "	}" & vbCRLF
		Response.Write " }" & vbCRLF

		Response.Write "//-->" & vbCrLF
		Response.Write "</script>" & vbCrLF

	End If

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'VARIABLE : 변수 명
'TEXT : 질문 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트
'CODES 예제
'CODES = Codes & "1∮상품권 증정(5만원이상구매)⇔<img src='Media/Q3_1.jpg' border='0' />⇔홈플러스 상품권 5만원 증정⇔9/26~10/26 (4주간)∑"
'CODES = Codes & "2∮포인트증정(신한카드 5만원이상 결재)⇔<img src='Media/Q3_2.jpg' border='0' />⇔신한 5만 포인트 증정⇔9/26~10/26 (4주간)∑"
'CODES = Codes & "3∮장바구니증정(7만원이상구매)⇔<img src='Media/Q3_3.jpg' border='0' />⇔에코 장바구니 증정⇔10/1(토)~10/3(월)∑"
'CODES = Codes & "4∮스티커 마일리지 증정(4,7,10장 당 선물증정)⇔<img src='Media/Q3_4.jpg' border='0' />⇔유명주방세트 증정⇔9/26(목)~10/19(수)∑"
'CODES = Codes & "5∮모두 알지 못함*NONE"
'#######################################################################################
Function QuestionMultiTable(VARIABLE,CODES,TEXT,COL,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR
	Dim WidthV,HeightV,CTV,LTV
	HeightV = "30px"
	CTV = COL
	OSTR = ""

	

	ITStr = Split(CODES,LABELSPLITTER)
	WidthV = FormatNumber(CDbl(100/CTV),2)

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF
	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	DSTR = ""	

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			V2 = V_COD(1)

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<td><input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/></td>" & vbCRLF
			Else
				DSTR = DSTR & "<td><input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &" /></td>" & vbCRLF
			End If
			
			If ((VARIABLE = "Q2" Or VARIABLE = "Q2Z" ) And V1=6 ) Or ((VARIABLE = "Q3" Or VARIABLE = "Q3Z" ) And V1=5 ) Then

				DSTR = DSTR & "<td colspan='4'><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');noCheckBoxValue('" & VARIABLE & "','" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
				DSTR = DSTR & Replace(V2,"*OTHER","") &"</a></td>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
				
				VAR = VAR & VARIABLE & "_" & V1  & ","
			ELse

			V2 = Split(V2,"⇔")

			'구분
			DSTR = DSTR & "<td><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
			DSTR = DSTR & Replace(V2(0),"*OTHER","") &"</a></td>"	'기타 라벨 제거

			'행사명
			DSTR = DSTR & "<td><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
			DSTR = DSTR & Replace(V2(1),"*OTHER","") &"</a></td>"	'기타 라벨 제거

			'전단지
			DSTR = DSTR & "<td><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
			DSTR = DSTR & Replace(V2(2),"*OTHER","") &"</a></td>"	'기타 라벨 제거

			'헹사대상품목

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<td><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
				DSTR = DSTR & Replace(V2(3),"*OTHER","") &"</a></td>"	'기타 라벨 제거
			Else
				DSTR = DSTR & "<td><a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');noCheckBoxValue('" & VARIABLE & "','" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
				DSTR = DSTR & Replace(V2(3),"*OTHER","") &"</a></td>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
			End IF

			VAR = VAR & VARIABLE & "_" & V1  & ","

			'기타안됨.
			If InStr(ITStr(iCnt),"*OTHER")>0 Then
				OSTR = OSTR & ";" & V1
				DSTR = DSTR & "&nbsp;<input type=" & Chr(34) & "text" & Chr(34) &" name=" & Chr(34) & "T" & VARIABLE & "_" & V1 & Chr(34) & " id=" & Chr(34) & VARIABLE & "_" & V1 & Chr(34) & " value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "30" & Chr(34) & " style='vertical-align: top;width:200px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End If

			End if
			
			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next



	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF

'	For iCnt=1 To Col
'		SBody = SBody & "						<col width=" & Chr(34) & "####%" & Chr(34) &"/>" & vbCRLF
'	Next	

	If VARIABLE = "Q2" Or VARIABLE = "Q2Z"  Then
		SBody = SBody & "						<col width=" & Chr(34) & "3%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "14%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "26%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "34%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "23%" & Chr(34) &"/>" & vbCRLF
	Else
		SBody = SBody & "						<col width=" & Chr(34) & "3%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "28%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "20%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "25%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & "23%" & Chr(34) &"/>" & vbCRLF
	End if

	SBody = SBody & "					</colgroup>" & vbCRLF

	If VARIABLE = "Q2" Or VARIABLE = "Q2Z"  Then
		SBody = SBody & "					<TR>"& vbCRLF
		SBody = SBody & "					<TH>&nbsp;</TH>"& vbCRLF
		SBody = SBody & "					<TH>구분</TH>"& vbCRLF
		SBody = SBody & "					<TH>행사명</TH>"& vbCRLF
		SBody = SBody & "					<TH>전단지</TH>"& vbCRLF
		SBody = SBody & "					<TH>행사 대상 품목</TH>"& vbCRLF
		SBody = SBody & "					</TR>"& vbCRLF
	Else
		SBody = SBody & "					<TR>"& vbCRLF
		SBody = SBody & "					<TH>&nbsp;</TH>"& vbCRLF
		SBody = SBody & "					<TH>행사명</TH>"& vbCRLF
		SBody = SBody & "					<TH>사은품</TH>"& vbCRLF
		SBody = SBody & "					<TH>사은품 설명</TH>"& vbCRLF
		SBody = SBody & "					<TH>기간</TH>"& vbCRLF
		SBody = SBody & "					</TR>"& vbCRLF
	End if

	SBody = Replace(SBody,"####",WidthV)

	ESTR = Split(DSTR,LABELSPLITTER)
	LTV = CInt(FormatNumber(CDbl(UBound(ESTR)/Col+0.49),1))

	cCnt=1
	SBody = SBody & "					<tr>" & vbCRLF

	Dim LC

	If Col>1 Then
		LC = (LTV*Col)
	Else
		LC = UBound(ItStr)
	End If

	For iCnt=0 To LC
		If UBound(ESTR)>=iCnt Then
			If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 Then
'				SBody = SBody & "<td>" & ESTR(iCnt)& "</td>" & vbCRLF
				SBody = SBody & "" & ESTR(iCnt)& "" & vbCRLF
			Else
'				SBody = SBody & "<td>&nbsp;</td>" & vbCRLF
			End If

			If cCnt=Col Then
				cCnt=1
				SBody = SBody & "					</tr>" & vbCRLF
				SBody = SBody & "					<tr>" & vbCRLF
			Else
				cCnt=cCnt+1
			End If
		End IF		
	Next


	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	'자바스크립트 처리 부분

	JBody = JBody & "	if (chkCheckBox("& Chr(34) & VARIABLE & Chr(34) &")==false)" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""&LangQuestion(1)&""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "#" & VARIABLE &":eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF & vbCRLF

	If Len(OSTR)>0 Then	'기타가 있는 경우 자바스크립트 처리
		Dim tmpOSTR
		tmpOSTR = Split(OSTR,";")

		For iCnt=0 To UBound(tmpOSTR)
			If VarType(tmpOSTR(iCnt))<>0 And VarType(tmpOSTR(iCnt))<>1 And tmpOSTR(iCnt)<>"" Then
				JBody = JBody & "	if ((getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()==" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				JBody = JBody & "	if ((getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")!=" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "&  LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF
			End IF
		Next

	End IF

	BODYSTR = SBody
	JBODYSTR = JBody


End Function

'#######################################################################################
'METRIX 타입
'VARIABLE : 변수 명
'ROWS : 행 수
'COLS : 문자 컬럼 수
'TEXTS : 문항
'TEXT : 컬럼 헤더 네임
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function MAQTemplate1(VARIABLE,ROWS,COL,TEXTS,TEXT,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,iCnt,cCnt
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR
	Dim HDStr
	Dim ATCnt
	Dim HStr


	Select Case SKIN
		Case "PANEL"
			QName = "Q1"
		Case "PROGRESS"
			QName = "Q1"
		Case "LOTTE"
			QName = "Q3"
		Case "GMI"
			QName = "Q2"
		Case Else
			QName = "Q3"
	End Select

	SBody = ""
	JBody = ""

	HStr = Split(TEXT,";")

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab02' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "				<colgroup>" & vbCRLF
	If CInt(COL)=3 Then
	SBody = SBody & "					<col width=""200""/>" & vbCRLF
	SBody = SBody & "					<col width=""150""/>" & vbCRLF
	SBody = SBody & "					<col width=""*""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	Else
	SBody = SBody & "					<col width=""200""/>" & vbCRLF
	SBody = SBody & "					<col width=""*""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	SBody = SBody & "					<col width=""120""/>" & vbCRLF
	End If
	SBody = SBody & "				</colgroup>" & vbCRLF
	
	For iCnt=0 To UBound(HStr)
		If VarType(HStr(iCnt))<>0 And VarType(HStr(iCnt))<>1 And Trim(HStr(iCnt))<>"" Then
			SBody = SBody & "				<th>" & Trim(HStr(iCnt)) & "</th>" & vbCRLF
		End IF
	Next
	
	DSTR = ""
	For iCnt=1 To CLng(ROWS)
		DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & iCnt & """>" & vbCRLF		
			For cCnt=0 To UBound(HStr)
				If VarType(HStr(cCnt))<>0 And VarType(HStr(cCnt))<>1 And Trim(HStr(cCnt))<>"" Then
					If cCnt<(CInt(COL)) Then
					DSTR = DSTR & "						<td><input type=""text"" name=""" & VARIABLE & "_" & iCnt & "_" & cCnt+1 & """ id=""" & VARIABLE & "_" & iCnt & "_" & cCnt+1 & """ value="""" maxlength=""100"" style=""width:90%""/></td>" & vbCrLF
					VAR = VAR & VARIABLE & "_" & iCnt & "_" & cCnt+1 & ","

					JBody = JBody & "	if ($(""#" & VARIABLE & "_" & iCnt & "_" & cCnt+1 & """).val()=="""")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""" & HStr(cCnt) & " 을(를) 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					ElseIf cCnt=(UBound(HStr)) Then
					DSTR = DSTR & "						<td>"
					DSTR = DSTR & "<input type=""text"" name=""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """ id=""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """ value="""" maxlength=""4"" style=""width:40%"" ReadOnly/>년"
					DSTR = DSTR & "<input type=""text"" name=""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """ id=""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """ value="""" maxlength=""2"" style=""width:30%"" ReadOnly/>월"
					DSTR = DSTR & "</td>" & vbCrLF
					VAR = VAR & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & ","
					VAR = VAR & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & ","

					JBody = JBody & "	if (parseFloat($(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).val())<0)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""" & HStr(cCnt) & " 연도를 시작연도와 종료연도를 확인해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt-1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF


					JBody = JBody & "	if (parseFloat($(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).val())<0)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""" & HStr(cCnt) & " 연도를 시작연도와 종료연도를 확인해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt-1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					ElseIf cCnt>=(CInt(COL)) Then
					DSTR = DSTR & "						<td>"
					DSTR = DSTR & "<input type=""text"" name=""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """ id=""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """ value="""" alt="""& VARIABLE & "_" & iCnt & """ maxlength=""4"" style=""width:40%""/>년"
					DSTR = DSTR & "<input type=""text"" name=""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """ id=""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """ value="""" alt="""& VARIABLE & "_" & iCnt & """ maxlength=""2"" style=""width:30%""/>월"
					DSTR = DSTR & "</td>" & vbCrLF
					VAR = VAR & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & ","
					VAR = VAR & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & ","

					JBody = JBody & "	if ($(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).val()=="""")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""[" & HStr(cCnt) & "] 연도를 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					JBody = JBody & "	if ($(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).val().length<4)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""[" & HStr(cCnt) & "] 연도를 4자리로 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					JBody = JBody & "	if ($(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).val()=="""")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""[" & HStr(cCnt) & "] 월을 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					JBody = JBody & "	if (parseFloat($(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).val())<1)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""[" & HStr(cCnt) & "] 월을 올바르게 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					JBody = JBody & "	if (parseFloat($(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).val())>12)" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""[" & HStr(cCnt) & "] 월을 올바르게 응답해 주십시오."");" & vbCRLF
					JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).focus();" & vbCRLF
					JBody = JBody & "		return;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF
					End IF
				End IF
			Next
		DSTR = DSTR & "					</TR>"
		DSTR = DSTR & "" & LABELSPLITTER
	Next

	'#####################################################################################
	'자바스크립트 입력부 숫자로 제한함
	'#####################################################################################
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF
	Response.Write "function computePe(a1,a2,b1,b2,t1,t2)" & vbCRLF
	Response.Write "{" & vbCRLF
	Response.Write "	var ye1,ye2,mo1,mo2,ye,mo" & vbCRLF
	Response.Write vbCrLf
	Response.Write "	mo1 = parseFloat($(""#""+a2).val());" & vbCRLF
	Response.Write "	mo2 = parseFloat($(""#""+b2).val());" & vbCRLF
	Response.Write vbCrLf						
	Response.Write "	ye1 = parseFloat($(""#""+a1).val());" & vbCRLF
	Response.Write "	ye2 = parseFloat($(""#""+b1).val());" & vbCRLF
	Response.Write vbCrLf
	Response.Write "	ye = ye2-ye1;" & vbCRLF
	Response.Write "	mo = mo2-mo1;" & vbCRLF
	Response.Write vbCrLf
	Response.Write "	if (mo<0)" & vbCRLF
	Response.Write "	{" & vbCRLF
	Response.Write "		ye = ye - 1;" & vbCRLF
	Response.Write "		mo = 12 + mo;" & vbCRLF
	Response.Write "	}"& vbCRLF
	Response.Write vbCrLf
	Response.Write "	$(""#""+t1).val(ye);" & vbCRLF
	Response.Write "	$(""#""+t2).val(mo);" & vbCRLF
	Response.Write "}" & vbCRLF


	Response.Write "	$(document).ready(function(){" & vbCrLf

	For iCnt=1 To CInt(ROWS)
		For cCnt=cLng(COL) To UBound(HStr)
			If VarType(HStr(cCnt))<>0 And VarType(HStr(cCnt))<>1 And Trim(HStr(cCnt))<>"" Then

			Response.Write "		$(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).numeric();" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """).css(""ime-mode"",""disabled"");" & vbCrLF
			Response.Write "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """).css(""ime-mode"",""disabled"");" & vbCrLF
			
			If cCnt=UBound(HStr) Then
				Response.Write "		$(""#" & VARIABLE & "_" & iCnt & "B_" & cCnt & """).blur(function(){;" & vbCrLF
				'Response.Write "			computePe(""" & VARIABLE & "_" & iCnt & """,""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """,""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """);" & vbCrLF
				Response.Write "			computePe(""" & VARIABLE & "_" & iCnt & "A_" & cCnt-1 & """,""" & VARIABLE & "_" & iCnt & "B_" & cCnt-1 & """,""" & VARIABLE & "_" & iCnt & "A_" & cCnt & """,""" & VARIABLE & "_" & iCnt & "B_" & cCnt & """,""" & VARIABLE & "_" & iCnt & "A_" & cCnt+1 & """,""" & VARIABLE & "_" & iCnt & "B_" & cCnt+1 & """);" & vbCrLF
				Response.Write "		});" & vbCrLF
			End IF

			End IF
		Next
	Next

	Response.Write "	});" & vbCRLF
	Response.Write "//-->" & vbCRLF
	Response.Write "</script>" & vbCrLF


	ESTR = Split(DSTR,LABELSPLITTER)
	SBody = SBody & "				<tr>" & vbCRLF

	For iCnt=0 To UBound(ESTR)
		If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 Then
			SBody = SBody & ESTR(iCnt) & vbCRLF
		End If
	Next

	SBody = SBody & "				</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF
	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function
'#######################################################################################
'숫자 받는 TextBox형 Sum 계산 (입력된 값을 자동으로 계산)
'VARIABLE : 변수 명
'ATTRIBUTE: 속성
'TEXT : 질문 TEXT
'MINV : 최소 입력값
'LENGTH : 입력 자리수
'SUMV : 합계 자동계산
'TLABEL : 총 합계 관련 TEXT
'BLABEL : 텍스트 박스 뒷자리 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트
'#######################################################################################
Function QuestionNumberTOTAL(VARIABLE,ATTRIBUTE,TEXT,MINV,LENGTH,SUMV,TLABEL,BLABEL,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,iCnt,V1,V2
	Dim ATStr,A_COD,A1,A2
	Dim JBody
	Dim QName,DSTR,ESTR
	Dim WidthV,HeightV,CTV
	Dim MIV,MAV,LTH,SV

	If Minv="" Or Minv="0" Then	Minv="0"
	If LENGTH="" Or LENGTH="0" Then 
		LTH="1"
	Else
		LTH=LENGTH
	End If
	
	If SUMV="" Or SUMV="0" Then
		Response.Write "Please Need SUM Value"
		Exit Function
	Else
		SV = SUMV
	End IF

	HeightV = "30px"
	ATStr = Split(ATTRIBUTE,LABELSPLITTER)

	

	SBody = ""
	JBody = ""
	DSTR = ""
	ESTR = ""
	
	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF
	
	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "			<table id='" & VARIABLE & "_table' class='attab02' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "				<colgroup>" & vbCRLF
	SBody = SBody & "					<col width=""*""/>" & vbCRLF
	SBody = SBody & "					<col width=""35%""/>" & vbCRLF
	SBody = SBody & "				</colgroup>" & vbCRLF
	CTV = ""

	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF
	Response.Write "	$(document).ready(function(){" & vbCrLF
	Response.Write vbCRLF

	For iCnt=0 To UBound(ATStr)
		If VarType(ATStr)<>0 And VarType(ATSTR)<>1 Then
			A_COD = Split(ATStr(iCnt),CODESPLITTER)
			A1 = A_COD(0)
			A2 = A_COD(1)

			CTV = CTV & VARIABLE & "_" & A1 & ","
		End IF
	Next

	CTV = Left(CTV,Len(CTV)-1)

	For iCnt=0 To UBound(ATStr)
		If VarType(ATStr)<>0 And VarType(ATSTR)<>1 Then
			A_COD = Split(ATStr(iCnt),CODESPLITTER)
			A1 = A_COD(0)
			A2 = A_COD(1)

			If InStr(A2,"*OTHER")<1 Then
				SBody = SBody & "				<tr>" & vbCRLF
				SBody = SBody & "				<td style=""text-align:left;"">&nbsp;<label id=""L" & VARIABLE & "_" & A1 & """>" & A2 & "</label></td>" & vbCRLF
				SBody = SBody & "				<td style=""text-align:center;""><input type=""TEXT"" name=""" & VARIABLE & "_"& A1 & """ id=""" & VARIABLE & """ value="""" size=""10"" maxlength="""& LTH & """/>" & BLABEL &"</td>" & vbCRLF
				SBody = SBody & "				</tr>" & vbCRLF
			Else
				SBody = SBody & "				<tr>" & vbCRLF
				SBody = SBody & "				<td style=""text-align:left;"">&nbsp;<label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(A2,"*OTHER","") & "</label>" 
				SBody = SBody & "				<input name=""T" & VARIABLE & "_" & A1 & """ id=""T" & VARIABLE & "_" & A1 & """ value="""" size=""15"" maxlength=""100""/></td>" & vbCRLF
				SBody = SBody & "				<td style=""text-align:center;""><input type=""TEXT"" name=""" & VARIABLE & "_"& A1 & """ id=""" & VARIABLE & """ value="""" size=""10"" maxlength="""& LTH & """/>" & BLABEL &"</td>" & vbCRLF
				SBody = SBody & "				</tr>" & vbCRLF
			End IF
			VAR = VAR & VARIABLE & "_" & A1 & ","		

			JBody = JBody & "	if ($(""input[name=" &VARIABLE & "_" & A1 & "]"").val().trim()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(""[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]  "& LangQuestion(1) &""");" & vbCRLF
			JBody = JBody & "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF

			If Minv<>"" Then
				JBody = JBody & "	if (parseFloat($(""input[name=" &VARIABLE & "_" & A1 & "]"").val())<" & Minv & ")" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert("""&"[" & Minv & "]" & LangQuestion(6) &""");" & vbCRLF
				JBody = JBody & "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").focus();" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF	
			End If
			
			
			
			If InStr(A2,"*OTHER")>0 Then
				JBody = JBody & "	if (($(""input[name=" &VARIABLE & "_" & A1 & "]"").val().trim()!=""0"") && ($(""#T" & VARIABLE & "_" & A1 &""").val().trim()==""""))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert("""& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		$(""input[name=T" & VARIABLE & "_" & A1 & "]"").focus();" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				JBody = JBody & "	if (($(""input[name=" &VARIABLE & "_" & A1 & "]"").val().trim()==""0"") && ($(""#T" & VARIABLE & "_" & A1 &""").val().trim()!=""""))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert("""& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		$(""input[name=T" & VARIABLE & "_" & A1 & "]"").focus();" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF
				VAR = VAR & "T" & VARIABLE & "_" & A1 & ","
			End IF			
			
			Response.Write "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").numeric();" & vbCrLF
			Response.Write "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").css(""ime-mode"",""disabled"");" & vbCrLF
			'If iCnt<>UBound(ATStr) Then
			Response.Write "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").blur(function(){" & vbCrLF
			Response.Write "			changeTotal();" & vbCRLF			
			Response.Write "		});" & vbCrLF
			'End IF
		End IF
	Next



	Response.Write "	});" & vbCrLF

	Response.Write "function changeTotal()" & vbCRLF
	Response.Write "{" & vbCRLF
	Response.Write "	var Total = 0;" & vbCRLF
	Response.Write "	if ($(""#"& VARIABLE & "_TOTAL"").val()=="""")" & vbCRLF
	Response.Write "	{" & vbCRLF
	Response.Write "		$(""#"& VARIABLE & "_TOTAL"").val(0);" & vbCRLF
	Response.Write "	}" &  vbCRLF

For iCnt=0 To UBound(ATStr)
	If VarType(ATStr)<>0 And VarType(ATSTR)<>1 Then
		A_COD = Split(ATStr(iCnt),CODESPLITTER)
		A1 = A_COD(0)
		A2 = A_COD(1)

	Response.Write "	if ($(""input[name="& VARIABLE &"_"& A1 &"]"").val().trim()!="""")" & vbCRLF
	Response.Write "	{" & vbCRLF
	Response.Write "		Total = Total + parseFloat($(""input[name="& VARIABLE &"_"& A1 &"]"").val().trim());" & vbCRLF
	Response.Write "	}" & vbCRLF		
	Response.WRite "	$(""#"& VARIABLE & "_TOTAL"").val(Total);" & vbCRLF
	End IF
Next
	Response.Write "}" & vbCRLF			

	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF
	
	SBody = SBody & "				<tr>" & vbCRLF
	SBody = SBody & "				<td style=""text-align:center;"">합계</td>" & vbCRLF
	SBody = SBody & "				<td style=""text-align:center;"">" & TLABEL & "<input type=""text"" name=""" & VARIABLE &"_TOTAL"" id=""" & VARIABLE &"_TOTAL"" value="""" size=""10"" readonly/>" & BLABEL &"</td>" & vbCRLF

	SBody = SBody & "				</tr>" & vbCRLF
	SBody = SBody & "			</table>" & vbCRLF
	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	VAR = VAR & VARIABLE & "_TOTAL,"

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'테이블이 가로로 보여지는 단수 선택형 - 짝수형만 아래로 내려짐 그외엔 안됨 --;
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼처리
'BLOCK : 블럭처리용 값
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트
'#######################################################################################
Function QuestionSingleWIDTHCOL(VARIABLE,CODES,TEXT,COL,BCODE,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,V1,V2
	Dim JBody
	Dim QName,DSTR,ESTR
	Dim WidthV,HeightV,CTV,COLCOUNT,mxCOL,XSTR
	Dim BArr,bCnt,bFlag

	HeightV = "30px"

	
	mxCOL = CLng(COL)

	ITStr = Split(CODES,LABELSPLITTER)
	IF BCODE<>"" Then BArr = Split(BCODE,",")

	SBody = ""
	JBody = ""
	DSTR = ""
	ESTR = ""
	
	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	CTV = 0
	VAR = VAR & VARIABLE & ","

	For iCnt=1 To mxCOL
		SBody = SBody & "			<col width=" & Chr(34) & "####%" & Chr(34) &"/>" & vbCRLF
	Next

	SBody = SBody & "						</colgroup>" & vbCRLF
	
	COLCOUNT=1
'	XSTR = XSTR & "					<tr>" & vbCRLF

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)

			V1 = V_COD(0)
			V2 = V_COD(1)

			If BCODE<>"" Then
				bFlag = False

				For bCnt=0 To UBound(BArr)
					If VarType(BArr(bCnt))<>0 And VarType(BArr(bCnt))<>1 And BArr(bCnt)<>"" Then
						If CLng(V1)=CLng(BArr(bCnt)) Then
							BFlag = True
						End IF
					End If
				Next
			Else
				bFlag = False 
			End If

			
			DSTR = DSTR & "					<td style='text-align:center;'>" & vbCRLF

			If bFlag Then
				DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " disabled/>" & vbCRLF
			Else
				DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			End If
			DSTR = DSTR & "					</td>" & vbCRLF

			EStr = EStr & "					<td style='text-align:center;background:#fff;'>" & vbCRLF
			EStr = EStr & "						" & V2 & vbCRLF
			EStr = EStr & "					</td>" & vbCRLF

			If COLCOUNT=mxCOL Then
				XSTR = XSTR & "					<tr>" & vbCRLF
				XSTR = XSTR & EStr
				XSTR = XSTR & "					</tr>" & vbCRLF
				XSTR = XSTR & "					<tr>" & vbCRLF
				XSTR = XSTR & DStr
				XSTR = XSTR & "					</tr>" & vbCRLF
				ESTR = ""
				DSTR = ""
				COLCOUNT=1
			Else
				COLCOUNT=COLCOUNT+1
			End If
			
		End IF
	Next
	If ESTR<>"" AND DSTR<>"" Then
		XSTR = XSTR & "					<tr>" & vbCRLF
		XSTR = XSTR & EStr & DSTR
		XSTR = XSTR & "					</tr>" & vbCRLF
	End IF

'	XSTR = XSTR & "					</tr>" & vbCRLF

	WidthV = FormatNumber(CDbl(100/mxCOL),2)
	SBody = Replace(SBody,"####",WidthV)
	
	SBody = SBody & XSTR
	SBody = SBody & "				</table>" & vbCRLF


	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")==undefined)" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""& LangQuestion(1) &""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'테이블이 가로로 보여지는 단수 선택형 - 현재는 기타는 적용되지 않음, 코드를 Disabled 시킴
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'BODYSTR : HTML 사용
'BCODE : 블록 코드
'JBODYSTR : 자바스크립트
'#######################################################################################
Function QuestionSingleWIDTHBLOCK(VARIABLE,CODES,TEXT,BCODE,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,V1,V2
	Dim JBody
	Dim QName,DSTR,ESTR
	Dim WidthV,HeightV,CTV
	Dim BArr,bCnt,bFlag
	HeightV = "30px"

	

	ITStr = Split(CODES,LABELSPLITTER)
	If BCODE<>"" Then	BArr = Split(BCODE,",")

	SBody = ""
	JBody = ""
	DSTR = ""
	ESTR = ""
	

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	CTV = 0
	VAR = VAR & VARIABLE & ","

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			CTV = CTV+1
			V1 = V_COD(0)
			V2 = V_COD(1)

			If BCODE<>"" Then
				bFlag = False

				For bCnt=0 To UBound(BArr)
					If VarType(BArr(bCnt))<>0 And VarType(BArr(bCnt))<>1 And BArr(bCnt)<>"" Then
						If CLng(V1)=CLng(BArr(bCnt)) Then
							BFlag = True
						End IF
					End If
				Next
			Else
				bFlag = False 
			End If

			SBody = SBody & "						<col width=" & Chr(34) & "####%" & Chr(34) &"/>" & vbCRLF
			DSTR = DSTR & "					<td style='text-align:center;'>" & vbCRLF
			If bFlag Then
				DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " disabled/>" & vbCRLF
			Else
				DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			End If
			DSTR = DSTR & "					</td>" & vbCRLF

			EStr = EStr & "					<th style='text-align:center;background:#fff;'>" & vbCRLF
			EStr = EStr & "						" & V2 & vbCRLF
			EStr = EStr & "					</th>" & vbCRLF

		End IF
	Next

	WidthV = FormatNumber(CDbl(100/CTV),2)
	SBody = Replace(SBody,"####",WidthV)

	SBody = SBody & "					</colgroup>" & vbCRLF
	SBody = SBody & "					<tr>" & vbCRLF
	SBody = SBody & EStr
	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "					<tr>" & vbCRLF
	SBody = SBody & DStr
	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF


	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")==undefined)" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""& LangQuestion(1) &""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'세로로 보여지는 복수 선택형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'CNT : 선택 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionMultiCNT(VARIABLE,CODES,TEXT,COL,CNT,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR
	Dim WidthV,HeightV,CTV,LTV
	HeightV = "30px"
	CTV = COL
	OSTR = ""

	

	ITStr = Split(CODES,LABELSPLITTER)
	WidthV = FormatNumber(CDbl(100/CTV),2)

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "		[$_STITEM_$]" & vbCRLF
	SBody = SBody & "		</div>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	DSTR = ""	

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			V2 = V_COD(1)

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " onclick=""CheckBoxCountDis('"&VARIABLE & "',"&CNT&",'"&VARIABLE&"_"&V1&"');""/>" & vbCRLF
			Else
				DSTR = DSTR & "<input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');CheckBoxCountDis('"&VARIABLE & "',"&CNT&",'"&VARIABLE&"_"&V1&"');"& CHR(34) &" />" & vbCRLF
			End if

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');CheckBoxCountDis('"&VARIABLE & "',"&CNT&",'"&VARIABLE&"_"&V1&"');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
'				CheckBoxCountDis(objid,mx,nm)
				DSTR = DSTR & Replace(V2,"*OTHER","") &"</a>"	'기타 라벨 제거
			Else
				DSTR = DSTR & "<a href=" & Chr(34) & "javascript:setCheckBoxValue('" & VARIABLE & "_" & V1 & "');CheckBoxCountDis('"&VARIABLE & "',"&CNT&",'"&VARIABLE&"_"&V1&"');noCheckBoxValue('" & VARIABLE & "','" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
				DSTR = DSTR & Replace(V2,"*OTHER","") &"</a>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
			End IF

			VAR = VAR & VARIABLE & "_" & V1  & ","

			If InStr(ITStr(iCnt),"*OTHER")>0 Then
				OSTR = OSTR & ";" & V1
				DSTR = DSTR & "&nbsp;<input type=" & Chr(34) & "text" & Chr(34) &" name=" & Chr(34) & "T" & VARIABLE & "_" & V1 & Chr(34) & " id=" & Chr(34) & VARIABLE & "_" & V1 & Chr(34) & " value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "30" & Chr(34) & " style='vertical-align: top;width:150px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End If
			
			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF

	For iCnt=1 To Col
		SBody = SBody & "						<col width=" & Chr(34) & "####%" & Chr(34) &"/>" & vbCRLF
	Next	
	SBody = SBody & "					</colgroup>" & vbCRLF
	SBody = Replace(SBody,"####",WidthV)

	ESTR = Split(DSTR,LABELSPLITTER)
	LTV = CInt(FormatNumber(CDbl(UBound(ESTR)/Col+0.49),1))

	cCnt=1
	SBody = SBody & "					<tr>" & vbCRLF

	Dim LC

	If Col>1 Then
		LC = (LTV*Col)
	Else
		LC = UBound(ItStr)
	End If

	For iCnt=0 To LC
		If UBound(ESTR)>=iCnt Then
			If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 And ESTR(iCnt)<>"" Then
				SBody = SBody & "<td>" & ESTR(iCnt)& "</td>" & vbCRLF
			Else
				'SBody = SBody & "<td>&nbsp;</td>" & vbCRLF
			End If

			If cCnt=Col Then
				cCnt=1
				SBody = SBody & "					</tr>" & vbCRLF
				SBody = SBody & "					<tr>" & vbCRLF
			Else
				cCnt=cCnt+1
			End If
		End IF		
	Next

	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	'자바스크립트 처리 부분

	JBody = JBody & "	if (chkCheckBox("& Chr(34) & VARIABLE & Chr(34) &")==false)" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""&LangQuestion(1)&""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "#" & VARIABLE &":eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF & vbCRLF

	JBody = JBody & "	if (CheckBoxCount2("& Chr(34) & VARIABLE & Chr(34) &")!="&CNT&")" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""&LangQuestion(1)&""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "#" & VARIABLE &":eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF & vbCRLF
	If Len(OSTR)>0 Then	'기타가 있는 경우 자바스크립트 처리
		Dim tmpOSTR
		tmpOSTR = Split(OSTR,";")

		For iCnt=0 To UBound(tmpOSTR)
			If VarType(tmpOSTR(iCnt))<>0 And VarType(tmpOSTR(iCnt))<>1 And tmpOSTR(iCnt)<>"" Then
				JBody = JBody & "	if ((getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()==" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				JBody = JBody & "	if ((getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")!=" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "&  LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF
			End IF
		Next

	End IF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'속성형태 라디오 - 가로보기
'VARIABLE : 변수 명
'CODES : 코드 라벨
'ATTRIBUTE: 속성
'TEXT : 질문 TEXT
'STEPFLAG : 스텝여부
'MCNT : 속성을 동일하게 응답하는 갯수 확인용
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'이미지가 마우스 오버로 나오는 부분(속성형)
'#######################################################################################
Function QuestionSingleMATRIX(VARIABLE,CODES,ATTRIBUTE,TEXT,STEPFLAG,MCNT,SUBTITLE,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim ATStr,A_COD,A1,A2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR,COL
	Dim WidthV,HeightV,CTV,LTV
	Dim XVX
	Dim HDStr
	Dim ATCnt

	HeightV = "45px"
	OSTR = ""
	ATCnt = MCNT

	

	ITStr = Split(CODES,LABELSPLITTER)
	ATStr = Split(ATTRIBUTE,LABELSPLITTER)
	COL = UBound(ITStr)
	CTV = Col

	Select Case COL
		Case 0
			XVX = 20
		Case 1
			XVX = 20
		Case 2
			XVX = 40
		Case 3
			XVX = 40
		Case 4
			XVX = 40
		Case 5
			XVX = 60
		Case 6
			XVX = 50
		Case 7
			XVX = 50
		Case 8
			XVX = 60
		Case 9
			XVX = 60
		Case 10
			XVX = 70
		Case Else
			XVX = 70
	End Select	

	WidthV = FormatNumber(CDbl(XVX/COL),2)

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
		SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;margin-bottom:100px;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div>" & TEXT & "<p></p>" & vbCRLF
	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	DSTR = ""	
	HDSTR = ""

	For cCnt=0 To UBound(ATStr)

		If VarType(ATStr(cCnt))<>0 And VarType(ATStr(cCnt))<>1 And ATStr(cCnt)<>"" Then
			A_COD = Split(ATStr(cCnt),CODESPLITTER)
			A1 = A_COD(0)
			A2 = A_COD(1)

			'Header TR 라인 생성
			If cCnt=0 Then
				HDSTR = "					<TR id=""HCOL" & VARIABLE & "_" & A1 & """>" & vbCRLF
				HDSTR = HDSTR & "						<TH>"& SUBTITLE &"</TH>" & vbCRLF
			End If

			If cCnt>0 And STEPFLAG Then
				DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & A1 & """ style=""display:none;"">" & vbCRLF
			Else
				DSTR = DSTR & "					<TR id=""COL" & VARIABLE & "_" & A1 & """>" & vbCRLF
			End If

			If InStr(A2,"*OTHER")>0 Then
				DSTR = DSTR & "						<TD class=""ATTHeader"" style=""cursor:pointer;"" alt=""./Media/"& VARIABLE & "_" & A1 & ".jpg""><label id=""L" & VARIABLE & "_" & A1 & """ >" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label>&nbsp;"
				DSTR = DSTR & "<input type=""text"" name=""T" & VARIABLE & "_" & A1 & """ id=""T" & VARIABLE & "_" & A1 & """ value="""" maxlength=""50"" style='vertical-align: top;width:200px;'/>&nbsp;"
				DSTR = DSTR & vbtab&vbtab&vbtab&vbtab&vbtab&vbtab & "<input type=""button"" name=""RE" & VARIABLE & "_" & A1 & """ id=""RE" & VARIABLE & "_" & A1 & """ value="""&LangQuestion(11)&""" onclick=""ResetETCRadio('T" & VARIABLE & "_" & A1 & "','" & VARIABLE & "_" & A1 & "')"" style=""cursor:pointer;""/>"
				DSTR = DSTR & vbtab&vbtab&vbtab&vbtab&vbtab&vbtab &"</TD>" & vbCrLF
			Else
				DSTR = DSTR & "						<TD class=""ATTHeader"" style=""cursor:pointer;"" alt=""./Media/"& VARIABLE & "_" & A1 & ".jpg""><label id=""L" & VARIABLE & "_" & A1 & """>" & Replace(Replace(A2,"*OTHER",""),"*NONE","") & "</label></TD>" & vbCrLF
			End IF

			For iCnt=0 To UBound(ITStr)
				If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 Then
					V_COD = Split(ITStr(iCnt),CODESPLITTER)
					V1 = V_COD(0)
					V2 = V_COD(1)
					DSTR = DSTR & "						<TD style=""text-align:center;"">"
					DSTR = DSTR & "<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & A1 & CHR(34) & " id=""" & VARIABLE & "_" & A1 & "_" & V1 & """ class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/></TD>" & vbCRLF

					If cCnt=0 Then
						HDSTR = HDSTR & "						<TH>" & Replace(Replace(V2,"*OTHER",""),"*NONE","") & "<br>(" & V1 & ")" & "</TH>" & vbCrLF
					End If
				End IF
			Next

			If cCnt=0 Then
				HDSTR = HDSTR & "					</TR>" & VBCRLF
			End If

			DSTR = DSTR & "					</TR>"
			DSTR = DSTR & "" & LABELSPLITTER
			VAR = VAR & VARIABLE & "_" & A1 & ","

			If InStr(A2,"*OTHER")>0 Then
				VAR = VAR & "T" & VARIABLE & "_" & A1 & ","

				JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		if ($(""#T" & VARIABLE & "_" & A1 & """).val().trim()!="""")"& vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]" & " " & LangQuestion(1) & Chr(34) & ");" & vbCrLF
				JBody = JBody & "			$(""#T" & VARIABLE & "_" & A1 & """).focus();" & vbCrLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCRLF 
				JBody = JBody & "	else" & vbCRLF 
				JBody = JBody & "	{" & vbCRLF 
				JBody = JBody & "		if ($(""#T" & VARIABLE & "_" & A1 & """).val().trim()=="""")"& vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]" & " " & LangQuestion(1) & Chr(34) & ");" & vbCrLF
				JBody = JBody & "			$(""#T" & VARIABLE & "_" & A1 & """).focus();" & vbCrLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCRLF & vbCRLF


				'기타 특수문자
				JBody = JBody & "	if ($(""#T" & VARIABLE & "_" & A1 & """).val().trim()!="""")"
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		if (containsChars($(""#T" & VARIABLE & "_" & A1 & """).val().trim()," & ERRORSTR & "))" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert("""&LangQuestion(3)&""");" & vbCrLF
				JBody = JBody & "			$(""#T" & VARIABLE & "_" & A1 & """).focus();" & vbCrLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCrLF

			Else
				JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" &  VARIABLE & "_" & A1 & """).text()+""]" & " " & LangQuestion(1) & Chr(34) & ");" & vbCRLF
				JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE & "_" & A1 &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF & vbCRLF
			End If
			
		End IF
	Next

	If ATCnt>0 Then
		Response.Write vbCrLF
		Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCRLF
		Response.Write "	var " & VARIABLE & "Flag;" & vbCrLf
		Response.Write "	" & VARIABLE & "Flag=false;" & vbCrLf

		Response.Write "	function image_show(e, image_url) {"& vbCrLf
		Response.Write "	     $('#image_box').find('img').removeAttr('src').attr('src', image_url);     //큰 박스내 빈 이미지태그에 마우스오버된 이미지의 경로를 복제합니다."& vbCrLf
		Response.Write "	     $('#image_box').css({display:'',top:e.pageY - 50 + 'px',left:e.pageX + 50 + 'px'});     //마우스 포인터의 좌표를 받아 해당 위치에 큰 이미지 박스를 보여줍니다."& vbCrLf
		Response.Write "	     //큰 이미지 박스에 마우스 포인터를 올렸을때"& vbCrLf
		Response.Write "	     $('#image_box').unbind('mouseover').bind('mouseover', function() {"& vbCrLf
		Response.Write "	          //정확한 제어를 위해 작은 이미지 마우스 포인터 오버, 아웃 액션을 초기화합니다."& vbCrLf
		Response.Write "	          $('.ATTHeader').unbind('mouseover');"& vbCrLf
		Response.Write "	          $('.ATTHeader').unbind('mouseout');"& vbCrLf
		Response.Write "	     });"& vbCrLf

		Response.Write "	     //큰 이미지 박스에서 마우스 포인터가 벗어났을때"& vbCrLf
		Response.Write "	     $('#image_box').unbind('mouseout').bind('mouseout', function() {"& vbCrLf
		Response.Write "	          $(this).css({display:'none'});"& vbCrLf
		Response.Write "	          image_cnf();"& vbCrLf
		Response.Write "	     });"& vbCrLf
		Response.Write "	}"& vbCrLf

		Response.Write "	function image_hide() {"& vbCrLf
		Response.Write "	$('#image_box').css({display:'none'});     //큰 이미지 박스를 숨깁니다."& vbCrLf
		Response.Write "	}"& vbCrLf

		Response.Write "	function image_cnf() {"& vbCrLf
		Response.Write "	     //작은 이미지에 마우스 포인터를 올렸을때"& vbCrLf
		Response.Write "	     $('.ATTHeader').bind('mouseover', function(e) {"& vbCrLf
		Response.Write "	          image_show(e, $(this).attr('alt'));"& vbCrLf
		Response.Write "	     });"& vbCrLf
		Response.Write "	     //작은 이미지에서 마우스 포인터가 벗어났을때"& vbCrLf
		Response.Write "	     $('.ATTHeader').bind('mouseout', function() {"& vbCrLf
		Response.Write "	          image_hide();"& vbCrLf
		Response.Write "	     });"& vbCrLf
		Response.Write "	}"& vbCrLf

		Response.Write "	$(document).ready(function() {"& vbCrLf
		Response.Write "	     image_cnf();     //페이지 로딩이 완료되면 해당 기능을 실행합니다."& vbCrLf
		Response.Write "	});"& vbCrLf

		Response.Write "//-->" & vbCRLF
		Response.Write "</script>" & vbCrLF

		JBody = JBody & "	if ((" & VARIABLE & "Flag==false) && (RadioArrayCnt(""" & Left(VAR,Len(VAR)-1) & ""","&ATCnt&")))" & vbCrLF
		JBody = JBody & "	{" & vbCrLF
		JBody = JBody & "		alert(" & Chr(34) & LangQuestion(4) & Chr(34) & ");" & vbCRLF
		JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE & "_" & A1 &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
		JBody = JBody & "		" & VARIABLE & "Flag=true;" & vbCrLF
		JBody = JBody & "		return;" & vbCRLF
		JBody = JBody & "	}" & vbCRLF & vbCRLF
	End IF

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab02' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	SBody = SBody & "						<col width=""*""/>" & vbCRLF
	For iCnt=0 To Col
		SBody = SBody & "						<col width=" & Chr(34) & WidthV & "%" & Chr(34) &"/>" & vbCRLF
	Next	
	SBody = SBody & "					</colgroup>" & vbCRLF
	SBody = SBody & HDSTR
	ESTR = Split(DSTR,LABELSPLITTER)

	For iCnt=0 To UBound(ESTR)
		If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 Then
			SBody = SBody & ESTR(iCnt) & vbCRLF
		End If
	Next

	If iCnt>6 Then
		SBody = SBody & HDSTR
	End IF
	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	SBody = SBody & vbtab & "<div id=""image_box"" style=""position:absolute;display:none;z-index:2;""><img src=""""/></div>" & vbCRLF

	'자바스크립트 처리 부분
	
	If STEPFLAG Then
		Response.Write vbCrLF
		Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCRLF
		Response.Write "	$(document).ready(function(){" & vbCrLf

		Response.Write vbCrLF
		For iCnt=0 To UBound(ATStr)
			If VarType(ATStr(iCnt))<>0 And VarType(ATStr(iCnt))<>1 Then		
				A_COD = Split(ATStr(iCnt),CODESPLITTER)
				A1 = A_COD(0)
				A2 = A_COD(1)
				Response.Write "		$(""input[name=" & VARIABLE & "_" & A1 & "]"").click(function(){" & vbCrLF
				Response.Write "			$(""#" & VARIABLE & "_table tr:nth-child(" & iCnt+3 & ")"").show();" & vbCrLF
				Response.Write "		});" & vbCrLF
			End If
		Next

		Response.Write "	});" & vbCrLF
		Response.Write "//-->" & vbCrLF
		Response.Write "</script>" & vbCrLF

	End If

	BODYSTR = SBody
	JBODYSTR = JBody

End Function


'#######################################################################################
'텍스트 박스가 세로로 여러개 보여지는 Template
'VARIABLE : 변수 명
'ATTRIBUTE: 속성 정보
'TEXT : 질문 TEXT
'MAXLENGTH: 텍스트 입력 갯수
'ATTMAX : 최소 응답 해야 하는 갯수
'MINLENGTH: 최소 입력 길이
'NFLAG : None 처리
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트
'이미지가 마우스 오버로 나오는 부분(텍스트박스 ATT)
'#######################################################################################
Function QuestionTEXTBOXATT(VARIABLE,ATTRIBUTE,TEXT,MAXLENGTH,ATTMAX,MINLENGTH,NFLAG,VIEW,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,V1,V2
	Dim JBody
	Dim QName,DSTR,ESTR
	Dim WidthV,HeightV,CTV
	Dim AMX,ML,MH
	Dim XVAR
	
	If MAXLENGTH="" Then 
		ML="255"
	Else
		ML = MAXLENGTH
	End IF
	
	If ATTMAX="" Or ATTMAX="0" Then 
		AMX=1
	Else
		AMX = ATTMAX
	End If
	
	If MINLENGTH="" Or MINLENGTH="0" Then 
		MH="4"
	Else
		MH = MINLENGTH
	End IF

	HeightV = "30px"
	ITStr = Split(ATTRIBUTE,LABELSPLITTER)

	

	SBody = ""
	JBody = ""
	DSTR = ""
	ESTR = ""
	
	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
		SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div>" & TEXT & "<p></p>" & vbCRLF
	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	SBody = SBody & "		<ul>" & vbCrLF	

	If VIEW="1" Then

		SBody = SBody & vbtab&vbtab&"<li style='padding : 5px 5px 5px 5px;'>"
		For iCnt=0 To UBound(ITStr)
			If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
				V_COD = Split(ITStr(iCnt),CODESPLITTER)
				V1 = V_COD(0)
				V2 = V_COD(1)
				SBody = SBody & "<input type=""text"" id=""" & VARIABLE & "_" & V1 & """ name=""" & VARIABLE & "_" & V1 & """ style=""width:10%;"" maxlength=""" & ML & """ value=""""/>,"
				VAR = VAR & VARIABLE & "_" & V1 & ","
				XVAR = XVAR & VARIABLE & "_" & V1 & ","
			End IF
		Next
		
		SBody = Left(SBody,Len(SBody)-1)
		SBody = SBody & vbCRLF & "		</li></ul>" & vbCrLF
	Else

		For iCnt=0 To UBound(ITStr)
			If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
				V_COD = Split(ITStr(iCnt),CODESPLITTER)
				V1 = V_COD(0)
				V2 = V_COD(1)
				SBody = SBody & vbtab&vbtab&"<li style='padding : 5px 5px 5px 5px;' ><span style='padding-right:3px;cursor:pointer;' class=""image_list"" alt=""./Media/"& Replace(VARIABLE,"_A","") & "_" & V1 & ".jpg"">"&V2&"</span><input type=""text"" id=""" & VARIABLE & "_" & V1 & """ name=""" & VARIABLE & "_" & V1 & """ style=""width:96%;"" maxlength=""" & ML & """/></li>" & vbCRLF
				VAR = VAR & VARIABLE & "_" & V1 & ","
				XVAR = XVAR & VARIABLE & "_" & V1 & ","
			End IF
		Next
		
		SBody = SBody & "		</ul>" & vbCrLF
	End if

	If NFlag Then
		SBody = SBody & "		<div><input type=""checkbox"" id="""&VARIABLE&"_NONE"" name="""&VARIABLE&"_NONE"" value=""1""/><a href=""javascript:setCheckBoxValue('"&VARIABLE&"_NONE');itemDisabledSetup('"&XVAR&"'.split(','),$('#"&VARIABLE&"_NONE').attr('checked'))"">"&NONSTR&"</a></div>" & vbCRLF
		Response.Write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCrLF
		Response.Write "	$(document).ready(function(){" & vbCrLF
		Response.Write "		$(""#"&VARIABLE&"_NONE"").click(function(){" & vbCrLF
		Response.Write "			itemDisabledSetup("""&XVAR&""".split("",""),$(""#"&VARIABLE&"_NONE"").attr(""checked""));" & vbCrLF
		Response.Write "		})" & vbCrLf
		Response.Write "	});" & vbCrLf
		Response.Write "//-->" & vbCrLF
		Response.Write "</script>"

		VAR = VAR & VARIABLE & "_NONE,"
	End If
	
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF

	Response.Write "	function image_show(e, image_url) {"& vbCrLf
	Response.Write "	     $('#image_box').find('img').removeAttr('src').attr('src', image_url);     //큰 박스내 빈 이미지태그에 마우스오버된 이미지의 경로를 복제합니다."& vbCrLf
	Response.Write "	     $('#image_box').css({display:'',top:e.pageY - 50 + 'px',left:e.pageX + 50 + 'px'});     //마우스 포인터의 좌표를 받아 해당 위치에 큰 이미지 박스를 보여줍니다."& vbCrLf
	Response.Write "	     //큰 이미지 박스에 마우스 포인터를 올렸을때"& vbCrLf
	Response.Write "	     $('#image_box').unbind('mouseover').bind('mouseover', function() {"& vbCrLf
	Response.Write "	          //정확한 제어를 위해 작은 이미지 마우스 포인터 오버, 아웃 액션을 초기화합니다."& vbCrLf
	Response.Write "	          $('.image_list').unbind('mouseover');"& vbCrLf
	Response.Write "	          $('.image_list').unbind('mouseout');"& vbCrLf
	Response.Write "	     });"& vbCrLf

	Response.Write "	     //큰 이미지 박스에서 마우스 포인터가 벗어났을때"& vbCrLf
	Response.Write "	     $('#image_box').unbind('mouseout').bind('mouseout', function() {"& vbCrLf
	Response.Write "	          $(this).css({display:'none'});"& vbCrLf
	Response.Write "	          image_cnf();"& vbCrLf
	Response.Write "	     });"& vbCrLf
	Response.Write "	}"& vbCrLf

	Response.Write "	function image_hide() {"& vbCrLf
	Response.Write "	$('#image_box').css({display:'none'});     //큰 이미지 박스를 숨깁니다."& vbCrLf
	Response.Write "	}"& vbCrLf

	Response.Write "	function image_cnf() {"& vbCrLf
	Response.Write "	     //작은 이미지에 마우스 포인터를 올렸을때"& vbCrLf
	Response.Write "	     $('.image_list').bind('mouseover', function(e) {"& vbCrLf
	Response.Write "	          image_show(e, $(this).attr('alt'));"& vbCrLf
	Response.Write "	     });"& vbCrLf
	Response.Write "	     //작은 이미지에서 마우스 포인터가 벗어났을때"& vbCrLf
	Response.Write "	     $('.image_list').bind('mouseout', function() {"& vbCrLf
	Response.Write "	          image_hide();"& vbCrLf
	Response.Write "	     });"& vbCrLf
	Response.Write "	}"& vbCrLf

	Response.Write "	$(document).ready(function() {"& vbCrLf
	Response.Write "	     image_cnf();     //페이지 로딩이 완료되면 해당 기능을 실행합니다."& vbCrLf
	Response.Write "	});"& vbCrLf

	Response.Write "//-->" & vbCRLF
	Response.Write "</script>" & vbCrLF

	SBody = SBody & "		</div>" & vbCRLF

	XVAR = Left(XVAR,Len(XVAR)-1)

	SBody = SBody & "	</div>" & vbCRLF

	If NFlag Then
	JBody = JBody & "	if ($("& Chr(34) & "#" & VARIABLE & "_NONE" & Chr(34) &").is("":checked"")==false){" & vbCrLF
	End if

	For iCnt=0 To AMX-1
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)

			JBody = JBody & "	if ($("& Chr(34) & "#" & VARIABLE & "_" & V1 & Chr(34) &").val()=="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			If iCnt=0 Then
				JBody = JBody & "		alert("""& LangQuestion(1) &""");" & vbCRLF
			Else
				JBody = JBody & "		alert(""(" & (iCnt+1) & ") "& LangQuestion(1) &""");" & vbCRLF
			End IF
			JBody = JBody & "		$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
			JBody = JBody & "		return;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF

		End IF
	Next
	
	JBody = JBody & "	var xx;" & vbCRLF
	JBody = JBody & "	var xy;" & vbCRLF
	JBody = JBody & "	var TextFlag;" & vbCRLF
	V2 = ""

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			

			JBody = JBody & "	if ($("& Chr(34) & "#" & VARIABLE & "_" & V1 & Chr(34) &").val()!="""")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF

			If iCnt<>0 Then
				JBody = JBody & "		xx = $(""#" & VARIABLE & "_" & V2 & """).val().trim();" & vbCrLF
				JBody = JBody & "		xy = $(""#" & VARIABLE & "_" & V1 & """).val().trim();" & vbCrLF

				JBody = JBody & "		if (xx.length<" & MH & ")" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(""" & (iCnt+1) & " "& LangQuestion(2) &""");" & vbCRLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF & vbCrLF

				JBody = JBody & "		if (containsChars(xx," & ERRORSTR & "))" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert("""& LangQuestion(3) &""");" & vbCrLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF

				JBody = JBody & "		TextFlag = TextOverlap("""& VARIABLE & "_" & V1 &""",xy);" & vbCrLF
				JBody = JBody & "		if (TextFlag==false)" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(""[""+xy+""] "& LangQuestion(10) &""");" & vbCrLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				
			Else
				JBody = JBody & "		xx = $(""#" & VARIABLE & "_" & V1 & """).val().trim();" & vbCrLF
				JBody = JBody & "		if (xx.length<" & MH & ")" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(""" & (iCnt+1) & " "& LangQuestion(2) &""");" & vbCRLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF & vbCrLF

				JBody = JBody & "		if (containsChars(xx," & ERRORSTR & "))" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert("""& LangQuestion(3) &""");" & vbCrLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF

				JBody = JBody & "		TextFlag = TextOverlap("""& VARIABLE & "_" & V1 &""",xx);" & vbCrLF
				JBody = JBody & "		if (TextFlag==false)" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(""[""+xx+""] "& LangQuestion(10) &""");" & vbCrLF
				JBody = JBody & "			$(" & Chr(34) & "#" & VARIABLE  & "_" & V1 & Chr(34) & ").focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF

			End If			
			JBody = JBody & "	}" & vbCRLF
			V2 = V1
		End IF
	Next

	If NFlag Then
		JBody = JBody & "	}" & vbCRLF
	End if

	SBody = SBody & vbtab & "<div id=""image_box"" style=""position:absolute;display:none;z-index:2;""><img src=""""/></div>" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function


'#######################################################################################
'세로로 보여지는 단수 선택형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionLeftSingle(VARIABLE,CODES,TEXT,COL,SUBTITLE,LeftWidth,ByRef BODYSTR,ByRef JBODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,cCnt,V1,V2
	Dim JBody
	Dim QName
	Dim DSTR,ESTR,OSTR
	Dim WidthV,HeightV,CTV,LTV
	HeightV = "30px"
	CTV = COL
	OSTR = ""

	

	ITStr = Split(CODES,LABELSPLITTER)
	WidthV = FormatNumber(CDbl(100/CTV),2)

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class=" & Chr(34) & "outdiv" & Chr(34) & ">" & vbCRLF
	SBody = SBody & "		<p></p><div style='float:left;margin-right:5px;height:100%;'><img src=" & CHR(34) & "./images/" & QNAME & ".gif" & CHR(34) & " class=" & CHR(34) & "middle" & CHR(34) & " alt=" & CHR(34) & "" & CHR(34) & "/></div><div class='q_area'>" & TEXT & "</div><p></p>" & vbCRLF

	SBody = SBody & "		<div class=" & CHR(34) & "indiv" & CHR(34) & ">" & vbCRLF
	DSTR = ""

	VAR = VAR & VARIABLE & ","
	Dim RightWidth
	RightWidth = 100-LeftWidth
	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			V2 = V_COD(1)
			DSTR = DSTR & "<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " class=" & CHR(34) & "radio1" & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			DSTR = DSTR & "					<a href=" & Chr(34) & "javascript:setRadioValue('" & VARIABLE & "','" & V1 & "');" & Chr(34) & " id=" & Chr(34) & "L" & VARIABLE & "_" & V1 & Chr(34) & " style=" & Chr(34) & "vertical-align: top;" & Chr(34) & ">"
			DSTR = DSTR & Replace(V2,"*OTHER","") &"</a>"

			If InStr(ITStr(iCnt),"*OTHER")>0 Then
				OSTR = OSTR & ";" & V1
				DSTR = DSTR & "&nbsp;<input type=" & Chr(34) & "text" & Chr(34) &" name=" & Chr(34) & "T" & VARIABLE & "_" & V1 & Chr(34) & " id=" & Chr(34) & VARIABLE & "_" & V1 & Chr(34) & " value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "30" & Chr(34) & " style='vertical-align: top;width:200px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End IF

			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab01' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF

'	For iCnt=1 To Col
		SBody = SBody & "						<col width=" & Chr(34) & ""&LeftWidth&"%" & Chr(34) &"/>" & vbCRLF
		SBody = SBody & "						<col width=" & Chr(34) & ""&RightWidth&"%" & Chr(34) &"/>" & vbCRLF
'	Next	
	SBody = SBody & "					</colgroup>" & vbCRLF
	SBody = Replace(SBody,"####",WidthV)

	ESTR = Split(DSTR,LABELSPLITTER)
	LTV = CInt(FormatNumber(CDbl(UBound(ESTR)/Col+0.49),1))

	cCnt=1
	SBody = SBody & "					<tr>" & vbCRLF
	Dim LC

	If Col>1 Then
		LC = (LTV*Col)
	Else
		LC = UBound(ItStr)
	End If
	SBody = SBody & "					<td style='vertical-align:top;padding-top:5px;padding-left:5px;font-size:10pt;border-right:none;' rowspan='"&Ubound(ESTR) &"'>" & SUBTITLE & "</td>" & vbCRLF
	For iCnt=0 To LC
		If UBound(ESTR)>=iCnt Then
			If VarType(ESTR(iCnt))<>0 And VarType(ESTR(iCnt))<>1 And ESTR(iCnt)<>"" Then
				SBody = SBody & "					<td>" & ESTR(iCnt)& "</td>" & vbCRLF
			Else
'				SBody = SBody & "					<td>&nbsp;</td>" & vbCRLF
			End If

			If iCnt>=UBound(ESTR) Then
'				SBody = SBody & "					<td>&nbsp;</td>" & vbCRLF
			End If

			If cCnt=Col Then
				cCnt=1
				SBody = SBody & "					</tr>" & vbCRLF
				SBody = SBody & "					<tr>" & vbCRLF
			Else
				cCnt=cCnt+1
			End If
		End IF
	Next

	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF

	SBody = SBody & "		</div>" & vbCRLF
	SBody = SBody & "	</div>" & vbCRLF

	'자바스크립트 처리 부분

	JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")==undefined)" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert("""& LangQuestion(1) &""");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "input[name=" & VARIABLE &"]:eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF & vbCRLF


	If Len(OSTR)>0 Then	'기타가 있는 경우 자바스크립트 처리
		Dim tmpOSTR
		tmpOSTR = Split(OSTR,";")

		For iCnt=0 To UBound(tmpOSTR)
			If VarType(tmpOSTR(iCnt))<>0 And VarType(tmpOSTR(iCnt))<>1 And tmpOSTR(iCnt)<>"" Then
				JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()==" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")!=" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=" & Chr(34) & Chr(34) & "))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).html()+""] "& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				'기타 특수문자
				JBody = JBody & "	if ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!="""")"
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		if (containsChars($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()," & ERRORSTR & "))" & vbCrLF
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert("""&LangQuestion(3)&""");" & vbCrLF
				JBody = JBody & "			$('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').focus();" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCrLF
				JBody = JBody & "	}" & vbCrLF

				'보기를 기타값에 응답
				JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		if (openValueCode($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim(),""" & CODES & """)==true)"
				JBody = JBody & "		{" & vbCrLF
				JBody = JBody & "			alert(""[" & """+$('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()+""] "& LangQuestion(12) &""");" & vbCRLF
				JBody = JBody & "			return;" & vbCRLF
				JBody = JBody & "		}" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

			End IF
		Next

	End IF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function


'#######################################################
' F Part MakeTable
'#######################################################

Function F_TableMaker(CODES,Cols,FName,ByRef BODYSTR)

	Dim SBody,ITStr,V_COD,iCnt,V1,V2
	Dim JBody
	Dim QName,DSTR,ESTR,OSTR
	Dim WidthV,HeightV,CTV
	Dim HJSTR,aCnt,HJT,AStr,BStr,IMGStr
	Dim SSTR
	Dim ColCnt 
	ColCnt = CInt(Cols)

	HeightV = "30px"

	

	HJSTR = Split(CODES,"∞")	

	SBody = ""
	JBody = ""
	
	For aCnt=0 To UBound(HJSTR)	'Group 개수		


			SBody = SBody & "				<table style='width:100%;border:1px solid #ccc;' cellpadding='0' cellspacing='0' >" & vbCRLF
			SBody = SBody & "					<colgroup>" & vbCRLF
			CTV = 0
			
				
				ITStr = Split(HJSTR(aCnt),LABELSPLITTER)				
				IMGStr=""
				SStr=""
				DSTR=""

				For iCnt=0 To UBound(ITStr)							
					
					If VarType(ITStr)<>0 And VarType(ITSTR)<>1 Then
						V_COD = Split(ITStr(iCnt),CODESPLITTER)
						CTV = CTV+1

											
						V1 = V_COD(0)
						V2 = V_COD(1)

						
						SBody = SBody & "						<col width=" & Chr(34) & "####%" & Chr(34) &"/>" & vbCRLF
						
						IMGStr = IMGStr & "				<td style='text-align:center;height:110px;'>" & vbCRLF
						
						
						If InStr(V2,"*NOIMG")>0 Then
							IMGSTR = IMGStr & "&nbsp;" & vbCRLF
						Else
							IMGStr = IMGStr & "					<img src='./Media/"&FName&"/"& FName & "_"& V1 &".jpg' border='0'>" & vbCRLF
						End if
							IMGStr = IMGStr & "				</td>" & vbCRLF

						SSTr = SStr & "				<td style='text-align:center;background-color:#CDECFA'>" & vbCRLF						
						SStr = SStr & Replace(Replace(V2,"*NOIMG",""),"*OTHER","") &vbCRLF
						SStr = SStr & "				</td>" & vbCRLF
					End if				

					If CTV=ColCnt Or CTV=ColCnt*2 Or CTV=ColCnt*3 Or CTV=ColCnt*4 Or CTV=ColCnt*5 Then
						IMGStr = IMGStr & "⇔"
						SStr = SStr & "⇔"
					End If	

				Next

			'CTV = CTV+1
			If CTV > ColCnt Then
				CTV = ColCnt
			End if						
			WidthV = FormatNumber(CDbl(100/CTV),2)
			SBody = Replace(SBody,"####",WidthV)

			SBody = SBody & "					</colgroup>" & vbCRLF

			
			AStr = Split(IMGStr,"⇔")
			BStr = Split(SStr,"⇔")


			For icnt = 0 To UBound(AStr)
				If VarType(ASTR(iCnt))<>0 And VarType(ASTR(iCnt))<>1 And ASTR(iCnt)<>"" Then
					SBody = SBody & "					<tr>" & vbCRLF
					SBody = SBody & Bstr(iCnt)
					SBody = SBody & "					</tr>" & vbCRLF

					SBody = SBody & "					<tr>" & vbCRLF
					SBody = SBody & Astr(iCnt)
					SBody = SBody & "					</tr>" & vbCRLF										
				End if
			Next
			SBody = SBody & "				</table>" & vbCRLF
	NEXT
	BODYSTR = SBody
End Function

%>

