<%
'#######################################################################################
'세로로 보여지는 복수 선택형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionMulti(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 = ""	

	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=""checkbox""><label style='cursor:pointer;' id=""L" & VARIABLE & "_" & V1 & """>"

			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 & """ value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			Else
				DSTR = DSTR & "<input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &" />" & vbCRLF
			End If
			

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<span>" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
			Else
				DSTR = DSTR & "<span onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &">" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
			End If
			
			DSTR = DSTR & "</label></div>"

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

			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) & " style='vertical-align: top;width:200px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End If

			DSTR = DSTR & "</div>" & vbCRLF
			
			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-hover' 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
				If iCnt<>LC Then
				SBody = SBody & "					<tr>" & vbCRLF
				End if

			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) & """).text().trim()+""] "& 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 & "	if ((getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")==undefined)"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=" & Chr(34) & Chr(34) & ")"
'				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').attr(""readonly"")==false))" & vbCrLF
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').prop(""readonly"")==false))" & 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 (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				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 (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & 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 : 코드 라벨
'NUMCNT : 최대 선택 가능 갯수
'MINCNT : 최소 선택 갯수
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionMultiNumber(VARIABLE,CODES,MINCNT,NUMCNT,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 Nc,TTStr,TXStr

	HeightV = "30px"
	CTV = COL
	OSTR = ""
	Nc = NUMCNT

	

	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 = ""
	TTStr = ""
	TXStr = ""

	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=""checkbox""><label style='cursor:pointer;' id=""L" & VARIABLE & "_" & V1 & """>"

			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 & """ value=" & Chr(34) & V1 & Chr(34) & " />" & vbCRLF
			Else
				DSTR = DSTR & "<input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &" />" & vbCRLF
			End if

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<span>" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
			Else
				DSTR = DSTR & "<span onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &">" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
			End If
			
			DSTR = DSTR & "</label></div>"

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

			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) & " style='vertical-align: top;width:200px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
			End If

			TTStr = TTStr & "		$(""input[name="& VARIABLE & "_" & V1 & "]"").click(function(){CheckBoxCnt('" & VARIABLE & "CNT','M" & VARIABLE & "CNT','" &VARIABLE&"_" & V1 &"');})" & vbCrLf
			
			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-hover' 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 & "					<input type=""hidden"" name=""" & VARIABLE & "CNT"" id=""" & VARIABLE & "CNT"" value=""0"">" & vbCRLF
	SBody = SBody & "					<input type=""hidden"" name=""M" & VARIABLE & "CNT"" id=""M" & VARIABLE & "CNT"" value="""& NUMCNT &""">" & vbCRLF
	SBody = SBody & "					<input type=""hidden"" name=""MI" & VARIABLE & "CNT"" id=""MI" & VARIABLE & "CNT"" value="""& MINCNT &""">" & vbCRLF
	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

	'자바스크립트 처리 부분

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

	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 ((CheckBoxCount('"&TXStr&"'))>parseFloat($(""#M"&VARIABLE&"CNT"").val()))" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert(""" & NC &" 개 이하로 선택해 주십시오."");" & vbCRLF
	JBody = JBody & "		$(" & Chr(34) & "#" & VARIABLE &":eq(0)" & Chr(34) & ").focus();" & vbCRLF
	JBody = JBody & "		return;" & vbCRLF
	JBody = JBody & "	}" & vbCRLF & vbCRLF

	JBody = JBody & "	if ((CheckBoxCount('"&TXStr&"'))<parseFloat($(""#MI"&VARIABLE&"CNT"").val()))" & vbCrLF
	JBody = JBody & "	{" & vbCrLF
	JBody = JBody & "		alert(""" & MINCNT &" 개 까지 선택해 주십시오."");" & 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) & """).text().trim()+""] "& 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) & """).text().trim()+""] "& 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 & "	{" & 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 (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & 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

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

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'세로로 보여지는 복수 선택형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionMultiGROUP(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
	Dim OriginalV,WV,aCnt,RowsV,ModV

	HeightV = "30px"
	CTV = COL
	OSTR = ""

	OriginalV = 15
	WV = Round((100-OriginalV)/COL,3)

	

	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 = ""	

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

		If VarType(GTStr)<>0 And VarType(GTStr)<>1 Then
			TTStr = Split(GTStr(cCnt),GCODESPLITTER)
			ITStr = Split(TTStr(1),LABELSPLITTER)
			DSTR = DSTR & vbCRLF
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "<td><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="""&OriginalV&"%"">" & vbCRLF
		For aCnt=1 To Col
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<col width="""&WV&"%"">" & vbCRLF		
		Next
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		</colgroup>" & vbCRLF
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		<tr>" & vbCRLF
	
			RowsV = Round(((UBound(ITStr)+1)/Col) + 0.49)

			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<th rowspan="""& RowsV &""" class='info' style=""text-align:center;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 And iCnt Mod Col = 0 Then
						DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		<tr>" & vbCrLF
					End If

					DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<td>" & vbCRLF
					
					If InStr(ITStr(iCnt),"*NONE")<1 Then
						DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "				<div class=""checkbox""><label style='cursor:pointer;'><input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
					Else
						DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "				<div class=""checkbox""><label style='cursor:pointer;'><input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &" />" & vbCRLF
					End if

					If InStr(ITStr(iCnt),"*NONE")<1 Then
						DSTR = DSTR & "<span>" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
					Else
						DSTR = DSTR & "<span onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &">" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
						DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
					End If
					DSTR = DSTR & "</label></div>"

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

					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) & " style='vertical-align: top;width:200px;'/>"
						VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
					End If
					
					DSTR = DSTR & vbCRLF & vbTab & vbTab & vbTab & vbTab & vbTab & "			</td>" & vbCrLF
					If iCnt=UBound(ITStr) Then
						ModV = (UBound(ITSTr)+1) Mod Col
						If ModV <>0 Then
							For aCnt=1 To Col-ModV
								DSTR = DSTR & vbCRLF & vbTab & vbTab & vbTab & vbTab & vbTab & "			<td>&nbsp;</td>" & vbCrLF
							Next
						End If
					End if

					If iCnt Mod Col = Col-1 Or iCnt = uBound(ITStr)Then
						DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "		</tr>" & vbCrLF
					End If
					
				End IF
			Next
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "</table>" & vbCRLF
			DSTR = DSTR & "" & LABELSPLITTER
		End If
	Next

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


	SBody = SBody & "						<col width=" & Chr(34) & "100%" & Chr(34) &"/>" & vbCRLF

	SBody = SBody & "					</colgroup>" & vbCRLF
	SBody = Replace(SBody,"####",WidthV)

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

	cCnt=1


	 Dim LC

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

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

		End IF		
	Next

	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

				'기타 특수문자
				JBody = JBody & "	if (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & Chr(34) &")==" & Chr(34) & tmpOSTR(iCnt) & Chr(34) &")"
				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 (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & 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 QuestionMultiNUM(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 = ""	

	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=""checkbox""><label style='cursor:pointer;' id=""L" & VARIABLE & "_" & V1 & """>"

			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 & """ value=" & Chr(34) & V1 & Chr(34) & "/>" & vbCRLF
			Else
				DSTR = DSTR & "<input type=" & CHR(34) & "checkbox" & CHR(34) & " name=" & CHR(34) & VARIABLE & "_" & V1 & CHR(34) & " id=""" & VARIABLE & """ value=" & Chr(34) & V1 & Chr(34) & " onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &" />" & vbCRLF
			End If
			

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR & "<span>" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
			Else
				DSTR = DSTR & "<span onclick="& CHR(34) &"noCheckBoxValue('" & VARIABLE & "','" & V1 & "');"& CHR(34) &">" & Replace(V2,"*OTHER","") &"</span>"	'기타 라벨 제거
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
			End If
			
			DSTR = DSTR & "</label></div>"

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

			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) & " value=" & Chr(34) & Chr(34) &" maxlength=" & Chr(34) & "2" & Chr(34) & " max=""99"" style='vertical-align: top;width:100px;'/>"
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
				If ETCLABEL<>"" Then
				DSTR = DSTR & " <span class=""badge"" id=""etcLabel_"&V1&""" style=""padding:5px;"">"&ETCLABEL&"</span>"
				End If
			End If

			DSTR = DSTR & "</div>" & vbCRLF
			
			DSTR = DSTR & "" & LABELSPLITTER
		End IF
	Next

	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-hover' 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
				If iCnt<>LC Then
				SBody = SBody & "					<tr>" & vbCRLF
				End if

			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) & """).text().trim()+""] "& 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) & """).text().trim()+""] "&  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 & "	{" & 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 (getCheckBoxValue("& Chr(34) & VARIABLE & "_" & tmpOSTR(iCnt) & 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
%>