<%
'#######################################################################################
'기존 가로형 보기되는 순위형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'RANKNUM : 순위 갯수
'RESNUM : 최소 응답 갯수
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionRank(VARIABLE,CODES,TEXT,RANKNUM,RESNUM,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 lCnt,NN
	CTV = COL
	OSTR = ""
	NN = ""

	lCnt=3 '기본 3개가 1라인안에 보여짐

	

	ITStr = Split(CODES,LABELSPLITTER)

	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
	
	SBody = SBody & "<!--데이터 영역//-->" & vbCRLF
	For iCnt=1 To RANKNUM
		SBody = SBody & "				<input type=""hidden"" name=""" & VARIABLE & "_" & iCnt & """ id=""" & VARIABLE & "_" & iCnt & """ value=""""/>" & vbCRLF
		VAR = VAR & VARIABLE & "_" & iCnt & ","
	Next
	SBody = SBody & "<!--데이터 영역 끝//-->" & vbCRLF
	
	'라벨 영역
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-responsive' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
'	SBody = SBody & "					<colgroup>" & vbCRLF
	
'	WidthV = FormatNumber(CDbl(100/lCnt),2)
'	For iCnt=1 To lCnt
'		SBody = SBody & "						<col width=""" & WidthV & "%""/>" & vbCRLF
'	Next
'	SBody = SBody & "					</colgroup>" & vbCRLF
'	SBody = SBody & "					<tr>" & vbCRLF
	
	cCnt=0
	For iCnt=1 To RANKNUM

'		If cCnt=lCnt Then
'			cCnt=0
'			SBody = SBody & "					</tr>" & vbCRLF
'			SBody = SBody & "					<tr>" & vbCRLF
'		End If
		SBody = SBody & "					<tr>" & vbCRLF
		SBody = SBody & "						<td>" & vbCRLF		
		SBody = SBody & "						<b>"&iCnt&"순위 :</b> <label id=""VV" & VARIABLE & "_" & iCnt & """>&nbsp;</label>" & vbCRLF
		SBody = SBody & "						</td>" & vbCRLF
		SBody = SBody & "					</tr>" & vbCRLF

		cCnt=cCnt+1
	Next
'	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF
	SBody = SBody & "				<div style=""width:100%;text-align:right;""><input type=""button"" class=""btn btn-default"" name="""&VARIABLE&"btn"" value="& LangQuestion(9) &"  onclick=""" & VARIABLE & "Reset();"" style=""cursor:pointer;""></div>" & vbCrLF
	SBody = SBody & "				<br>" & vbCRLF

	DSTR = ""
	
	'입력부 만들기
	WidthV = FormatNumber(CDbl(100/CTV),2)
	Response.Write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCrLF
	Response.Write "	$(document).ready(function(){" & vbCrLF
	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr(iCnt))<>0 And VarType(ITSTR(iCnt))<>1 And VarType(ITSTR(iCnt))<>"" Then
			'Response.Write ITStr(iCnt) & "<BR>"
			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 & """><input type=""radio"" name=""V" & VARIABLE & "_" & V1 & """ id=""V" & VARIABLE & """ value="""& V1 & """/>" & vbCRLF

			If InStr(ITStr(iCnt),"*NONE")<1 Then
				DSTR = DSTR &vbTab&vbTab&vbTab&vbTab&vbTab& "" & Replace(V2,"*OTHER","") &"</label></div>"
			Else
				DSTR = DSTR &vbTab&vbTab&vbTab&vbTab&vbTab& "" & Replace(V2,"*OTHER","") &"</label></div>"
				DSTR = Replace(DSTR,"*NONE","")	'없음 라벨 제거	
				DSTR = DSTR & vbCrLF
				DSTR = DSTR &vbTab&vbTab&vbTab&vbTab&vbTab& "<input type=""hidden"" name=""" & VARIABLE & "NonFlag"" id=""" & VARIABLE & "NonFlag"" value="""">"
				NN = V1
			End IF

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

			Response.Write "		$(""input:radio[name=V" & VARIABLE & "_" & V1 & "]"").click(function(){" & vbCRLF
			Response.Write "			"&VARIABLE&"setRankValue(this.name);" & vbCrLF
			If InStr(ITStr(iCnt),"*NONE")>0 Then
			Response.Write "			noRankValue('V"&VARIABLE&"','" & VARIABLE & "');" & vbCrLF
			End IF
			Response.Write "		});" & vbCRLF

		End IF
	Next
	Response.Write "	});" & vbCrLf
	Response.Write "//-->" & vbCrLF
	Response.Write "</script>"

	'순위용 스크립트 영역
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF
	Response.Write "	function "&VARIABLE&"setRankValue(nm)" & vbCRLF
	Response.Write "	{" & vbCRLF

	Response.Write "		if($(""#"&VARIABLE&"NonFlag"").val()==""true"")" & vbCrLf
	Response.Write "		{" & vbCrLf
	Response.Write "			vlag = true;" & vbCrLf
	Response.Write "		}" & vbCrLf
	Response.Write "		else{" & vbCrLf

	Response.Write "			var vlag,txtstr,valv;" & vbCrLF
	Response.Write "			txtstr = $(""#L""+nm.replace('V','')).text();" & vbCrLF
	Response.Write "			vlag = false;" & vbCrLF
	Response.Write "			valv = $(""input:radio[name=""+nm+""]"").val();" & vbCrLF  & vbCrLF

	Response.Write "			if ($(""input:radio[name=""+nm+""]"").attr(""disabled"")==""disabled"")" & vbCrLf
	Response.Write "			{" & vbCrLF
	Response.Write "				return;" & vbCrLF
	Response.Write "			}" & vbCrLF

	Response.Write "		}" & vbCrLf

	For iCnt=1 To RankNum
	Response.Write "		if (($(""#" & VARIABLE & "_" & iCnt & """).val()!="""") && ($(""#" & VARIABLE & "_" & iCnt & """).val()==valv))" & vbCrLF
	Response.Write "		{" & vbCrLF
	Response.Write "			return;" & vbCrLF
	Response.Write "		}" & vbCrLF
	Next

	For iCnt=1 To RankNum
	Response.Write "		if (($(""#" & VARIABLE & "_" & iCnt & """).val()=="""") && (vlag==false))" & vbCrLF
	Response.Write "		{" & vbCrLF
	Response.Write "			$(""#" & VARIABLE & "_" & iCnt & """).val(valv);" & vbCrLF
	Response.Write "			$(""#VV" & VARIABLE & "_" & iCnt & """).html(txtstr);" & vbCrLF
	Response.Write "			vlag = true;" & vbCrLf
	Response.Write "		}" & vbCrLF
	Next

	Response.Write "		if ((($(""input:radio[name=""+nm+""]"").attr(""disabled"")==false) && (vlag==true)) || (($(""input:radio[name=""+nm+""]"").attr(""disabled"")==undefined) && (vlag==true)))" & vbCRLF
	Response.Write "		{" & vbCRLF
	Response.Write "			$(""input:radio[name=""+nm+""]"").attr(""checked"",""checked"");" & vbCRLF
	Response.Write "		}else{" & vbCrLF
	Response.Write "			$(""input:radio[name=""+nm+""]"").removeAttr(""checked"");" & vbCRLF
	Response.Write "		}" & vbCRLF

	Response.Write "	}" & vbCRLF	

	Response.Write "	function " & VARIABLE & "Reset()" & vbCrLF
	Response.Write "	{" & vbCrLF
	Response.Write "		$(""#"& VARIABLE & "NonFlag"").val("""");" & vbCrLF
	For iCnt=1 To RankNum
	Response.Write "		$(""#" & VARIABLE & "_" & iCnt & """).val("""");" & vbCrLF
	Response.Write "		$(""#VV" & VARIABLE & "_" & iCnt & """).html("""");" & vbCrLF
	Next

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)(0)
		Response.Write "		$(""input:radio[name=V"&VARIABLE&"_"&V_COD&"]"").removeAttr(""checked"");" & vbCrLF
		Response.Write "		$(""input:radio[name=V"&VARIABLE&"_"&V_COD&"]"").attr(""disabled"",false);" & vbCrLF
		End IF
	Next

	Response.Write "	}" & vbCrLF

	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF
	
	'입력부 테이블 만들기
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered table-hover table-responsive' 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(ESTR)
	End If

	For iCnt=0 To LC
		If iCnt<=UBound(ESTR) 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

	'자바스크립트 처리 부분
	For iCnt=1 To CInt(RESNUM)
		JBody = JBody & "	if (($(""#" & VARIABLE & "_" & iCnt & """).val().trim()=="""") && (($(""#" & VARIABLE & "NonFlag"").val()==undefined)||($(""#" & VARIABLE & "NonFlag"").val()=="""")))" & vbCrLF
		JBody = JBody & "	{" & vbCrLF
		JBody = JBody & "		alert(""" & iCnt & "순위 "& LangQuestion(1) &""");" & vbCRLF
		JBody = JBody & "		return;" & vbCRLF
		JBody = JBody & "	}" & vbCRLF & vbCRLF
	Next

	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(""V"& VARIABLE & "_" & tmpOSTR(iCnt) & """)==""" & tmpOSTR(iCnt) & """)"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()==""""))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#L" & VARIABLE & "_" & tmpOSTR(iCnt) & """).text().trim()+""] "& LangQuestion(5) &""");" & vbCRLF
				JBody = JBody & "		return;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF

				JBody = JBody & "	if ((getRadioValue(""V" & VARIABLE & "_" & tmpOSTR(iCnt) & """)!="""& tmpOSTR(iCnt) & """)"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=""""))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[""+$(""#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(""V"& VARIABLE & "_" & tmpOSTR(iCnt) & """)==" & 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 : 코드 라벨
'ATT : 순위 정보
'TEXT : 질문 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################

Function QuestionRankATT(VARIABLE,CODES,ATT,TEXT,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,HDSTR
	Dim WidthV,COL
	Dim nFlag
	Dim OtherJBody,OtherCnt
	OSTR = ""

	

	ITStr = Split(CODES,LABELSPLITTER)
	ATStr = Split(ATT,LABELSPLITTER)

	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
		
	'라벨 영역
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered table-hover table-responsive' cellpadding='5' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	
	COL = UBound(ATSTR)

	If COL=2 Then
		WidthV = "15"
	ElseIf COL>2 Then
		WidthV = "10"
	Else
		WidthV = "10"
	End IF
	SBody = SBody & "						<col width=""*""/>" & vbCRLF

	For iCnt=0 To COL
		SBody = SBody & "						<col width=""" & WidthV & "%""/>" & vbCRLF
	Next
	SBody = SBody & "					</colgroup>" & vbCRLF

	cCnt=0

	'로직 영역 만들기
	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)					
			
			VAR = VAR & VARIABLE & "_" & A1 & ","
			
			If cCnt=0 Then
				JBody = JBody & "	if (getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined)" & vbCrLF			
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[" & cCnt+1 & "]" & 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
			Else
				JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined) && (($(""#NON_F" & VARIABLE & """).val()==undefined) || ($(""#NON_F" & VARIABLE & """).val()=="""")))" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[" & cCnt+1 & "]" & 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
				JBody = JBody & "	else if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined) && ($(""#NON_F" & VARIABLE & """).val()!=undefined) && ($(""#NON_F" & VARIABLE & """).val()!="""") && (checkRadioDisabled("""&VARIABLE&"_"&A1&""")))"& vbCRLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(" & Chr(34) & "[" & cCnt+1 & "]" & 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
	
	'보기 영역 만들기
	For iCnt=0 To UBound(ITSTR)
		If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			V2 = V_COD(1)
			DSTR = DSTR & "					<tr>" & vbCRLF

			If InStr(V2,"*OTHER")>0 Then
				DSTR = DSTR & "						<td class=""ATTHeader""><span id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & Replace(V2,"*OTHER","") & "</span>"
				DSTR = DSTR & "<input type=""text"" id=""T" & VARIABLE & "_" & V1 & """ name=""T" & VARIABLE & "_" & V1 & """ size=""30"" maxlength=""100"" value=""""/></td>" & vbCRLF
				VAR = VAR & "T" & VARIABLE & "_" & V1 & ","

			ElseIf InStr(V2,"*NONE")>0 Then
				DSTR = DSTR & "						<td class=""ATTHeader""><label id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & Replace(V2,"*NONE","") & "</label>" & vbCRLF
				DSTR = DSTR & "						<input type=""hidden"" id=""NON_" & VARIABLE & """ name=""NON_" & VARIABLE & """ value="""&V1&"""/>" & vbCRLF
				DSTR = DSTR & "						<input type=""hidden"" id=""NON_F" & VARIABLE & """ name=""NON_F" & VARIABLE & """ value=""""/>" & vbCRLF
				DSTR = DSTR & "						</td>" & vbCRLF
			Else
				DSTR = DSTR & "						<td class=""ATTHeader""><label id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & V2 & "</label></td>" & vbCRLF
			End If

			If iCnt=0 Then
				HDSTR = "					<tr>" & vbCRLF
				HDSTR = HDSTR & "						<th>&nbsp;</th>" & vbCRLF
			End IF
			
			'라디오 영역만들기
			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)
					'DSTR = DSTR & "						<td><input type=""radio"" name=""" & VARIABLE & "_" & A1 & """ id=""R" & VARIABLE & "_" & V1 & "_" & A1 & """ class=""radio1"" value=""" & V1 & """/></td>" & vbCRLF
					DSTR = DSTR & "						<td style='vertical-align:middle;text-align:center;'><input type=""radio"" name=""" & VARIABLE & "_" & A1 & """ id=""R" & VARIABLE & "_" & V1 & """ class=""radio1"" value=""" & V1 & """/></td>" & vbCRLF

					If iCnt=0 Then
						HDSTR = HDSTR & "						<th>"&A2&"</th>" & vbCRLF
					End If
					
					If InStr(V2,"*OTHER")>0 Then	'기타처리
						JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==" & Chr(34) & V1 & Chr(34) &")"
						JBody = JBody & " && ($('input[name=T" & VARIABLE & "_" & V1 & "]').val().trim()==" & Chr(34) & Chr(34) & "))" & vbCrLF
						JBody = JBody & "	{" & vbCrLF  
						JBody = JBody & "		alert(""" & A2 & " " & """+$(""#L" & VARIABLE & "_" & V1 & """).html()+"" "& LangQuestion(5) &""");" & vbCRLF
						JBody = JBody & "		$('input[name=T" & VARIABLE & "_" & V1 & "]').focus();" & vbCRLF
						JBody = JBody & "		return;" & vbCRLF
						JBody = JBody & "	}" & vbCRLF & vbCRLF

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

						OtherJBody = OtherJBody & "(getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")!=" & Chr(34) & V1 & Chr(34) &") &&"
						OtherCnt = OtherCnt +1
					End If										
				End If
			Next

			If OtherCnt > 0 Then

				OtherJBody = Left(OtherJBody,Len(OtherJBody)-2)
						
				JBody = JBody & "	if($('input[name=T" & VARIABLE & "_" & V1 & "]').val().trim()!=" & Chr(34) & Chr(34) & ")" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "	if ("& OtherJBody &")" & vbCrLF
				JBody = JBody & "	{" & vbCrLF
				JBody = JBody & "		alert(""" & LangQuestion(11) &""");" & vbCRLF
				JBody = JBody & "		$('input[name=T" & VARIABLE & "_" & V1 & "]').focus();" & vbCRLF
				JBody = JBody & "		return ;" & vbCRLF
				JBody = JBody & "	}" & vbCRLF & vbCRLF
				JBody = JBody & "	}" & vbCRLF & vbCRLF

				OtherCnt = 0
				OtherJBody = ""

			End If

			DSTR = DSTR & "					</tr>" & vbCRLF

			If iCnt=0 Then
				HDSTR = HDSTR & "					</tr>" & vbCRLF
			End IF
		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 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)					

			response.Write "		$(""input[name="&VARIABLE&"_"&A1&"]"").click(function(){" & vbCRLF
			response.Write "			resetArray(this,"""&Left(VAR,Len(VAR)-1)&""");"&vbCrLF
			response.Write "			nonCheck(this);"&vbCRLF
			response.Write "			subDisCheck(this);"&vbCRLF
			response.Write "		});" & vbCRLF & vbCRLF
			
		End If
	Next
	
	Response.Write "	});" & vbCrLF
	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF

	SBody = SBody & HDSTR
	SBody = SBody & DSTR

	If UBound(ITStr)>6 Then
		'SBody = SBody & HDSTR
	End IF

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

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

	BODYSTR = SBody
	JBODYSTR = JBody

End Function



'#######################################################################################
'기존 가로형 보기되는 순위형 - Group
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'RANKNUM : 순위 갯수
'RESNUM : 최소 응답 갯수
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionRankGROUP(VARIABLE,CODES,TEXT,RANKNUM,RESNUM,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 lCnt,NN
	Dim GTStr,TTStr,XSTR,tCnt
	Dim sCnt

	CTV = COL
	OSTR = ""
	NN = ""

	lCnt=3 '기본 3개가 1라인안에 보여짐
	
	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
	
	SBody = SBody & "<!--데이터 영역//-->" & vbCRLF

	For iCnt=1 To RANKNUM
		SBody = SBody & "				<input type=""hidden"" name=""" & VARIABLE & "_" & iCnt & """ id=""" & VARIABLE & "_" & iCnt & """ value=""""/>" & vbCRLF
		VAR = VAR & VARIABLE & "_" & iCnt & ","
	Next

	SBody = SBody & "<!--데이터 영역 끝//-->" & vbCRLF
	
	'라벨 영역
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-responsive' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
'	SBody = SBody & "					<colgroup>" & vbCRLF
	
