'' asp code Generated by Basic Processor
'' Original Page Name: C:\gmTestBed\FMStocks\src\FMSWeb\ASP\t_head.asp

Imports System.Web
NameSpace FMSWeb
Public Class _t_head
   Public g_AccountID As String = ""
   Public g_strError As String = ""
   Public g_bUseMenu As Boolean = False
   Public Sub Author_Markup()
      If (Not HttpContext.Current.Response.IsClientConnected) Then
         HttpContext.Current.Response.End()
      End If
      g_bUseMenu = True
      VerifyLogin()
      HttpContext.Current.Response.Write("<script src='jscripts.js' language='JavaScript'></script>" & vbCrLf)
      HttpContext.Current.Response.Write("<meta http-equiv='Expires' content='Tue, 04 Dec 1993 21:29:02 GMT'>" & vbCrLf)
      HttpContext.Current.Response.Write("<link rel='stylesheet' href='styles.css'>" & vbCrLf)
   End Sub
   ' Helper functions
   Public Function VerifyLogin() As Object
      VerifyLogin = Nothing
      If (Not HttpContext.Current.Response.IsClientConnected) Then
         HttpContext.Current.Response.End()
      End If
      'check to see if they are logged in or are at the login page
      If (Not IsNothing(HttpContext.Current.Request.Cookies("Account")) AndAlso Not String.IsNullOrEmpty(HttpContext.Current.Request.Cookies("Account").Value)) Then
         g_AccountID = HttpContext.Current.Request.Cookies("Account").Value
      Else
         g_AccountID = "0"
      End If
      If (g_AccountID = 0) Then
         Dim strASP As String = ""          ' Current ASP page
         strASP = Strings.LCase(HttpContext.Current.Request.ServerVariables("Script_Name"))
         ' Allow access to default.asp or any page that starts with an underscore
         ' without requiring a login. Don't mess with this code.
         If (Strings.InStr(1,strASP,"default.aspx",CompareMethod.Binary) = 0 And Strings.InStr(1,strASP,"/_",CompareMethod.Binary) = 0) Then
            HttpContext.Current.Response.Redirect("logout.aspx")
            HttpContext.Current.Response.End()
         End If
      End If
   End Function
   Public Function BuildErrorMessage() As Object
      BuildErrorMessage = Nothing
      g_strError = g_strError & "<p><b>Actual Error Message:<br></b>" & Err.Description & "</p>"
      g_strError = g_strError & "<p><b>Source/Call Stack:<br></b>" & Err.Source & "</p>"
      g_strError = g_strError & "<br><br><br>"
   End Function
   Public Function rw(ByVal s As String) As Object
      rw = Nothing
      HttpContext.Current.Response.Write(s)
   End Function
   Public Function rwbr(ByVal s As Object) As Object
      rwbr = Nothing
      HttpContext.Current.Response.Write(Convert.ToString(s) & "<br>")
   End Function
   Public Function rwp(ByVal s As Object) As Object
      rwp = Nothing
      HttpContext.Current.Response.Write("<p>" & Convert.ToString(s) & "</p>")
   End Function
   Public Function nbsp(ByVal n As Integer) As Object
      nbsp = Nothing
      Dim i As Integer = 0
      Dim str As String = ""
      For i = 0 To n Step 1
         str = str & "&nbsp;"
      Next
      HttpContext.Current.Response.Write(str)
   End Function
End Class
End Namespace
