<%
	Function ListField(RSObj)
		Dim i,TitleTypeArr,checked,IsNotNull
		Dim arrtitle,arrvalue,titles

		If rsobj("IsNotNull")="0" Then 
			IsNotNull="  <small><font color=red title=""±ØÌî"">*</font>  "&rsobj("Description")&"</small>"
		Else
			IsNotNull="  "&rsobj("Description")
		End If 
 		 Select Case RSObj("FieldType")
		   Case "TextType"
				ListField= "<input class=""Ainput"" type=""text"" title="""&RSObj("Description")&""" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RSObj("Type_Default")&""">"&IsNotNull
		   Case "MultipleTextType"
				ListField= "<textarea title="""&RSObj("Description")&""" name="""&RSObj("FieldName")&""" style=""height:"&RSObj("height")&"px;width:"&RSObj("width")&"px;"">"&RSObj("Type_Default")&"</textarea>"&IsNotNull
		   Case "MultipleHtmlType"
				ListField=ListField&writeeditor(0,""&RSObj("FieldName")&"",""&RSObj("FieldName")&"","","")
		   Case "RadioType"
				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  ListField= ListField&"<select  name="""&RSObj("FieldName")&""">"
				  For I = 0 To UBound(TitleTypeArr)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					If RSObj("Type_Default")=arrvalue Then checked="selected" Else checked=""
					ListField = ListField & "<option value='" & arrvalue & "' "&checked&">" & titles & "</option>"& vbCrLf
				  Next
					ListField= ListField&" </select>"&IsNotNull
				Else
				  For I = 0 To UBound(TitleTypeArr)
				
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					
					If RSObj("Type_Default")=arrvalue Then checked="checked" Else checked=""
					ListField = ListField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""radio""  name="""&RSObj("FieldName")&""" value="""&arrvalue&""" "&checked&" />"&titles&"&nbsp;&nbsp;</label>" 
				  Next
				    ListField = ListField&IsNotNull
				End If 
		   Case "ListBoxType"
 				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  For I = 0 To UBound(TitleTypeArr)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					If RSObj("Type_Default")=arrvalue Then checked="checked" Else checked=""
					ListField = ListField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""checkbox""  name="""&RSObj("FieldName")&""" value="""&arrvalue&""" "&checked&" />"&titles&"&nbsp;&nbsp;</label>"& vbCrLf
				  Next
				  ListField = ListField&IsNotNull
				Else
				  ListField= ListField&"<select  size=""4""   style=""width:300px;height:126px""  name="""&RSObj("FieldName")&""" multiple>"
				  For I = 0 To UBound(TitleTypeArr)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					If RSObj("Type_Default")=arrvalue Then checked="checked" Else checked=""
					ListField = ListField & "<option value=""" & arrvalue & """ "&checked&">" & vbCrLf& titles & "</option>"& vbCrLf
				  Next
					ListField= ListField&" </select>"&IsNotNull
				End If 
		   Case "DateType"
				ListField= ListField&"<input class=""Ainput"" name="""&RSObj("FieldName")&""" type=""text"" id="""&RSObj("FieldName")&""" value=""""  onClick=WdatePicker();  >"&IsNotNull
		  

				 
		   
		   Case "FileType"
				ListField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""" size=""40""><iframe src="""&fycms.actsys&fycms.adminurl&"/Upload_Admin.asp?ModeID=1&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&file=yes&amp;instrct=content"" name=""image"" width='75%' height=""25"" scrolling=""No"" frameborder=""0"" id=""image""></iframe>"&IsNotNull
		   Case "NumberType"
				ListField= "<input class=""Ainput""  type=""text"" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RSObj("Type_Default")&""">"&IsNotNull
		   Case "RadomType"
				ListField= "<input class=""Ainput""  type=""text"" name="""&RSObj("FieldName")&""" size=""25""  value="""&fycms.MakeRandom(20)&""">"&IsNotNull
		  
		   Case else
				ListField= "<font color=red></font>"
		   End Select 
	End Function 






	Function  ForClasslist(ModeID)
		 Dim Crs,selected,ModeSql
		' If Modeid<>0 Then ModeSql="And ModeID="&ModeID
		 Set Crs = fycms.actexe("Select * from Class_fy where rootid=0 "&ModeSql&"  and ActLink<>2 Order by Orderid desc,ID desc")
		 If Not  Crs.Eof Then
		 do while Not Crs.Eof
				If CLng(ClassID)=Crs("ClassID") Then selected=" selected=""selected""" Else selected=""
					If Crs("ActLink")=3 Then 
					 ForClasslist=ForClasslist&"<option disabled=""value""  value='?ClassID="&Crs("ClassID")&"' "&selected&">"& Crs("ClassName") & "</option>"& vbCrLf
					Else 
					 ForClasslist=ForClasslist&"<option  value='?ClassID="&Crs("ClassID")&"' "&selected&">"& Crs("ClassName") & "</option>"& vbCrLf
					End If 
				 ForClasslist=ForClasslist&(GetForClass(Crs("ClassID"),""))
			 Crs.MoveNext
		 Loop
		 End IF
	 End  Function 
	 Function GetForClass(CID,Str)
	       Dim Sql,RSC,TempImageStr,ImageStr,CheckStr,selected
	        TempImageStr = "&nbsp;©¸"
	        Sql = "Select * from Class_fy where rootid=" & CID & "  and ActLink<>2"
	        Set RSC = Conn.Execute(Sql)
			ImageStr = Str & "&nbsp;©¸"
	            do while Not RSC.Eof
					If CLng(ClassID)=RSC("ClassID") Then selected=" selected=""selected""" Else selected=""
					  If RSC("ModeID")= ModeID   Then 
							If RSC("ActLink")=3 Then 
								GetForClass = GetForClass  & "<option disabled=""value"" value='?ClassID="&RSC("ClassID")&"' "&selected&">"& ImageStr & TempImageStr &" "& RSC("ClassName")& "</option>"& vbCrLf
							Else 
								GetForClass = GetForClass  & "<option value='?ClassID="&RSC("ClassID")&"' "&selected&">"& ImageStr & TempImageStr &" "& RSC("ClassName")& "</option>"& vbCrLf
							End If 
					  End If 
					   GetForClass = GetForClass & GetForClass(RSC("ClassID"),ImageStr)
					   RSC.MoveNext
	           loop
	       Set RSC = Nothing
	 End Function

%>