'	WidthV = FormatNumber(CDbl(100/RANKNUM),2)
'	For iCnt=1 To RANKNUM
'		SBody = SBody & "						<col width=""" & WidthV & "%""/>" & vbCRLF
'	Next
'	SBody = SBody & "					</colgroup>" & vbCRLF
'	SBody = SBody & "					<tr>" & vbCRLF
	
	cCnt=0
	For iCnt=1 To RANKNUM

		If cCnt=lCnt Then
'			cCnt=0
'			SBody = SBody & "					</tr>" & vbCRLF
'			SBody = SBody & "					<tr>" & vbCRLF
		End If
		SBody = SBody & "					<tr>" & vbCRLF
		SBody = SBody & "						<td>" & vbCRLF		
		SBody = SBody & "						<b>"&iCnt&"순위 :</b> <label id=""VV" & VARIABLE & "_" & iCnt & """>&nbsp;</label>" & vbCRLF
		SBody = SBody & "						</td>" & vbCRLF
		SBody = SBody & "					</tr>" & vbCRLF

		cCnt=cCnt+1
	Next
'	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF
	SBody = SBody & "				<div style=""width:100%;text-align:right;""><input type=""button"" class=""btn btn-default"" name="""&VARIABLE&"btn"" value="& LangQuestion(9) &"  onclick=""" & VARIABLE & "Reset();"" style=""cursor:pointer;""></div>" & vbCrLF
	SBody = SBody & "				<br>" & vbCRLF

	DSTR = ""
	
	'입력부 만들기	

	WidthV = FormatNumber(CDbl(100/CTV),2)
	Response.Write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCrLF
	Response.Write "	$(document).ready(function(){" & vbCrLF
	Response.write "        $(""form[name='Survey']"").addClass(""form-inline"");" & vbCrLF

	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
		
		If InStr(TTStr(0),"*CELL")>0 Then
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & "		<tr style=""border-top:none;border-bottom:none;"">" & vbCRLF
		Else
			DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & "		<tr>" & vbCRLF
		End If
				

		ITStr = Split(TTStr(1),LABELSPLITTER)
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & "			<th class=""ATTHeader text-center info"" style=""vertical-align:middle;"" >" & Replace(TTStr(0),"*CELL","") & "</th>" & vbCRLF
		
		XSTR = ""
		XSTR = XSTR & "							<TD style=""text-align:center;"" border=""0"">" & vbCrLF
		XSTR = XSTR & "							<table class=""table table-borderd table-responsive table-hover nomarintable"" border=""0"" cellpadding=0 cellspacing=0>" & vbCRLF
		XSTR = XSTR & "							<colgroup>" & vbCRLF
		For iCnt=0 To Col-1
			XSTR = XSTR & "							<col width=" & Chr(34) & WidthV & "%" & Chr(34) &"/>" & vbCRLF
		Next
		XSTR = XSTR & "							</colgroup>" & vbCRLF

		tCnt=0	

		For iCnt=0 To UBound(ITStr)
			If VarType(ITStr(iCnt))<>0 And VarType(ITSTR(iCnt))<>1 And VarType(ITSTR(iCnt))<>"" Then
				'Response.Write ITStr(iCnt) & "<BR>"
				V_COD = Split(ITStr(iCnt),CODESPLITTER)
				V1 = V_COD(0)
				V2 = V_COD(1)

				If iCnt=0 Then
					XSTR = XSTR & "							<tr>" & vbCRLF
				ElseIf tCnt>=COL Then
					XSTR = XSTR & "							</tr>" & vbCRLF
					XSTR = XSTR & "							<tr>" & vbCRLF
					tCnt=0
				End If
				
				XSTR = XSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "			<td>" & vbCRLF
				XSTR = XSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "				<div class=""radio""><label id=""L" & VARIABLE & "_" & V1 & """ style=""cursor:pointer;""><input type=""radio"" name=""V" & VARIABLE & "_" & V1 & """ id=""V" & VARIABLE & """ class=""radio1"" value="""& V1 & """/>" & vbCRLF

				If InStr(ITStr(iCnt),"*NONE")<1 Then
					XSTR = XSTR & Replace(V2,"*OTHER","") &"</label></div>" &vbCRLF	'기타 라벨 제거
				Else
					XSTR = XSTR & Replace(V2,"*OTHER","") &"</label></div>"	'기타 라벨 제거
					XSTR = Replace(XSTR,"*NONE","") &vbCRLF	'없음 라벨 제거	
					XSTR = XSTR & vbCrLF
					XSTR = XSTR &vbTab&vbTab&vbTab&vbTab&vbTab& "<input type=""hidden"" name=""" & VARIABLE & "NonFlag"" id=""" & VARIABLE & "NonFlag"" value="""">"
					NN = V1
				End IF

				If InStr(ITStr(iCnt),"*OTHER")>0 Then
					OSTR = OSTR & ";" & V1
					XSTR =  XSTR & vbTab & vbTab & vbTab & vbTab & vbTab & "				&nbsp;<input type=""text"" class=""form-control"" name=""T" & VARIABLE & "_" & V1 & """ id=""" & VARIABLE & "_" & V1 & """ value="""" maxlength=""100"" style='vertical-align: top;width:140px;'/>" & vbCrLF
					VAR = VAR & "T" & VARIABLE & "_" & V1 & ","
				End If
				
				XSTR = XSTR & vbCRLF & vbTab & vbTab & vbTab & vbTab & vbTab & "			</td>" & vbCrLF
				tCnt=tCnt+1

				Response.Write "		$(""input:radio[name=V" & VARIABLE & "_" & V1 & "]"").click(function(){" & vbCRLF
				Response.Write "			"&VARIABLE&"setRankValue(this.name);" & vbCrLF
				If InStr(ITStr(iCnt),"*NONE")>0 Then
				Response.Write "			noRankValue('V"&VARIABLE&"','" & VARIABLE & "');" & vbCrLF
				End IF
				Response.Write "		});" & vbCRLF
			End IF
		Next

		XSTR = XSTR & "							</tr>" & vbCrLF
		XSTR = XSTR & "							</table>"
		DSTR = DSTR & XSTR
		DSTR = DSTR & vbCRLF & vbTab & vbTab & vbTab & vbTab & vbTab & "			</td>" & vbCrLF
		DSTR = DSTR & vbTab & vbTab & vbTab & vbTab & "		</tr>" & vbCrLF
		DSTR = DSTR & "" & LABELSPLITTER
	End If

	Next

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

	'순위용 스크립트 영역
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF
	Response.Write "	function "&VARIABLE&"setRankValue(nm)" & vbCRLF
	Response.Write "	{" & vbCRLF
	'--------------추가 한 부분--------------------------
	Response.Write "		if($(""#"&VARIABLE&"NonFlag"").val()==""true"")" & vbCrLf
	Response.Write "		{" & vbCrLf
	Response.Write "			vlag = true;" & vbCrLf
	Response.Write "		}" & vbCrLf
	Response.Write "		else{" & vbCrLf
	'-------------------------------------------	
	Response.Write "			var vlag,txtstr,valv;" & vbCrLF
	Response.Write "			txtstr = $(""#L""+nm.replace('V','')).text();" & vbCrLF
	Response.Write "			vlag = false;" & vbCrLF
	Response.Write "			valv = $(""input:radio[name=""+nm+""]"").val();" & vbCrLF  & vbCrLF

	Response.Write "			if ($(""input:radio[name=""+nm+""]"").attr(""disabled"")==""disabled"")" & vbCrLf
	Response.Write "			{" & vbCrLF
	Response.Write "				return;" & vbCrLF
	Response.Write "			}" & vbCrLF
	Response.Write "		}" & vbCrLF
	
	For iCnt=1 To RankNum
	Response.Write "		if (($(""#" & VARIABLE & "_" & iCnt & """).val()!="""") && ($(""#" & VARIABLE & "_" & iCnt & """).val()==valv))" & vbCrLF
	Response.Write "		{" & vbCrLF
	Response.Write "			return;" & vbCrLF
	Response.Write "		}" & vbCrLF
	Next

	For iCnt=1 To RankNum
	Response.Write "		if	(($(""#" & VARIABLE & "_" & iCnt & """).val()=="""") && (vlag==false))" & vbCrLF
	Response.Write "		{" & vbCrLF
	Response.Write "			$(""#" & VARIABLE & "_" & iCnt & """).val(valv);" & vbCrLF
	Response.Write "			$(""#VV" & VARIABLE & "_" & iCnt & """).html(txtstr);" & vbCrLF
	Response.Write "			vlag = true;" & vbCrLf
	Response.Write "		}" & vbCrLF
	Next

	Response.Write "		if ((($(""input:radio[name=""+nm+""]"").attr(""disabled"")==false) && (vlag==true)) || (($(""input:radio[name=""+nm+""]"").attr(""disabled"")==undefined) && (vlag==true)))" & vbCRLF
	Response.Write "		{" & vbCRLF
	Response.Write "			$(""input:radio[name=""+nm+""]"").attr(""checked"",""checked"");" & vbCRLF
	Response.Write "		}else{" & vbCrLF
	Response.Write "			$(""input:radio[name=""+nm+""]"").removeAttr(""checked"");" & vbCRLF
	Response.Write "		}" & vbCRLF
	Response.Write "	}" & vbCRLF	

	Response.Write "	function " & VARIABLE & "Reset()" & vbCrLF
	Response.Write "	{" & vbCrLF
	Response.Write "		$(""#"& VARIABLE & "NonFlag"").val("""");" & vbCrLF
	For iCnt=1 To RankNum
	Response.Write "		$(""#" & VARIABLE & "_" & iCnt & """).val("""");" & vbCrLF
	Response.Write "		$(""#VV" & VARIABLE & "_" & iCnt & """).html("""");" & vbCrLF
	Next

	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)
		For iCnt=0 To UBound(ITStr)
			If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
				V_COD = Split(ITStr(iCnt),CODESPLITTER)(0)
				Response.Write "		$(""input:radio[name=V"&VARIABLE&"_"&V_COD&"]"").removeAttr(""checked"");" & vbCrLF
				Response.Write "		$(""input:radio[name=V"&VARIABLE&"_"&V_COD&"]"").attr(""disabled"",false);" & vbCrLF
			End IF
		Next
	End If
	
	Next

	Response.Write "	}" & vbCrLF

	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF
	
	'입력부 테이블 만들기
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered nopadtable' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	SBody = SBody & "						<col width=""*%""/>" & vbCRLF
	SBody = SBody & "						<col width=""75%""/>" & vbCRLF
	SBody = SBody & "					</colgroup>" & vbCRLF
	

	ESTR = Split(DSTR,LABELSPLITTER)

	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

	'자바스크립트 처리 부분
	For iCnt=1 To CInt(RESNUM)
		JBody = JBody & "	if (($(""#" & VARIABLE & "_" & iCnt & """).val().trim()=="""") && ((($(""#" & VARIABLE & "NonFlag"").val()==undefined)) || ($(""#" & VARIABLE & "NonFlag"").val()=="""")))" & vbCrLF
		JBody = JBody & "	{" & vbCrLF
		JBody = JBody & "		alert(""" & iCnt & "순위 "& LangQuestion(1) &""");" & vbCRLF
		JBody = JBody & "		return;" & vbCRLF
		JBody = JBody & "	}" & vbCRLF & vbCRLF
	Next

	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(""V"& VARIABLE & "_" & tmpOSTR(iCnt) & """)==""" & tmpOSTR(iCnt) & """)"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()==""""))" & 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(""V" & VARIABLE & "_" & tmpOSTR(iCnt) & """)!="""& tmpOSTR(iCnt) & """)"
				JBody = JBody & "	&& ($('input[name=T" & VARIABLE & "_" & tmpOSTR(iCnt) & "]').val().trim()!=""""))" & 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(""V"& VARIABLE & "_" & tmpOSTR(iCnt) & """)==" & 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

