Imports System.Collections.Generic

Partial Class Controls_Ad
	Inherits System.Web.UI.UserControl

	Public Property Count() As Integer
		Get
			If ViewState(Me.ID & "_Count") Is Nothing Then
				Return 0
			Else
				Return CType(ViewState(Me.ID & "_Count"), Integer)
			End If
		End Get

		Set(ByVal value As Integer)
			ViewState(Me.ID & "_Count") = value
		End Set
	End Property

	Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
		Select Case Count
			Case 0
				ucPromotion0.Visible = False
				ucPromotion1.Visible = False
				ucPromotion2.Visible = False
				ucPromotion3.Visible = False
				ucPromotion4.Visible = False
			Case 1
				ucPromotion0.Visible = True
				ucPromotion1.Visible = False
				ucPromotion2.Visible = False
				ucPromotion3.Visible = False
				ucPromotion4.Visible = False
			Case 2
				ucPromotion0.Visible = True
				ucPromotion1.Visible = True
				ucPromotion2.Visible = False
				ucPromotion3.Visible = False
				ucPromotion4.Visible = False
			Case 3
				ucPromotion0.Visible = True
				ucPromotion1.Visible = True
				ucPromotion2.Visible = True
				ucPromotion3.Visible = False
				ucPromotion4.Visible = False
			Case 4
				ucPromotion0.Visible = True
				ucPromotion1.Visible = True
				ucPromotion2.Visible = True
				ucPromotion3.Visible = True
				ucPromotion4.Visible = False
			Case 5
				ucPromotion0.Visible = True
				ucPromotion1.Visible = True
				ucPromotion2.Visible = True
				ucPromotion3.Visible = True
				ucPromotion4.Visible = True
		End Select
	End Sub
End Class
