Partial Class Controls_Header
  Inherits System.Web.UI.UserControl

  Public Event SearchSiteAgain()


	Public Property SelectedItem() As MenuItem
		Get
			If ViewState(Me.ID & "_SelectedItem") Is Nothing Then
				Return MenuItem.Unspecified
			Else
				Return CType(ViewState(Me.ID & "_SelectedItem"), MenuItem)
			End If
		End Get

		Set(ByVal value As MenuItem)
			ViewState(Me.ID & "_SelectedItem") = value
		End Set
  End Property


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.IsAuthenticated Then
            lblMyAccountLink.Text = "<a href=""../MS/MyAccount.aspx"">My Account</a>"
        Else
            If Not Application("MyAccountLoginLink") Is Nothing Then
                lblMyAccountLink.Text = Application("MyAccountLoginLink").ToString().Replace(">Login</a>", ">My Account</a>")
            Else
                lblMyAccountLink.Text = "<a href=""../MsLogin"" target=""_blank"">My Account</a>"
            End If

        End If
    End Sub

	Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
		ltrCableTV.Text = "<a href='../Visitors/Products.aspx?" & QueryStringName.MenuItem & "=" & MenuItem.CableTV & "'><span>Cable TV</span></a>"
		ltrInternet.Text = "<a href='../Visitors/Products.aspx?" & QueryStringName.MenuItem & "=" & MenuItem.Internet & "'><span>High-Speed Internet</span></a>"
		ltrTelephone.Text = "<a href='../Visitors/Products.aspx?" & QueryStringName.MenuItem & "=" & MenuItem.Telephone & "'><span>Telephone</span></a>"
		ltrBusiness.Text = "<a href= '" & ExternalLinks.CharterBusiness & "' target='_charter_business'><span>Business Services</span></a>"
        ltrSupport.Text = "<a href='../customers/support.aspx'><span>Support</span></a>"
        ltrCharterNet.Text = "<a href= '" & ExternalLinks.CharterNet & "' target='_charter_net'><span>Charter.net</span></a>"

		Select Case SelectedItem
			Case MenuItem.CableTV
				ltrCableTV.Text = "<li id='current'>" & ltrCableTV.Text & "</li>"
				ltrInternet.Text = "<li>" & ltrInternet.Text & "</li>"
				ltrTelephone.Text = "<li>" & ltrTelephone.Text & "</li>"
				ltrBusiness.Text = "<li>" & ltrBusiness.Text & "</li>"
                ltrSupport.Text = "<li>" & ltrSupport.Text & "</li>"
                ltrCharterNet.Text = "<li>" & ltrCharterNet.Text & "</li>"
			Case MenuItem.Internet
				ltrCableTV.Text = "<li>" & ltrCableTV.Text & "</li>"
				ltrInternet.Text = "<li id='current'>" & ltrInternet.Text & "</li>"
				ltrTelephone.Text = "<li>" & ltrTelephone.Text & "</li>"
				ltrBusiness.Text = "<li>" & ltrBusiness.Text & "</li>"
                ltrSupport.Text = "<li>" & ltrSupport.Text & "</li>"
                ltrCharterNet.Text = "<li>" & ltrCharterNet.Text & "</li>"
			Case MenuItem.Telephone
				ltrCableTV.Text = "<li>" & ltrCableTV.Text & "</li>"
				ltrInternet.Text = "<li>" & ltrInternet.Text & "</li>"
				ltrTelephone.Text = "<li id='current'>" & ltrTelephone.Text & "</li>"
				ltrBusiness.Text = "<li>" & ltrBusiness.Text & "</li>"
                ltrSupport.Text = "<li>" & ltrSupport.Text & "</li>"
                ltrCharterNet.Text = "<li>" & ltrCharterNet.Text & "</li>"
			Case MenuItem.Support
				ltrCableTV.Text = "<li>" & ltrCableTV.Text & "</li>"
				ltrInternet.Text = "<li>" & ltrInternet.Text & "</li>"
				ltrTelephone.Text = "<li>" & ltrTelephone.Text & "</li>"
				ltrBusiness.Text = "<li>" & ltrBusiness.Text & "</li>"
                ltrSupport.Text = "<li id='current'>" & ltrSupport.Text & "</li>"
                ltrCharterNet.Text = "<li>" & ltrCharterNet.Text & "</li>"
			Case Else
				ltrCableTV.Text = "<li>" & ltrCableTV.Text & "</li>"
				ltrInternet.Text = "<li>" & ltrInternet.Text & "</li>"
				ltrTelephone.Text = "<li>" & ltrTelephone.Text & "</li>"
				ltrBusiness.Text = "<li>" & ltrBusiness.Text & "</li>"
                ltrSupport.Text = "<li>" & ltrSupport.Text & "</li>"
                ltrCharterNet.Text = "<li>" & ltrCharterNet.Text & "</li>"
		End Select
	End Sub


End Class