'#######################################################################################
'세로로 보여지는 순위형 - GROUP
'VARIABLE : 변수 명
'CODES : 코드 라벨
'ATT : 순위 정보
'TEXT : 질문 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################

Function QuestionRankATTGROUP(VARIABLE,CODES,ATTRIBUTE,TEXT,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,HDSTR
	Dim WidthV,COL
	Dim nFlag
	Dim GTStr,TTStr,xCnt
	Dim OtherJBody,OtherCnt

	OSTR = ""

	

	ATStr = Split(ATT,LABELSPLITTER)
	GTSTr = Split(CODES,GROUPSPLITTER)

	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
		
	'라벨 영역
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered table-hover table-responsive' cellpadding='0' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	SBody = SBody & "						<col width=""10%""/>" & vbCRLF
	COL = UBound(ATSTR)

	If COL=2 Then
		WidthV = "10"
	ElseIf COL>2 Then
		WidthV = "10"
	End IF
	SBody = SBody & "						<col width=""*""/>" & vbCRLF

	For iCnt=0 To COL
		SBody = SBody & "						<col width=7%""/>" & vbCRLF
	Next
	SBody = SBody & "					</colgroup>" & vbCRLF

	cCnt=0

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

	'로직 영역 만들기
	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)					

			response.Write "		$(""input[name="&VARIABLE&"_"&A1&"]"").click(function(){" & vbCRLF
			response.Write "			nonCheck(this);"&vbCRLF
			response.Write "			subDisCheck(this);"&vbCRLF
			response.Write "		});" & vbCRLF & vbCRLF
			
			VAR = VAR & VARIABLE & "_" & A1 & ","
			
			If cCnt = 0 Then
				JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined))" & vbCrLF
			Else
				JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==undefined) && (($(""#NON_F" & VARIABLE & """).val()==undefined) || ($(""#NON_F" & VARIABLE & """).val()=="""")))" & vbCrLF
			End If
			
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(" & Chr(34) & "[" & cCnt+1 & " ]" & 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
	Next
	
	Response.Write "	});" & vbCrLF
	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF

	For xCnt=0 To UBound(GTStr)

	If VarType(GTStr)<>0 And VarType(GTStr)<>1 Then
		TTStr = Split(GTStr(xCnt),GCODESPLITTER)
		ITStr = Split(TTSTR(1),LABELSPLITTER)
		'보기 영역 만들기
		For iCnt=0 To UBound(ITSTR)
			If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
				V_COD = Split(ITStr(iCnt),CODESPLITTER)
				V1 = V_COD(0)
				V2 = V_COD(1)
				DSTR = DSTR & "					<tr>" & vbCRLF

				If iCnt=0 Then
				DSTR = DSTR & "						<TH class=""ATTHeader info text-center"" rowspan="""&UBound(ITStr)+1&""">" & TTStr(0) & "</TH>" & vbCrLF	
				End If

				If InStr(V2,"*OTHER")>0 Then
					DSTR = DSTR & "						<td class=""ATTHeader""><span id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & Replace(V2,"*OTHER","") & "</span>"
					DSTR = DSTR & "<input type=""text"" id=""T" & VARIABLE & "_" & V1 & """ name=""T" & VARIABLE & "_" & V1 & """ size=""15"" maxlength=""100"" value=""""/></td>" & vbCRLF
					VAR = VAR & "T" & VARIABLE & "_" & V1 & ","

				ElseIf InStr(V2,"*NONE")>0 Then
					DSTR = DSTR & "						<td class=""ATTHeader""><span id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & Replace(V2,"*NONE","") & "</span>" & vbCRLF
					DSTR = DSTR & "						<input type=""hidden"" id=""NON_" & VARIABLE & """ name=""NON_" & VARIABLE & """ value="""&V1&"""/>" & vbCRLF
					DSTR = DSTR & "						<input type=""hidden"" id=""NON_F" & VARIABLE & """ name=""NON_F" & VARIABLE & """ value=""""/>" & vbCRLF
					DSTR = DSTR & "						</td>" & vbCRLF
				Else
					DSTR = DSTR & "						<td class=""ATTHeader""><span id=""L" & VARIABLE & "_" & V1 & """ class=""RLabel"">" & V2 & "</span></td>" & vbCRLF
				End If

				If iCnt=0 Then
					HDSTR = "					<tr>" & vbCRLF
					HDSTR = HDSTR & "						<th colspan=""2"">&nbsp;</th>" & vbCRLF
				End IF
				
				'라디오 영역만들기
				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)
						DSTR = DSTR & "						<td class=""text-center""><input type=""radio"" name=""" & VARIABLE & "_" & A1 & """ id=""R" & VARIABLE & "_" & V1 & """ class=""radio1"" value=""" & V1 & """/></td>" & vbCRLF

						If iCnt=0 Then
							HDSTR = HDSTR & "						<th class=""text-center"">"&A2&"</th>" & vbCRLF
						End If

						If InStr(V2,"*OTHER")>0 Then	'기타처리
							JBody = JBody & "	if ((getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")==" & Chr(34) & V1 & Chr(34) &")"
							JBody = JBody & " && ($('input[name=T" & VARIABLE & "_" & V1 & "]').val().trim()==" & Chr(34) & Chr(34) & "))" & vbCrLF
							JBody = JBody & "	{" & vbCrLF  
							JBody = JBody & "		alert(""" & A2 & " " & """+$(""#L" & VARIABLE & "_" & V1 & """).html()+"" "& LangQuestion(5) &""");" & vbCRLF
							JBody = JBody & "		$('input[name=T" & VARIABLE & "_" & V1 & "]').focus();" & vbCRLF
							JBody = JBody & "		return;" & vbCRLF
							JBody = JBody & "	}" & vbCRLF & vbCRLF

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

							OtherJBody = OtherJBody & "(getRadioValue("& Chr(34) & VARIABLE & "_" & A1 & Chr(34) &")!=" & Chr(34) & V1 & Chr(34) &") &&"
							OtherCnt = OtherCnt +1
						End If										

						

					End If
				Next

				If OtherCnt > 0 Then

					OtherJBody = Left(OtherJBody,Len(OtherJBody)-2)
							
					JBody = JBody & "	if($('input[name=T" & VARIABLE & "_" & V1 & "]').val().trim()!=" & Chr(34) & Chr(34) & ")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "	if ("& OtherJBody &")" & vbCrLF
					JBody = JBody & "	{" & vbCrLF
					JBody = JBody & "		alert(""" & LangQuestion(11) &""");" & vbCRLF
					JBody = JBody & "		$('input[name=T" & VARIABLE & "_" & V1 & "]').focus();" & vbCRLF
					JBody = JBody & "		return ;" & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF
					JBody = JBody & "	}" & vbCRLF & vbCRLF

					OtherCnt = 0
					OtherJBody = ""
				End If

				DSTR = DSTR & "					</tr>" & vbCRLF

				If iCnt=0 Then
					HDSTR = HDSTR & "					</tr>" & vbCRLF
				End IF
			End If		
		Next
	End If
	Next

	SBody = SBody & HDSTR
	SBody = SBody & DSTR

	If UBound(ITStr)>6 Then
		SBody = SBody & HDSTR
	End IF
	
	SBody = SBody & "					</tr>" & vbCRLF
	SBody = SBody & "				</table>" & vbCRLF
	SBody = SBody & "				</div>" & vbCRLF
	SBody = SBody & "				</div>" & vbCRLF

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'기존 가로형 보기되는 순위형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'#######################################################################################
Function QuestionRankORDER(VARIABLE,CODES,TEXT,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 lCnt,NN
	Dim HDSTR

	OSTR = ""
	NN = ""

	lCnt=3 '기본 3개가 1라인안에 보여짐

	

	ITStr = Split(CODES,LABELSPLITTER)

	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
	
	SBody = SBody & "				<div style=""width:100%;text-align:right;"">" & vbCRLF
	SBody = SBody & "				<input class=""btn btn-default"" type=""button"" name="""&VARIABLE&"btn"" value="""&LangQuestion(9)&""" style=""cursor:pointer;"" onclick=""" & VARIABLE & "Reset();"" >" & vbCrLF
	SBody = SBody & "				<input type=""hidden"" id="""&VARIABLE&"_CNT"" name="""&VARIABLE&"_CNT"" value=""0"">" & vbCrLF
	SBody = SBody & "				</div>" & vbCrLF

	DSTR = ""
	'입력부 테이블 만들기
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='table table-bordered table-hover table-responsive' cellpadding='5' cellspacing='0' border='0'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	SBody = SBody & "						<col width=""10""/>" & vbCRLF
	SBody = SBody & "						<col width=""*""/>" & vbCRLF
	SBody = SBody & "					</colgroup>" & vbCRLF	
	'입력부 만들기
