<%
'#######################################################################################
'세로로 보여지는 단수 선택형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionSingle(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='panel panel-default'>" & vbCRLF
	SBody = SBody & "		<div class='panel-heading'><h4 style='line-height:150%;'>" & TEXT & "</h4></div>" & vbCRLF

	SBody = SBody & "		<div class='panel-body'>" & vbCRLF
	DSTR = ""	

	VAR = VAR & VARIABLE & ","

	
	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 & "<div class=""radio""><label style='cursor:pointer;' id=""L" & VARIABLE & "_" & V1 & """>"
			DSTR = DSTR & "<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			DSTR = DSTR & Replace(V2,"*OTHER","") &"</label></div>"

			If InStr(ITStr(iCnt),"*OTHER")>0 Then
				OSTR = OSTR & ";" & V1
				DSTR = DSTR & "&nbsp;<input type=" & Chr(34) & "text" & Chr(34) &" class=""form-control othertext"" name=" & Chr(34) & "T" & VARIABLE & "_" & V1 & Chr(34) & " id=" & Chr(34) & VARIABLE & "_" & V1 & Chr(34) & " value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "100" & Chr(34) & " placeholder="""&LangQuestion(90)& """ 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='table tablebordered table-hover' cellpadding='5' cellspacing='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)

	Dim EESTR
	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
			End If

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

	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) & """).text().trim()+""] "& 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) & ")"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').attr(""readonly"")==undefined))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""[" & """+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).text().trim()+""] "& 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

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

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

	ITStr = Split(CODES,LABELSPLITTER)

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

	SBody = SBody & "	<div class='panel panel-default'>" & vbCRLF
	SBody = SBody & "		<div class='panel-heading'><h4 style='line-height:150%;'>" & TEXT & "</h4></div>" & vbCRLF

	SBody = SBody & "		<div class='panel-body'>" & vbCRLF
	DSTR = ""	
	
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered' 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)<>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
			DSTR = DSTR & "					<td style='text-align:center;'>" & vbCRLF
			DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			DSTR = DSTR & "					</td>" & vbCRLF

			EStr = EStr & "					<td style='text-align:center;vertical-align:bottom;'>" & vbCRLF
			EStr = EStr & "						" & V2 & "<br>(" & V1 & ")" & vbCRLF
			'EStr = EStr & "						" & V2 & vbCRLF
			EStr = EStr & "					</td>" & 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
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트
'#######################################################################################
Function QuestionSingleWIDTH(VARIABLE,CODES,TEXT,ByRef BODYSTR,ByRef JBODYSTR)

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

	ITStr = Split(CODES,LABELSPLITTER)

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

	SBody = SBody & "	<div class='panel panel-default'>" & vbCRLF
	SBody = SBody & "		<div class='panel-heading'><h4 style='line-height:150%;'>" & TEXT & "</h4></div>" & vbCRLF

	SBody = SBody & "		<div class='panel-body'>" & vbCRLF
	DSTR = ""	
	
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered' 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)<>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
			DSTR = DSTR & "					<td style='text-align:center;'>" & vbCRLF
			DSTR = DSTR & "					<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			DSTR = DSTR & "					</td>" & vbCRLF

			EStr = EStr & "					<th style='text-align:center;vertical-align:bottom;'>" & vbCRLF
'			EStr = EStr & "						" & V2 & "<br>(" & V1 & ")" & vbCRLF
			EStr = EStr & "						" & Trim(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 : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionSingleGROUP(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
	Dim GTStr,TTStr
	HeightV = "30px"
	CTV = COL
	OSTR = ""	

	SBody = ""
	JBody = ""

	SBody = SBody & "	<div class='panel panel-default'>" & vbCRLF
	SBody = SBody & "		<div class='panel-heading'><h4 style='line-height:150%;'>" & TEXT & "</h4></div>" & vbCRLF

	SBody = SBody & "		<div class='panel-body'>" & vbCRLF
	DSTR = ""

	VAR = VAR & VARIABLE & ","

	GTSTr = Split(CODES,GROUPSPLITTER)
	
	For cCnt=0 To UBound(GTStr)

	If VarType(GTStr)<>0 And VarType(GTStr)<>1 Then
		TTStr = Split(GTStr(cCnt),GCODESPLITTER)
		DSTR = DSTR & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "<table id='" & VARIABLE & cCnt+1 &"_table' class='table table-bordered table-hover nomarintable'>" & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		<colgroup>" & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<col width=""30%"">" & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<col width=""*"">" & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		</colgroup>" & vbCRLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		<tr>" & vbCRLF		

		ITStr = Split(TTStr(1),LABELSPLITTER)
		WidthV = FormatNumber(CDbl(100/CTV),2)
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<th rowspan="""& UBound(ITStr)+1 &""" class='text-center info' style=""vertical-align:middle;"">" & TTStr(0) & "</th>" & 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 iCnt>0 Then
					DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		<tr>" & vbCrLF
				End If

				DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<td>" & vbCRLF
				DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "				<div class=""radio""><label style='cursor:pointer;'><input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
				DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab &  "			"
				DSTR = DSTR & Replace(V2,"*OTHER","") &"</label></div>"

				If InStr(ITStr(iCnt),"*OTHER")>0 Then
					OSTR = OSTR & ";" & V1
					DSTR = DSTR & "&nbsp;<input type=" & Chr(34) & "text" & Chr(34) &" class=""form-control othertext"" 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:250px;'/>"
					VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
				End If
				
				DSTR = DSTR & vbCRLF & vbTab & vbTab & vbTab & vbTab & vbTab & "			</td>" & vbCrLF
				DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		</tr>" & vbCrLF
			End IF
		Next
		
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "</table>" & vbCRLF
		DSTR = DSTR & "" & LABELSPLITTER
	End If

	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-responsive nopadtable' 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>0 Then
		LC = (LTV*Col)
	Else
		LC = UBound(ItStr)
	End If

	For iCnt=0 To LC-1
		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
			End If

			If cCnt=Col Then
				cCnt=1
				SBody = SBody & "					</tr>" & vbCRLF
				If LC-1<>iCnt THen
					SBody = SBody & "					<tr>" & vbCRLF
				End if
			Else
				cCnt=cCnt+1
			End If
		End IF
	Next

	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) & """).text().trim()+"" "& 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) & """).text().trim()+"" "& 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

