<% 
' Dynamic Display Code
RSAtt.MoveFirst
If Not RSAtt.EOF Then
   Do Until RSAtt.EOF
	Att_ID = RSAtt("Att_ID")
	Att_Desc = RSAtt("Att_Desc")
	Disp_Type = LCase(Trim(RSAtt("Disp_Type")))
	Properties = Trim(RSAtt("Properties"))
	Default_Value = RSAtt("Default_Value")

	TR_Class = RSAtt("TR_Class")

	Input_Class = RSAtt("Input_Class")
	Input_TD_Class = RSAtt("Input_TD_ClasS")

	Att_Desc_Class = RSAtt("Att_Desc_Class")
	Hide_Att_Desc = RSAtt("Hide_Att_Desc")

	Label_Left = RSAtt("Label_Left")
	Label_Right = RSAtt("Label_Right")
	Label_Left_Class = RSAtt("Label_Left_Class")
	Label_Right_Class = RSAtt("Label_Right_Class")
	

	SQLRetrieve = "Select * from Att_Group_Map Where [Group_ID] = '" & Session("Admin_Group_ID") & "' And [Att_ID]='" & Att_ID & "' And [Att_Page] = '" & Page & "'"
	Set RSRetrieve = Conn.Execute(SQLRetrieve)

	Value = ""
	If Not RSRetrieve.EOF Then
		Value = RSRetrieve("Variable")
	End If

	If Disp_Type = "checkbox" Then
	   If Value = Default_Value Then
		Input_Line = "<!--" & Value & " - " & Default_Value & "--><input class=""" & Input_Class & """ type=""checkbox"" name=""" & Att_ID & """ value=""" & Default_Value & """ " & Properties & " checked>"
	   Else
		Input_Line = "<!--" & Value & " - " & Default_Value & "--><input class=""" & Input_Class & """ type=""checkbox"" name=""" & Att_ID & """ value=""" & Default_Value & """ " & Properties & ">"
	   End If

	   If Hide_Att_Desc = True Then
		Att_Desc = ""
	   End If

		' Begin Rendering the HTML
		    Response.Write "<tr class=""" & TR_Class & """>" & Chr(13)
		    Response.Write "<td class=""" & Att_Desc_Class & """>" & Att_Desc & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Left_Class & """>" & Label_Left & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Input_TD_Class & """>" & Input_Line & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Right_Class & """>" & Label_Right & "&nbsp;</td>" & Chr(13)
		    Response.Write "</tr>" & Chr(13)
		' End Rendering the HTML

	ElseIf Disp_Type = "text" Then
		Input_Line = "<input class=""" & Input_Class & """ type=""text"" name=""" & Att_ID & """ value=""" & Value & """ " & Properties & ">"

	   	If Hide_Att_Desc = True Then
		   Att_Desc = ""
		End If

		' Begin Rendering the HTML
		    Response.Write "<tr class=""" & TR_Class & """>" & Chr(13)
		    Response.Write "<td class=""" & Att_Desc_Class & """>" & Att_Desc & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Left_Class & """>" & Label_Left & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Input_TD_Class & """>" & Input_Line & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Right_Class & """>" & Label_Right & "&nbsp;</td>" & Chr(13)
		    Response.Write "</tr>" & Chr(13)
		' End Rendering the HTML

	ElseIf Disp_Type = "break" Then
		Response.Write "    <tr>" & Chr(13)
		Response.Write "      <td>&nbsp;</td>" & Chr(13)
		Response.Write "      <td>&nbsp;</td>" & Chr(13)
		Response.Write "      <td>&nbsp;</td>" & Chr(13)
		Response.Write "      <td>&nbsp;</td>" & Chr(13)
		Response.Write "    </tr>" & Chr(13)

	ElseIf Disp_Type = "label" Then

		' Begin Rendering the HTML
		    Response.Write "<tr class=""" & TR_Class & """>" & Chr(13)
		    Response.Write "<td colspan=""4""><table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
		    Response.Write "<td class=""" & Label_Left_Class & """> &nbsp; " & Label_Left & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Right_Class & """>" & Label_Right & "&nbsp;</td>" & Chr(13)
		    Response.Write "</tr></table>" & Chr(13)
		    Response.Write "</tr>" & Chr(13)
		' End Rendering the HTML

	ElseIf Disp_Type = "textarea" Then

		Input_Line = "<textarea class=""" & Input_Class & """ name=""" & Att_ID & """ " & Properties & ">" & Value & "</textarea>"

	   	If Hide_Att_Desc = True Then
		   Att_Desc = ""
		End If

		' Begin Rendering the HTML
		    Response.Write "<tr class=""" & TR_Class & """>" & Chr(13)
		    Response.Write "<td colspan=""4"" class=""" & Att_Desc_Class & """> &nbsp; " & Att_Desc & "&nbsp;</td></tr>" & Chr(13)
		    Response.Write "<tr>" & Chr(13)
		    Response.Write "<td colspan=""4""><table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%""><tr>"
		    Response.Write "<td class=""" & Label_Left_Class & """>" & Label_Left & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Input_TD_Class & """>" & Input_Line & "&nbsp;</td>" & Chr(13)
		    Response.Write "<td class=""" & Label_Right_Class & """>" & Label_Right & "&nbsp;</td>" & Chr(13)
		    Response.Write "</tr></table>" & Chr(13)
		    Response.Write "</tr>" & Chr(13)
		' End Rendering the HTML

	End If

	RSAtt.MoveNext
   Loop
End If
%>