'	WidthV = FormatNumber(CDbl(100/CTV),2)
	DSTR = ""

	HDSTR = "					<tr>" & vbCRLF
	HDSTR = HDSTR & "						<th>Order</th>" & vbCRLF
	HDSTR = HDSTR & "						<th>Cleaning Activities for Each Room/Space</th>" & vbCRLF
	HDSTR = HDSTR & "					</tr>" & vbCRLF
	
	For iCnt=0 To UBound(ITSTR)

		If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)
			V1 = V_COD(0)
			V2 = V_COD(1)
			DSTR = DSTR & "					<tr>" & vbCRLF
			
			DSTR = DSTR & "						<td>"  & vbCRLF
			DSTR = DSTR & "						<input type=""number"" class=""form-control order_input"" style=""text-align:center;font-weight:bold;cursor:pointer;"" name=""" & VARIABLE & "_"& V1 &""" id=""" & VARIABLE & "_"& V1 &""" value="""" min=""1"" max=""99"" maxlength=""2"" data-tid=""" & VARIABLE & "_"& V1 &""" data-var=""" & VARIABLE & "_CNT"" readOnly/>" & vbCRLF
			DSTR = DSTR & "						</td>"  & vbCRLF
			DSTR = DSTR & "						<td><span id=""L" & VARIABLE & "_" & V1 & """ for=""" & VARIABLE & "_"& V1 &""" data-tid=""" & VARIABLE & "_"& V1 &""" data-var=""" & VARIABLE & "_CNT"" class=""order_label"" style=""cursor:pointer;"">" & Replace(V2,"*NONE","") & "</span></td>" & vbCRLF
			DSTR = DSTR & "					</tr>" & vbCRLF

			VAR = VAR & VARIABLE & "_" & V1 & ","
						
			JBody = JBody & "	if($('input[name=" & VARIABLE & "_" & V1 & "]').val().trim()==" & Chr(34) & Chr(34) & ")" & vbCrLF
			JBody = JBody & "	{" & vbCrLF
			JBody = JBody & "		alert(""" & LangQuestion(1) &""");" & vbCRLF
			JBody = JBody & "		$('input[name=" & VARIABLE & "_" & V1 & "]').focus();" & vbCRLF
			JBody = JBody & "		return ;" & vbCRLF
			JBody = JBody & "	}" & vbCRLF & vbCRLF
		End If		
	Next


	Response.Write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCrLF
	Response.Write "	$(document).ready(function(){" & vbCrLF
	Response.Write "		var order_cnt;" & vbCrLF
	Response.Write "		var target_id;" & vbCrLF
	Response.Write "		var prev_value;" & vbCrLF
	Response.Write "		$("".order_label"").click(function(){" & vbCrLF
	Response.Write "			prev_value='';" & vbCrLF
	Response.Write "			order_cnt=$('#'+$(this).data('var')).val();" & vbCrLF	
	Response.Write "			prev_value=$('#'+$(this).data('tid')).val();" & vbCrLF
	''Response.Write "			alert(prev_value);" & vbCrLF
	Response.Write "			if (prev_value=='')" & vbCrLF
	Response.Write "			{"& vbCrLF
	Response.Write "				order_cnt++;" & vbCrLF
	Response.Write "				$('#'+$(this).data('tid')).val(order_cnt);" & vbCrLF
	Response.Write "				$('#'+$(this).data('var')).val(order_cnt);" & vbCrLF
	Response.Write "			}" & vbCrLF
	Response.Write "		})" & vbCrLF
	Response.Write "		$("".order_input"").click(function(){" & vbCrLF
	Response.Write "			prev_value='';" & vbCrLF
	Response.Write "			order_cnt=$('#'+$(this).data('var')).val();" & vbCrLF	
	Response.Write "			prev_value=$('#'+$(this).data('tid')).val();" & vbCrLF
	''Response.Write "			alert(prev_value);" & vbCrLF
	Response.Write "			if (prev_value=='')" & vbCrLF
	Response.Write "			{"& vbCrLF
	Response.Write "				order_cnt++;" & vbCrLF
	Response.Write "				$('#'+$(this).data('tid')).val(order_cnt);" & vbCrLF
	Response.Write "				$('#'+$(this).data('var')).val(order_cnt);" & vbCrLF
	Response.Write "			}" & vbCrLF
	Response.Write "		})" & vbCrLF
	Response.Write "	});" & vbCrLf
	Response.Write "//-->" & vbCrLF
	Response.Write "</script>"

	'순위용 스크립트 영역
	Response.Write vbCrLF
	Response.write "<script type=""text/javascript"" language=""javascript"">" & vbCrLF
	Response.Write "<!--" & vbCRLF

	Response.Write "	function " & VARIABLE & "Reset()" & vbCrLF
	Response.Write "	{" & vbCrLF

	For iCnt=0 To UBound(ITStr)
		If VarType(ITStr(iCnt))<>0 And VarType(ITStr(iCnt))<>1 And ITStr(iCnt)<>"" Then
			V_COD = Split(ITStr(iCnt),CODESPLITTER)(0)
			Response.Write "		$(""input[name="&VARIABLE&"_"&V_COD&"]"").val('');" & vbCrLF
		End IF
	Next
	Response.Write "		$(""input[name="&VARIABLE&"_CNT]"").val('0');" & vbCrLF

	Response.Write "	}" & vbCrLF

	Response.Write "//-->" & vbCrLF
	Response.Write "</script>" & vbCrLF
	
	SBody = SBody & HDSTR
	SBody = SBody & DSTR
	SBody = SBody & "				</table>" & vbCRLF

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


	BODYSTR = SBody
	JBODYSTR = JBody

End Function

'#######################################################################################
'기존 가로형 보기되는 순위형
'VARIABLE : 변수 명
'CODES : 코드 라벨
'TEXT : 질문 TEXT
'RANKNUM : 순위 갯수
'RESNUM : 최소 응답 갯수
'COL : 컬럼 갯수
'BODYSTR : HTML 사용
'JBODYSTR : 자바스크립트 
'여러개 중복되는 값을 응답 받아야 할때 
'#######################################################################################
Function QuestionRankList(VARIABLE,CODES,TEXT,RANKNUM,RESNUM,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 lCnt,NN
	CTV = COL
	OSTR = ""
	NN = ""

	lCnt=RankNum '기본 3개가 1라인안에 보여짐

	

	ITStr = Split(CODES,LABELSPLITTER)

	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=""indiv"">" & vbCRLF
	
	SBody = SBody & "<!--데이터 영역//-->" & vbCRLF
	For iCnt=1 To RANKNUM
'		SBody = SBody & "				<input type=""hidden"" name=""" & VARIABLE & "_" & iCnt & """ id=""" & VARIABLE & "_" & iCnt & """ value=""""/>" & vbCRLF
		VAR = VAR & VARIABLE & "_" & iCnt & ","
	Next
	SBody = SBody & "<!--데이터 영역 끝//-->" & vbCRLF
	SBody = SBody & "<div style='text-align:center;font-size:14px;font-weight:bold;'><center>" & vbCRLF
	SBody = SBody & "☞ 최대 10번째까지 응답 가능하며, 단계별 동일 보기를 선택하실 수도 있습니다. <br>만일 3번째 단계까지 정보를 탐색하신 후 계약을 하셨다면 3번째까지만 선택하시면 됩니다.<br/>" & vbCRLF
	'라벨 영역
	SBody = SBody & "				<table id='" & VARIABLE & "_table' class='attab00' cellpadding='0' cellspacing='0' style='width:560px;border:1px solid eeee;text-align:center;'>" & vbCRLF
	SBody = SBody & "					<colgroup>" & vbCRLF
	
	SBody = SBody & "						<col width=""30%""/>" & vbCRLF
	SBody = SBody & "						<col width=""70%""/>" & vbCRLF
	
	SBody = SBody & "					</colgroup>" & vbCRLF
	Dim XB
	XB =  MkDrop(CODES)
	
	SBody = SBody & "					<tr>" & vbCRLF		
	SBody = SBody & "					<th style='text-align:center;font-weight:bold;height:35px;background:#eee;' colspan='2'>차량구입 결심</th>" & vbCRLF
	SBody = SBody & "					</tr>" & vbCRLF
	For iCnt=1 To RANKNUM
		If iCnt=1 Then			
			SBody = SBody & "					<tr>" & vbCRLF
			SBody = SBody & "					<td style='text-align:center;font-weight:bold;'>처음</td>" & vbCRLF
			SBody = SBody & "					<td>" & VBCRLF
			SBody = SBody & "						<select id="""& VARIABLE & "_" & iCnt & """ name=""" & VARIABLE & "_" & iCnt &""" style='font-size:12px;'>" & vbCrLF
			SBody = SBody & "						" & XB & VBCRLF
			SBody = SBody & "						</select>" & VBCRLF
			SBody = SBody & "					</td>" & VBCRLF
			SBody = SBody & "					</tr>" & vbCRLF
		Else
			SBody = SBody & "					<tr>" & vbCRLF
			SBody = SBody & "					<td style='text-align:center;font-weight:bold;'>"&iCnt & "번째</td>" & vbCRLF
			SBody = SBody & "					<td>" & VBCRLF
			SBody = SBody & "						<select id="""& VARIABLE & "_" & iCnt & """ name=""" & VARIABLE & "_" & iCnt &""" style='font-size:12px;'>" & vbCrLF
			SBody = SBody & "						" & XB & VBCRLF
			SBody = SBody & "						</select>" & VBCRLF
			SBody = SBody & "					</td>" & VBCRLF
			SBody = SBody & "					</tr>" & vbCRLF
		End IF
	Next

	SBody = SBody & "					<tr>" & vbCRLF		
	SBody = SBody & "					<th style='text-align:center;font-weight:bold;height:35px;background:#eee;' colspan='2'>계약</th>" & vbCRLF
	SBody = SBody & "					</tr>" & vbCRLF
	
	SBody = SBody & "				</table>" & vbCRLF
	SBody = SBody & "</center></div>" & vbCRLF
	

	DSTR = ""
	
	'입력부 만들기
	WidthV = FormatNumber(CDbl(100/CTV),2)

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

	'자바스크립트 처리 부분
	For iCnt=1 To CInt(RESNUM)
		JBody = JBody & "	if (($(""#" & VARIABLE & "_" & iCnt & """).val().trim()==""""))" & vbCrLF
		JBody = JBody & "	{" & vbCrLF
		JBody = JBody & "		alert("""& LangQuestion(1) &""");" & vbCRLF
		JBody = JBody & "		$(""#" & VARIABLE & "_" & iCnt & """).focus();" & vbCRLF
		JBody = JBody & "		return;" & vbCRLF
		JBody = JBody & "	}" & vbCRLF & vbCRLF
	Next

	BODYSTR = SBody
	JBODYSTR = JBody

End Function

Function MkDrop(CODS)
	Dim iXCnt,CCC,iCnts,V_COD
	Dim RNBASE
	CCC = Split(Codes,LABELSPLITTER)
	
	RNBASE = vbTab&"<option value="""">선택</option>" & vbCRLF
	For iCnts=0 To UBound(CCC)
		If VarType(CCC(iCnts))<>0 And VarType(CCC(iCnts))<>1 And VarType(CCC(iCnts))<>"" Then
			V_COD = Split(CCC(iCnts),CODESPLITTER)
			RNBASE = RNBASE & vbTab& "<option value=""" & V_COD(0) & """>" & V_COD(1) & "</option>" & vbCRLF
		End IF
	Next

	MkDrop = RNBASE

End Function

%>