'#######################################################################################
'세로로 보여지는 단수 선택형, 기타는 숫자로
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionSingleNum(VARIABLE,CODES,TEXT,COL,ETCLABEL,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='panel panel-default'>" & vbCRLF
	SBody = SBody & "		<div class='panel-heading'><h4 style='line-height:150%;'>" & TEXT & "</h4></div>" & vbCRLF

	SBody = SBody & "		<div class='panel-body'>" & vbCRLF
	DSTR = ""	

	VAR = VAR & VARIABLE & ","

	
	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 & "<div class=""radio""><label style='cursor:pointer;' id=""L" & VARIABLE & "_" & V1 & """>"
			DSTR = DSTR & "<input type=" & CHR(34) & "radio" & CHR(34) & " name=" & CHR(34) & VARIABLE & CHR(34) & " value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			DSTR = DSTR & Replace(V2,"*OTHER","") &"</label></div>"

			If InStr(ITStr(iCnt),"*OTHER")>0 Then
				OSTR = OSTR & ";" & V1
				DSTR = DSTR & "&nbsp;<input type=""number"" class=""form-control othertext"" name=" & Chr(34) & "T" & VARIABLE & "_" & V1 & Chr(34) & " id=" & Chr(34) & VARIABLE & "_" & V1 & Chr(34) & " min=""1"" value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "100" & Chr(34) & " style='vertical-align: top;width:100px;'/>"
				If ETCLABEL<>"" Then
				DSTR = DSTR & " <span class=""badge"" id=""etcLabel_"&V1&""" style=""padding:5px;"">"&ETCLABEL&"</span>"
				End If
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End IF

			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-hover' cellpadding='5' 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)

	Dim EESTR
	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
			End If

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

	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) & """).text().trim()+""] "& 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) & """).text().trim()+""] "& 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

		Response.Write vbCrLF
		Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
		Response.Write "<!--" & vbCRLF
		Response.Write "	$(document).ready(function(){" & vbCrLF
		Response.Write "		$(""input[type=number]"").numeric();" & vbCrLF
		Response.Write "		$(""input[type=number]"").css(""ime-mode"",""disabled"");" & vbCrLF
		Response.Write "	});" & vbCrLF
		Response.Write "//-->" & vbCrLF
		Response.Write "</script>" & vbCrLF
	End If
	


	BODYSTR = SBody
	JBODYSTR = JBody

End Function
%>
